Friday, May 2, 2014


Getting on....




As the initial phase of the project I had to get familiar with Carbon component architecture,WSO2 Governance Registry code base (specially governance component), UI generator models, Web services, JSON parsing, JSP, Test frameworks etc. during the interim period.

Building WSO2 Carbon from source:

I referred WSO2 documentation links on Carbon architecture & checked out Carbon and built them on Ubuntu 14.04.

Carbon comes as 3 directories:  Orbit, Kernel & Platforms.

Orbit bundles external third party dependencies which are not maintained by WSO2, but are needed for some products.
WSO2 products are built on top of WSO2 Carbon Kernel, which contains the Kernel libraries used by all products.
A WSO2 Platform release is a set of WSO2 products based on the same Carbon release.

In order to check out the code I had to install SVN.

Installing SVN:
Subversion is an open source version control system. To setup SVN in the Ubuntu environment:
$ apt-get install subversion
     $ apt-get install libapache2-svn

Referred http://lasindu.com/setup-svn-in-your-ubuntu-environment/

Installing Maven:
Maven basically is a build tool which can manage a project's build, reporting and documentation from a central piece of information. Below is an easy guide to install maven in your local setup.

1. Download apache-maven-3.0.4-bin.zip and unzip it.
 $ tar -xzvf apache-maven-3.0.4-bin.tar.gz

2. Create a new directory
$ sudo mkdir /usr/local/apache-maven

3. Copy extracted files into the new folder
$ sudo cp -R apache-maven-3.0.4 /usr/local/apache-maven/

4. Append these lines to .bashrc file in /home directory.
M2_HOME=/usr/local/apache-maven/apache-maven-3.0.4
M2=$M2_HOME/bin
MAVEN_OPTS="-Xms256m -Xmx512m"
PATH=$M2:$PATH

5. Run 'mvn –version' to verify that it is correctly installed.

When building from source, I first had to build orbit, then kernel and finally build the platform.

Referred http://lasindu.com/installing-maven3-in-ubuntu-12-04/

First I created separate folders to check out orbit, kernel and platforms.

Home > repos >wso2 > carbon > kernel > branches > 4.0.0
Home > repos >wso2 > carbon > orbit> branches > 4.0.0
Home > repos >wso2 > carbon > platforms > branches > 4.0.0

Then come out of directory 4.0.0 and executed the checkout command.
Check out command:
Orbit:
$ svn checkout https://svn.wso2.org/repos/wso2/carbon/orbit/branches/
Kernel:
$ svn checkout https://svn.wso2.org/repos/wso2/carbon/orbit/branches/
Platforms:
$ svn checkout https://svn.wso2.org/repos/wso2/carbon/platforms/branches/

Also I got a basic understanding on pom. xml which is essential for the product to be built.

JSON:

JSON (JavaScript Object Notation) is a lightweight data-interchange format. Derived from the JavaScript scripting language, JSON is a language for representing simple data structures and associative arrays, called objects. 
In my project XML based RXT format will be replaced by JSON. JSON would be more human friendly than XML and will be much efficient in processing. 

 XML to JSON:

One of the following two Methods can be used.

(I) Badgerfish implements the full XML infoset in JSON using various techniques.

(II) Mapped allows you to manually map XML namespaces to JSON element prefixes.

JSON Parsing:

The existing model used axiom which uses StAX based implementation to parse XMLs. To parse JSON in the proposed implementation II would use Jettinson.

Jettison is the JSON StAX parser and writer implementation used in implementing JSON support for Axis2. It is a collection of Java APIs (like STaX and DOM) which read and write JSON. It consists of two different parsers and writers for the “Badgerfish” and “Mapped” conventions. Using Jettison, both formats can be supported in Axis2, and the user can use the one which is more appropriate for the application.


JSON schema validators would become handy when validating the user created RXT files. Using the Java model created, org.wso2.carbon.governance.generic.ui component could be modified to automatically generate the necessary UIs. 

After referring to the code base I got some idea about governance component and its UI generator models.



No comments:

Post a Comment