Sunday, May 18, 2014


Update on 11.05.2014 -18.05.2014 week




As far as I understand the project by now, I can divide it into following tasks:

Task 1:

Currently XML is read and UI is rendered using UIGenerator class. I have to do it using
the same flow(with minimal affect to existing code) and read a JSON to render a similar UI.

So I am looking at the governance. generic and governance. generic.ui classes. Now I am getting much familiar with code and I would like to know whether these are the relevent code segments I am referring at the moment.
First I hope to create and test new Java classes to replace Util ,GenericArtifactsUtil and Manage GenericArtifactsService to do novel changes without breaking the current model.
As a milestone I will try to plug JSON based rxt to existing model and validate and parse it within 2 weeks time.
For now it is the main thing I am working on.

Task 2:
Drag and Drop UI

I have run the G-Reg product and did some experiments on how to create new artifacts.
In the existing system user has to create the XML file according to his requirements and upload it in order to configure new artifact. User has to be familiar with coding in order to make use of this system.
After looking at artifact configuration XML files I got an idea on a general artifact structure.
If drag and drop UI is implemented what is going to be drag drop elements and what is going to be required information.
I designed simple UI for that drag drop UI interface and it's elements and still I am searching for some kind of drag and drop UI framework with Apache version 2.0 license to cater this, where user doesn't need to be much familiar with coding.

http://aribaweb.org/Home.htm seems somewhat relevant to it but I still go through its documentation and demos and not having an exact idea on its usability for this project.

I hope it would be better if I get to know any of such drag drop UI component available in WSO2 carbon and some people working in those areas to get some guidance. I will carry on searching about this in between task 1.

Task 3:


Create the JSON using a UI template which we construct using drag and drop sort of UI.
For this task I have to first look upon task 2. So I am not going to search more about it since it mostly depend on how I going to enhance user experience through task 2.


Also I understand how to build the individual components and finally how the whole product is built in order to create wso2greg-4.6.0.zip. That is what we run as the product in the browser. I was new to ubuntu and now I am gradually getting familiar with it. To understand the code and it's functionality I have to get familiar with remote debugging.

Remote debugging:

To start Carbon server with remote debugging enabled type:

./wso2server.sh -debug 5005

in the terminal.
before enter Create debug pointer in code and configure a new debug window. Then enter the above command and start debugging.


I hope the knowledge and the understanding I got within last weeks about WSO2 Carbon, XML to JSON conversion and JSON parsing and validation would help me to fulfill tasks, with not much difficulty.

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.




Beginning of a New Era...


In my last post I described that awesome path I came towards GSOC 2014. Here, I would like to introduce my project for GSOC 2014.

Topic: Implement Registry Extension (RXT) 2.0 + Associated UI support
Organization: WSO2
Mentor: Shelan Perera (Senior Software Engineer – WSO2)


What is WSO2 governance Registry

           

“Governance encompasses more than just technology; governance also includes people and processes. The WSO2 Governance Registry provides the right level of structure straight out of the box to support SOA Governance, configuration governance, development process governance, design and run-time governance, lifecycle management, and team collaboration.”

That is how WSO2 describes Governance registry.

Introduction to project:

Configurable Governance Artifacts are one of many well-defined extension points supported by the WSO2 Governance Registry. It extends the functionality of WSO2 Governance Registry to support modeling any type of asset to suit the user requirements. The RXT model provides an extensible configuration language to create new types of artifacts. Governance API provides easy management and access of resources from outside.

Main objective of this project:

To provide enhanced usability in configuring new types of artifacts and introduce a new JSON based RXT format. After the successful completion of the project, the existing XML based RXT configuration will be tailored to use JSON and users with less programming background will be able to create new artifact types more easily. In addition, this project focuses on providing extended functionality to the RXT model and provides customizable UI to create/manage new artifact types.

Deliverables:

·        Replace the current XML based configuration with a JSON based configuration.
·        Refactor the existing UI generator model to use JSON based configuration instead of the XML based configuration and plug it into the governance API along with new JSON schema validators and parsers.
·        Implementing nested RXT support so that new artifact can be added inside another artifact.

·        Proved a UI based editing/creation of the configuration file along with the JSON edit.





GSOC & ME…




Being an undergraduate of Department of Electronic & Telecommunication Engineering, University of Moratuwa, I wondered what Google Summer of Code is.

At first it was all about money in 2012! I was first year undergraduate then, my fellow undergraduates buy Apple stuff, DSLR cameras. So I felt it would be nice if I also could take part in GSOC. In 2013 it was a dream. Many of my own batch mates took part in it. 
Then it comes my industrial training semester and I selected to Virtusa, one of the biggest IT companies in Sri Lanka. I got exposure to coding and then what?

GSOC 2014 announced! Now that I understood this is not all about money, but will be a lifetime experience for me.

First I was looking on a  project from Joomla . But when the accepted organizations were announced, I saw WSO2 in the list. I got more information about the project “Implement Registry Extension (RXT) 2.0 + Associated UI support” from a senior who worked in WSO2 governance registry. I was interested on the topic & managed to understand the project to certain level even I was not much aware about all.

After some mail exchanges with some team members of Governance Registry, I cleared my vision on project and its deliverables, did some experiments on my own and with help from other resource people  I wrote the proposal for GSOC 2014.

It was exactly the beginning of an awesome journey.
On April 21 st  2014!
I was in a dream when got up and rushed to mélange site.
Yey…

Dream was out there…