Mobile Services App Development Tools for Micro App in SAP Web IDE¶
Mobile Development Kit extension on SAP Web IDE helps you to quickly and efficiently develop or modify micro apps throughout their life cycles.
Note
WeCom application support is available only in China.
Prerequisites¶
This topic describes the prerequisites for Micro App extension.
Following are the prerequisites.
-
An application in WeChat work
To create an application in WeChat work, see this guide. you can reuse an existing application instead of creating a new one.
-
Destination for Cloud Foundry Mobile Service in NEO. To create a new destination, see Creating Destination for mobile services in Neo Environment
Note
Provide the following values for
Destination Name
andURL
:- Destination Name:
mobileservices_cf
- URL: mobile services admin UI root url (without the path)
- Destination Name:
-
Mobile Development Kit editor in SAP Web IDE
To enable Mobile Development Kit editor in SAP Web IDE, see Setting Up the Editor in SAP Web IDE Full-Stack
-
Configuring WeChat settings To configure WeChat settings, see Configuring WeChat Settings.
Create a Back-End Module for WeChat Application¶
Creating a back-end module on SAP Web IDE for WeChat application.
-
Launch SAP Web IDE and navigate to your development workspace. Right click on
Workspace
and selectNew
>Project
from Template. -
On the pop-up screen that appears. In the
Template Selection
section, selectCloud Foundry
in theEnvironment
drop-down and Mobile Services in theCategory
drop-down. ChooseWeChat Micro App with Mobile Back-End Tools
tile and then chooseNext
. -
In the
Basic Information
section, enter aProject Name
and chooseNext
. -
In the
Mobile OData Service Parameters
section, enter or select the requested details and then chooseNext
.Attribute Name Description Service App Name Enter the application name. Service App Version Enter the version in the format *.*.*
, for example1.0.0
Deployment Target Select Cloud Foundry. Authentication Method Select XSUAA -
In the
Mobile Services
section, either enter or select theAPI Endpoint
,Organization
, andSpace
. You can either select an existing application or create a new application by choosing the '+' icon. ChooseNext
.After the confirmation, you can check the project settings for mobile services information. To do so, right-click on the newly created project and choose
Project
>Project Settings
. In theMicro App
section, you can view the micro app configurations like API, server, destination, and so on. -
Create a back-end service from CSDL. To do so, you can either copy an existing
.csdl
metadata file or create a new one by, right-clicking on the newly created project and chooseNew
>OData CSDL Document
.A new
.csdl
file is created and added to the project. -
Generate a mobile OData service. To do so, right-click on the newly created
.csdl
file and chooseGenerate Mobile OData Service
.After the service is generated, you can perform the following:
- Add messaging: Right click on
srv
folder and selectAdd Micro App Messaging
. A messaging folder is generated in the current package. - Customize notification: Edit a
.listener
file under the current package'slistener
folder. - Build the application: Right click on
srv
and chooseBuild
>Build
.
- Add messaging: Right click on
Create a UI Module for WeChat Application¶
Create a UI module using SAP Web IDE for WeChat application. Use this procedure to create a UI module for WeChat application and update the module with back-end information.
Prerequisites:
You’ve created a project of WeChat Micro App with Mobile Back-End Tools
template. If not created, then refer Create a UI Module for WeChat Application
Procedure:
-
Launch SAP Web IDE and navigate to your development workspace.
-
Select the required project. Right-click on the project and choose
New
>HTML5 Module
. -
On the pop-up screen that appears. In the
Template Selection
section, chooseCRUD Master-Detail Module
tile and then chooseNext
. -
In the
Basic Information
section, enter a name, title, description, and namespace for the module. ChooseNext
. -
In the
Data Connection
section, selectWorkspace
and s service metadata document (.csdl file) from the workspace. -
In the
Template Customization
section, select the required data binding object and line item. ChooseFinish
. -
Update the UI module with back-end information. To do so, right-click on
mta.yaml
file.mta.yaml
is updated with Cloud Foundry and Mobile Service application information. -
Update back-end information in
manifest.json
andxs-app.json
files. To do so, right-click on the newly created UI module and chooseUse back-end destination
.
Create a Blank WeChat Application¶
Create a blank WeChat micro app.
-
Launch SAP Web IDE and navigate to your development workspace. Right click on
Workspace
and selectNew
>Project from Template
. -
On the pop-up screen that appears. In the
Template Selection
section, selectCloud Foundry
in theEnvironment
drop-down andMobile Services
in theCategory
drop-down. ChooseBlank WeChat Micro App
tile and then chooseNext
. -
Provide a
Project Name
and chooseNext
. -
In the
Template Customization
section, provide theApplication ID
,Application Version
, andDescription
. ChooseNext
. -
In the
Mobile Services
section, provide yourCloud Foundry API
Info, such asAPI Endpoint
,Organization
, andSpace
. You can select an existing application from theApplication ID
drop-down or create a new application by selecting the + icon. In the pop up for new application, provide the mobile services application ID, Name, Corp ID, and Agent ID. -
Choose
Finish
.A new project under the workspace is created.
You can now perform the following:
- Create an empty HTML5 module: Right click on the newly created project and select
New
>HTML5 Module
. ChooseSAPUI5
application and then chooseNext
. Provide values forModule Name
andNamespace
. - Create an empty JAVA Module: Right click on the newly created project and select
New
>Java Module
. ChooseSpring Boot application
application and then chooseNext
. Provide values forName
,Group ID
,Artifact ID
, andPackage
. - Add messaging: Right click on
srv
folder and selectAdd Micro App Messaging
. Amessaging
folder is generated in the current package. - Use SAP Cloud SDK to Generate OData Service Access Code:
- Specify the OData service: Select your Java folder and expand the folder. Create a
edmx
folder under the Java module. Import the OData modulesBusinessPartner.edmx
andECWorkflow.edmx
into the newly creatededmx
folder. The OData modules are available on SAP Business Accelerator Hub. - Add build dependencies and plugins: Locate
pom.xml
in your Java module. Right click and selectAdd S/4 Hana Dependencies
.
- Specify the OData service: Select your Java folder and expand the folder. Create a
- Create an empty HTML5 module: Right click on the newly created project and select