Aurora_Gaimon

CA PPM: How to quickly create a new version of your NSQL portlet

Blog Post created by Aurora_Gaimon Employee on Mar 16, 2017

It's been a while since I've published in my blog.. lately It's been crazy in my personal life and not so much time left... 

 

But, today, I will explain how to modify and create a new version of a custom NSQL portlet. I'm pretty sure you have "felt" the pain when trying to modify it, for instance just by adding new columns. Those columns did not exist when query was created, or just simply those columns were not required at the beginning. Guess what  now you need them.

 

Query will not allow structural changes, therefore, you need to create a new one and also a new portlet. Why? An existing portlet using already a query cannot be changed to use new one.

 

How do we work on that quickly? Well, I'm pretty sure many peers will  have many other brilliant ideas, but this is how I usually do:

 

1. Xog out JUST the NSQL query:

 

This XML will xog out just  NSQL code which you can easily edit in an editor such "notepad++" or similar.

<?xml version="1.0" encoding="UTF-8" ?>
<NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_read.xsd">
<Header version="8.0" action="read" objectType="contentPack" externalSource="NIKU">
<args name="singleContentType" value="query" />
</Header>
<QueryQuery>
<Filter name="code" criteria="EQUALS">your_custom_nsql_query</Filter>
</QueryQuery>
</NikuDataBus>

 

 

 

2. Xog out just the Portlet without dependencies:

 

 

This XML will xog out just portlet without dependencies (no lookups, no NSQL code...) which you can easily edit in an editor such "notepad++" or similar. 

<?xml version="1.0" encoding="UTF-8" ?>
<NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_read.xsd">
<Header version="8.0" action="read" objectType="contentPack" externalSource="NIKU">
<args name="singleContentType" value="portlet" />
</Header>
<PortletQuery>
<Filter name="code" criteria="EQUALS">your_custom_portlet</Filter>
</PortletQuery>
</NikuDataBus>

 

What should you edit here? Ensure you edit the dataProviderId= which should be the new NSQL query id.

 

 

3. You can either XOG the 2 XMLs separability, or even merge them in 1

 

That's really up to you, but I usually merge them to simplify. How do we merge them?

Basically, I keep the portlet XML (header, portlet code in "green")  and I add the query part ("blue" lines). 

 

See a sample below:

<?xml version="1.0" encoding="UTF-8"?><NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_contentPack.xsd">
<Header action="write" externalSource="NIKU" objectType="contentPack" version="8.0"/>
<contentPack update="true">


<portlets update="true">
<gridPortlet allowConfigure="true" allowConfigureLabel="true" allowEditing="false" category="businessIntelligence" code="your_custom_portlet" dataProviderId="your_nsql_query" dataProviderPartitionId="NIKU.ROOT" dataProviderType="nsql" defaultSortColumn="created_date" defaultSortOrder="descending" forceFilter="false" gridAttributeProtection="1" hasEditableColumn="false" metricsLocation="bottom" objectType="SYSTEM" pageSize="50" querySource="customer" showAltValueText="false" showColumnCurrencyCode="false" source="customer">
<nls description="your_portlet_description" languageCode="en" name="your_custom_portlet"/>
<column
....

....

....
</gridPortlet>
</portlets>

<queries update="true">
<query code="your_nsql_query" isUserPortletAvailable="1" source="customer">
<nls languageCode
...

....

....
</query>
</queries>

 

</contentPack>
</NikuDataBus>

 

 

If you need help with NSQL queries, portlets o r xogging, please engage CA Services or ask questions in CA Communities.

 

 Related and interesting links:

CA Clarity Tuesday Tip : XOG - controlling the amount of data 

 

 

That’s all. Thanks for reading until here. Did you like it? Please, don’t be shy and share it.

Attachments

Outcomes