Tagging Handler Sample
This sample demonstrates how to apply namespace as a tag while creating a service in order to retrieve the resource using that namespace tag. A tag is a keyword that allows a resource or collection to be found when using the Search function.
Instructions
Execute the
mvn clean installmaven command from thetaggingHandler/srcsample directory.Copy the
org.wso2.carbon.registry.samples.taggingHandler-5.0.0.jarinto the<GREG_HOME>/repository/components/dropinsdirectory.You can also upload handlers through the administration console by clicking Add in the Extensions menu.
Edit the
registry.xmlfile which is in<GREG_HOME>/repository/conffolder and add the following XML snippet:<handler class="org.wso2.carbon.registry.samples.taggingHandler.CustomTagServiceHandler"> <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher"> <property name="mediaType">application/vnd.wso2-service+xml</property> </filter> </handler>You can also add the handler configuration through the administration console.
Click the Extensions menu and open the Handlers configuration menu.
Click Add New Handler.
Add the handler configuration.
See also Configuring Handlers.
Start the server and go to the admin console. See Running the Product for more information.
In the Main menu, under Add in the Metadata section, click Service.
Add a new service.
You can see that the namespace tag has been added to the resource.