How to Develop a Governance Registry Handler to Add Associations Automatically.



In my last post I created a RXT dropdown populator which will dynamically load values for rxt option filed by available WSDL in the registry. In this post I will show you how to create a association with the selected WSDL. You will be able to find download links for source code along the post.

First add below XML code snippet to the registry.xml which is located in /<GREG_HOME>/repository/conf/registry.xml.

<handler class="org.wso2.carbon.registry.sample.extensions.handlers.AssociationHandler" profiles="default,uddi-registry">
        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
            <property name="mediaType">application/vnd.wso2-application+xml</property>
        </filter>
</handler>

make sure you add above code line as the last handler in the registry.xml. For WSO2 GReg 5.2.0 release IndexingHandler will be the last handler therefore add above code after IndexingHandler.


Now download the AssociationHandler Java source code from here.  Now apply the jar file which includes the org.wso2.carbon.registry.sample.extensions.handlers.AssociationHandler and org.wso2.sample.rxt.WSDLPopulator to <GREG_HOME>/repository/components/lib/ directory. you can find the org.wso2.carbon.registry.sample.extensions.handlers-5.1.0.jar from here(AssociationHandler/target/). The source code is also available there. To build it in your machine please do a mvn clean install within the root directory.


You have applied the handler jar and declared the handler in registry.xml, Now its time to restart the server if it is already running.

After server starts defined the dynamic option filed in rxt like below.



Users just need to add <values class="org.wso2.sample.rxt.WSDLPopulator"/> in the relevant filed. You can download the sample RXT from here

Now login to the publisher and try to add an Enterprise Application,


As you can see WSDL option filed now holds all the resource paths for WSDLs available in registry. Lets select a WSDL and click on 'Create'

Now if you click on show dependancy view or association tab for the newly added 'testApp6' you can see association added.






You can find the git code from hereThats it from here. If you have any questions please create a stackoverflow question and attached it as a comment below.

Comments

  1. I'm not sure why but this site is loading extremely slow for me. Is anyone else having this issue or is it a problem on my end? I'll check back later on and see if the problem still exists. How To Insulate A Shipping Container

    ReplyDelete

Post a Comment