This page describes how to create artifacts for the for Governance Registry. It contains the following sections:
Table of Contents |
---|
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 separate project called Registry a Registry Resources Project. To create a Registry Resources Project, go to File -> New -> Projects -> WSO2 -> Repository and select the Developer Studio dashboard and click Registry Resources Project.
Give a name to the project and click Finish.
Initially your project will contain 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 click New > Registry Resource from New menu .
There are several ways to create a Registry Resource.
...
From Existing Template
Using the From Existing Template option, you can select a template from which you can create a registry resource. Here, we will select the WSDL File template. Give a name to the WSDL file. There's a field called Registry Path to Deploy which is to where you can define where you want to save the resource in the registry. The Save Resource In field is to select the Registry Resources Projects in the workspace in where you can save your resource file.
Now you will see the WSDL file has been generated with the name that we specified and , and it will open in the embedded WSDL editor as shown.
In the a similar way, you can create files from other templates as well.
...
With the Import from File System option, you can import a file or a folder.
With this also, you have the The same fields as before appear here, such as as Registry Path to Deploy and and Save Resource In fields fields. If you select a a Folder as a as a Registry Resource, you will see a the Copy Content Only check check box being enabled. By default, this field is un-tick in the sense that cleared so you will have a copy of the folder inside the location you specified in the field the Registry Path to Deploy field. If If you tick select that option, it will only copy the content of the folder you have given in to the registry location you specified at at Registry Path to Deploy.
Import Registry Dump File from File System
With this option, you can browse a Registry Dump file which you can use to sync a registry.
Registry Path To Deploy is is common for all the three options. With this, you are specifying, You specify to where that registry resource should be checked-in at the time of deployment.
You may need to change the details you enter entered for the Registry Path to Deploy at the a later stage. You can edit such information with using the Registry Resource Editor. To open the Registry Resource Editor, right click on the Registry Resources Project and there is a menu item called click Registry Resource Editor.
This editor list lists all the registry resources that you have defined in that project and it will list the Registry Path to Deploy per resource and you can edit that according to your needwhich can be edited accordingly.
Registry Filter
To create a Registry Filter open the WSO2 Developer Studio Dashboard and select click Registry Filter Project from the Governance Registry category.
Give details for the Project Name, Package Name and Class Name. A Maven POM file will be generated automatically for this project. If you want to add a parent project's POM information to this project's POM, click Next and specify the parent project. Otherwise, just click Finish.
Now you will see a Filter class being created according to the class name you have provided and it is extending the org.wso2.carbon.registry.core.jdbc.handlers.filters.Filter class. Necessary The necessary libraries are added to your classpath in order to make your life easyyour class path .
If you already have a Carbon Composite Application Project that is being created created in the workspace, the newly created Filter Project will also be added to the Carbon Composite Application Project pom file. If needed, you can create a new Carbon Composite Application Project project and select the dependencies.
Registry Handler
To create a Registry Handler open the WSO2 Developer Studio Dashboard and select click Registry Handler Project from the Governance Registry category.
To create a Registry Handler Project, you need to have two types of classes. Handler class which is extended 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 The first page in the wizard relates to information of the Handler class. Give a name to the Handler Project and select the Handler Class creation method.
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 being extended 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.
In the next page, you can select the Handler Properties Info and Handler Methods and click Next .
Then it will ask specify 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
If you select the first option, there are two classes that you can use as Existing Filter classes. These classes are available in the WSO2 Governance Registry product.
...
This drop-down box will display any other Filter classes that you have defined in the workspace.
Define the filter criteria and then click Next if you want to add a parent project's POM information to this project's POM, or just click Finish.
Now you will see that the Handler Project has been created in the workspace. By default, it will open Regisrty the Registry Info Editor appears 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.
As In the same manner you did as for Filter Projects, you can include the created Handler Project in to a Carbon Composite Application Project and generate Carbon a Composite 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 clicking File -> New -> Other as well. In the wizard, go to WSO2 -> Extensions -> Service Extension Features.
Select WSO2 Registry Aspect Class and click Next.
Then you will get normal Eclipse class generating wizard page. Give necessary information and click Finish .
Now you will see the Aspect class is created which is extended from the org.wso2.carbon.registry.core.Aspect super class.
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 the Third Party Java Library Artifact section for more details on how to create library artifact using WSO2 Carbon Developer 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 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 select the Make this a fragment bundle check box. 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 select the check box and make org.wso2.carbon.regisrty.core as the fragment host. (Figure 35)
Now you can deploy this library artifact in to WSO2 G-Reg as a CAR file by including it to a Carbon Composite Application Project. Before creating the CAR file, make sure to change the server role of the created library bundle as to GovernanceRegistry. For library artifacts artefacts, the default server role is set as ApplicationServer. To deploy it to WSO2 Governance Registry , you need to change it to the correct server role.
After deploying the library artifact, you will have to restart the server to make the Aspect class available in the runtime.
You can access this class by configure configuring it via the registry.xml or through the WSO2 Governance Registry management console.