Friday, January 21, 2011

UCM 11g: Desktop Integration Suite Walkthrough - Adding custom metadata to Office properties



Here’s a quick post to show the added power of the DesktopTag component which comes bundled with the Desktop Integration Suite.

DIS 11g allows for much more dynamic and flexible handling of native content. One of the mechanisms used to do this is Outside In’s BitLocker SDK (acquired by Stellent in 2006). The containing jar can be located here:

../<middleware_home>/Oracle_ECM_prod/ucm/idc/components/OracleCleanContent/libs/java/CleanContent.jar

This SDK is typically used by UCM to clean content of hidden metadata, revisions, comments, etc; but, in this case, it is being used to embed metadata information into the content’s native format.

The metadata usually embedded by the DesktopTag component are:



  • DISidcName
  • DISdID
  • DIScgiUrl
  • DISProperties
  • DISTaskPaneUrl
  • DISdUser
  • DISdDocName



All of these are what you expect them to be, except the TaskPaneUrl, which is a url to the DESKTOP_DOC_INFO service for the specific document.

These variables work together to determine the validity of the current doc compared to the version currently within the content server. For more information on DIS and its new features, please see:

http://download.oracle.com/docs/cd/E14571_01/doc.1111/e10624/c01_introduction.htm#BABHAEHF
 






Now that we’ve had a quick peak under the covers of DIS, let’s see how we can leverage that for our own custom metadata.




The DesktopTag component sets a number of environmental variables. One of the variables is DesktopTagFieldsCustom, but it’s currently commented out. So let’s create our own component to set this variable.

You can get a look at my sample component here.

This component overrides all values to allow testing, but specifically, focus on the following:


DesktopTagFieldsCustom=xComments,xkeywords(Keywords)

This test implements two different syntax options: standard & special syntax, as defined in the original cfg:
# Special syntax: binderName(propertyName)
# Example: dID(DISMyId) will create a custom property named DISMyID with
# the value of dID.


For our customization, we’re adding xComments and xkeywords to the list of embedded metadata. We want to leverage this metadata, which is managed within the content server, within our native content. I will be demonstrating using Microsoft Word, but this technique should work with any compatible application.




  • To start, let’s create a new blank Word document




  • Now, let’s add some static text.


I have added some static text to the header & body


  • At this time, we'll add a quick part for the keywords. This is a standard Word property.
    • Place the cursor after the "Keywords:" text
    • Click on the Insert Word Ribbon (i.e., the menu tab)
    • Click on  Quick Parts à field










      • Could also shortcut buy using Quick Parts à Document Property à Keywords
    • Click on “DocProperty” in the Field Names list
    • Click on “Keywords” in the Property list
    • Click Ok


  • Note: Nothing appears immediately in the document as there are no keywords assigned

  • Commit doc as new to UCM, applying metadata as it is checked in. specifically the comments and keywords.



  • Open the document from UCM


  •  Note: Nothing appears in the document, but this time it’s specifically due to Microsoft Word not auto-updating Quick Parts
    • Out of the box, Word would require right-clicking and manually updating each field.

  • Now that we have opened the document via DIS, our custom UCM metadata have been applied as Word properties


    • Notice the value of “under review” for the DISCxCo… property
    • Also notice that because we targeted our custom UCM metadata at a standard Word property, it appears in the standard field


  • Let’s add our custom property now:
    • Place the cursor after the “Status:” text in the header
    • Click on the Insert Word Ribbon (i.e., the menu tab)
    • Click on  Quick Parts --> field
    • Click on “DocProperty” in the Field Names list
    • Click on “DISCxCommets” in the Property list
    • Click Ok 



  • Now both of our values are showing in the document 



  • To show the lack of auto update, let’s save the document and update the metadata
    • On the Oracle UCM ribbon, click Check In With Metadata
    • Alter the Comments & keywords 


    • Click Ok
  • Re-open the document from UCM
    • On the Oracle UCM ribbon, click Open
    • Search for your document
    • Select it to be opened

  • Notice that the metadata values did not update automatically.
  • It appears that this is a often encountered issue as Microsoft has put out a support article addressing it.
    • http://support.microsoft.com/kb/832897/en-us
    • We will use the Method 2 workaround, Creating a macro to automatically update the field
    • The step-by-step procedure is listed on Microsoft’s site, so I’ll skip that for now 



  • Save & reopen from UCM

  • Notice that the metadata is applied automatically. 




Thanks it, now we have a word document that receives updates from UCM during each re-open. This ensures that any metadata applied to a document is current during each edit session.


Get a copy of the SenaDIS component here.


Thanks again for reading & I hope you've found some part of this useful and perhaps even reusable.


Disclaimer: The code, opinions, and other content on this page are my own and are not necessarily representative of my employer. There is no expressed support for any code contained herein. Most code supplied within these pages has been created to proof out a specific concept or to show a specific case. No code should be considered production-ready without your own testing and validation.