creating a first mobile app without using mobile appbuilder - Forum - Mobile - Progress Community

creating a first mobile app without using mobile appbuilder

 Forum

creating a first mobile app without using mobile appbuilder

This question is answered

Hi,

I'm looking for a guide for creating a simple first app without mob appbuilder (is there one somewhere?), but using the jsdo. I have a mobile service working; restclient tool works with GET http://localhost:8980/CustomerMobile/rest/CustomerMobile/dsCustomer?filter=.

  But now I want to create a first simple html-page that shows some data of this dataset. I have put the following in RESTContent /static/customer.html (see below). This file is published automatically to servers\tomcat\webapps\CustomerMobile\static. But I do not see progress.js and progress.session.js in servers\tomcat\webapps\CustomerMobile\static\mobile, only CustomerMobile.json. And which url should I use to get the data, is it http://localhost:8980/CustomerMobile/static/customer.html?

<!

DOCTYPE

html>

<html>

<head>

<script src="/jsdo/progress.session.js"></script>

<script src="/jsdo/progress.js"></script>

<script>

session =

new progress.data.Session();

session.login(

"http://localhost:8980/CustomerMobile/rest/CustomerMobile", "", "");

session.addCatalog(

"http://localhost:8980/CustomerMobile/static/mobile/CustomerMobile.json");

jsdo =

new progress.data.JSDO({ name: "dsCustomer" });

// jsdo.subscribe("AfterFill", onAfterFillCustomers, this);

jsdo.fill();

function onAfterFillCustomers(jsdo, success, request) {

jsdo.eCustomer.foreach(

function(customer) {

document.write(customer.data.CustNum +

" " + customer.data.Name + "<br>");

});

}

</script>

</head>

<body>

</body>

</html> 

 

--
Kind regards,

Stefan Houtzager

Houtzager ICT consultancy & development

www.linkedin.com/in/stefanhoutzager

Verified Answer
  • Hello,

    The Session object and the JSDO components in the OpenEdge Mobile do not have dependencies. (It only required JavaScript and the XMLHttpRequest object.)

    Even though the Mobile App Builder with its design tool gives you high productivity, you can build mobile apps by just using HTML/JS and CSS and package them with PhoneGap/Cordova. You can use any web development or even a text editor.

    Here are some few comments:

    - Yes, the URL that you mentioned is correct.

    - progress.js and progress.session.js are now distributed as progress.jsdo.<version>.js via the Mobile App Builder.

    As Shelley Chase mentioned your license question from few weeks back, in the near future, this library would be available as Open Source on GitHub.

    - You can place your files in RESTContent or WebContent, the difference is which WAR file would be used to delive the HTML/JS/CSS portion of your app. Notice that HTML/JS/CSS could also be hosted on a different web server or packaged with PhoneGap.

    - I noticed that the code to subscribe to AfterFill is commented out. You would need to subscribe to the call since the fill() operation is asynchronous.

    At the oemobiledemo.progress.com web site, you can find some examples of code using the JSDO, JQuery, the Mobille App Builder and other components:

    Simple HTML page using the JSDO

    - oemobiledemo.progress.com/.../example001.html

    Simple HTML page with JQuery/JQuery Mobile using the JSDO

    - oemobiledemo.progress.com/.../example002.html

    App developed using the Mobile App Builder:

    - oemobiledemo.progress.com/.../example003.html

    Simple HTML page with JQuery/JQuery Mobile using an INVOKE operation in the JSDO:

    oemobiledemo.progress.com/.../example004.html

    Sample App developed using the Mobile App Builder using JS char by amCharts as a plugin (template):

    - oemobiledemo.progress.com/.../example005.html

    Simple HTML page using an INVOKE operation and addRecords in the JSDO:

    oemobiledemo.progress.com/.../example006.html

    App developed using the Mobile App Builder using the Express Project based on the UIHelper component:

    - oemobiledemo.progress.com/.../example007.html

    Simple example using the JSDO from Angular:

    - oemobiledemo.progress.com/.../example008.html

    I hope this helps.

All Replies
  • Hello,

    The Session object and the JSDO components in the OpenEdge Mobile do not have dependencies. (It only required JavaScript and the XMLHttpRequest object.)

    Even though the Mobile App Builder with its design tool gives you high productivity, you can build mobile apps by just using HTML/JS and CSS and package them with PhoneGap/Cordova. You can use any web development or even a text editor.

    Here are some few comments:

    - Yes, the URL that you mentioned is correct.

    - progress.js and progress.session.js are now distributed as progress.jsdo.<version>.js via the Mobile App Builder.

    As Shelley Chase mentioned your license question from few weeks back, in the near future, this library would be available as Open Source on GitHub.

    - You can place your files in RESTContent or WebContent, the difference is which WAR file would be used to delive the HTML/JS/CSS portion of your app. Notice that HTML/JS/CSS could also be hosted on a different web server or packaged with PhoneGap.

    - I noticed that the code to subscribe to AfterFill is commented out. You would need to subscribe to the call since the fill() operation is asynchronous.

    At the oemobiledemo.progress.com web site, you can find some examples of code using the JSDO, JQuery, the Mobille App Builder and other components:

    Simple HTML page using the JSDO

    - oemobiledemo.progress.com/.../example001.html

    Simple HTML page with JQuery/JQuery Mobile using the JSDO

    - oemobiledemo.progress.com/.../example002.html

    App developed using the Mobile App Builder:

    - oemobiledemo.progress.com/.../example003.html

    Simple HTML page with JQuery/JQuery Mobile using an INVOKE operation in the JSDO:

    oemobiledemo.progress.com/.../example004.html

    Sample App developed using the Mobile App Builder using JS char by amCharts as a plugin (template):

    - oemobiledemo.progress.com/.../example005.html

    Simple HTML page using an INVOKE operation and addRecords in the JSDO:

    oemobiledemo.progress.com/.../example006.html

    App developed using the Mobile App Builder using the Express Project based on the UIHelper component:

    - oemobiledemo.progress.com/.../example007.html

    Simple example using the JSDO from Angular:

    - oemobiledemo.progress.com/.../example008.html

    I hope this helps.

  • Thanks Edsel,

    I removed the comment on the subscribe you named. No data, in the chrome console I get

    GET http://localhost:8980/jsdo/progress.session.js 404 (Not Found) customer.html:4
    GET http://localhost:8980/jsdo/progress.js 404 (Not Found) customer.html:5

    I cannot find the sources back where I based my code on, in any case I don't see this jsdo map with the .js files. So it is not delivered with the publish (should I copy them from the oe install to some place manually?). Ok, I download  http://oemobiledemo.progress.com/jsdo/progress.jsdo.3.0.js from example 1 which you provided and put it next to my CustomerMobile.json, in \servers\tomcat\webapps\jsdo. I put some debugcode in customer.html:

    var loginResult = session.login("http://localhost:8980/CustomerMobile/rest/CustomerMobile", "", "");
     switch (loginResult) {
    case progress.data.Session.LOGIN_AUTHENTICATION_FAILURE:
    alert('Invalid user-id or password');
    break;
    case progress.data.Session.LOGIN_GENERAL_FAILURE:
    alert('Login failed');
    default:
    alert('Service is unavailable');
    break;
    }

    And see alert 'Login failed'. 

    F12 (chrome, console) gives

    GET http://localhost:8980/CustomerMobile/rest/CustomerMobile/static/home.html 500 (Internal Server Error) progress.jsdo.3.0.js:6181

    servers\tomcat\webapps\CustomerMobile\static\home.html is there, it contains only

    <html>
    <body>
    Home
    </body>
    </html>

    What am I missing? 

    --

    Kind regards,

    Stefan Houtzager

    Houtzager ICT consultancy & development

    www.linkedin.com/in/stefanhoutzager

  • Never mind, I placed the progress.jsdo.3.0.js in servers\tomcat\webapps\jsdo and use

    session.login("http://localhost:8980/CustomerMobile", "", "");

    It works now.