The fields that you add to mobile apps are defined by OSLC Resource Description Framework (RDF) files.
When you add fields to mobile apps, you specify the OSLC resource for the field as a resource attribute
in the application definition file.
About this task
The OSLC resource must exist in
Maximo Asset Management for the field
that you are adding to the mobile app. You can use an existing OSLC resource for the field that you are adding.
You can also create a field by creating the resource for the field in Maximo Asset Management and importing the
resource RDF into Maximo Anywhere.
When
you add a field to an app view, you must first define the resource
for the field in the Data section of the application definition file.
You then add the resource to the view in the UI section so that the
field is shown on the app.
If you translate the mobile app,
update the artifact.js file for each supported
language to include the name of the field. The artifact.js files
for each language are in the Anywhere\MaximoAnywhere\apps\app_name\common\js\application\translation directory.
Procedure
- In Eclipse, open the app.xml file for the mobile app that you want
to update. The app.xml file is located in the Anywhere\MaximoAnywhere\apps\app_name\artifact directory.
- In the Data section, add the attribute to the resource
that you want to add the field to.
- On the Design tab, find the <resource> element that
you want to add the field to.
- On the Source tab, add the attribute that includes the
shape document details to the <resource> element.
For example, to add a field named Risk to
the
Work Order Details view
in the
Technician app,
add the details of the risk attribute to the resource named workOrder:
<resource providedBy="/oslc/sp/WorkManagement"
describedBy="http://jazz.net/ns/ism/work/smarter_physical_infrastructure#WorkOrder"
name="workOrder" pageSize="200" class="application.business.WorkOrderObject>
<attributes>
<.....>
<attribute name="risk" describedByProperty="spi_wm:risk" index="false" />
- In the UI section, add the resource attribute to the view
that you want to add the field to.
- On the Design tab, find the <view> element that you
want to update.
- On the Source tab, add the resource attribute to the <group
item> element within the view you are updating.
For example, add the resource attribute
for the
Risk field to the view for
Work Order Details:
<view id="WorkExecution.WorkDetailView" label="Work Order Details">
...
<groupitem transitionTo="WorkExecution.DescriptionView">
<text resourceAttribute="description" label="Description"
editable="true" placeHolder="Tap to enter" />
</groupitem>
<groupitem>
<text resourceAttribute="risk" label="Risk"
editable="true" placeHolder="Tap to enter" />
</groupitem>
- Optional: Make the field editable by adding
the value of true to the editable attribute
and adding the value of tap to enter to the
placeholder attribute.
The placeholder attribute indicates
that the field is editable and that you can enter any value in the
field. To change the field to read only, change the value of the editable
attribute to false and delete the placeholder
attribute.
- Save your changes.
The application is built
automatically.
What to do next
Build and deploy the app.