0

I am trying to create a new View for SR object in maximo anywhere, I created view like this

        <view id="SR.SRView" label="Service Request">

        <queries resource="serviceRequest">
            <query label="My SR" queryBase="getMySR" />             
        </queries>

        <requiredResources>
            <requiredResource name="serviceRequest">
                <requiredAttribute name="siteid" />
            </requiredResource>
        </requiredResources>

        <list resource="serviceRequest" attribute="siteid">
            <sortOptions>
                <sortOption label="Item">
                    <sortAttribute name="siteid" direction="asc" />
                </sortOption>
            </sortOptions>
            <listItemTemplate layout="PlannedMaterialListItem">
                <listtext resourceAttribute="siteid" layoutInsertAt="item1" />
            </listItemTemplate>
        </list>
    </view>

and resource defination like

        <resource providedBy="/oslc/sp/ServiceRequest"
        describedBy="http://jazz.net/ns/ism/sr/smarter_physical_infrastructure#ServiceRequest"
        name="serviceRequest" pageSize="20">
        <attributes>
            <attribute name="siteid" describedByProperty="dcterms:description" />
        </attributes>
        <queryBases>
            <queryBase name="getMySR" queryUri="/oslc/os/oslcsrequest?savedQuery=SR%3AMYSR"/>
        </queryBases>

    </resource>

I added it inside workdetail view, after work log entry

                <group>
                <groupitem transitionTo="SR.SRView" layout="PlannedMaterialListItem">
                    <text value="Service Request" editable="false" layoutInsertAt="item1" 
                        cssClass="relatedRecords" >
                    </text>
                </groupitem>
            </group>

But when I am trying to open it, it shows error like WOrklist records could not be downloaded, contact administrator

Note that if I just change the "transitionTO" to any existing view in app.xml then it works fine. It opens the view but its not opening my view.

Can someone guide me how to create new view in app.xml and wheter I am missing any steps.

Any help will be highly appriciated.

max75
  • 13
  • 5
  • Per the request in your previous question: "attach the full console log and maybe some screenshots of what you're trying to accomplish with your customization". – Idan Adar Apr 24 '15 at 16:17
  • Dear Idan, at console it is only showing [WARNING ] Authentication error: Unable to respond to any of these challenges: {}. I am unable to attach images (requires 10 reputations). My actual requirement is to have a Service Request application on mobile, when user logs in then it should display the SR's assigned to him. As I am new to worklight & anywhere, I started with sample application and wants to get list of all SR exists in the system. I completed the OSLC integration and tested it successfully but I am missing something in configuring maximo anywhere app. – max75 Apr 24 '15 at 16:33

1 Answers1

0

If you hit this OSLC URL directly in your browser

http://<yourhost>/oslc/os/oslcsrequest?savedQuery=SR%3AMYSR&_lid=<username>&_lpwd=<passsword>

filling in yourhost, username and password.. does the set of returned Service Requests come back from the OSLC layer?

scott dickerson
  • 908
  • 1
  • 5
  • 13
  • If I change to then it is getting the response but without port/maximo its saying URL not found. Also I noticed that the result contains this URL's rdf:resource: "http://localhost/maximo/oslc/os/oslcsrequest/_U1IvMTAwMQ--" and if I click on it it says 401, username/password not valid but if I change localhost to machine name with port then it works – max75 Apr 24 '15 at 17:31
  • you can change the localhost by setting the oslc.webappurl property to your external hostname to be allowed to browse the records. Do that, and then doublecheck an example SR record returned by the OSLC layer. Make sure that your describedby attribute properties in your resource, match those returned by the OSLC layer. – scott dickerson Apr 24 '15 at 17:43
  • Thanks @scott after changing the property, host name got changed. But the real issue I identified was different. In OSLC query, one order by clause was appending and its pointing to "identifier" attribute and I didnt had identifier attribute in my resource, hence it was not loading the view. Then I mapped ticketid column of SR table to identifier property of OSLC and it worked. – max75 Apr 29 '15 at 08:29