Device Management System
Development Lab Guide
Huawei Technologies CO., LTD.
[在此处 键入]
Device Management System Development Lab Guide Contents
Contents
1 Lab Environment .................................................................................................................... 1
1.1 About This Course .................................................................................................................................................................... 1
1.2 Lab Environment....................................................................................................................................................................... 1
2 Requirement Description ...................................................................................................... 3
2.1 Purpose ........................................................................................................................................................................................ 3
2.2 Introduction to the Experiment ........................................................................................................................................... 3
2.3 Experimental Development Process .................................................................................................................................. 4
3 Development of Device Management System ................................................................ 5
3.1 Preparations ............................................................................................................................................................................... 5
3.2 Creating a Project ..................................................................................................................................................................... 5
3.3 Configure data model ............................................................................................................................................................. 7
3.4 Configure Service ....................................................................................................................................................................15
3.4.1 Configure service query condition ................................................................................................................................15
3.4.2 Configure service translator ............................................................................................................................................17
3.4.3 Configure the validator .....................................................................................................................................................21
3.5 Configure page ........................................................................................................................................................................24
3.6 Release to Runtime State ....................................................................................................................................................29
3.7 Result Verification ..................................................................................................................................................................32
Copyright © Huawei Technologies Co., Ltd.. ii
[在此处 键入]
Device Management System Development Lab Guide 1 Lab Environment
1 Lab Environment
1.1 About This Course
This course is a practice task for the development of the Device Management System.
Upon completion of this course, you should be able to:
⚫ Create projects independently
⚫ Configure project and module independently
⚫ Complete data model configuration
⚫ Complete the configuration of the translator and validator
1.2 Lab Environment
Lab address: [Link]
Login environment: Google Chrome is recommended.
Get the User Account and Password from trainer.
Successful login page:
Copyright © Huawei Technologies Co., Ltd.. 1
[在此处 键入]
Device Management System Development Lab Guide 1 Lab Environment
Training tenant, Tenant ID = 2065, Tenant Name = stcGDE_001.
After the administrator approve the application, then switch the tenant. Make sure the page URL is
correct.
Copyright © Huawei Technologies Co., Ltd.. 2
[在此处 键入]
Device Management System Development Lab Guide 2 Requirement Description
2 Requirement Description
2.1 Purpose
This experiment mainly introduces how to develop device management system. Through this
experiment, you can clarify the logical relationship between the project, data model, and page
configuration. Functionally, the following functions can be implemented:
⚫ Manages devices, including creating, updating, and query device information
⚫ Implements data import and export configuration
⚫ Device status information display
⚫ Familiar with service validator and translator
2.2 Introduction to the Experiment
The device management system contains the following pages:
List page:
Create a page:
Update page:
Copyright © Huawei Technologies Co., Ltd.. 3
[在此处 键入]
Device Management System Development Lab Guide 2 Requirement Description
2.3 Experimental Development Process
Log in Creating project Creating model
Creating Services
Data Importing Creating Services
Validator and
and Exporting and Pages
Translator
Release
Copyright © Huawei Technologies Co., Ltd.. 4
[在此处 键入]
Device Management System Development Lab Guide
3 Development of Device Management
System
3.1 Preparations
The platform development environment can be successfully logged in.
3.2 Creating a Project
Step 1 After the login is successful, click Orchestration Now to enter the
development State Studio.
Step 2 Create a Project, select a project template. select ADC Common Template,
type in project information, for example, xx_device_mgt for Name and
xx_device_mgt for Display Name, and click Create
Copyright © Huawei Technologies Co., Ltd.. 5
[在此处 键入]
Device Management System Development Lab Guide
Step 3 After the project is created, click the menu on the left to view the
information about the current project, such as model, service, page, trigger,
data import, and data export.
Copyright © Huawei Technologies Co., Ltd.. 6
[在此处 键入]
Device Management System Development Lab Guide
3.3 Configure data model
Step 1 Click Model. After the following page is displayed, click the canvas to switch
to the canvas mode. Drag the Data Model to the design page. Then, the
Create Model (Data Model) dialog box is displayed. You need to enter the
Model Name, Display Name. Then click OK.
Copyright © Huawei Technologies Co., Ltd.. 7
[在此处 键入]
Device Management System Development Lab Guide
Step 2 You can see the following page generated. Click the symbol "+"
Copyright © Huawei Technologies Co., Ltd.. 8
[在此处 键入]
Device Management System Development Lab Guide
Step 3 The Create Property interface is displayed, as shown in the following figure.
You can view the property type, property name, label name, primary key
selection, and description. Property types need to be selected based on
different model property.
Step 4 Create the Device Number field. Set Property Type to Text, Property Name to
device_no, Label Name to Device No., Primary Key to Yes, Mandatory, and
Maximum Length to 200 by default. Then, click Submit and Create Next
Copyright © Huawei Technologies Co., Ltd.. 9
[在此处 键入]
Device Management System Development Lab Guide
Step 5 Add other model properties of the device except the primary key based on
the following table information. After the last property type is set, click
Submit
Attributes of the
Property Type Property Name Label Name
Property type
Primary key, max.
text device_no Device No. length 200,
mandatory
Non-primary key,
text location Device Location max. length 200,
mandatory
Non-primary key,
mandatory, max.
text device_status Device Status length 200,
mandatory
Non-primary key,
text creator Submitted by
max. length 200
Copyright © Huawei Technologies Co., Ltd.. 10
[在此处 键入]
Device Management System Development Lab Guide
Date and Time create_time Creation Time
Date and Time update_time Update Time
Step 6 After all the fields are created, click Save. Then, click Model Generate Service
and Page. In the displayed dialog box, select a model and click Next. At this
point, you can see four related pages. Click Generate
Copyright © Huawei Technologies Co., Ltd.. 11
[在此处 键入]
Device Management System Development Lab Guide
Step 7 On the upper right corner, click the one-click deployment to deploy and
release this application.
Step 8 Update model attribute. Click the data model, select the device_no property,
change property type to Sequence, and sequence is auto increment (This
auto-increment sequence type increases in the order of 1 2 3 4 …).
Step 9 Add two new properties, click the + symbol to add one new property type
File, property name is picture, label name is Picture. You also can drag the
property type to the data mode to add the other one property, for example,
the high-risk device.
Copyright © Huawei Technologies Co., Ltd.. 12
[在此处 键入]
Device Management System Development Lab Guide
After finish all the property, please don’t forget save the data mode. Then regenerate the service
and page. When overwrite the existing services pages, select all the exist pages and services.
Copyright © Huawei Technologies Co., Ltd.. 13
[在此处 键入]
Device Management System Development Lab Guide
Step 10 On the upper right corner, click the one-click deployment to deploy and
release this application again.
Copyright © Huawei Technologies Co., Ltd.. 14
[在此处 键入]
Device Management System Development Lab Guide
3.4 Configure Service
3.4.1 Configure service query condition
Step 1 Service query conditions. Click the service icon on the left to expand the
service list and click service mgt_device_info_get_list to open the editing
page.
Step 2 The service configuration page is displayed. Click the get_list icon in the
middle of the canvas and click the arrow icon in the upper right corner to
expand the service configuration page
Copyright © Huawei Technologies Co., Ltd.. 15
[在此处 键入]
Device Management System Development Lab Guide
Step 3 Edit the Query Condition.
Syntax rule: “$! + variable name” indicates that the query variable is ignored when the input
parameter value is empty. "contains" indicates fuzzy query.
Save the service.
Copyright © Huawei Technologies Co., Ltd.. 16
[在此处 键入]
Device Management System Development Lab Guide
3.4.2 Configure service translator
Step 1 Click the service icon on the left, click and open the service that ends with
_create.
Step 2 Open the _create service, click the start node, and click the double arrow icon
in the upper right corner to expand the input parameter configuration
Copyright © Huawei Technologies Co., Ltd.. 17
[在此处 键入]
Device Management System Development Lab Guide
Step 3 Set the create_time to the current_time. Click the “+ “icon where create_time
row translator column. After the dialog box is displayed, the Translator
Configuration page is displayed. Translation method --> General
configuration, mapping type --> Common functions, name --> currentTime().
After the configuration is complete, click OK
Copyright © Huawei Technologies Co., Ltd.. 18
[在此处 键入]
Device Management System Development Lab Guide
Step 4 Set the update time to the current time. The method for configuring the
translator is the same as that for create_time. Select the update_time line
and add the translator currentTime()
Step 5 Set the creator to the current user. Same as the method of configuring the
translator for create_time, select the line of the creator and configure the
translator as currentUser().
Copyright © Huawei Technologies Co., Ltd.. 19
[在此处 键入]
Device Management System Development Lab Guide
Step 6 Configure the system to automatically update the update time when data is
updated on the page. Click the service icon on the left, expand the service
list, and click and open the service that ends with _update.
Input parameter configuration, add translator currentTime() to update_time. Remember to save the
service.
Copyright © Huawei Technologies Co., Ltd.. 20
[在此处 键入]
Device Management System Development Lab Guide
3.4.3 Configure the validator
Step 1 Click the service icon on the left, expand the service list, and and click and
open the service that ends with _create
Copyright © Huawei Technologies Co., Ltd.. 21
[在此处 键入]
Device Management System Development Lab Guide
Step 2 Open the create service, click the start node, and click the double arrow icon
in the upper right corner to expand the input parameter configuration
Step 3 Select the validator of the location input parameter, delete the old default
validator first, click the + icon of the validator, and select Common
Verification from the drop-down list
Copyright © Huawei Technologies Co., Ltd.. 22
[在此处 键入]
Device Management System Development Lab Guide
Step 4 Set Verification Type to Text, set Maximum Length to 8, that means the
location text length should be less than 8 letters. Then, click OK. Click Save to
save the service.
Copyright © Huawei Technologies Co., Ltd.. 23
[在此处 键入]
Device Management System Development Lab Guide
3.5 Configure page
Step 1 On the _create page, deleted the Submitted by, Creation Time, and Update
Time fields.
Click the component to find the component in the component tree. Then select the upper layer
component, right-click the component, and select Delete in the pop-up window. Delete the
Submitted by, Creation Time, and Update Time components on the page. After the deletion is
complete, save the page.
Copyright © Huawei Technologies Co., Ltd.. 24
[在此处 键入]
Device Management System Development Lab Guide
Step 2 On the _update page, deleted the Update Time fields. Set the Submitted by,
Creation Time read-only.
Note: Read-only setting. Each component has a read-only attribute setting. Select Yes to set the
component as read-only.
Copyright © Huawei Technologies Co., Ltd.. 25
[在此处 键入]
Device Management System Development Lab Guide
When finish the configuration, don’t foget save the page.
Copyright © Huawei Technologies Co., Ltd.. 26
[在此处 键入]
Device Management System Development Lab Guide
Step 3 Click Page in the left menu to view the automatically generated page. Click
the name of the page mgt_device_info_grid to enter the page designer and
set the page
Step 4 Add the Device Location search on the toolbar. On the grid page, search for
the Text Input component in the left component, pull it to the toolbar in the
right component tree, and enter the text box name location and label Device
Location.
Step 5 Add Device Status search condition. On the grid page, search for the drop-
down list box component in the left pane, pull the component tree on the
right pane, and enter the text box name device_status and label Device
Status.
Copyright © Huawei Technologies Co., Ltd.. 27
[在此处 键入]
Device Management System Development Lab Guide
Step 6 Click the drop-down list box "Options" created in the previous step to enter
the option editor, and copy the following scripts. (text is the displayed value
of the option, and value is the actual value of the option). Then, click Save.
[
{"text": "normal", "value": "normal"},
{"text": "abnormal", "value": "abnormal"}
]
Step 7 Click Save to preview the page
Copyright © Huawei Technologies Co., Ltd.. 28
[在此处 键入]
Device Management System Development Lab Guide
3.6 Release to Runtime State
Step 1 Click the Internationalization menu on the left and add the bundle named
xx_mgt_device (user defined). Click Confirm and Complete.
Step 2 Open the newly created bundle, click the new button in the upper right
corner, and create a property name mgt_device_system. (Simplified Chinese:
leave it blank; English: xx Device Management System)
Copyright © Huawei Technologies Co., Ltd.. 29
[在此处 键入]
Device Management System Development Lab Guide
Step 3 Choose Menu on the left, create the menu named mgt_device_system, select
the xx_mgt_device Bundle package for internationalization last step we
created, and select the mgt_device_info_grid page as the app menu. After the
configuration is complete, click Add at the bottom.
Copyright © Huawei Technologies Co., Ltd.. 30
[在此处 键入]
Device Management System Development Lab Guide
Copyright © Huawei Technologies Co., Ltd.. 31
[在此处 键入]
Device Management System Development Lab Guide
Step 4 After the menu is added, click One-Click Deployment in the upper right
corner to deploy the application.
3.7 Result Verification
Step 1 Preview the runtime state menu. Click the corresponding menu to access the
app.
Copyright © Huawei Technologies Co., Ltd.. 32
[在此处 键入]
Device Management System Development Lab Guide
Step 2 Click to enter the application. The _grid page is displayed. Click Create the
page will go to the _create page.
Step 3 On the _create page, type in data.
Copyright © Huawei Technologies Co., Ltd.. 33
[在此处 键入]
Device Management System Development Lab Guide
Step 4 Repeatedly create multiple data records. We can check the translator, the
Creation Time, Update Time,Submitted By are fill in automatically.
Step 5 Verify the validator. for example, 123456789. After you click Submit, an error
message is displayed. The maximum length is eight digits. The verification
has taken effect
Step 6 Verify the search filter.
Copyright © Huawei Technologies Co., Ltd.. 34
[在此处 键入]
Device Management System Development Lab Guide
Step 7 Verify the update page. For example, click the device no, go to the update
page, modify the device status to from normal to abnormal, the
corresponding update time is also changed.
Step 8 Verify excel export.
Step 9 Verify excel import.
Copyright © Huawei Technologies Co., Ltd.. 35
[在此处 键入]
Device Management System Development Lab Guide
Download the template first.
Following the table format, fill in the data.
Upload the excel file.
Copyright © Huawei Technologies Co., Ltd.. 36
[在此处 键入]
Device Management System Development Lab Guide
Copyright © Huawei Technologies Co., Ltd.. 37