How to retrieve custom associations configured in governance.xml in WSO2 Enterprise Store

247 Views Asked by At

I created a custom association for type 'Schema' in governance.xml as below:

<Association type="schema">             
 <critical reverseAssociation ="isCriticalTo" iconClass="">service</critical>
</Association>

I created some associations using the Greg Publisher for the same. The custom associations are not retrieved in the default payload of WSO2 Store for the specific artifact.

How can I customize WSO2 Enterprise Store View to retrieve and display the custom association details (critical/isCriticalTo)?

1

There are 1 best solutions below

11
On

Your governance.xml entry looks fine, however please remove the iconClass attribute if your not using it. Please find the rectified governance.xml entry,

<Association type="service">
 <isCriticalTo reverseAssociation ="critical" iconClass="fw-store">schema</critical>
</Association>

Note: I presume you have deployed service.rxt in admin console and made it enable in publisher and store(if you can view assets then fine.)

Please find the association page look a like after adding above xml code. Association page

Please find this this useful blog post. This blog post is about G-Reg 5.2.0. however it is compatible with G-Reg 5.1.0 as well except reverseAssociation, iconClass.

For WSDLs if users want to view all the "depends" and "usedBy" users can view them by extending the WSDL asset.js file as per their needs. In order to view all the "depends" and "usedBy" associations for WSDL find the below code snippet from asset.js file,

GREG_HOME/repository/deployment/server/jaggeryapps/store/extensions/assets/wsdl/asset.js

if(deps.associationType == "soapservice") {
  associations.push(deps);
}

and comment out the below code,

//if(deps.associationType == "soapservice") {
  associations.push(deps);
//}

Then user can view all the "depends" and "usedBy" associations.

Association page in Publisher New Store view after fix

WSO2 developers have fixed this correctly in their git repo, Please find the PR from here.