Wednesday, July 14, 2010

DB2 Content Management Records with .Net

To demonstrate storing and retrieving documents from content management for .Net we’ll first look at the high level code to actually create and retrieve the file.  Then we’ll examine how to make a new class particular to the RIM Training record type.  I need to caveat everything first by pointing out that there are some assumption upfront regarding access to CM, the process for determining record attributes, and the use of NU.Configuration for encrypting accounts that will not be covered. See the Setup / Preconditions for more information.

Creating Records Content Management

Using the API the process of creating a record is straight forward and to demonstrate this we’ll use the ‘RIM Training’ record type.   First an instance of the RIMTrainingRecord is created and then the custom attributes set.  After the record information has been filled out .Create is called.  This will return the new unique id of the record (RIMTrainingRecord.Id property). Here is an example.

// TODO: Change the file to an existing file here.
RIMTrainingRecord target = new RIMTrainingRecord("Create RIMTrainingRecord Test", new File("c:\\temp\\myRecord.doc", null));
target.Keyword = "testing .Net api"; target.NUCompany = "NUSCO";
target.Date = DateTime.Now.ToString("yyyy-mm-dd");
// TODO: Change the app/web config entry to the correct creds
string id = target.Create("TestCM"); 

Note:  A full example can be found in the NU.ContentManagement.RIMTraining.Test project.  To verify that the record was created you can check the Test Content manager server*.  In the example the new File (path, mimetype) ctor can take the record mime type.  If this is left null it will attempt to set the information from the local registry.The record owner / creator (RIMTrainingRecord.Owner property) can be set as well.  If left null, it defaults to the authorization of the account running the process.  In a desktop application this is desirable.  In a web scenario they should be specifically set to e.g. User.Identity.Name.The custom attributes for the RIM Training record as Keyword, NUCompany, and Date we will look at how those are defined later.*Requires Logon
 

Retrieving a Content Management Record File

To retrieve a content management record you will need the Id property.  Existing records are created from one of the static factory methods as Bytes or saved to a file.  Simply pass the record Id to the

 RIMTrainingRecord.SaveCopyAs("TestCM", id, @"c:\drtsdemo\recordFile.doc"); 

 Creating a Custom Content Management Record Class

Now that you understand how storing and retrieving of records works you’ll need to work with the Records Information Management team to determine the best attributes for your record type.  If you’re lucky this will done by the business analystJ.  After this has been determined you will use those attributes to create a class specific to your project. To better understand this we’ll look to the RIMTrainingRecord class again.  Steps:Inherit from the content Management record class and define the XmlRootAttribute to the document type specified by the RIM Team.  

 [XmlRootAttribute("RIM_Training", Namespace = "http://www.ibm.com/xmlns/db2/cm/beans/1.0/schema")] public class RIMTrainingRecord : NU.ContentManagement.Record
 Create a public default constructor for XmlSerialization by the web service and any ease of use constructors. Override the values of the inherited abstract properties Display Name, ACL, and ItemTypeName.  These values are specified by RIM team.
[XmlIgnore]public override string DisplayName{get { return "Rim Training";}}
[XmlIgnore]public override string ACL {get { return "XRIMTRAINING";}}
[XmlIgnore]public override string ItemTypeName {get { return "RIM_Training";}}
 
 Create a custom property for each attribute and set the XmlAttribute to the exact name defined by the RIM team.
        [XmlAttribute("ZNUCompany")]  //Get from Records         [AttributeInfo("NU Company(RIM Demo only)", MaxLength = 8)]        public string NUCompany { get; set; }         [XmlAttribute("ZDate")]        [AttributeInfo("Date (yyyy-mm-dd)", MaxLength = 10,                  HelpText = " (YYYY-MM-DD)", IsDate = true)]        public string Date { get; set; }         [XmlAttribute("ZKeyword")]        [AttributeInfo("Keyword", MaxLength = 64)]        public string Keyword { get; set; }
 Setup / Preconditions:1.      Content Management record/docment type has to be setup.  a.     For this demo I used the existing ‘RIM_Training’ document type in test.  To view the document types and attributes in test goto: http://barmtstcm1:9086/eclient/IDMLogon2.jsp. 2.     The NU.ContentManagement assembly must be referenced a.     Source with examples is located in  VOB: webeas, PVOB: RIM_CM, Path: NU.ContentManagement\NU.ContentManagement\b.    Include the <system.serviceModel/> from the test project.3.     The NU.Confirguration assembly should be referenced.a.     Source located in  VOB: webeas, Path: NU.Configuration.b.    Tutorial

Rational Team Concert Proof of Concept

Rational Team Concert (RTC) is built on the open source jazz server and focuses on collaboration, visibility, and Eclipse integration.  For the day we went through 7 labs as a team member on an 11 person team working on a single application.  This exercise gave us the opportunity to use the Team Concert client (Eclipse) and the web client interface to the product. 

We went through labs for:

·         Setting up a team

·         Planning work

·         Tracking work

·         Performing and sharing work

·         SCM configurations

·         Builds

·         Changes and traceability

·         Tightening up process

During the day, I had a private meeting with Dan Gouveia and Cayce Marston who were very helpful answering questions particular to our environment.  They were aware of the current issues with the Clearcase product set and felt that the current incompatibility with Visual Studio web projects would be overcome by migrating to Rational Team Concert.  We also discussed the product set architecture, licensing, infrastructure, integrations, builds, etc..

Licensing:

·         Team Concert comes in 3 versions NU’s needs are probably best met by the standard version.  The only reason to upgrade to the enterprise version is +250 users &/or high availability.

·         End users are licensed as Developers, Adv. Change Management, or Contributor (client).   Licenses are concurrent or named.

Infrastructure:

·         The Jazz App/Web Server (WAS or *Apache) *Recommended.

·         The Jazz server also requires a database backend (SQL Server, DB2, Oracle) not covered by the licensing.

Pros: 

·         RTC has customizable workitems and workflows.  Comes with the OpenUp ~Rational Process, CloudBurst?, Scrum, Simple.

·         Requires developers to associate code changes to assigned workitems.

·         Fully http based client (will work remotely).

·         Comes with a nice set of canned project management and software engineering reports for builds and assigned work.

·         Nice search functionality that uniformly coverers all workitems.

·         Collaboration features that support SameTime and other IM products.

Cons:

·         Team Concert – uses a Subversion like proprietary source control system (NOT Clearcase**).

·         Requirements Composer – Elicit, capture and elaborate, discuss & review requirements. Is required to integrate Ravenflow.

·         No project task integration for Primavera or MS Project.  Only IBM Project Conductor.

·         No CMDB integration other than Clear Quest.

·         Doesn’t support .Net builds without custom integration. 

·         Doesn’t support remote controlled builds without customization or additional 3rd party products.

**Two ways of working with Clearcase

1. Synchronize.  Bi-directional (e.g. nightly).

2. Bridge.  Checking out of CC through version some performance and network considerations.

Conclusion

The overall Rational / Jazz product set is a great improvement over the current product set.  It makes improves in every area over Clearcase process, reporting, security, performance, accessibility.   However, it is in a great state of change the newer products are currently replacing the ‘Classic’ Rational products and it doesn’t offer all of the heavy source control features that Clearcase does.

There is great potential for this type of ALM product and it will be a part of our infrastructure within the next few years.  We will need to look at our existing tools and processes to determine the best and hopefully least disruptive means of getting there.