In the first and second part I described how to create a registry extension file. Now I am going to describe how to deploy it in the WSO2 Governance Registry. You can download WSO2 Governance Registry from here.
1. Extract the downloaded zip file to any place you like.
2. Start up the WSO2 Governance Registry
execute: sh GREG_HOME/bin/wso2server.sh
3. Go to Main->Browse->Detail view and add the registry extension file to any location you like.
4. Sign-out and Sign-in
5. Now you can see Event and Events in Metadata Add and List pans.
6. Click Event in Add pan. You can see a window use to add an Event.
7. Fill the given fields and see whether all the items work properly. If not you have made a mistake in the registry extension file.
8. Press Save.
9. Click Events in List pan. You can see a list of Events you saved.
10. When you click on one you can see the data you saved as follows.
Or you can see the content in standard view by clicking Standard view.
Now you can try your custom artifact by changing registry extension file.
Wednesday, December 21, 2011
WSO2 Governance Registry-Configurable Governance Artifacts part-2
In the first part I discussed about creating a registry extension file up to content element. In this post I try to cover how to create a content which describe the data model of the artifact.
Here is a sample content.
Now lets look at how each type and some of their attributes associated with it.
text
Defines a text field.
path and url attributes
If url attribute is set then the input expected to be a url.
If the input is a url or a path to a source in the repository then you can use both as in the example appear.
text-area
Defines a text area field.
options
Defines a field with a combo-box with the given values.
option-text
Defines a composite field with a options field and a text field. Values of the options field need to define as a child element of field.
maxoccurs attribute
Here is how it looks like after saving multiple values.
Since maximum occurrance is unbounded this can keep unlimited entries. If you want limit the number you can define maxoccurs to bounded value.
Associating a lifecycle using options field
options field can be use to select a lifecycle to the artifact instance using above code. This will list down the existing lifecycles to choose one which will associated with the instance. Not associating a lifecycle is also possible. This can be done by adding the following field.
Multi-type attributes
reqired attribute
required attribute makes a field required in order to create a artifact instance. In here I used the reqired attribute for text type, it can be used with other types also. Required fields are indicated using a red star as shown in the figure below.
Table attributes
columns attribute
columns attribute is use to set the number of fields in each row. Following fields are put in to the table in the order of they appear. Also number of heading child elements in the subheading element needs to be same as the number of columns.
Now we have an idea about elements of registry extension file. In the next part we will see how we can add this extension to the WSO2 Governance Registry.
Here is a sample content.
Artifact datamodel can be sub-catagorized under different topics. This separation can be acheive by introducing table element. You can see there are five table elements in the above sample registry extension file. table element consists of different fields. There are several types of fields.<table name="Details"> Name Date </table> <table name="Rules"> Venue Gender male female Description </table> <table name="Participants"> Auther House Name </table> <table name="Service Lifecycle"> Contact Titans Legions Cloud Bots Wild Boars </table> <table name="SLA" columns="3"> Lifecycle Name Document Type URL Comment SLA SLA1 </table> SLA2
- text
- text-area
- options
- option-text
Now lets look at how each type and some of their attributes associated with it.
text
Defines a text field.
Name
path and url attributes
path attribute is set then input expected to be a path. Also enabling this gives the option of browsing within the repository. But you can type the path as well.SLA
If url attribute is set then the input expected to be a url.
If the input is a url or a path to a source in the repository then you can use both as in the example appear.
text-area
Defines a text area field.
Description
options
Defines a field with a combo-box with the given values.
Gender male female
option-text
Defines a composite field with a options field and a text field. Values of the options field need to define as a child element of field.
Contact Titans Legions Cloud Bots Wild Boars
maxoccurs attribute
This attribute enables store multiple entries under same field.Contact Titans Legions Cloud Bots Wild Boars
Here is how it looks like after saving multiple values.
Since maximum occurrance is unbounded this can keep unlimited entries. If you want limit the number you can define maxoccurs to bounded value.
Associating a lifecycle using options field
options field can be use to select a lifecycle to the artifact instance using above code. This will list down the existing lifecycles to choose one which will associated with the instance. Not associating a lifecycle is also possible. This can be done by adding the following field.
Lifecycle Name
Multi-type attributes
reqired attribute
required attribute makes a field required in order to create a artifact instance. In here I used the reqired attribute for text type, it can be used with other types also. Required fields are indicated using a red star as shown in the figure below.
Name
Table attributes
columns attribute
columns attribute is use to set the number of fields in each row. Following fields are put in to the table in the order of they appear. Also number of heading child elements in the subheading element needs to be same as the number of columns.
<table name="External Links" columns="3">Document Type URL Comment URL URL1 </table> URL2
Now we have an idea about elements of registry extension file. In the next part we will see how we can add this extension to the WSO2 Governance Registry.
Tuesday, December 20, 2011
WSO2 Governance Registry-Configurable Governance Artifacts part-1
WSO2 Governance Registry give the full flexibility over extending its functionalities and capabilities. One of its configurable capability is extending its Metadata model in a way such that anyone can store any custom type of data like Services, WSDLs, etc. which are already there. This only needs to add a XML file (registry extension or .rxt file) as a resource to the registry which include the new Metadata model artifact. Here I am discussing about creattion of registry extension file which introduce a Event data model.
Now lets identify main elements one by one.
artifactType element
type - Define the mediatype of the artifact. This should be in the format of "application/vnd.[SOMENAME]+xml". SOMENAME can contain any alphanumeric character, '-' (hyphen) or '.' (period).
shortName - Short name for the artifact
singularLabel - Singular label of artifact
pluralLabel - Plural label of artifact
hasNamespace - Whether artifact has a namespace (boolean)
iconSet - Icon set number which use as the artifact icons
artifactKey element
storagePath element
nameAttribute element
namespaceAttribute element
ui element
This element define the view of the data instances when browsing for that data type. It can include the list of data types which are in the content of the artifact.
relationships element
isConsumedBy - Artifact which consume newly created artifact
uses - Artifact which use newly created artifact
usedBy - Artifact used by the newly created artifact
content element
We will discuss about content in the next post.
event /events/@{details_name} details_name http://www.wso2.com/rxt/event
<table name="Details"> Name Date </table> <table name="Rules"> Venue Gender male female Description </table> <table name="Participants"> Auther House Name </table> <table name="Service Lifecycle"> Contact Titans Legions Cloud Bots Wild Boars </table> <table name="SLA" columns="3"> Lifecycle Name Document Type URL Comment SLA SLA1 </table> SLA2
Now lets identify main elements one by one.
artifactType element
This is the root element of the new artifact which is going to define. It has several attributes.
type - Define the mediatype of the artifact. This should be in the format of "application/vnd.[SOMENAME]+xml". SOMENAME can contain any alphanumeric character, '-' (hyphen) or '.' (period).
shortName - Short name for the artifact
singularLabel - Singular label of artifact
pluralLabel - Plural label of artifact
hasNamespace - Whether artifact has a namespace (boolean)
iconSet - Icon set number which use as the artifact icons
artifactKey element
This element defines the unique key which can be used to identify the artifact. This key is used when fetching configurations and loading customized UIs.event
storagePath element
This is the path where the instance data of artifact is stored. When evaluate this expression, it automatically replace @{name} with the name of the artifact, and @{namespace} with the namespace of the artifact. In addition to name and namespace, you can also specify any other attribute in the format @{ATTRIBUTE_NAME}. e.g. /trunk/processes/@{business_domain}/@{overview_version}/consumers/@{namespace}/@{name}
nameAttribute element
This is the main attribute which define the name of the artifact. This must be in the format, {$table}_{$base-column}.details_name
namespaceAttribute element
This attribute which you will define the namespace of the artifact. some artifacts might not need a namespace, and therefore, this is optional. Namespaces are found in artifacts related to Web Services, but might not be common to others such as Policy and SLA.http://www.wso2.com/rxt/event
ui element
This element define the view of the data instances when browsing for that data type. It can include the list of data types which are in the content of the artifact.
relationships element
relationships defines the relationships between the newly created artifact and other artifacts. We can find three types here.
isConsumedBy - Artifact which consume newly created artifact
uses - Artifact which use newly created artifact
usedBy - Artifact used by the newly created artifact
content element
This element defines the data model of the new artifact. Also it will use to auto-generate the ui of instantiate artifacts.<table name="Details"> Name Date </table> <table name="Rules"> Venue Gender male female Description </table> <table name="Participants"> Auther House Name </table> <table name="Service Lifecycle"> Contact Titans Legions Cloud Bots Wild Boars </table> <table name="SLA" columns="3"> Lifecycle Name Document Type URL Comment SLA SLA1 </table> SLA2
We will discuss about content in the next post.
Sunday, December 18, 2011
Started my career life with WSO2
I finished my degree from University of Moratuwa at the end of last month. Soon after the finishing, we were asked to join WSO2 as we selected from the interviews. So I had a busy "end November" with preparation (filling docs and boring stuff).
If I describe in one sentence, WSO2 is a open source middleware company which provide middleware stack for enterprise solutions.
1st December 2011, it is the first day at office and there were 21 fresh graduates who join WSO2 in the same day. Actually I am not exited because there were lot of familiar faces in WSO2 who were there at my intern. In the very first day we were assigned to different sub-products in WSO2 SOA platform. I was assigned to WSO2 Governance Registry.
Thursday, December 15, 2011
maven2 - maven3 and java.lang.NoClassDefFoundError: org/codehaus/plexus/classworlds/launcher/Launcher
I typically use maven2 as my builder manager and I had to install maven3 to use in the same machine for build a new source code. I used following simple hack for this.
1. Download and extract maven3 distribution to any place as you prefer.
(MAVEN3_HOME = path of root of the extracted distribution)
2. Rename one of the mvn file in MAVEN3_HOME/bin
You can use rename MAVEN3_HOME/bin/mvn mvn3 or mv MAVEN3_HOME/bin/mvn mvn3
3. Add MAVEN3_HOME/bin to the environment variable in /etc/environment or /etc/bash.bashrc
4. Restart the shell/terminal
Now you can use both maven2 and maven3 using mvn and mvn3 commands.
Also you cannot use maven2 and maven3 shared m2 repository. You can do that by allocating different spaces for maven2 m2 repo and maven3 m2 repo. For more details click here.
After doing this when I execute mvn3 clean install I got the following exception.
Solution:
First guess: The cause of this should be installing maven2 and maven3 in the same machine. But theoretically this cannot happened. Because we invoke maven2 and maven3 using different commands which locates in different places.
Second guess: There may some environmental variable which belongs to maven2 accessed by maven3. Fortunately the second guess was right. I exported M2_HOME in /etc/bash.bashrc file which direct to the maven2 root. After commenting out that piece of code mvn3 clean install worked fine for me.
WARNING: Programs which uses M2_HOME variable may not work properly after this modification.
NOTE: This is only one cause which throws this exception. There may more. Here is another example which throws the same exception but when executing maven2.
1. Download and extract maven3 distribution to any place as you prefer.
(MAVEN3_HOME = path of root of the extracted distribution)
2. Rename one of the mvn file in MAVEN3_HOME/bin
You can use rename MAVEN3_HOME/bin/mvn mvn3 or mv MAVEN3_HOME/bin/mvn mvn3
3. Add MAVEN3_HOME/bin to the environment variable in /etc/environment or /etc/bash.bashrc
4. Restart the shell/terminal
Now you can use both maven2 and maven3 using mvn and mvn3 commands.
Also you cannot use maven2 and maven3 shared m2 repository. You can do that by allocating different spaces for maven2 m2 repo and maven3 m2 repo. For more details click here.
After doing this when I execute mvn3 clean install I got the following exception.
Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/plexus/classworlds/launcher/Launcher
Solution:
First guess: The cause of this should be installing maven2 and maven3 in the same machine. But theoretically this cannot happened. Because we invoke maven2 and maven3 using different commands which locates in different places.
Second guess: There may some environmental variable which belongs to maven2 accessed by maven3. Fortunately the second guess was right. I exported M2_HOME in /etc/bash.bashrc file which direct to the maven2 root. After commenting out that piece of code mvn3 clean install worked fine for me.
WARNING: Programs which uses M2_HOME variable may not work properly after this modification.
NOTE: This is only one cause which throws this exception. There may more. Here is another example which throws the same exception but when executing maven2.
Tuesday, June 14, 2011
Thrift, Scribe, Hive, and Cassandra: Open Source Data Management Software
I found a old but has some valued set of slides which may useful.
Friday, April 8, 2011
Subscribe to:
Posts (Atom)






