4

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)?

Community
  • 1
  • 1
Kamban
  • 41
  • 1

1 Answers1

2

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.

tk_
  • 16,415
  • 8
  • 80
  • 90
  • The associations, 'service' asset visibility across publisher, store is all good. The 'show dependencies' is also working fine for the asset & the added association type (critical). I would like to see the assets involved in this custom association listed on the overview page in Enterprise Store. Does any customization help to get these in the overview page? – Kamban Jul 06 '16 at 00:55
  • you mean you want to add dependancy button and feature in WSO2 ES? – tk_ Jul 06 '16 at 06:06
  • In the Enterprise Store, for an asset, in its overview page, I would like to view the associations that I added for it in the publisher (owned-by, used-by, security & other custom associations). I do not want to see them via the show dependencies button-click action. The clustered graphical representation presented by show-dependencies action is not very useful for us. – Kamban Jul 26 '16 at 06:38
  • As far as i understand, you want to move the show dependance button to association page? – tk_ Aug 01 '16 at 06:09
  • show dependencies button displays different association types like usedBy, ownedBy, Security etc as a pictorial representation. Instead of pictorial representation, I would like to see the other association types (usedBy, ownedBy) in the overview page listed under subsections (similar to how dependencies & dependants are shown in the overview page) – Kamban Aug 01 '16 at 06:16
  • Please see attached image. I would like to see other association types like usedBy, ownedBy to be displayed just like how the dependencies are displayed !http://tinypic.com/view.php?pic=ly8ub&s=9 . The payload corresponding to a store overview page does not contain other association types in it except 'depends' – Kamban Aug 01 '16 at 06:30
  • What is the G-Reg version you are using? – tk_ Aug 01 '16 at 14:14
  • The version that I am using is 5.2.0 – Kamban Aug 01 '16 at 23:46
  • Any help on this is highly appreciated. WSO2 GReg parses the 'Schema' contents and auto-generates the associations as 'used by'. The 'Used By' associations are not easily visible in the Enterprise Store except for the dependency chart. A linked, easily readable 'list' kind of presentation on the Store user interface would be really helpful for all association types, similar to 'dependencies association type' – Kamban Aug 09 '16 at 01:55
  • I tried to get the association data other than depends to front-end. Apparently there is API change to do. Therefore I prefer contacting WSO2 directly on this. – tk_ Aug 09 '16 at 02:42
  • @Kamban you can use the registry API and get all the dependancies from registry. http://sencs.blogspot.com/2016/08/retrieving-associations-using-registry.html – tk_ Aug 11 '16 at 05:33