Tag Archives: DFS

Documentum Foundation Services

Dynamic value assistance using DFS

Continuing my collaboration with John Sweeney (or his collaboration with me), today we’ll examine the DFS Schema service and do so in .NET as a direct-to-WSDL consumer. This tutorial builds upon a previous tutorial; so, if you’re not already familiar with it, please read this post and play with this sample. You’ll also need and be familiar with using Documentum Administrator (DA) and Documentum Composer 6.5 SP1.

Thanks to John for doing the legwork in this tutorial and for allowing me to share it all with you here. (Although, I’d really like to see John blog about this directly; he has a lot to share.)

Not only can the DFS Schema service return value-assist values, it also supports dynamic value assistance, including the handling of dependencies (e.g. one attribute value-assist dynamically built based on the value of another attribute).

This tutorial demonstrates how to use the DFS Schema service to perform dynamic value-assist tasks. Knowledge of Documentum Administrator, Documentum Composer 6.5 SP1, DFS 6.5 SP1, Visual Studio 2008 and WSDL-based consumption of DFS with .NET is assumed.

Before we begin, we’ll need to create users, groups and an object type to use as test data.

Step 1 – Create users and groups (to be performed with Documentum Administrator)

1. Create three groups named writers, reviewers and publishers in your repository.

2. Create six users. Name them appropriately, but for this tutorial, they will be referred to as User1–6. Put the users in the new groups, as specified in the following chart:

  Group   Members
  writers   User1, User2
  reviewers   User3, User4
  publishers   User5, User6

Step 2 – Create a new object type (to be performed with Documentum Composer 6.5 SP1)

1. Open Documentum Composer and create a new project.

2. Add a new type called kb_document with a supertype of dm_document.

3. Add a new attribute to the type named document_state (as shown in the following image).

4. Expand the document_state attribute and select Value mapping.

5. In the Conditional Assistance section, click New…

6. Add Draft,Review,Publish as values of Fixed List (as shown in the following image) and click OK.

Your Conditional Assistance section should now look like this:

7. Add another new attribute to the type named assigned_to as shown in the following image.

8. Expand the assigned_to attribute and select Value mapping.

9. In the Conditional Assistance section, click New…

10. Add the following query:

select users_names from dm_group where group_name = 'writers'

Set the other fields (as shown in the following image).

The value-assist list will be populated with users who are members of the writers group by default, when document_state does not have a value of Review or Publish.

11. In the Conditional Assistance section, click New…

12. Add the following query:

select users_names from dm_group where group_name = 'reviewers'

Set the other fields (as shown in the following image).

The value in the Expression field will cause the value-assist list to be populated with users who are members of the reviewers group, but only when document_state has a value of "Review."

13. In the Conditional Assistance section, click New…

14. Add the following query:

select users_names from dm_group where group_name = 'publishers'

Set the other fields (as shown in the following image).

The value in the Expression field will cause the value-assist list to be populated with users who are members of the publishers group, but only when document_state has a value of "Publish."

Your Conditional Assistance section should now look like the following:

15. Install the Documentum project to your repository.

Step 3 – Retrieve the value-assist list (using C# and the .NET Framework 3.0 or higher)

Note: the ServiceContextHeader class used in this tutorial comes from this prior sample, as noted above.

The following code snippet will return group members in the ValueAssist Values list. A PropertySet is created for document_state. The value of document_state will alter the dynamic-assist values for the assigned_to property.

// Get a reference to the DFS Schema service
SchemaServicePortClient schemaService =  
    new SchemaServicePortClient("SchemaServicePort"); 

StringProperty sp = new StringProperty();
sp.name = "document_state"; 
// assigned_to will have different dynamic-assist values, 
// depending upon the value set here
sp.Value = "Publish"; // or Review or Draft

// Create a PropertySet for document_state, which assigned_to depends upon
PropertySet ps = new PropertySet();
ps.Properties = new Property[1];
ps.Properties[0] = sp; 

using (OperationContextScope scope = 
           new OperationContextScope(schemaService.InnerChannel))
    // Add the ServiceContextHeader info to the outgoing request
        new ServiceContextHeader(repositoryName, userName, password)); 

    // Get the values for the assigned_to property
    ValueAssist valueAssist = schemaService.getDynamicAssistValues(
        repositoryName, "DEFAULT", "kb_document", "assigned_to", ps, null); 

    // Display the values
    if (valueAssist != null || valueAssist.Values != null)
        foreach (string s in valueAssist.Values)
            MessageBox.Show(s, "Value Assist Value");

The following table shows the expected results:

  document_state value   assigned_to values
  Draft   User1, User2
  Review   User3, User4
  Publish   User5, User6

It is worth noting that if you execute SchemaService.getTypeInfo for kb_document, and examine the assigned_to property, you can determine that the property has dependencies. The returned TypeInfo.PropertyInfos[n].Dependencies will contain an entry for document_state. You can check this beforehand as a way of determining if setting one property (document_state) should trigger a refresh of the value list (calling getDynamicAssistValues again). This is very useful for a picklist property page where the values of one list depend on the value of another.

Here endeth the lesson… :-)

Update 2/6/2009: In order for you to spend more time understanding dynamic value assistance with DFS, I’ve uploaded a Visual Studio project to EDN here. Enjoy.

Consuming DFS WSDL in Visual Studio

Earlier today I posted to EDN a new sample project that demonstrates consuming DFS web services directly from their WSDL in a Visual Studio 2008 environment. Right up front, I want to credit my colleague John Sweeney, who really should start blogging, with providing the original work contained in this sample. My subsequent contribution was mostly UI/UX-related. Thanks, John!

After downloading and extracting the sample to your local development machine, open the solution in Visual Studio 2008. The default code assumes that you’re running the DFS web services locally (i.e. IP and port 8080). You should, of course, modify the IP address and port to match your particular development environment.

Main sample UI

The main intent of this sample is to demonstrate various ways to authenticate via DFS. It’s worth noting that this sample doesn’t cover single sign-on (SSO) support in DFS, nor does it cover WS-Security header-based authentication. Good demos to be certain…

As the user interface (UI) above tries to clearly state upfront, content repository (aka Docbase) name cannot be null or empty, regardless of authentication approach. Given authentication via ServiceContext header, user name and password cannot be null or empty. Given authentication via ContextRegistry runtime service, when token is null or empty, user name and password cannot be null or empty, and when user name and password are both null or empty, token cannot be null or empty.

One thing that is still a bit obscure in the current UI is that authentication via DFS can be a two-step or one-step process, depending on the situation. If you choose “Via ContextRegistry…” and a Context Registry token isn’t provided to DFS, two runtime service invocations will be made. In all other cases, there is one service invocation.

Assuming that your connection details are valid given your authentication approach, this sample will (a) retrieve a repository list, (b) retrieve cabinets, and (c) retrieve content (i.e. transfer MenuItemTemplate.ini to your desktop).

A previous direct-to-WSDL DFS consumer sample I posted, targeted .NET 3.0 and WCF "v1." This sample targets .NET 3.5 and WCF "v2" instead, along with support for Silverlight 2. It accomplishes this change via LINQ to XML (e.g. leverages System.Xml.Linq.XDocument instead of System.Xml.XmlDocument).

If you need to target this sample at .NET 3.0, in addition to adjusting the project build properties, removing the project reference to the System.Xml.Linq.dll assembly, and removing the System.Xml.Linq namespace declaration in ServiceContextHeader.cs, you’ll need to change the relevant code within OnWriteHeaderContents. For example:

  XDocument doc = null;
  using (StringWriter sw = new StringWriter(CultureInfo.CurrentCulture))
      XmlSerializer xs = new XmlSerializer(typeof(ServiceContext));
      xs.Serialize(sw, serviceContext);
      doc = XDocument.Load(new StringReader(sw.ToString()));

would become:

  XmlDocument doc = null;
  using (StringWriter sw = new StringWriter(CultureInfo.CurrentCulture))
      XmlSerializer xs = new XmlSerializer(typeof(ServiceContext));
      xs.Serialize(sw, serviceContext);
      doc = XmlDocument.LoadXml(new StringReader(sw.ToString()));


Although, it’s not currently employed in the sample, there is also code to add a ContentTransferProfile to the ServiceContext header.

As always, consult the DFS Developer Guide for complete details on everything that may be passed in the ServiceContext header.

I do expect that this sample will be incorporated into the DFS SDK and DFS technical publications content; however, I wanted to get this into your hands sooner rather than later. Cheers…

This year blogging

Not including this post, I posted 50 blogs this year, which received 67 comments. Clearly, I’m not prolific (!), but I’m happy to see more comments than posts, and I’m content with roughly a post-a-week average for 2008. (For those with a young, active families and with jobs that aren’t centrally about blogging, I’d love to know how pull-off a higher posting average without impacting your quality of life and quality of work. :-) )

Blogging is a discipline, and it’s something I intend to continue pursuing in the coming year. So, with that in mind, here is how things online ranked here in 2008:

Top 10 posts written in 2008

  1. DFS tutorial
  2. CMIS – Content Management Interoperability Services – received the most comments this year
  3. DFS best practices
  4. Download PDC2008 presentations – i.e. essentially a public service post
  5. Blue Ocean Strategy – i.e. one of my book reviews (and not the one I expected either)
  6. Documentum 6.5 with services in mind
  7. DFS Object service consumer #1
  8. DFS Object service consumer #2a – second most comments this year
  9. DFS Object service consumer #2b
  10. DFC, Microsoft developers, .NET and DFC PIA – i.e. a post about pre-DFS development using Documentum in a Microsoft environment

Top 10 posts (ever)

  1. Documentum Foundation Services (DFS)
  2. DFS tutorial (see above)
  3. CMIS – Content Management Interoperability Services (see above)
  4. Ruby coding conventions, standards and best practices
  5. Spell checking Java source code
  6. Great NASA observatories
  7. DFS best practices (see above)
  8. Download PDC2008 presentations (see above)
  9. The Starbucks Experience- i.e. another book review of mine
  10. What’s new in DFS 6.0 SP1

Top three pages in 2008

  1. Music – i.e. over 3x the number of visits versus #2
  2. About
  3. Books

As 2008 comes to a close, I hope that you have a safe and hopeful new year.

Developing with DFS in an IDE

My friend and colleague Paul Warren recently posted content that talks about the creation of Enterprise Content Services (like those in DFS) in the context of an integrated development environment (IDE):

WTP support is something the Composer team is hard at work on, and this will change the nature of DFS tooling, too.

Essentially we’re working together to promote more standard developer workflow and development lifecycle by embracing tools developers already use to build services. While WTP assumes Eclipse and Composer is indeed powered by Eclipse, that doesn’t mean that Eclipse is the only IDE for Enterprise Content Service development. We’re working on changing the nature of the DFS SDK, too, to better emphasize, for example, how to use Visual Studio and Windows Communication Foundation directly to build service consumers.

What tools, including IDEs, do you use to build Enterprise Content Services and ECS-based solutions?

Documentum 6.5 with services in mind

You may have seen this week’s press release (PR) concerning the launch of the EMC Documentum 6.5 platform. Given that this blog is referenced in the PR’s sidebar, I thought it would be appropriate for me to offer my perspective on this release.

When the Documentum Foundation Services (DFS) team first embarked on its mission to better service-orient the Documentum platform, I suggested that, over time, the very focus of our daily work–services and common service infrastructure–would become less “talked about.” I suggested that services alone deliver less value than services in the context of processes and processes in the context of solutions.

So, ultimately EMC has to deliver relevant, robust solutions to market much more than just web services. This is exactly the focus of the EMC PR–and each solution discussed is built using Enterprise Content Services (ECS).

Take CenterStage (aka “Magellan”), Media WorkSpace, and My Documentum as D6.5 solution examples. One user experience differs fairly significantly from another user experience (e.g. CenterStage Essentials versus Media WorkSpace). Looking under the covers, one implementation (i.e. presentation layer and application behavior) also differs from another implementation. However, common business logic is provided to each solution via a consistent set of services (e.g. Object, Query, Schema, Access Control, etc.).

Each solution is worth its own coverage, but I will allow solution teams to accomplish this (e.g. content like this).

Instead, I’d like to focus on the progress achieved in the D6.5 release where services and common service infrastructure are concerned:

1. The number of out-the-box Enterprise Content Services (ECS) in DFS has more than doubled in 6.5, from the six to 13. The total number of ECS across D6.5 has grown nearly fourfold, from six to 23.

  • Six original services with DFS 6.0: Object (enhanced in 6SP1 to support external objects; enhanced again in 6.5 to support aspects), Query, Schema, Search (enhanced functionality in 6.5 for clusters), Version Control (enhanced in 6.5 to support aspects), Workflow
  • Seven new services with DFS 6.5: Access Control, Analytics, Comment, Lifecycle, Query Store, Task Management (WS-HumanTask), Virtual Document
  • Plus 10 additional, new services beyond (i.e. not packaged with) DFS 6.5:
    Content Delivery, Electronic Signature, ERP Integration (SAP), Federated Proxy, Formal Record, Physical Records Library, (Records Management) Policy, (Content Transformation) Profile, Retention Markup, (Content) Transformation

Bottom line #1: there are many more services with D6.5 from which to compose content-centric applications.

2. Common service infrastructure has been significantly enhanced at the same time. For example:

  • Contract first (or WSDL first) development of services is supported in addition to code first development.
  • Design time discovery of services is supported via a new service catalog or an existing UDDI v2 compliant service registry. Classification of service occurs via the concept of catalogs and categories, by default.
  • Modularity has increased at the binary (e.g. JAR file) level to promote better composition (i.e. only take what you need).
  • Single sign-on (SSO) support has been improved.

Bottom line #2: you have more options now to provide, discover and consume services.

Certainly there is a lot more to each bullet point above, and I plan to drill down into several points in future posts.

…and I didn’t even use the term “Web 2.0″…until now. :-)