Sunday, June 30, 2013

WSO2 Governance Registry Checkin client - Dump Registry Resources To A File System

In WSO2 Governance Registry you can dump the registry content into a file system or a single file where you can use it to restore the registry to that SNAPSHOT. In addition to that when you dump into a file system you can do changes to it and commit. Here I am talking about how you can do it.


Dump the registry resources into a file system.
Command -
Linux : sh checkin-client.sh co https://localhost:9443/registry/ -u admin -p admin
Windows : checkin-client.bat co https://localhost:9443/registry/ -u admin -p admin

In the following content I will be describing the additional functionalities we introduced after Governance Registry version 4.5.3.

1. Add - Use of this is to add new resource in the client side. This will be reflected in the registry when committing. In earlier versions of checkin client there were no option like this and whatever we put in the checked in location will be committed. But now the resource must be add to reflect in the registry.
Command -
Linux - sh checkin-client.sh add x.xml
Windows checkin-client.bat add x.xml

If you want to specify the mediatype when adding you can follow the following commands,
Linux - sh checkin-client.sh add x.xml -mediatype application/policy+xml
Windows checkin-client.bat add x.xml -mediatype application/policy+xml

[NOTE] Though we are specifying the mediatype it won't go through the registry handlers when we committing to the registry.

2. Delete - Use of this is to delete a resource which is checked in using checkin client.  This will be reflected in the registry when committing and will not delete the local resource until then (this method is for the purpose of reverting). In earlier resource can be deleted using OS delete but in the current version it won't delete the resource in the registry untill the resource deleted using the delete command.

Command -
Linux - sh checkin-client.sh delete x.xml
Windows checkin-client.bat delete x.xml

3. Add/Update property - Using this method you can add, update a resource property. You can set any number of properties in one command as key value pairs.
Command -
Linux - sh checkin-client.sh propset x.xml property1 value1 property2 value2
Windows checkin-client.bat propset x.xml property1 value1 property2 value2

4. Delete Property - Using this command you can delete a resource property. You can delete any number of properties in one command giving key set.
Command -
Linux - sh checkin-client.sh propdelete x.xml property1 property2
Windows checkin-client.bat propdelete x.xml property1 property2

Check in the changes
Command-
Linux - sh checkin-client.sh ci -u admin -p admin
Windows - checkin-client.bat ci -u admin -p admin

[NOTE] In the current model when checkin to the registry all the resource won't restored to the registry unless there are changes in the local resources. Change in the content or property, resource add and resource delete will be consider as change of property and will only checkin those changed resources to the registry. 

There are still certain limitations which we are working on overcome them and will be fixed in next release.

No comments:

Post a Comment