Unknown macro: {next_previous_links}
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

This page describes how to create artifacts for the Governance Registry. It contains the following sections:

Registry Resource

You can save resources such as images, WSDLs, XSLTs in a central repository. We define them as Registry Resources. We save all these Registry Resources in a seperate project called Registry Resources Project. To create a Registry Resources Project, go to File -> New -> Projects -> WSO2 -> Repository and select Registry Resources Project.

New Server Runtime

Give a name to the project and click Finish.

New Server Runtime

Initially your project will only contains only a pom file. You can create any number of Resgistry Resources inside that project. To create a Registry Resource right click on the Registry Resources project and select Registry Resource from New menu.



New Server Runtime

There are several ways to create a Registry Resource.



New Server Runtime

From Existing Template

From Existing Template option, you can select a template from which you can create a registry resource. Here, we will select WSDL File template. Give a name to the WSDL file. There's a field called Registry Path to Deploy which is to define where you want to save the resource in the registry. Save Resource In field is to select the Registry Resources Projectsin the workspace in where you can save your resource file.

New Server Runtime 

New Server Runtime

Now you will see WSDL file has been generated with the name that we specified and it will open in the embedded WSDL editor as shown.

New Server Runtime

In the similar way, you can create files from other templates as well.

Import from File System

With the Import from File System option, you can import a file or a folder.

New Server Runtime

With this also, you have the same fields such as Registry Path to Deploy and Save Resource In fields. If you select a Folder as a Registry Resource, you will see a Copy Content Only check box being enabled. By default, this field is un-tick in the sense that you will have a copy of the folder inside the location you specified in the field Registry Path to Deploy. If you tick that option, it will only copy the content of the folder you have given in to the registry location you specified at Registry Path to Deploy.

Import Registry Dump File from File System

With this option, you can browse a Registry Dump file which you use to sync a registry.

New Server Runtime

Registry Path To Deploy is common for all the three options. With this, you are specifying, to where that registry resource should be checked-in at the time of deployment.

You may need to change the details you enter for Registry Path to Deploy at the later stage. You can edit such information with Registry Resource Editor. To open the Registry Resource Editor, right click on the Registry Resources Project and there is a menu item called Registry Resource Editor.

New Server Runtime

This editor list all the registry resources that you have defined in that project and it will list Registry Path to Deploy per resource and you can edit that according to your need.

New Server Runtime

Registry Filter

To create a Registry Filter open WSO2 Developer Studio Dashboard and select Registry Filter Project from Governance Registry category.

New Server Runtime

Give details for Project Name, Package Name and Class Name and clicl Finish.

New Server Runtime

Now you will see a Filter class being created according to the class name you have provided and it is extending org.wso2.carbon.registry.core.jdbc.handlers.filters.Filter class. Necessary libraries are added to your classpath in order to make your life easy.

New Server Runtime

If you already have a Carbon Application Project that is being created in the workspace, newly created Filter Project will also be added to the Carbon Application Project pom. If needed, you can create a new Carbon Application Project project and include the

New Server Runtime

Registry Handler

To create a Registry Handler open WSO2 Developer Studio Dashboard and select Registry Handler Project from Governance Registry category.

New Server Runtime

To create a Registry Handler Project, you need to have two types of classes. Handler class which is exteneded by org.wso2.carbon.registry.core.jdbc.handlers.Handler and a Filter class which is extended by org.wso2.carbon.registry.core.jdbc.handlers.filters.Filter.

First wizard page is regarding information of Handler class. Give a name to the Handler Project and select the Hadler Class creation method.

New Server Runtime

You can create a Handler class in two ways.

  • New Registry Handler Class
  • Import Handler Class from the workspace

With the first option, you can create a Handler class from the scratch and if you select the second option, it will list all the classes that are bieng exteneded by org.wso2.carbon.registry.core.jdbc.handlers.Handler. Suppose I select the first option and click Next. Fill the necessary information for Package Name and Class Name.

New Server Runtime

In the next page, you can select Handler Properties Info and Handler Methods and click Next.

New Server Runtime

Then it will ask how you want to create the Filter class. As for the Handler, you can create the Filter class in two different ways.

  • Already Existing Filter Class
  • New Filter Class

New Server Runtime

If you select the first option, there are two classes that you can use as Existing Filter classes. These classes are available in WSO2 Governance Registryproduct.

  • org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher
  • org.wso2.carbon.registry.core.jdbc.handlers.filters.URLMatcher

This drop-down box will display any other Filter classes that you have defined in the workspace.

New Server Runtime

Define filter criteria and click Finish.

New Server Runtime

Now you will see the Handler Project has been created in the workspace. By default, it will open Regisrty Info Editor which shows you all the information that you have given when creating the Handler Project. You can add new Handler Properties, add new Handler Methods, Filter Criteria etc.

New Server Runtime

As the same manner you did for Filter Projects, you can include the created Handler Project in to a Carbon Application Project and generate Carbon Application Archive [CAR] file to deploy your Handler in to WSO2 Governance Registry.

Registry Aspect

You can create a Registry Aspect class from WSO2 Developer Studio. To create a Registry Aspect class, select any java project / or any artifact type project that you have created in your workspace and press Ctrl + n to open the New wizard. You can open the same wizard by File -> New -> Other as well. In the wizard, go to WSO2 -> Extensions -> Service Extension Features.

Select WSO2 Registry Aspect Class and click Next.

New Server Runtime

Then you will get normal Eclipse class generating wizard page. Give necessary information and click Finish.

New Server Runtime

Now you will see Aspect class is created which is extended from org.wso2.carbon.registry.core.Aspect super class.

New Server Runtime

You can implement the functionality you want in this class and deploy this aspect class in to WSO2 Governance Registry by making it as a library artifact.

Please refer Third Party Java Library Artifact section for more details on how to create library artifact using WSO2 Carbon Studio.

There, you have an option to select a project in your workspace when creating the library artifact. With that option, it will compile the selected project and make it a deployable bundle. To deploy the Registry Aspect, that we have just created for WSO2 G-Reg server, first we will make it a library artifact. Select the project which has the created aspect class when creating the library artifact.

When creating a library artifact, there is a checkbox called Make this a fragment bundle. To deploy a bundle which includes the aspect class, we need to make it a fragment host of org.wso2.carbon.regisrty.core. Otherwise it will not be visible at the runtime. So we will check that check box and make org.wso2.carbon.regisrty.core as the fragment host. (Figure 35)

New Server Runtime 

Now you can deploy this library artifact in to WSO2 G-Reg as a CAR file by including it to a Carbon Application Project. Before creating the CAR file, make sure to change the server role of created library bundle as GovernanceRegistry. For library artifacts default server role is set as ApplicationServer.

To deploy it to WSO2 Governance Registry, you need to change it to correct server role.

After deploying the library artifact, you will have to restart the server to make Aspect class available in the runtime.

You can access this class by configure it via registry.xml or through the WSO2 Governance Registry management console.

  • No labels