To use a template application, set up connection to a mobile platform server:
NOTE. Names of objects used in connection settings correspond to names in application code. If an object is renamed, rename the object in application code. All constants that are related with interaction between an application and a mobile platform server are contained in the HHFWConstants interface.
Add environments with names:
stencil_D. Development environment.
stencil_Q. Testing environment.
stencil_P. Operation environment.
Add a project named stencil in the stencil_D environment.
Add API users and a group of users in the stencil project.
NOTE. The example of connection setup uses the following API users: Petr1, Ekaterina2.
Add API users to group of users.
NOTE. If a template application is used only for working with Foresight. Analytics Platform, it is enough to execute steps 1-4. When synchronizing resources the template application may return role loading error that does not affect template application work.
Connect a PostgreSQL data source in the project, add credentials and create resources without caching with names:
SYSTEM_R1roles. The resource contains a table of used application roles.
SYSTEM_R2permissions. The resource contains a table of access permissions to resources by roles. Resource name must correspond with the value in the Mobile Client Name field of imported resource.
SYSTEM_R3parameters. The resource contains a table with application settings.
SYSTEM_R4users. The resource contains a table with information about users that is displayed in application interface. Values in the login column should match with logins of API users.
NOTE. Resources tables must contain the structure specified in examples. Table fields must not be zeroable.
The configured resources will be hidden from the user in the application.
Examples of resources structure
Set up connection to nfs4 file resource and create the SYSTEM directory.
The SYSTEM directory stores user avatar images displayed in application interface, for example:
NOTE. To automatically set user avatar, make sure that image name matches with user login that is set in the SYSTEM_R4users resource.
Allow access for a group of users to configured resources.
Add credentials for API user to connect to PostgreSQL data source and file resource with the SYSTEM directory.
Connect required data sources and import resources.
Template applications use resources with determined structure.
Copy the configured stencil project to the stencil_Q and stencil_P environments.
After executing the operations set up connection to a mobile platform server in a template application. Set mobile platform URL, project and environment name and select working mode in application settings:
See also:
Mobile Application Templates | Example of Connecting Application to Foresight Analytics Platform