Incorporating Custom Fields into OSLC Components

强颜欢笑 提交于 2019-12-11 09:59:50

问题


I've got a procedural question I'm having issue finding in the documentation for the OSLC components of Maximo Anywhere. I have a custom field tied to a preexsisting Maximo MBO, how do we go about accessing it through the OSLC? Do I need to republish the connector every time I add a custom field?


回答1:


I would appreciate more correct info, let me try to answer, you created a custom field in maximo and you like to use that field part of maximo anywhere , ?

follow this
Adding fields to mobile apps
The fields that you add to mobile apps are defined by OSLC resource RDFs. 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 MaximoAnywhere\apps\app_name\common\js\application\translation directory.

Procedure
In MobileFirst Studio, go to the MaximoAnywhere\apps\app_name\artifact directory and open the app.xml file with the XML editor. 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 Work Execution 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 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.
Optional: To preview your changes in a mobile simulator, right-click on the application folder and select Run As > Preview.
What to do next



来源:https://stackoverflow.com/questions/34754292/incorporating-custom-fields-into-oslc-components

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!