Meet me at WSO2Con 2011

WSO2Con 2011 is a technical and IT-Biz conference organized by WSO2 inc, and 2011 is its second consecutive time. Last year the conference concluded grandly and it discussed many technical topics such as enterprise computing, cloud, web services security, enterprise data etc. It concluded with a great panel discussion on the topic “A Walk Down Memory Lane: XML, Web Services & SOA from 1990 to 2010” and the panelists were some of the renowned personalities in XML Web services space.

So the conference is back this year, and it will be on September 12th to 16th at Waters Edge Colombo, There will be two tutorial sessions (12th and 16th) and the conference will span for three days (13th, 14th and 15th). The agenda was recently announced officially, and it surely looks interesting. I guess if you are into Distributed Computing, SOA and Cloud this would be the right place to and the event to be apart of.

WSO2Conf

Also am quite proud to blog about that I will also be one of the speakers in the 2011 conference, The topic I submitted was “User interfaces in distributed environments” and later I altered it to “Users: The SOA Last Mile” to make it broader.

Main reason for this topic is that I have done some resent work close to the Users of information systems and about delivering information to users effectively and efficiently, I believe I can talk about it, and maybe give some insight about How important the “Last Mile” is. Anyhow I don’t wona write about What I will be talking, coz mainly its still a blank paper for me too 😀

So yeah what I wanted to say is that WSO2Con will be happening on September in Colombo, and I have no doubt that it will be one great tech Conf with a great set of talks and workshops, so hope to see you there soon !!!

 

Advertisement

WSO2 Gadget Server 1.3.0 is out with a bunch of awaited features

This is a short post aiming to notify the new features of WSO2 Gadget Server 1.3.0 which was released recently. The product is popular among the community as a gadget rendering platform, which provides a presentation layer for heterogeneous enterprise services based on Google Gadgets Specification and Apache Shindig. As an enterprise presentation product, the Gadget server is now fully fledged with number of awaited features such as,

And some of the important features of WSO2 Gadget Server are,

Try out The Gadget Server 1.3.0, and provide your feedback to make it better and brighter. You can provide feedback, report bugs and join in with architectural discussions at any of WSO2 public lists and also you can have a better understanding via going through many articles at WSO2 Oxygen tank.

{HowTo} WSO2 Carbon Server logs to be stored in a database

Thought of documenting this for my own reference, hope this will help. I am also planing to make a knowledge base article out of it to be posted in WSO2 Oxygen Tank.

As you may know, if your are familiar with Log4j, that the logs created with it, can be stored in a database instead of a file. In order to do that you need to add few configuration values to the log4j.properties file.

In-terms of a WSO2 Carbon based server this properties file resides in CARBON_HOME/lib directory. before adding these configurations there are few steps to visit.

[1] Create database {LOG_DB}
[2] Create the log table  {LOGGING} with the following fields

create table LOGGING (
             id decimal NOT NULL,
             prio varchar(15),
             cat varchar(255),
             thread varchar(30),
             msg varchar(255),
             layout_msg varchar(255),
             throwable varchar(2000),
             the_timestamp timestamp);

[3] Create a user and assign to the DB

           {user: logger / pwd: logger}

[4] Copy jdbcappender.jar to {CARBON_HOME}/lib and {CARBON_HOME}/repository/components/lib along with the database driver

           {jdbcappender.jar can be found at http://www.dankomannhaupt.de/projects/jdbcappender/lib/jdbcappender.jar}

Thats it. All preconditions are set, Now open up the log4j.properties file and add the following appender settings to the end.

#log to db appender
log4j.appender.DB_APPENDER=org.apache.log4j.jdbcplus.JDBCAppender
log4j.appender.DB_APPENDER.url=jdbc:mysql://localhost:3306/LOG_DB
log4j.appender.DB_APPENDER.dbclass=com.mysql.jdbc.Driver
log4j.appender.DB_APPENDER.username=logger
log4j.appender.DB_APPENDER.password=logger
log4j.appender.DB_APPENDER.sql=INSERT INTO LOGGING (id, prio, cat, thread, msg, layout_msg, throwable, 
the_timestamp) VALUES (@INC@, '@PRIO@', '@CAT@', '@THREAD@', '@MSG@', '@LAYOUT:1@', '@THROWABLE@', '@TIMESTAMP@')
log4j.appender.DB_APPENDER.layout=org.apache.log4j.PatternLayout

Scroll to log4j.rootLogger and add the appender to the list,

log4j.rootLogger=ERROR, CARBON_CONSOLE, CARBON_LOGFILE, CARBON_MEMORY, CARBON_SYS_LOG, DB_APPENDER

Gadgets On the Cloud

There is no doubt that JavaScript/XML gadgets make a great presentation layer over the web with increasing amount of data floating around. The ability of which these gadgets can be embedded in any place over the web, provides a great flexibility, and a wider reach. Google does this quite nicely with their iGoogle gadgets, enabling the gadgets to be embedded in almost any web page. The success of this great idea, would be only logical if all the data, services and mashups are also available over the web with open access or maybe authenticated access. This is where a cloud story fits-in, and this the very reason why Google can do it quite easily.

However, what if you want to do everything from the scratch and also provide a great presentation layer for the users. For an instance, lets say you have a lot of financial data within your enterprise, and you need to provide some of these to your customers, to general public and some for your employees. To do this, you will have to create appropriate data services, maybe mediate or transform some data, integrate with some legacy data sources, create some business work flows, mashup them with some 3rd party services like Google finance or charts and finally expose the end results to the targeted user group. This is where WSO2 Stratos PaaS comes for your rescue 🙂

If your requirements are such, you will need a strong middle-ware platform to full fill all the above tasks, and if its all on the cloud, you will not have to worry about anything other than writing your business logic. Once the business logic is correctly compiled, you can Mashup some of your data with external service APIs, and then write the presentation logic purely on javascript and xml as XML Gadgets and expose them to the users you need. Once the gadgets are published on WSO2 Cloud Gadget Server its just a matter of linking them up in any web page you want over the web.

https://gadget.cloud.wso2.com/ifr?container=default&mid=3&nocache=1&country=US&lang=en&view=default&parent=https%3A%2F%2Fgadget.cloud.wso2.com%2F&debug=1&up_=undefined&st=john.doe%3Ajohn.doe%3A10717%3Ashindig%3Ahttp%253A//gadget.cloud.wso2.com%253A80/registry/resource/_system/config/repository/gadget-server/gadgets/ngeo_vid.xml%3A0%3Adefault&url=http%3A%2F%2Fgadget.cloud.wso2.com%3A80%2Fregistry%2Fresource%2F_system%2Fconfig%2Frepository%2Fgadget-server%2Fgadgets%2Fngeo_vid.xml#rpctoken=1304649864https://gadget.cloud.wso2.com/ifr?container=default&mid=0&nocache=1&country=US&lang=en&view=default&parent=https%3A%2F%2Fgadget.cloud.wso2.com%2F&debug=1&up_=undefined&st=john.doe%3Ajohn.doe%3A10197%3Ashindig%3Ahttp%253A//gadget.cloud.wso2.com%253A80/registry/resource/_system/config/repository/gadget-server/gadgets/soa.xml%3A0%3Adefault&url=http%3A%2F%2Fgadget.cloud.wso2.com%3A80%2Fregistry%2Fresource%2F_system%2Fconfig%2Frepository%2Fgadget-server%2Fgadgets%2Fsoa.xml#rpctoken=1304649864

The above two gadgets are taken from WSO2 Cloud Gadget Server and have linked in to this blog, to convince about the great flexibility and reach it can add-up. You do not need to use the Cloud Gadget Portal as the only place for your data to be presented (Of cause if you are not using other gadget server specific privileges such as inter-gadget communication etc). You can simply use the Gadget Server as your own gadget repository, and encourage users to discover the gadgets and embed them into their own web pages over the web.

To sum up the story I would say, try-out Stratos, try out the available services and you will definitely find out more use cases, and creative ways to use the platform and leverage the advantages of the cloud

WSO2 Stratos – A true cloud story

Stratos Services

Yesterday (1st of June), A little over a 12 developer team at WSO2, took a great middle-ware platform in to the cloud. It’s not just putting all our server products on an EC2 instance, but embedding all cloud-native features into them. The PaaS (Platform as a Service) is named as WSO2 Stratos, which is based on award winning WSO2 Carbon middle-ware platform. As the Alpha-1 release, Stratos offers number of WSO2 products integrated, namely Governance Registry (GREG), Identity Server (IS), Business Activity Monitor (BAM), Mashup Server (MS) and WSO2 Gadget Server (GS).

Stratos is also offered as a downloadable version for the private cloud within your enterprise. If you are quite serious about using SOA for your enterprise and do not need to worry about deployment, scalability and server maintenance, Stratos would be the ideal solution for you.

Web Scraping & Parsing HTML to XML in Javascript

Today I was working on a customer POC and happened to create few Google gadgets to visualize selected data sets from *.gov.uk sites. The scenario which is implemented was, mixed with inter-gadget communication and content search over data.gov.uk sites. I created three simple gadgets which communicates with each other, and one acted as the controlling gadget which pushed the search parameters to other two gadgets. The two content gadgets showed UK (1) primary school information and (2) electoral information. The pushed parameter was the postal code of different parts of UK. The direct.gov.uk has a form based implementation of this.

The Requirements for the POC was, simple and we already had working samples of such a scenario at WSO2 library.

  1. Show how one gadget can pass the context to other gadgets
  2. How gadgets can harvest data in various formats (in my previous post I explained on how to get data from RDF endpoints, which are also available in *.gov.uk sites)

The building blocks for the implementation was the search url, which was quite straight forward. for all the requests based on postal codes the direct.gov site served in the same manner (because of this important fact, the automation process became trivial). for an instance the url for primary school information retrial was,

http://local.direct.gov.uk/LDGRedirect/LocationSearch.do?LGSL=13&searchtype=1&LGIL=8&Style=&formsub=t&text=SE1+7DU

Where the param “text” changed according to the postal code. So far everything seemed straight forward, however at implementation, while using Gadgets API for content retrial, I faced problems in parsing text with javascript. Hence the gadgets.io.makeRequest supported HTML as text and the API method returned the retrieved HTML document as string making it quite impossible to process.

With some thinking and advise, I brought the Mashup Server in to the picture and used it to retrieve the data from the gov site and returned the result in XML format. Using the Mashup Server web scraping seems to be a piece of cake, We created a simple mashup using the scraper host-object and captured the result set in the search result page. The mashup code as follows,

function search(searchUrl) {
	var scraper = new Scraper(
		
		    {searchUrl}
			
			    
				
				   
				
			     
			
		
	);
	return new XMLList(scraper.response);
}

And finally the two gadgets were making service calls to the mashup service and retrieved the data as an XML object, making the data processing painless. The final version at the Gadget Server looked quite appealing.

WSO2 Gadget Server with UK gov data
Gadget Server look - in the end

Special thanks goes to Ruchira for helping me out with the mashup service 🙂 You can download the Gadget code and the Mashup service and try the scenario yourself.

Mashing up RDF data with WSO2 Mashup Server

Okey so this is the fun part that I promised to write about :D. I managed to cook up a use-case to demonstrate RDF querying and making use of the semantic data. The data that I am using for querying, is the rdf data sources available in the UK data.gov site. With some analysis I figured out that this task can be fundamentally archived using the combination of Mashup and Gadget Technologies. My choice of tools were WSO2 Mashup Server and WSO2 Gadget Server for their great flexibility and of cause for other obvious reasons :D. However the Mashup Server does not natively support RDF data retrieval, hence I had to do some work to get such functionality integrated. The great fact about the mashup server is its extensibility, the concept of host objects and the ability to write custom host objects and its pluggable nature comes handy in such cases. The high level architecture of what I am trying to achieve is as follows.

RDF data retrival with WSO2 Mashup server / WSO2 Gadget Server

To implement the above architecture with the tools at hand I created a custom host object that can be plugged to the Mashup Server. When dealing with semantic web related tasks and RDF data handling HP’s Jena java library comes in handy. With the use of Jena-ARQ (for SPARQL) api I managed to get the host object working with few lines of code.

.....
            Dataset dataSet = DatasetFactory.create(sparqlObject.rdfDataSource);
            // Create a new query form a given user query
            String queryString = sparqlObject.spaqrlQuery;
            Query query = QueryFactory.create(queryString);
            QueryExecution qe = QueryExecutionFactory.create(query, dataSet);
            ResultSet results = qe.execSelect();
.....
           resultString = ResultSetFormatter.asXMLString(results);
..... OR.....
           ByteArrayOutputStream bos = new ByteArrayOutputStream();
           ResultSetFormatter.outputAsJSON(bos, results);

With the host object in place, the next task was to create a Mashup in-order to query the rdf data with a given source (EndPoint or data source). The javascript service (Mashup) is created to serve this purpose, where the consumer can specify the RDF endpoint or the data source with the SPARQL query and retrieve the dataset in XML or JSON.

.....
function RdfDocQueryService(rdfDataSource, rdfQuery, resultType) {
   var sparqlObj = new SparqlHostObject();
   sparqlObj.rdfDataSource = rdfDataSource;
   sparqlObj.spaqrlQuery = rdfQuery;
   sparqlObj.resultType = resultType;
   return new XML(sparqlObj.getDataFromRdfSource());
}

Finally to bind everything together, lets try querying some data. My example usecase is to use the query at N2 blog to retrieve traffic monitoring points in UK roads. The query to retrieve the data set as follows,

#List the uri, latitude and longitude for road traffic monitoring points on the M5
PREFIX road:
PREFIX rdf:
PREFIX geo:
PREFIX wgs84:
PREFIX xsd:
SELECT ?point ?lat ?long WHERE {
  ?x a road:Road.
  ?x road:number "A4"^^xsd:NCName.
  ?x geo:point ?point.
  ?point wgs84:lat ?lat.
  ?point wgs84:long ?long.
}

To visualize these points I have created a gadget with the aid of Google Maps api. This gadget can be hosted in the Gadget Server, where it can dynamically retrieve traffic monitoring points for each road in the UK and display them in the map as follows.

Traffic points in A4 road, UK

WSO2 Gadget Server 1.1.0, What to expect

WSO2 Carbon 3.0.0 – code name “Iridium” is just about to release in few more days. as of WSO2’s release strategy, all the products will graduate with their next version on top of carbon based platform. As for the newly released Gadget Server it would be version 1.1.0

Features were frozen for version 1.1.0 and that was in the end of February as I recall. We (the GS team) managed to squeeze in few new very important features to this release.

  • Upgraded shindig to the latest version

This was a bummer, since WSO2 Carbon platform is running on OSGi, if you had to use a non native OSGi project (i.e. Shindig) you will have to create an OSGi aware carbon orbit bundle and make use of it at run time. This was done some time back where shindig was on r734876 revision. In-order to leverage new functionalities such as OAuth, Pub-Sub etc. and to patch the bug fixes we thought of updating the shindig carbon orbit bundle. So now shindig is on r910768 and is quite up to date.

  • i18n internationalization support for gadgets

i18n is not a big deal for Google gadgets since the gadget API itself supports it, What we had to do is enable i18n support in shindig. (Which was already implemented by the shindig community)

  • Inter Gadget communication

Inter gadget communication, seemed to be the hot topic in our forums and webinars, all most in all tech talks we did about the Gadget Server, some person in the audience raised the question about gadget-to-gadget communication. Our answer was “it can be done at shindig level, and we are yet to support it”. So without a long await, with GS v1.1.0 we enabled this feature. The architecture is quite fascinating where there will be zero backend calls and all the communication is done simply on the front-end. Basically each publisher will have a publishing channel and the subscribers can subscribe to this channel. After that its simple pub-sub.

  • The portal will completely run on HTTP transport

This was a limitation we had in our fist release. The portal was running only on HTTPS, and the reason behind was that all WSO2 products are running on secure transport and the Gadget Server is also a combination of some specific components which ran on the same platform. For this release we went the extra mile and enabled HTTP for the portal. So once you go to the login page it will switch to the secure transport (HTTPS) and after successful login you will redirect back to the HTTP non-secure mode. (Of cause you can disable HTTP any time and run the portal purely on HTTPS, it all depends on the requirement.)

One disappointment I have is that we couldn’t integrate OAuth on time. even though it is supported at shindig level we have to do a considerable amount of work from the Gadget Server side to fully support it, hence it is postponed to our next release. You can try the sample OAuth GData Gadget, simply adding it by the URL, and that will work like a charm. (nothing useful but just to let you know that we are only few steps behind on it)

Okey so enough sneak peak 😉 download the Gadget Server pre-beta, play with it, and help us to improve (even in the last minute) by reporting any issues.

Cheers !!

Time for family and friends, Time to party and time to relax :D

Today I got holidays. 😀 yeah I know some of you might be wondering whether am still schooling (Yeah I got the same feeling first lol) !!! !@#$%^& But yeah we got a super awesome two whole weeks to have some fun, go some where, anywhere out from checking mail, and doing the stuff we do day to day. Had the last-office-day party at flag and whistle dressed up like pirates, doing some crazy games and enjoying nice food. Dr. Sanjiva gave an inspiring speech, talked about what we achived as a team at WSO2 in 2009 and what we should do in the coming year.

I am still 5 months old at WSO2 and all these things inspires me, the friendly open culture (with a very Geeky backdrop), the challenging work, friendly people with an amazing passion and team work. All those make me think how great it is to be apart of it all. So now its holidays for us, till Jan 4th we take a break from work and enjoy with everything else but work. My plan is to sleep about two days, Going on a trip to North (Yeah north since there NO WAR any more) for like 3 ~ 4 days, visit some old friends and la..di..da..di..da… 🙂 So yeah until then HAPPY HOLIDAYS

The SOA Workshop day

Today was “THE Workshop Day” for WSO2 folks, an event organized by WSO2 with an intention to make an awareness of SOA building blocks. I was (proudly 🙂 ) among the audience as a WSO2 crew member, listening to all the tech talks of my collogues. It was a great session we had today, starting from Paul’s introduction to SOA and until Asanka’s talk about enterprise SOA pattern’s. The whole set of talks took me back in time where I was reading about SOA concepts for my bachelor’s thesis. If I had experienced this workshop then, life would have been much easier :P.

Guys,.. cheers !! for a job well done 🙂

com-workshop-banner