Wednesday, February 17, 2010

Governance Registry- Remote Client part-1

Governance Registry is a WSO2 product which use to store and govern the data.

Here I am going to talk about creating a remote client for the WSO2 Governance Registry using Remote API.

For this I use the wso2 Governance Registry v3.03 which you can download from here.
Also it must be install Apache ANT in your machine.

In this post I am describe how to run the sample. Later I'll show how to what are the functions provide by the API and how to use them.
(sample path :- wso2greg-3.0.3/samples/filesampleutils)

First we have to set some of the jars which need to run the sample.

Jars you need to run the sample
-----------------------------------
1.jaxen-1.1.1. jar( http://www.java2s.com/Code/JarDownload/jaxen-1.1.1.jar.zip)
2.abdera -jars 0.4.0 (http://abdera.apache.org/)
3.commons httpclient 3.0.1 jar(http://www.java2s.com/Code/JarDownload/commons-httpclient-3.0.1.jar.zip)
4.commons-codec-1.3 jar (http://www.java2s.com/Code/JarDownload/commons-codec-1.3.jar.zip)
5.axiom-impl-1.2.5 jar(http://www.java2s.com/Code/JarDownload/axiom-impl-1.2.5.jar.zip)
6.axiom-api-1.2.5 jar(http://www.java2s.com/Code/JarDownload/axiom-api-1.2.5.jar.zip)
7.org.wso2.carbon.registry.core-2.0.2.jar (Find at GREG_HOME\webapps\ROOT\WEB-INF\plugins\common folder)
8.axis2-transport-base-1.0.0.wso2v2.jar(Find at GREG_HOME\webapps\ROOT\WEB-INF\plugins\common folder)

Copy above jars to the bin directory in the HOME.

Now you are ready to run the sample.

change directory to the samples/filesampleutils/src

In this example we were given two functionalities.
1. To upload a file of collection to the Registry
2. Download a file or a collection from the Registry.

To upload a file we need to execute ant upload

Then there will be some details to fill regarding the upload,
1. Keystore file path : Provide HOME/resources/security/client-truststore.jks
2. Registry URL : Provide "https://localhost:9443/registry" this is the URL which registry cab be accessed.
3. Username : user name of login to registry(default it's "admin")
4. Password : password of login to registry(default it's "admin")
5. From path : this is the path where upload file/directory is.
(eg :- /home/example/Sample.txt or /home/example/)
6. To path : this is the path where we going to save in the repository (eg :- /)

After fill these you can log on to https://localhost:9443/carbon and select the Browse from the Resources and you will appear your uploaded file/directory in there.

To upload a file we need to execute ant download

Then there will be some details to fill regarding the download,
1. Keystore file path : Provide HOME/resources/security/client-truststore.jks
2. Registry URL : Provide "https://localhost:9443/registry" this is the URL which registry cab be accessed.
3. Username : user name of login to registry(default it's "admin")
4. Password : password of login to registry(default it's "admin")
5. From path : this is the path where download file/directory from.
(eg :- /C1/C2)
6. To path : this is the path where we going to save download file/directory in the local disk.
(eg :- /home/example/)

Now you can see the file or directory you downloaded at the To path.

No comments:

Post a Comment