Saturday, August 29, 2009

Retrieving document using DKDDO, DKLobICM and PID string

Uggh this might be cryptic and useless for some out there. But if you use IBM CM 8.4 with Type 4 JDBC driver, you may find this useful if you know what to look for. Certainly one of the more confusing IBM products. Even the name and variation of the Content Manager products make your head spin. If you have to work on this I pity you... nuff said...

Here's a snippet of codes using DKDDO and DKLobICM to retrieve a document using PID string from content manager:

public void retrieveDoc(String pidString) throws Exception {
  if(pidString == null || pidString.trim().length() == 0) {
    throw new Exception("PID string is null - nothing to retrieve.");
  }

  DKDatastoreICM dsICM = getDataStore();

  DKDDO ddo = dsICM.createDDOFromPID(pidString);
        
  DKRetrieveOptionsICM retrOpts = DKRetrieveOptionsICM.createInstance(dsICM);
  retrOpts.baseAttributes(true);  // Get Base Attributes
  retrOpts.partsList(true);       // Get the parts
  retrOpts.resourceContent(true); // Get the document content

  ddo.retrieve(retrOpts.dkNVPair());    // Retrieve from content manager

  // Get the Dynamic Data Objects (DDO) parts 
  DKParts parts = null;
  short dataID = ddo.dataId(DKConstant.DK_CM_NAMESPACE_ATTR, DKConstant.DK_CM_DKPARTS);
  if (dataID != 0) {    // 
    parts = (DKParts)ddo.getData(dataID);
  } else { // The namespace or data-item name (parts) is not found
    throw new Exception("The document parts not found for pid: " + pidString);
  }

  // Get the base ICM content from the parts.
  DKLobICM icmBase = null;
  if(parts != null) {
    // Iterate through the parts.
    // Whoever develops the IBM java libraries isn't a Java guy, probably a C++ guy
    // All Java developers know Class names started with a capital letter.
    dkIterator iter = (dkIterator) parts.createIterator();
    while (iter.more()) {
      DKDDO d = (DKDDO)iter.next();
      if(d instanceof DKLobICM && ICMBASE_OBJECT_TYPE_STR.equalsIgnoreCase(d.getObjectType())) {
        System.out.println("Found ICMBASE object with mimeType: " + ((DKLobICM)d).getMimeType());
        icmBase = (DKLobICM) d;
      }
    }
  }

  // Did we find the ICMBASE object? If yes, and it has content, write it to an external file.
  if(icmBase != null) {
    byte content[] = icmBase.getContent();
    if (content != null) {
      OutputStream os = new FileOutputStream(new File("testdoc2.tiff"));
      os.write(content);
    }
  } else {
    System.out.println("Oops... can't find the document with pid: " + pidString);
  }
} 
Off course the entire code set is more complicated. This is just snippet after all.

Tuesday, August 18, 2009

VMware acquired SpringSource


According to Steve Herrod, VMware's CTO, here's the common goal for the acquisition: "
Our common goal is for developers to easily build their applications and move from coding to production execution as seamlessly as possible… regardless of whether they will be deployed to a small internal datacenter for limited use or to a completely external cloud provider for much larger scale audiences"

Here's the llink to vmware's blog: http://blogs.vmware.com/console/2009/08/vmware-acquires-springsource.html

Rod Johnson said the following about the merger:
"Working together with VMware we plan on creating a single, integrated, build-run-manage solution for the data center, private clouds, and public clouds. A solution that exploits knowledge of the application structure, and collaboration with middleware and management components, to ensure optimal efficiency and resiliency of the supporting virtual environment at deployment time and during runtime. A solution that will deliver a Platform as a Service (Paas) built around technologies that you already know, which can slash cost and complexity. A solution built around open, portable middleware technologies that can run on traditional Java EE application servers in a conventional data center and on Amazon EC2 and other elastic compute environments as well as on the VMware platform."

His post can be found at: http://blog.springsource.com/2009/08/10/springsource-chapter-two/

And Adrian Colyer, SpringSource's CTO blog post about the acquisition can be found here: http://blog.springsource.com/2009/08/13/virtualization-enterprise-java/

Monday, August 17, 2009

Cash tossed onto freeway

You would think cash - real cash... tossed onto freeway happened only in movies? You haven't been to Southern California! You'd think in this kind of economy cash would be gripped so tight you can't even pry it off from a dead cold hand. Well, apparently not so when the cash owner is mentally unstable.

The man reportedly tossed money away from his car while on interstate 210 along Glendora/Azusa about 25 miles out of Los Angeles. About 10 people is said to ran into freeway traffic to get the cash, causing traffic jam.

The CHP managed to recover about $1000. The Authorities have asked the rest of the money to be returned.

Here's the link to the San Gariel Valley Tribune where the news is reported: http://www.sgvtribune.com/weirdnews/ci_13144078

Sunday, August 16, 2009

What is Service Oriented Architecture (SOA)?

Here's a youtube video that provides an animatic explanation on Service Oriented Architecture (SOA) seems to be quite simple and easy to understand for those wondering what SOA is all about.

Saturday, August 15, 2009

Is SOA dead?

An obituary on SOA was written on the Burton Group blog post at the turn of this year. This subject has been propagated over the net so many times over. The idea is the economy hurled a massive comet into the SOA universe and freeze it into an ice age.

According to the post, "With the tight budgets of 2009, most organizations have cut funding for their SOA initiatives." Which also said, "SOA is survived by its offspring: mashups, BPM, SaaS, Cloud Computing, and all other architectural approaches that depend on 'services'".

I can accept some of the points mentioned, but somehow I got a feeling that there are others who simply "forget" that SOA is dead.  Service-Oriented is an architecture. Talking about how various systems are inter-connected via services, is... talking about a Service-Oriented Architecture ie: SOA. At JavaOne this year, topics on SOA still has loads of audiences.  While it's understandable that many adopters out there got hang up on the term SOA rather than focusing on the "service oriented" part, SOA is still alive and well.

While I agree that mashups and cloud computing has gained significant audience from the masses, after almost the same amount of time to prepare the birth of a baby, the report on the demise of SOA seems a little premature. Give it another wave of financial meltdown in the stock market and the big boys selling expensive solutions may start to wither lacking its food source.

The "free" renegades of the solutions, just like anything viral and nimble will rebirth itself as the survivors of the industry. The needs to provide bridges between the old and expensive to the new and agile by focusing on systems inter-connectivity using services will keep the architecture alive absorbing solutions that make sense for SOA to keep going.

Friday, August 14, 2009

Agile Best Practice of Continuous Integration (CI)


Setup an integration build environment that triggers every 5 minutes! That type of instruction will send your head spinning pretty fast if you don't see what's exactly involved. The purpose of doing so is for a best practice of Agile Software Development called Continuous Integration. For those practicing Agile, this is a familiar term. If you've done iterative software development before, you'll value the need for a continuous integration.

How in the world are you going to trigger a build every five minutes? The next guy wouldn't get a chance to send in his changes! Well, that's exactly where the strength of CI is. Anything missing from the build will become apparent very quickly and the culprit can be quickly chastised if necessary. =) The idea is to find integration errors and tests failure ASAP before the procession of events get further away and costs more to fix.

Martin Fowler introduced CI as follows: "Continuous Integration is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily - leading to multiple integrations per day. Each integration is verified by an automated build (including test) to detect integration errors as quickly as possible. Many teams find that this approach leads to significantly reduced integration problems and allows a team to develop cohesive software more rapidly." (read more here)

The frequent code check-ins and automated build execution helps tightened the feedback cycles to increase software quality. This means not only developer's feedback cycles are increased, it will also increases business users and stake holders satisfaction of the product. Less bugs means less problem at demos and less iritation to the stake holders, which hopefully generates constructive improvement requests.

Back to the crazy 5 minutes automated build frequency, this does not mean the automated build will terminates itself and checkout new codes before it finishes its cycle. Rather the CI mechanism will check if any new changes can be detected in the source/version control system. If there's any new changes then the automated bulid will run until it finished and then wait for the set frequency (in this case 5 min.) and repeats the process. If no changes is detected, then no build is executed.

Tuesday, August 11, 2009

Apache Maven Basics Video

If you are new to Maven, you may want to read this article written by John Ferguson Smart published by JavaWorld. It's a little old, written at the end of 2005, but I think its still cover the basics of Maven 2. I attended John's session at JavaOne 2009 and I liked it.

There's a video on you tube covering Generating a basic project in Maven 2. I embed it below.

Friday, August 07, 2009

Guidewire ClaimCenter Development with Agile, Scrum, Maven and SOA


One of the project that I worked on was an implementation of Guidewire Software's ClaimCenter. The project went live successfully thanks to the great collaboration of the entire team. The team was small but the spirit of collaboration was great. While there will always be some pain in any development project, the project which consist of replacing a legacy insurance claim system went relatively very well.

The project implemented Agile Software Development Methodology which help in getting the business logic implemented and adjusted for change quickly when necessary. The usage of monthly sprints helped in establishing delivery priorities and help stakeholders to quickly confirm if they are getting what they expected or not. This type of quick feedbacks are crucial for the success of the project as changes can be made early enough before it gets to costly to change.

The project also uses morning Scrums. While these can be informative for stakeholder representatives, personally it can get annoying when there are those who will start to ramble about some nonsense no-one else care about, or when it get long and we get stuck in a hot, stuffy and claustrophobic room.

I would think integrating services such as Twitter to broadcast updates would be more "high tech" and efficient if the company didn't block it. I can understand that there will be those who may abuse such availability, but for the rest of us who can use such technology responsibly, it's a loss of technological opportunity. The uses of technology such as Twitter can be extended for example as: build notification, support request and transmission failure notification. While security may be an issue there are ways to code message in such a way that security need not be breach. After all, not all broadcasts have to be made public.

Our usage of "SOA wannabe" technology - a partial implementation of a full blown SOA concept help in bridging our clunker-of-technology to work with the brand-spanking-new ClaimCenter implementation. The old and the new can be made to play well with each other. The complexity of interaction between so many different subsystem can be abstracted and different technology were made to integrate seamlessly. It's just a beautiful orchestration of technologies.

One base technology which initially hit a resistance, mainly for a lack of support from Guidewire Software is using Maven2 as a build tool as oppose to Ant. The project in a some sense was "dragged kicking and screaming" to use Maven. There was initial unhappiness and resistance for the change. Now, however, after live deployment, it is proven that using Maven simplifies the process of maintaining the build process and take most of the tedious hardwork off the process. The declarative approach of Maven - compared to the task-centric approach of Ant - significantly reduces the need of maintaining build files. Just another proof that having a bit of forward vision does not always pay off initially but might pay well later on.

Tuesday, August 04, 2009

Java Technology Concept Map


We've all heard about looking into a map to know where you're going. For those of you who are new to Java (and still wanted to embrace it as a career path) take a look at this Java Technology Concept Map to get an overview of the Java landscape. You can then decide where your learning path is going to be and what you may need to touch to get there.

Looking at the map alone may overwhelm you, but it's much better than just being a confused wanderer. So, to my buddies out there that kept asking me to teach you Java, look at the map - then start getting into the specifics of what you need to do to move on and make sure you get your Object Oriented Analysis concepts nailed down too.

Here's the link to the Map at Sun's site (require flash): http://java.sun.com/new2java/javamap/intro.html

And here's the link to the pdf version of the map: http://java.sun.com/new2java/javamap/Java_Technology_Concept_Map.pdf

* free photos for your blog