Tuesday, July 17, 2012

Adding a subscritption to a resource\collection in WSO2 G-Reg

In WSO2 Governance registry you get a community feature which allows you to subscribe to any resource/collection to keep an eye on certain events that occur over the resource/collection. For these subscriptions you get a notification of your preferenced type as soon as the relevant event occurs.

Lets see how you subscribe and sign for a notification.

1. Extract WSO2 G-Reg if you already have it.  G-Reg 4.5.0 packs are being worked on these days and latest alpha2 packs are available at [1].

2. Start the server by running wso2server.sh in GREG_HOME/bin

3. Login to the admin console. Lets use default admin user/pass (admin/admin)

4. In the Admin Console, access to registry browser by navigating to Home>Resources>Browse




Now, if we recalled our purpose; we wanted to subscribe to a resource and have RESTful notifications on the changes that happen to the resource.

5. OK so lets create a resource or a collection to keep an eye on :D. I'm going to have a collection called yumani_images under /_system



6. Once the resource\collection is created you will be able to see the community features belonging to it.

7. You will also see "Subscriptions" panel as one of them.



8. Click on 'Add Subscription" link.

9. Select an event. It has many but self explanatory event types. Nevertheless heres a briefing too.
  • Check LC item -  Selecting an item from a life cycle state. You need to have a life cycle added to the resource\collection to achieve this.
  • Uncheck LC item - De-selecting an item from a life cycle state. You need to have a life cycle added to the resource\collection to achieve this.
  • Create Child - Creating a collection\resource inside the collection in concern.
  • Delete Child - - Creating a collection\resource inside the collection in concern.
  • Delete - Deleting the collection\resource in concern.
  • Create LC - Adding a life cycle to the resource\collection.
  • Delete LC - Removing an existing life cycle from the resource\collection
  • Change LC State - Promoting or demoting to a different stage in the life cycle which is associated to the resource\collection.
  • Update  - Any update to the resource\collection. This can be a version change, a community update such as a rating, comment etc.


 10. Then select the notification type. I will explain how each notification type is used, in my next posts.

11. Next is "Hierarchical subscription method. At the moment we have 3 levels of hierarchies.
  • Collection only
  • Collection and Children only
  • Collection, Children and Grand Children

12. Once this is saved you will have a subscription created for the resource\collection.



Like above we can create any number of subscriptions for different events that need to be tracked.

13. After the subscription is created you can manage it from Configure>Notifications. This page lists all the available subscriptions and allows you to add\edit\delete them.




 
Hope I was clear enough. Please await for more details in next posts !



[1] - https://svn.wso2.org/repos/wso2/people/ajith/greg-4.5.0/alpha-2/pack/



No comments:

Post a Comment

Featured

Selenium - Page Object Model and Action Methods

  How we change this code to PageObjectModel and action classes. 1 2 3 driver . findElement ( By . id ( "userEmail" )). sendKeys (...

Popular Posts