worklight-adapters

Getting response from HTTP Adapter from Worklight

青春壹個敷衍的年華 提交于 2019-12-24 10:58:04
问题 I am new to worklight. I tried to get the json response from the http adapter, but I am unable to get it to display on device. I added some alerts in my javascript code and found that it is returning the size of json object as `undefined``. Here is my adapter javascript file: function getGooglePlaces(location,name) { var input = { method : 'get', returnedContentType : 'json', path : 'maps/api/place/search/json', headers: { Host: 'maps.googleapis.com' }, parameters : { 'key' : MyKey, 'location

Return an array of resultSets from the server in worklight

余生长醉 提交于 2019-12-24 04:58:12
问题 I want to use the values from multiple rows returned in a resultSet to invoke a procedure again and again and display the result of the invoked procedure on main html page Adapter JS var selectStatement = WL.Server.createSQLStatement("select * from medicine WHERE Name= ? "); var selectStatement2 = WL.Server.createSQLStatement("select LocId from location WHERE LocName= ? "); var selectStatement3 = WL.Server.createSQLStatement("select RegNo from storeloc WHERE LocId= ? "); var selectStatement4

Worklight Event Source, what security test

给你一囗甜甜゛ 提交于 2019-12-23 05:30:05
问题 Worklight 6.1, testing in WL Studio on a Mac. As a follow-up to this question concerning doing background work in a Worklight Server, the accepted answer to which is to use an Event Source. WL.Server.createEventSource( { name: "housekeepingEventSource", poll: { interval: 5, onPoll: workToBeDone }, securityTest: "eventTest" } ); The issue concerns which security test to use. Whatever I try I get this error: Adapter deployment failed: Wrapped java.lang.ClassCastException: org.mozilla.javascript

Invoking Worklight Adapter and Displaying that JSON data in list view as strings

本小妞迷上赌 提交于 2019-12-23 05:00:21
问题 This is my adapter.impl.js code. //This procedure implementation is to get all the details from the table which in database. var procedure1Statement = WL.Server.createSQLStatement("select * from employee"); function procedure1() { return WL.Server.invokeSQLStatement({ preparedStatement : procedure1Statement, parameters : [] }); } This is my JSON data retrieved from SQL Adapter in worklight. { "isSuccessful": true, "resultSet": [ { "EMAIL": "bkandregula@gmail.com", "ID": 1, "NAME": "Bhanu

IBM Worklight - Include a JavaScript library on the server side

二次信任 提交于 2019-12-21 17:51:24
问题 I'm building a mobile application using IBM Worklight. In an adapter, I need to use some functionality which is provided by a third party JavaScript file. I want to know if it's possible to include such a file on the server? If not, what is the alternative? 回答1: At the moment there is no way to include an external JavaScript library in the Adapter code. Currently the only workaround is to copy the library code to the adapter. 回答2: In Worklight 6.0.0, IBM introduced Node.js adapters, touting

how to perform xslt transformation for input request in adapter

浪尽此生 提交于 2019-12-20 06:29:35
问题 i have created a XSLT for the WL.Server.invokeHttp which gets the data from the backend server in XML format and performing transformation successfully. this adapter is used to get the data from backend server. but while sending data to server in XML , as i am getting data in adapter as JSON , i need to transform it into XML using XSLT. is there any provision in ibm worklight adapters that i can perform XSLT transformation for input request just the way i can do it easily while getting

5.0.6 - Changing Adapter domain and port configuration after deploy through configuration - for QA and Testing team in development process

梦想的初衷 提交于 2019-12-20 03:57:06
问题 I have seen some questions about dynamic adapter configuration at run-time how to pass domain,port number,username and password from user input to worklight http adapter With a Worklight Adapter can I change the domain and port for a procedure at runtime? but my question is about adapter configuration after deploy on WL server 5.0.6 from external - not at runtime from code. Our scenario is that in our enterprise development and testing process requires the QA and Testing team to change the

Use of third parameter in the WL.Client.InvokeProcedure

一曲冷凌霜 提交于 2019-12-19 04:55:43
问题 I am using the client side API WL.Client.InvokeProcedure(invocationData, options, UseSendInvoke) in worklight 6. But I could not find a description for the parameter UseSendInvoke in the API. Do you guys know what it is? 回答1: This parameter is used internally by WL authentication framework. Technically there should not be a reason for developer to use it. There are several ways to invoke adapters. (1) First one is via client application. This is where you use WL.Client.invokeProcedure

Worklight logout does not clear active user

て烟熏妆下的殇ゞ 提交于 2019-12-18 17:26:10
问题 I am using Worklight 6.1 and am using a challange handler to determine if my user is logged or not. Once logged in, I have the following code attached to my logout button in my app: on(logoutBtn, "click", lang.hitch(this, function() { WL.Client.logout('AdapterAuthRealm', { onSuccess:lang.hitch(this, function() { this.gotoView("login"); }), onFailure:lang.hitch(this, function() { WL.Logger.error("Unable to logout"); })}); return false; })); Clicking it opens the login view, but when the user

Worklight logout does not clear active user

一曲冷凌霜 提交于 2019-12-18 17:26:05
问题 I am using Worklight 6.1 and am using a challange handler to determine if my user is logged or not. Once logged in, I have the following code attached to my logout button in my app: on(logoutBtn, "click", lang.hitch(this, function() { WL.Client.logout('AdapterAuthRealm', { onSuccess:lang.hitch(this, function() { this.gotoView("login"); }), onFailure:lang.hitch(this, function() { WL.Logger.error("Unable to logout"); })}); return false; })); Clicking it opens the login view, but when the user