WSO2 Governance Registry - Guide for Governance Registry Samples

WSO2 Governance Registry - Guide for Governance Registry Samples

Table of Contents

Distributed LifeCycle Management sample

Introduction

ProjectLifecycle CheckList is a sample about how can a user able to use the "Lifecycle status" in his project development cycle. First Architect designs 'Use case diagrams and other designs' and let the Developers to implement it. After finishing the implementation task, Developers promote the resource to QAs to validate the resource/product. After passing all the tests, QAs allow customers to deploy the product/project. It has six states.

Running the sample

Note:- Rather than editing the "registry.xml" file, you can easily add your LC configurations via the administration console, by adding "New LifeCycle Configuration", which you can find under "Lifecycles" menu. These added configurations will availabele for a resource to enable Lifecycle functionality .

WS-API for file upload Sample

This is useful when uploading large files, since atom based remote registry API is not that efficient in uploading large files. Before getting the sample to work you have to run ant from GREG_HOME/bin and start the registry server. Edit the build.xml by filling the path element with GREG-HOME and the AXIS2-HOME.

Steps to get this sample to work

Browsing to the resource

Go to admin console "Resource Browser" menu. Where you can find that your resource will available with the name called "testpath". Note:- You need "AXIS2" distribution to run this sample.

Exporting/importing a file to Remote registry

Introduction

This sample demonstrates how to export a local file system into a remote registry, and how to import a remote registry into a local file system. We can build our content in the local file system with the directory hierarchy we want, including any type of content. Then we can use the registry API to export our local file system into the registry. Once we upload a local file system into the registry we have "socially enabled" it. We can comment on resources, we can tag, we can rate, etc... We can also build our hierarchy in the Registry with the structure we want, and then we can download or import the remote registry into our local file system. Then the registry will create the exact same directory structure and download all the files in the registry.

Running the sample

Running the sample is just a matter of executing an ant file. If you don't have ant, you can download it at http://ant.apache.org/. Run 'ant' at the 'bin' directory of the distribution.

Exporting local file system into a remote registry

Run "ant upload" inside the "samples/filesample" directory. You will be asked for:

Importing a file into the local file system

Now we go the other way. Again, run "ant download" first, and provide values: Note:-You should put all the required jars into the "GREG_HOME\lib" folder.

Jars you may need to run the sample

Keep all those jars in "GREG_HOME/lib directory"

ProjectProposalHandler Sample

Introduction

The idea of this sample is to demonstrate how to use media type handlers. The sample application is to process project proposals, so we'll be using a component that intercepts Registry put() requests with a particular "porposal" media-type. The Handler will read the proposal and mark it as valid or not. In order to be a valid proposal there should be a number of fields - if all of them are there then the handler will mark the proposal as valid. If one or more fields are missing then the proposal would be invalid. Note:- Sample project proposals are available in "resources" folder.

Custom UI Sample

This file explains the usage of the custom UI sample (Adding endpoint references as custom resources).

Adding an endpoint reference as a resource

Browsing the resource