Skip to content

Starter Template FAQ

edselg edited this page Apr 17, 2018 · 9 revisions

Starter Template FAQ

How do I add authentication?

Basic and form authentication are currently supported. Demo services are provided and available for public use.

Open file jsdo.settings.ts:

yourapp
└───app 
    └───shared 
        |   jsdo.settings.ts

Replace the following values in jsdo.settings.ts in the JsdoSettings class:

Basic:

// BASIC JSDOSettings
// login to app:
// user: basicuser
// password: basicpassword
    static serviceURI = "https://oemobiledemo.progress.com/OEMobileDemoServicesBasic";
    static catalogURI = "https://oemobiledemo.progress.com/OEMobileDemoServicesBasic/static/SportsService.json";
    static authenticationModel = "Basic";

Form:

// FORM JSDOSettings
// login to app:
// user: formuser
// password: formpassword
    static serviceURI = "https://oemobiledemo.progress.com/OEMobileDemoServicesForm";
    static catalogURI = "https://oemobiledemo.progress.com/OEMobileDemoServicesForm/static/SportsService.json";
    static authenticationModel = "Form";

How do I use filtering and sorting?

Filtering and sorting can be performed on the server-side using the JSON Filter Pattern (JFP). The filter and sort options use the same syntax as the filter and sort options in the Kendo UI DataSource.

If JFP support is not available in the Business Entity, only filter with ABL where string can be used. Alternatively, you can use functionality in NativeScript to do client-side filtering and sorting.

    // static filter = "";
    // static sort = "";

    // static filter = {};
    // static sort = "";

    // static filter = "CustNum <= 11";
    // static sort = "";

    static filter = { field: "CustNum", operator: "lte", value: 11 };
    static sort = { field: "Name", dir: "asc" };

    // Filter expression used by the SearchBar field
    // $SEARCH token is replaced by the value entered in the field
    // static searchFilter = "CustNum <= 11 AND Name MATCHES '*$SEARCH*'";
    // static searchFilter = { field: "Name", operator: "contains", value: "$SEARCH" };
Clone this wiki locally