How to implement push notification using oracle maf - oracle

I just tried the the sample code provided by oracle maf for push notifications.I can register through it but when I pass message I didn't receive any message.
this is server code. Can us plz explain how to register in gcm.I registered there but I doubt in that also and is there any way to seeing the message received details in gcm
<af:commandButton actionListener="#{bindings.Execute.execute}"
text="Refresh"
disabled="#{!bindings.Execute.enabled}"
id="ctb1" immediate="true"/>
<af:table value="#{bindings.RegistrationsView1.collectionModel}"
var="row"
rows="#{bindings.RegistrationsView1.rangeSize}"
emptyText="#{bindings.RegistrationsView1.viewable ? 'No data to display.' : 'Access Denied.'}"
fetchSize="#{bindings.RegistrationsView1.rangeSize}"
rowBandingInterval="0"
selectedRowKeys="#{bindings.RegistrationsView1.collectionModel.selectedRow}"
selectionListener="#{bindings.RegistrationsView1.collectionModel.makeCurrent}"
rowSelection="single" id="t1"
partialTriggers="::ctb1" width="633" inlineStyle="height:189px;">
<af:column sortProperty="DeviceToken" sortable="false"
headerText="Device Token" id="c1" width="100">
<af:outputText value="#{row.DeviceToken}" id="ot5"/>
</af:column>
<af:column sortProperty="DeviceModel" sortable="false"
headerText="Device Model" id="c3" width="100">
<af:outputText value="#{row.DeviceModel}" id="ot4"/>
</af:column>
<af:column sortProperty="ApplicationId" sortable="false"
headerText="Application" id="c5" width="205">
<af:outputText value="#{row.ApplicationId}" id="ot1"/>
</af:column>
<af:column sortProperty="UserId" sortable="false"
headerText="User Id" id="c2" width="-5">
<af:outputText value="#{row.UserId}" id="ot3"/>
</af:column>
<af:column sortProperty="SenderId" sortable="false"
headerText="Sender Id" id="c4" width="100">
<af:outputText value="#{row.SenderId}" id="ot2"/>
</af:column>
</af:table>
</af:panelGroupLayout>
<af:panelGroupLayout layout="scroll"
xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
id="pgl1">
<af:panelFormLayout id="pfl1" partialTriggers="t1">
<af:panelLabelAndMessage label="#{bindings.DeviceToken.hints.label}"
id="plam4">
<af:outputText value="#{bindings.DeviceToken.inputValue}"
id="ot7"/>
</af:panelLabelAndMessage>
<af:panelLabelAndMessage label="#{bindings.DeviceModel.hints.label}"
id="plam2">
<af:outputText value="#{bindings.DeviceModel.inputValue}"
id="ot6"/>
</af:panelLabelAndMessage>
<af:panelLabelAndMessage label="#{bindings.UserId.hints.label}"
id="plam1">
<af:outputText value="#{bindings.UserId.inputValue}"
id="ot9"/>
</af:panelLabelAndMessage>
<af:panelLabelAndMessage label="#{bindings.ApplicationId.hints.label}"
id="plam3">
<af:outputText value="#{bindings.ApplicationId.inputValue}"
id="ot8"/>
</af:panelLabelAndMessage>
<af:inputText label="Message" id="it1"
value="#{MessageBean.message}"/>
</af:panelFormLayout>
<af:commandButton text="Push Message" id="cb1"
actionListener="#{MessageBean.pushMessage}"/>
</af:panelGroupLayout>

First of all, you will have two applications. A server application (PushServer ) and a mobile application implemented with MAF framework (PushDemo) .I believe you found those after you installed MAF module into JDeveloper.
Secondly, to register with Google Cloud Messaging server, go to this link , write your app name ( default is PushService ) and your Android package name ( default for sample app is com.oraclecorp.internal.maf.PushSample ). You will get a GOOGLE API KEY which you will have to set into the PushServer application, into the MessageBean class (it is a constant there called GOOGLE_APIKEY), and a senderId that you will write into the mobile application ( into adf-config.xml - it is a property called gcmSenderId ).
You will have to run the server project on a public server ( Weblogic probably ) and have your mobile app call the URL where your servlet is - for example : http://www.something.com/PushService-ViewController-context-root/registrations ), then in your mobile application project, under connections.xml you have two fields that you have to edit :
<urlconnection name="SyncService_base_connection" url="http://www.something.com"/>
and
<urlconnection name="PushServiceConn" url="http://www.something.com/PushService-ViewController-context-root/registrations"/>
You start the app on the device, then check on the application if you registered into the database. Then if you press push for your device, you should receive those notifications straight on the Android device.
For the APNS process things are a little bit complicated, but the tutorial gets you going.
Thanks,
Razvan

Above issue solved after enabling JSSE on all managed servers including Admin Server (in weblogic server).

Related

How do I change agents in a Dialogflow CX Avaya integration for two different agents in a subdialog?

I have two Dialogflow agents, each one has been tested and working independently. Now I want to be able to call agent1, then pass the caller to agent2, do more processing, then pass the caller back to agent1 with the new data that agent2 had collected.
I want to leverage the Avaya-provided technology as much as possible.
Avaya Experience Portal v8.1.1
Google Dialogflow CX agents
I've tried this with a vxml subdialog (using Avaya's default/sample apps as reference) but I can't figure out how to change agent1's Conversation Profile Automated Agent string to instead be the one for agent2.
I've also thought about using one of the dialogflow API's but haven't used them before so not sure their capabilities.
Is a plain phone transfer an option in this case? Not sure how the data would get passed if I did.
Here's the form of my vxml code:
<form id="invokemainmenu">
<property name="com.avaya.asr.vendor" value="dialogflowasr"/>
<subdialog name="dialogflowapp" src="http://localhost/mpp/misc/dialogflowapp/AuthIVR811.vxml">
<param name="calledAsSubDialog" value="true"/>
<param name="sipInfoFromParent" expr="session.connection.protocol.sip"/>
<filled>
<!-- once the subdialog has been filled(completed and returns), we pass control to a different form -->
<goto next="#invokeagent2"/>
<form id="invokeagent2">
<property name="com.avaya.asr.vendor" value="dialogflowasr"/>
<subdialog name="dialogflowapp" src="http://localhost/mpp/misc/dialogflowapp/AuthIVR811.vxml">
<param name="calledAsSubDialog" value="true"/>
<param name="sipInfoFromParent" expr="session.connection.protocol.sip"/>
<filled>
<!-- process data here? -->
<prompt bargein="false">
<audio src="http://localhost/mpp/misc/dialogflowapp/prompts/test/DialogflowFinished.wav"/>
</prompt>

App/Widget Height is zero on SAP Hana Cloud Portal

So I am building (a) webpage(s) using the SAP Hana Cloud Portal.
I have defined a template that looks roughly like this:
<mvc:View
controllerName="cpv2.templates.custom.Template"
height="100%"
xmlns:cpControls="sap.hana.uis.flp.control"
xmlns:l="sap.ui.layout"
xmlns:core="sap.ui.core"
xmlns:mvc="sap.ui.core.mvc"
xmlns:u="sap.ui.unified"
xmlns="sap.m">
<Page showFooter="false" showHeader="false" enableScrolling="true">
<u:SplitContainer id="mySplitContainer" showSecondaryContent="false">
<u:secondaryContent>
<core:Fragment fragmentName="cpv2.templates.custom.SideNavigationPanel"
type="XML" id="idSideNav"/>
</u:secondaryContent>
<u:content>
<cpControls:Section alias="custom.shellHeader"></cpControls:Section>
<cpControls:Section alias="custom.header"></cpControls:Section>
<cpControls:Section alias="custom.content"></cpControls:Section>
<cpControls:Section alias="custom.footerbanner"></cpControls:Section>
<cpControls:Section alias="custom.footer"></cpControls:Section>
</u:content>
</u:SplitContainer>
</Page>
</mvc:View>
I then develop multiple SAPUI5 applications which I convert to SAP Portal Components. My app-widgets' views all have this basic format:
<mvc:View [namespaces, controller, etc.]>
<App>
<!-- most of them have VBox or HBox in their view -->
<Vbox>
<!-- some content here -->
</VBox>
</App>
</mvc:View>
I deploy these applications to the Cloud Portal.
finally I create a webpage, use the above template and fill the defined sections with these app-widgets.
Now for some reason the height of these app-widgets are all 0. Inspecting the page shows me they are there, but their height is rendered zero.
Is there a fix for this?

Cordova : How to diagnose ajax not working for UWP (windows store) application

I have a simple Cordova application, where when built, and running as a Windows UWP application, has ajax calls are somehow being blocked my work network.
I have asked this many times before, but thought would try to reword, as have never got any solutions.
The application ajax calls work fine on my home machine, or whats seems to be most other networks. When it works, I can see all the output in Wireshark
When on my work machine, connected to our work Network, I see absolutely nothing in Wireshark. If I point to a server running on localhost, the app does work (but I see nothing in Wireshark, but perhaps this is because it is localhost)
If I run the app outside of the UWP container, ie I just run on the same machine, on the same network, but via the desktop browser (as you do for Cordova to debugging), it also works fine.
So it appears to be blocked before it even gets to the Network, as we see nothing in Wireshark at all, so this rules out host not reachable, CORS etc as it hasn't even been sent to the server.
I can run this in debug via Visual Studio, and I run the following test code...
document.addEventListener('deviceready', callUrl, false);
function callUrl() {
console.log('callUrl');
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function () {
var DONE = 4; // readyState 4 means the request is done.
var OK = 200; // status 200 is a successful return.
console.log(xhr.readyState);
if (xhr.readyState === DONE) {
if (xhr.status === OK)
console.log(xhr.responseText); // 'This is the returned text.'
} else {
console.log('Error: ' + xhr.status); // An error occurred during the request.
}
}
xhr.open('GET', 'https://httpbin.org/get');
xhr.send(null);
};
onreadystatechangeis called twice, with xhr.readyState first 2 and then 4.
status is always 0.
How can I diagnose what is blocking this?? I have absolutely no idea. This is something low level, but how to see what? I have also looked through Windows Event logs, but can find nothing.
The Ajax call just returns 0 with a blank description. Our Network administrator just says there is something wrong with my app (I have tried multiple Cordova apps, including just basic test apps)
Thanks in advance for any help.
[EDIT1]
In response to the comment from #Xavier, all I have in my AppxManifest.xml (that I extracted from my built .appxupload file) is
<Capabilities>
<Capability Name="internetClient" />
</Capabilities>
There is some documentation on the capabilities here, where we have the following (right at the bottom of the page)..
The following capabilities are unavailable when deploying your Remote Mode application to the Windows Store:
Enterprise Authentication (enterpriseAuthentication)
Shared User Certificates (sharedUserCertificates)
Documents Library (documentsLibrary)
Music Library (musicLibrary)
Pictures Library (picturesLibrary)
Videos Library (videosLibrary)
Removable Storage (removableStorage)
Internet client/server (internetClientServer) - note that internetClient is still permitted
Private network client/server (privateNetworkClientServer)
I am not sure were we even set these in Visual Studio (config.xml), but also the above seems to be saying some of these can't be used?
Should the internetClient be enough (I only want to call out to a server as a client, not act as a server).
Also, this seems to be enough to work on most Networks except for my Work..
[EDIT2]
In response to the reply on the CSP...
There is a discussion on this here. The test Cordova app I created in Visual Studio does have this :
<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *">
Surprisingly, I don't see this in my Ionic index.html, but perhaps this is because it is using the white list plugin?
My Ionic application has the following in the config.xml
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<allow-navigation href="http://localhost:8080/*" />
....
<plugin name="cordova-plugin-whitelist" spec="^1.3.1" />
It would be great if the ajax even had some error saying it was something to do with CSP if that is what it is, but we just get nothing.
Once again, it is weird that the problem only occurs on my work network (either on cable or our WIFI). If I run the exact machine (e.g. a Surface tablet)over another connection (e.g. tether it to my phones cell), then all works as expected. So it must be some setting to do with the network (or firewall maybe), which also I find strange as surely I would at least then see something in Wireshark.
Would be great to be able to "debug into" the ajax call, and see where it is failing.
[EDIT 3]
After reading one of the comments, I used fiddler to see if I could see anything, which I do...
It even reports 200 (which is not correct), my request still fails.
According to this, you need to request the privateNetworkClientServer capability in order to communicate with a local network.
Note that this capability only works if you app is configured for local mode (your app will be rejected from the store if using this capability in remote mode).
To enable local mode, you need to set <preference name="WindowsDefaultUriPrefix" value="ms-appx://" /> in your cordova config.xml.
Note that local mode might lead to other issues, as you cannot use e.g. inline scripts in local mode (CSP violation)

Push Notification in Windows App - How can I change the content of the Toast Message?

I have a Windows App developed with Cordova. I registered it with my Windows Developer Account and got my token etc. Now when I send a push message (toast) via Fiddler to the App, which is currently installed on an Windows Phone 8.1, I receive the Notification on the Phone just fine - but it only says 'New Notification'.
I used this xml for the message:
<?xml version="1.0" encoding="utf-8"?>
<wp:Notification xmlns:wp="WPNotification">
<wp:Toast>
<wp:Text1>Test Message</wp:Text1>
<wp:Text2>XXX</wp:Text2>
</wp:Toast>
</wp:Notification>
However, neither Text1 nor Text2 show up in my notification.
How can I implement the toast notification to actually use the content from the push notification?
Since my application is written in Angular JS, I can not use any C# documentations on the topic.
Any help with this problem would be much appreciated.
Thanks in advance!
It looks like you're using the MPNS format for toasts, but trying to push using WNS (I assume). Make sure you use the WNS toast format, documented here. Your toast should be formatted something like this:
<toast>
<visual>
<binding template="ToastText02">
<text id="1">Test Message</text>
<text id="2">XXX</text>
</binding>
</visual>
</toast>

Start workflow popup menu is empty in OpenKM web interface

I've created a simple workflow in jBoss studio and deployed it on OpenKM, every things is OK and my workflow will be shown in administration panel but in desktop panel there is no files in /okm:root/ and when I want to start my workflow the workflow lists in 'workflow start' dialog is empty, Did not have any entry.
Can any one please help me with how can I start my workflow?
As a note, I uses Firefox 30 and Java plug-in is disable on it
You must enable available workflow list from profiles ( administration -> profiles -> first tab). Also to start any workflow you need to doing it selecting a document.
In addition if your problem is that you're not showing th form just when you start workflow then take in consideration, there's an special task name in forms.xml if you want to be shown the form at the moment you're registering. You can see example in this form with task called task="run_config":
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE workflow-forms PUBLIC "-//OpenKM//DTD Workflow Forms 2.1//EN"
"http://www.openkm.com/dtd/workflow-forms-2.1.dtd">
<workflow-forms>
<workflow-form task="run_config">
<input label="number" name="number" />
<button name="submit" label="Submit" />
</workflow-form>
<workflow-form task="task">
<input label="number" name="number" data="modified" />
<button name="submit" label="Submit" />
</workflow-form>
</workflow-forms>
Here you can find some examples http://wiki.openkm.com/index.php/File:Course_workflows.zip, also I suggest take a look on it. Hope this could be useful for you

Resources