Skip to content

Commit

Permalink
Merge pull request #31 from mendix/improve-usability
Browse files Browse the repository at this point in the history
#720386 and #720633: Improve developer-visible interface of module
  • Loading branch information
reinouts committed Jun 1, 2016
2 parents ca470e7 + 9f192c0 commit df4bba7
Show file tree
Hide file tree
Showing 40 changed files with 692 additions and 439 deletions.
100 changes: 65 additions & 35 deletions README.md

Large diffs are not rendered by default.

Binary file modified assets/images/gcm-step1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/gcm-step4a.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/gcm-step6.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/testing/device overview.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/testing/send message.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed test/PushNotfications.mpr.bak
Binary file not shown.
Binary file renamed test/PushNotfications.mpr → test/PushNotifications.mpr
100644 → 100755
Binary file not shown.
Empty file.
71 changes: 71 additions & 0 deletions test/javasource/pushnotifications/actions/QueueMessage.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// This file was generated by Mendix Modeler.
//
// WARNING: Only the following code will be retained when actions are regenerated:
// - the import list
// - the code between BEGIN USER CODE and END USER CODE
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
// Other code you write will be lost the next time you deploy the project.
// Special characters, e.g., é, ö, à, etc. are supported in comments.

package pushnotifications.actions;

import com.mendix.systemwideinterfaces.core.IContext;
import com.mendix.webui.CustomJavaAction;
import static pushnotifications.proxies.microflows.Microflows.createAndQueueMessage;
import com.mendix.systemwideinterfaces.core.IMendixObject;

/**
* Replaces microflow 'SendMessageQueued'.
* Parameters:
* Device: Android, iOS or Windows
* MessageText: the contents of the message
* Title: The title of the message
* Badge: a number that appears on the app icon (iOS)
* LaunchImage: file name of the launch image (iOS)
* Sound: name of system sound to play (iOS)
*
*/
public class QueueMessage extends CustomJavaAction<Boolean>
{
private IMendixObject __DeviceParameter1;
private pushnotifications.proxies.Device DeviceParameter1;
private String MessageText;
private String Title;
private Long Badge;
private String LaunchImage;
private String Sound;

public QueueMessage(IContext context, IMendixObject DeviceParameter1, String MessageText, String Title, Long Badge, String LaunchImage, String Sound)
{
super(context);
this.__DeviceParameter1 = DeviceParameter1;
this.MessageText = MessageText;
this.Title = Title;
this.Badge = Badge;
this.LaunchImage = LaunchImage;
this.Sound = Sound;
}

@Override
public Boolean executeAction() throws Exception
{
this.DeviceParameter1 = __DeviceParameter1 == null ? null : pushnotifications.proxies.Device.initialize(getContext(), __DeviceParameter1);

// BEGIN USER CODE
createAndQueueMessage(getContext(), DeviceParameter1, MessageText, Title, Badge, LaunchImage, Sound);
return true;
// END USER CODE
}

/**
* Returns a string representation of this action
*/
@Override
public String toString()
{
return "QueueMessage";
}

// BEGIN EXTRA CODE
// END EXTRA CODE
}
Empty file modified test/javasource/pushnotifications/actions/RestartGCM.java
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions test/javasource/pushnotifications/actions/SendAppleMessages.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

package pushnotifications.actions;

import pushnotifications.implementation.apn.APNConnection;
import com.mendix.systemwideinterfaces.core.IContext;
import com.mendix.webui.CustomJavaAction;
import com.mendix.systemwideinterfaces.core.IMendixObject;
import com.mendix.webui.CustomJavaAction;
import pushnotifications.implementation.apn.APNConnection;

/**
*
Expand Down
2 changes: 1 addition & 1 deletion test/javasource/pushnotifications/actions/SendGoogleMessages.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public Boolean executeAction() throws Exception

// BEGIN USER CODE
GCMConnection connection = GCMConnection.getConnection();
connection.sendMessage(messages);
connection.sendMessages(messages);
return true;
// END USER CODE
}
Expand Down
71 changes: 71 additions & 0 deletions test/javasource/pushnotifications/actions/SendMessage.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// This file was generated by Mendix Modeler.
//
// WARNING: Only the following code will be retained when actions are regenerated:
// - the import list
// - the code between BEGIN USER CODE and END USER CODE
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
// Other code you write will be lost the next time you deploy the project.
// Special characters, e.g., é, ö, à, etc. are supported in comments.

package pushnotifications.actions;

import com.mendix.systemwideinterfaces.core.IContext;
import com.mendix.webui.CustomJavaAction;
import com.mendix.systemwideinterfaces.core.IMendixObject;
import static pushnotifications.proxies.microflows.Microflows.createAndSendMessage;

/**
* Java action to use instead of microflow 'SendMessageImmediately'
* Parameters:
* Device: Android, iOS or Windows
* MessageText: the contents of the message
* Title: The title of the message
* Badge: a number that appears on the app icon (iOS)
* LaunchImage: file name of the launch image (iOS)
* Sound: name of system sound to play (iOS)
*
*/
public class SendMessage extends CustomJavaAction<Boolean>
{
private IMendixObject __DeviceParameter1;
private pushnotifications.proxies.Device DeviceParameter1;
private String MessageText;
private String Title;
private Long Badge;
private String LaunchImage;
private String Sound;

public SendMessage(IContext context, IMendixObject DeviceParameter1, String MessageText, String Title, Long Badge, String LaunchImage, String Sound)
{
super(context);
this.__DeviceParameter1 = DeviceParameter1;
this.MessageText = MessageText;
this.Title = Title;
this.Badge = Badge;
this.LaunchImage = LaunchImage;
this.Sound = Sound;
}

@Override
public Boolean executeAction() throws Exception
{
this.DeviceParameter1 = __DeviceParameter1 == null ? null : pushnotifications.proxies.Device.initialize(getContext(), __DeviceParameter1);

// BEGIN USER CODE
createAndSendMessage(getContext(), DeviceParameter1, MessageText, Title, Badge, LaunchImage, Sound);
return true;
// END USER CODE
}

/**
* Returns a string representation of this action
*/
@Override
public String toString()
{
return "SendMessage";
}

// BEGIN EXTRA CODE
// END EXTRA CODE
}
4 changes: 2 additions & 2 deletions test/javasource/pushnotifications/actions/SendMessagesInBackground.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public Boolean executeAction() throws Exception
appleMessages);
}
} catch (Exception e) {
logger.warn("Background process for Apple messages already running? " + e.toString(), e);;
logger.warn("Background process for Apple messages already running? " + e.toString(), e);
}

try {
Expand All @@ -76,7 +76,7 @@ public Boolean executeAction() throws Exception
googleMessages);
}
} catch (Exception e) {
logger.warn("Background process for Google messages already running? " + e.toString(), e);;
logger.warn("Background process for Google messages already running? " + e.toString(), e);
}

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
/**
* Takes windows message input and sends a windows notifcation via a webservice (toast)
*/
public class SendWindowMessage extends CustomJavaAction<Boolean>
public class SendWindowsMessage extends CustomJavaAction<Boolean>
{
private java.util.List<IMendixObject> __WindowsMessages;
private java.util.List<pushnotifications.proxies.WindowsMessage> WindowsMessages;

public SendWindowMessage(IContext context, java.util.List<IMendixObject> WindowsMessages)
public SendWindowsMessage(IContext context, java.util.List<IMendixObject> WindowsMessages)
{
super(context);
this.__WindowsMessages = WindowsMessages;
Expand Down Expand Up @@ -109,7 +109,7 @@ public Boolean executeAction() throws Exception
@Override
public String toString()
{
return "SendWindowMessage";
return "SendWindowsMessage";
}

// BEGIN EXTRA CODE
Expand Down
4 changes: 2 additions & 2 deletions test/javasource/pushnotifications/actions/StartAPN.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@

package pushnotifications.actions;

import pushnotifications.implementation.apn.APNConnection;
import com.mendix.systemwideinterfaces.core.IContext;
import com.mendix.webui.CustomJavaAction;
import com.mendix.systemwideinterfaces.core.IMendixObject;
import com.mendix.webui.CustomJavaAction;
import communitycommons.Misc;
import pushnotifications.implementation.apn.APNConnection;

/**
*
Expand Down
Empty file modified test/javasource/pushnotifications/actions/StartGCM.java
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions test/javasource/pushnotifications/actions/StopAPN.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@

package pushnotifications.actions;

import pushnotifications.implementation.apn.APNConnection;
import com.mendix.systemwideinterfaces.core.IContext;
import com.mendix.webui.CustomJavaAction;
import com.mendix.systemwideinterfaces.core.IMendixObject;
import com.mendix.webui.CustomJavaAction;
import communitycommons.Misc;
import pushnotifications.implementation.apn.APNConnection;

/**
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package pushnotifications.implementation;

import java.util.List;

import pushnotifications.proxies.Message;
import pushnotifications.proxies.MessagingServiceSettings;

public interface MessagingServiceConnection<S extends MessagingServiceSettings, M extends Message> {

void stop();

void sendMessages(List<M> messages);

void sendMessage(M message);

void start (S settings);

}
Loading

0 comments on commit df4bba7

Please sign in to comment.