W
whenshaw
Guest
Well, here is a set of steps that should work for you in the current version of the Mobile App Builder. You may want to consider waiting for the new release after you see these, but I would be happy to help you through them if you want to go this route. The basic idea is to copy the existing MobileService and edit the copy to give you the second service. The copy is indirect -- you will need to create a plugin from MobileService and then create a new service from that plugin. (Thanks to Maura Regan for showing me a document she wrote that includes this procedure) 1. Open your project in the Mobile App Builder and select "Export" and then "OpenEdge Plugin" a. in the dialog that opens up, fill in a Name b. Uncheck "Export entire project" c. under "Export entire project" (now unchecked), expand "Services" d. check MobileService_Login, MobileService_Logout, and MobileService_Settings (be sure NOT to check any other services that might be there) e. Click the green Export button at bottom right 2. Should get a dialog box that says the export worked, click OK 3. Now back at the MAB screen for your project 4. Create New | From Plugin a. Select the plugin that you just created b. Click "Import selected plug-ins" 5. Dialog box that says "Appery.io plugin(s) were installed successfully." should appear. It asks whether you want to set the Settings now. Might as well check the box for that and click "Apply settings" -- that will create the new services and display the Settings page for them 6. Set the appropriate settings -- the catalogsURIs and serviceURI for the REST service you created for the marketing info, leave the other 2 fields alone. Save. 8 Unfortunately, your new services (and the Settings object) will have the same names as the original services that you made the plugin from, with GUIDs appended, e.g., - MobileService_Login1369420228594 - MobileService_Logout1369420228620 - MobileService_Settings1369420228648 And under the JavaScript node on the left of the MAB screen (these files contain the implementation code for the services): - SessionLogin1369420228674 - SessionLogout1369420228700 Sooner or later you'll probably want to change those names. It's fairly easy to change the names of the MobileService_Login... and MobileService_Logout... services -- just click on them, you'll see a property page come up with fields for things like "Name", "JavaScript Implementation", etc. . Just enter whatever you'd like in the "Name" field ("MarketingService_Login", for example). Changing the names of the MobileService_Settings... and the 2 JavaScript files is more involved and not necessary. I can give you instructions for that if you want, but for now let's make a few final changes that *are* necessary: 9. Click on the new JavaScript file for the login (SessionLogin1369420228674 in the example above). a. you'll see the JS code displayed in the main part of the screen b. on line 11 (I think it should be), replace $t.SessionLogin with $t.SessionLoginxxxx..., where xxxx... is the number appended to the JavaScript file you're editing (i.e., make sure that what follows the first $t. on that line is the name of the file it's in. Leave the $t.createClass on that line alone) c. Save 10. Click on the SessionLogout JS file so you can edit it, too a. As in the login file, replace $t.SessionLogout (should be on line 9) with $t. + the name of the file you're editing b. a little farther down (it's line 28 in the file I'm looking at), replace MobileService_Login with the name of your new MobileService_Login service -- that would be MobileService_Login1369420228594 in the example above, or whatever you may have changed it to (and yes that is correct that even though this is the logout code, you are dealing with the Login service in this particular statement) 11. Be sure to save! This will give you the second set of Session services. As I outlined earlier, you'd probably want to execute the new Marketing login as soon as the app is activated, by adding it to the Data tab of your main page and executing it in page Load, or something along those lines.
Continue reading...
Continue reading...