Maximo Anywhere 7.6 - Custom Query added in Maximo & app.xml is not displayed in the browser - maximo-anywhere

I have created a custom public query in Service Request application in Maximo. The same is downloaded as part of WorkManagement rdf as part of execution of anywhere-rdf-puller.xml.
When the query is added in app.xml in view and resource sections, the same is not visible in the simulator.
I have verified the generated ApplicationUIBuilder.js, I could see the query details but in the debug I couldn't find the query in the eventcontext object. I could see only the standard queries.
I have taken standard query as reference to add the custom query in app.xml. Below are the code snippets:
<view id="ServiceRequest.MyReportedSR" label="My Service Requests" resource="serviceRequest" showBackButton="true">
<queries id="ServiceRequest.MyReportedSR_serviceRequest_queries" resource="serviceRequest">
<query id="ServiceRequest.MyReportedSR_MY_REPORTED_SR" label="My Service Requests" queryBase="MY_REPORTED_SR"/>
<query id="ServiceRequest.MyReportedSR_HIGH_PRIORITY_SR" label="Urgent Service Requests" queryBase="Z_HighPrioritySRs"/>
.
.
</queries>
.
.
</view>
<resource defaultOrderBy="srnum desc" describedBy="http://jazz.net/ns/ism/work/smarter_physical_infrastructure#ServiceRequest" hasManagedQuery="true" id="serviceRequest" name="serviceRequest" pageSize="200" providedBy="/oslc/sp/WorkManagement">
<attributes id="serviceRequest_attributes">
.
.
</attributes>
<queryBases id="serviceRequest_queryBases">
<!-- list of query bases the app will rely upon for this resource -->
<queryBase id="serviceRequest_queryBase_MY_REPORTED_SR" name="MY_REPORTED_SR" queryUri="/oslc/os/oslcsrdetail?savedQuery=MY_REPORTED_SR"/>
<!-- Added by Karthik For Demo -->
<queryBase id="serviceRequest_queryBase_HIGH_PRIORITY_SR" name="Z_HighPrioritySRs" queryUri="/oslc/os/oslcsrdetail?savedQuery=Z_HighPrioritySRs"/>
</queryBases>
</resource>
Any suggestions would be highly appreciated?
Regards,
Karthik

It looks like the query was not displayed as it is getting overridden by the queries available Anywhere Administration. After disabling the Anywhere Administration, the queries written in the app.xml are visible.

Related

How can I add a custom Page to Alfresco share that copies the the look/feel of Alfresco Share?

Link to Project: https://github.com/raystorm/Alfresco-Smalgyax
I am trying to:
Upload Documents into Alfresco/Share
Set a custom Document Type
Set Metadata
Use a Form that matches the Look/Feel of Alfresco/Share
I have Added a menu Item to the Create... menu.
The link points to the create-content Page. I was unable to upload the the file with that page. I set a custom file input field, but could not upload the file. I was unable to get a custom form template to work.
I have now switched tactics.
I have a custom share service that can:
Upload the file
Set Document Type
Set Metadata.
Bare-bones HTML page. Note: Does not match the Alfresco/Share look/feel.
How can I set the Share service page template to actually look like the create-content page?
UPDATE
I reset the get page to match the hello-world template.
the first line of the file:
<#include "/org/alfresco/include/alfresco-template.ftl" />
threw the following error:
smalgyax-share_1 | Caused by: freemarker.template.TemplateNotFoundException: Template not found for name "org/alfresco/include/alfresco-template.ftl".
smalgyax-share_1 | The name was interpreted by this TemplateLoader: MultiTemplateLoader(loader1 = org.springframework.extensions.webscripts.ClassPathStore$ClassPathTemplateLoader#3471b524, loader2 = org.springframework.extensions.webscripts.ClassPathStore$ClassPathTemplateLoader#e944270, loader3 = org.springframework.extensions.webscripts.ClassPathStore$ClassPathTemplateLoader#4a121f1c, loader4 = org.springframework.extensions.webscripts.ClassPathStore$ClassPathTemplateLoader#6aa5340e, loader5 = org.springframework.extensions.webscripts.ClassPathStore$ClassPathTemplateLoader#53c474eb, loader6 = org.springframework.extensions.webscripts.ClassPathStore$ClassPathTemplateLoader#7fef2b21, loader7 = org.springframework.extensions.webscripts.ClassPathStore$ClassPathTemplateLoader#255f313f, loader8 = org.springframework.extensions.webscripts.ClassPathStore$ClassPathTemplateLoader#661974de, loader9 = org.springframework.extensions.webscripts.ClassPathStore$ClassPathTemplateLoader#168a37da, loader10 = org.springframework.extensions.webscripts.ClassPathStore$ClassPathTemplateLoader#103ab009, loader11 = org.springframework.extensions.webscripts.ClassPathStore$ClassPathTemplateLoader#4c30bdf8, loader12 = org.springframework.extensions.webscripts.ClassPathStore$ClassPathTemplateLoader#61228f24).
The error occurs from both
service: http//:localhost:8180/share/service/hayts
and
Page: http://localhost:8180/share/page/upload-smalgyax-document
I have downloaded your source code and customized the share project and added a custom share page, it works perfectly for me without any issues.
Your project doesn't have the required css files that's the reason it doesn't looks like as like other alfresco pages.
Please follow the below project in github it will work, let me know if you face any issues.
https://github.com/Alfresco/alfresco-sdk-samples/tree/alfresco-51/all-in-one/add-surf-dashlet-and-page-share
Update:
UPDATE:
Please add a entry in share-config-custom.xml and change the name from hayts.xml to helloworldhome.xml under /site-data/pages.
<config evaluator="string-compare" condition="SitePages">
<pages>
<page id="helloworldhome">helloworldhome</page>
</pages>
</config>
You can place below line in share-config-custom.xml or you can create share extension module.
Change item id as per your custom type instead of cm:content.
You custom type form control should be properly configured in share-config-custom.xml.
<config evaluator="string-compare" condition="DocumentLibrary">
<create-content>
<content id="acme-plain-text" label="Custom Menu" icon="text" type="pagelink">
<param name="page">create-content?destination={nodeRef}&itemId=cm:content&mimeType=text/plain</param>
</content>
</create-content>
</config>

Maximo Anywhere 7.6 - Adding additional field to a list item - Error: Cannot add an item to layout

We are trying to add a field in the SR List screen of Service Request app. We are able to see the additional field's data in the response and see the value in the detail screen. But the same is not visible in the list screen even after we made changes in the WorkListItem.xml. When we looked at the developer logs, we saw an error as below.
Cannot add an item to layout [generated_application_ui_layout_small_WorkListItem_0]. Position [item7] does not exist.
We executed build.xml and also artifact-processor.xml. But if is of no use as we are still getting the error.
Below are code snippets added in the app.xml & WorkListItem.xml.
app.xml
<listItemTemplate id="ServiceRequest.MyReportedSR_serviceRequest_listItemTemplate_WorkListItem" layout="WorkListItem">
.
.
<listtext id="ServiceRequest.MyReportedSR_serviceRequest_WorkListItem_internalpriority" layoutInsertAt="item7" resourceAttribute="internalpriority"/>
</listItemTemplate>
WorkListItem.xml
<layout>
.
.
<row id="row_3">
<column colspan="10" columnid="item7" id="item7_column"/>
</row>
</layout>
Please let us know if we are missing any steps.
Regards,
Karthik
The layoutInsertAt field should point to the id within the layout which is id="item7_column", not "item7".
It looks like the standard Service Requests app has issue when it is referring the Worklistitem layout xml. I have found that there is field mapped to item2 in app.xml but item2 is not present in the layout xml.
I have created a custom layout file copied from the WorkListItem and provided a different name. It worked after referring the new layout xml which included item2(For existing field) and item7 (New Field which we wanted to display) added in the layout xml.

Maximo anywhere apps how to configure

Im new to Maximo. I already have maximo anywhere work execution app. Please let me know how to add new button in it through worklight.
Open the index.html file and add a <button> element.
If this does not help you, please learn how to ask questions first.
You can Edit the app.xml in <: Install Root :>/apps/<: app :>/antifact, like IBM MAXIMO Anywhere guide.
link: https://www.ibm.com/developerworks/community/blogs/a9ba1efe-b731-4317-9724-a181d6155e3a/entry/Adding_Custom_Fields_to_a_Maximo_Anywhere_application?lang=en
Before you embark on that Journey, be sure to back up the default app.xml. In order to add a button you first need to modify the Application UI, changes are made in the app.xml file .\MaximoAnywhere\apps\WorkExecution\artifact\app.xml. You can add additional tags to the file, which builds the UI and makes the app.
<button border="false" cssClass="statusIcon" id="WorkExecution.WorkDetailView_status_button_1" layoutInsertAt="item3" resourceAttribute="returnActive">
<states id="WorkExecution.WorkDetailView_status_buttons_return">
<state id="WorkExecution.WorkOrderDetail_ReturnButton_render_active" image="/images/RETURNED.png" label="Return" value="true"/>
<state default="true" id="WorkExecution.WorkOrderDetail_ReturnButton_render_inactive" image="/images/RETURNED_INACTIVE.png" label="Return" value="false"/>
</states>
<eventHandlers id="WorkExecution.WorkDetailView_status_button_eventHandlers_1">
<eventHandler class="application.handlers.Custom.WODetailHandler" event="render" id="WorkExecution.WorkOrderDetail_ReturnButton_render" method="renderReturnedIcon"/>
<eventHandler class="application.handlers.Custom.WODetailHandler" event="click" id="WorkExecution.WorkDetailView_status_button_1_eventHandlers" method="onReturnStatusIconClicked"/>
</eventHandlers>
</button>
Thats an example of a button we use in the app on the Work Details screen. Notice it has a CSS class that we've added, as well as a resourceAttribute that manages the state of the button. Putting a state on the button tells the app when to render which of the images. Lastly, we have event handlers that are tied to the button, with corresponding code written in the Custom.WODetailHandler file.

Change root element in association picker control in Alfresco Share

I'm using Alfresco Share 4.2c and I have to change a root node of an association picker. When I change some property of my document I want that picker directly points to the folder where my document is placed (parent of my document).
My problem is how to access nodeRef of document from association.ftl. I think that one solution is to use page.url.args.nodeRef, find his parent and add pass it to parameter rootNode. I'm not satisfied with that because it works only if I'm on Edit metadata page and my clients also what to use popup window to manage properties which appears on click Edit Properties link.
In that case I don't have nodeRef of document in url.
Do you have any idea how to solve this?
The best way is to a NodeLocator fur such purposes: http://docs.alfresco.com/4.1/concepts/node-locator-intro.html
the ancestor NodeLocator should be sufficient for your needs. Try the following setting in your form configuration:
<field id="my:association">
<control>
<control-param name="startLocation">{ancestor}</control-param>
</control>
</field>

iFrame in XPage, load WebContent

My myFolder/myDB.nsf contains WebContent/mySite/index.html, an html file without any XPage code. The database is configured to only display web content after valid Notes login.
Now I want to embed this index.html in Notes Client in such a way that our users don't have to login to see it.
How would I achieve this?
I thought of doing it via XPages/index.xsp, an xsp containing the following code:
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<iframe src="mySite/index.html" style="width:100%;height:100%"></iframe>
</xp:view>
This works well when opening http://myserver/myFolder/myDB.nsf/index.xsp in Web Browser.
When opening it in Notes Client, an Error 404 is thrown.
When using
<iframe src="http://myServer/myFolder/myDB.nsf/mySite/index.html" style="width:100%;height:100%"></iframe>
no error is thrown, but I still have to login, even though I already authenticated to notes.
Furthermore, when opening http:///myFolder/myDB.nsf/index.xsp, I have to login twice.
In the notes client if you are referencing an XPiNC URL directly you need to add xsp/ on the front.
So in you case the URL would be
Whatever.nsf/xsp/index.html
You would need to programmatically detect the notes client as your user agent and add the xsp accordingly.
Short answer: Don't.
Long answer: XPiNC behaves somehow different from a regular browser and IFrames are one of the areas. You can copy the body content of a standard HTML page into an XPage and it will just display. for CSS/JS you put them into resources. This way it will display properly.
For the base path - you need to add it to the header. In XPages that is considered a resource, so you do:
<xp:this.resources>
<xp:headTag tagName="base">
<xp:this.attributes>
<xp:parameter name="href" value="/xx" />
<xp:parameter name="target" value="_top" />
</xp:this.attributes>
</xp:headTag>
</xp:this.resources>

Resources