Apache Shindig talk at Apache Con Asia 09

As I have mentioned in some previous post, today I did a talk about Apache shindig and its use cases (WSO2 Gadget Server) at Apache Con 09 with my Colleague Tyrell. So without writing about the whole talk let me share the presentation slides. The Talk turned up great, audience were quite interested, too bad we had very limited time and missed to do a demo. 😦

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

Writing custom queries to retrieve data from WSO2 Governance Registry

WSO2 Governance Registry is a big part of wso2 governance product stack. Even though it is primarily aimed at managing, versioning, rating, and commenting on SOA artifacts it can also be used as a simple data store. with the 3.0 version the G-Reg gave support to custom query execution from the client side. This feature helps immensely when you use the registry for non-standard tasks. For me I had to do some pagination work for the comments that belongs to a particular resource, hence my approach was to write few custom quires to get the job done. The code is as follows.

	/**
	 * Returns a chunk of comments
	 * 
	 * @param resPath	Path to the comment
	 * @param start		The beginning index
	 * @param size		Size of the chunk
	 * @return			an array of comments
	 */
 public Comment[] getCommentSet(String resPath, int start, int size) {
		Registry registry = null;
		try {
			registry = ; // get an instance of the registry 

			Resource comQuery = registry.newResource();

                        // The Sql Statement
			String sql = "SELECT REG_COMMENT_ID FROM REG_RESOURCE_COMMENT RC, REG_RESOURCE R, REG_PATH P WHERE "
					+ "RC.REG_VERSION=R.REG_VERSION AND "
					+ "R.REG_NAME=? AND "
					+ "P.REG_PATH_VALUE=? AND "
					+ "P.REG_PATH_ID=R.REG_PATH_ID LIMIT ?, ?";

			// Set SQL statement as the resource content
                        comQuery.setContent(sql);

                       // Setting the media type and properties
			comQuery.setMediaType(RegistryConstants.SQL_QUERY_MEDIA_TYPE);
			comQuery.addProperty(RegistryConstants.RESULT_TYPE_PROPERTY_NAME, RegistryConstants.COMMENTS_RESULT_TYPE);

			registry.put("system/myQueries/query", comQuery);
                 String resourceName = "testResource";
                 String pathToResource = "/system/myResources"

			Map params = new HashMap();

                        //Setting the parameters
			params.put("1", resourceName);
			params.put("2", pathToResource);
			params.put("3", start);
			params.put("4", size);

                       // Executing the SQL statement
			Collection qResults = registry.executeQuery("system/myQueries/query", params);

			String[] qPaths = (String[]) qResults.getContent();

			Comment[] comments = new Comment[qPaths.length];
                        // Loading the comment data to comment object array 
			for (int i = 0; i < qPaths.length; i++) {
				if (registry.resourceExists(qPaths[i])) {
					comments[i] = (Comment) registry.get(qPaths[i]);
				}
			}

			return comments;

		} catch (Exception e) {
			String errorMsg = "Backend server error - could not get comment set";
			log.error(new MyTestException(errorMsg, e));
			return null;
		}

	}

Yeah simple as that you get your resources set without much effort. A big thank goes to Dimuthu

Best of SOA Summer School

During this entire summer, WSO2 conducted a series of trainings on SOA best practices, How-Tos and trends, titled “SOA Summer School“. With the dawn of the autumn the series of online summer classes came to an end. With the popular demand, a 3 hour session is going to be held tomorrow the 13th August summarizing the 8 weeks of lessons and highlighting their key areas.

Untitled
for a better insight I have attached tomorrow’s agenda, and it is conducted by Samisa Abeysinghe, Ruwan Linton, Prabath Siriwardena, Keith Chapman and Nandika Jayawardena. The online trainings are totally free and any one who is interested in SOA and EA can gain a good knowledge of its dynamics.

JSF, Spring together with apache CXF

Good tutorials and resources on Apache CXF How Tos are not easy to digg. I had to spend hours searching and reading to make my small application up and running, Integrating Spring with JSF was pretty straightforward, but when it comes to integrating those two with JSF i got stuck.

So this post is about exposing a web service as a web project using JSF front end / Spring backed and CXF for service invocation

before starting I should mention few valuable resource around the net.

The web service u used was the publicly available spelling checker which is used in the netbeans tutorial.

The Step by step guide as follows >>

Step 1 :

Create the classes from the WSDL you can use netbeans for this task or WSDL2JAVA command (wsdl2java [URL]) in the shell.

Continue reading JSF, Spring together with apache CXF

UDDI Tutorial : JUDDI / UDDI4J ( publish & inquiry using juddi console and uddi4j client API )

Last two weeks i was busy with my office work trying to figure out some tasks related to an EU project called sensoria. I had to integrate the Events plugin of Joomla (CMS) with Google calender (which i am hoping to write about in future) and I had to compose a case study documentation for service discovery using UDDI (Universal Description, Discovery and Integration). It took me few days to setup a test environment to get things actually working.pict_uddi_1.gif

As I saw, that in this area there aren’t many help or online tutorials.. you have to collect tits and bits from every where and put some effort to make things work..

SO yeah thats why i thought to publish a small tutorial on setting up a UDDI server and handling the UDDI4J java client API..

 

Continue reading UDDI Tutorial : JUDDI / UDDI4J ( publish & inquiry using juddi console and uddi4j client API )