Introducing Java Code Generator 1.0 A Utility to generate Java Beans from Documentum Objects


Java Code Generator generates Java classes from Documentum Object types. Few bullet points about what this utility does

  • Generates Java Classes from the Documentum Object types
  • All non-inherited Attributes will be member variables of the Generated Java Class
  • An array of the Object type for Repeated Attributes.
  • Class name by default will be capitalized name of the underlying Documentum object type
  • Option to prefix and suffix class name
  • Option to specify the Package name
  • Supports DFS Annotation

After a couple of Beta versions finally, I am glad to announce The Java code Generator. Thanks a lot for all who tried this and send the valuable feedbacks to me. I tried to incorporate most of the suggestions and fix many of the bugs in this version

 I have added a new DFC version of this tool to the download page.

Click here to Go to Downloads page

Data Dictionary in Documentum


As you all know Documentum is all about Objects and its attributes, Have you ever wondered where Documentum is storing information about its Object types and its attributes?

To get the answer to this question you should know more about Data Dictionary in Documentum. Let me walk you through some of the important aspects of Data Dictionary in this study note.

What is the use of Data Dictionary

The following is a partial collection of the information about an Object type that will be stored by Data Dictionary Attribute label, help and other information (Localized), Default Attribute values, Value Assistance, Value Mapping, Constraints, and Default lifecycle of that object type. A Documentum client application can leverage this information to build the Presentation layer for that Object type and also provide some business rule enforcement.

Another interesting point about Data Dictionary is that it supports multiple locales, which means you can have multiple locale configured for each object type. Each locale represents a geographical region.

Imagine an Organization that has offices in Paris, Spain and US , The Data Dictionary allows you to store each  Attribute label information in all three languages and  the Client application (e.g.: WebTop, or a Custom UI) can fetch for the specific labels in the language of that region and display it to the user.

More about Data Dictionary

Let’s see some of the useful features of Data Dictionary here, above I mentioned some of the information that you can store in the Data Dictionary, let’s see some of these in detail for a better understanding. First, we will see all UI related and then we will see some business rules and functionalities that you can enforce through the data dictionary

UI Related

1) Default Values for Attributes

During the Creation of an Object type or upon its modification you can specify the default value of that Attribute, which means if no value for that attribute has been specified by the user this default value will be set as the attribute value

2) Value Assistance

Value assistance is used to provide a user with a drop-down list of possible values for that attribute. This can be even conditional, means upon selected criteria the values in the value assistance can be changed (Conditional Value Assistance)

Another important point about Value assistance is the values used for Value Assistance can be a fixed list or based out of a DQL query that runs dynamically.

3) Value Mapping

Value mapping is another useful feature where a value can be mapped for another, this works as a Key-Value pair, for an example consider this list used for Value mapping New Jersey – NJ, New York – NY, and New Hampshire – NH.

This option provides a possibility of a user being displayed with the Complete State name in the UI and Value stored will be just the state code.

4) Internationalization of Various Texts

If you look at the WebTop or Any Documentum UI application (Not necessarily a custom build User Interface) you can see there are a lot of information like labels, error messages, help information etc, these text bits can be stored for different locales in the Data Dictionary. Different locale means different languages. So this helps to build a single UI for a global application and support multiple languages.

Business Rule and Functionality

1) Lifecycles for an object type.

During the Creation or modification of an object type, you can specify a lifecycle as the default lifecycle of an object type. This eliminates the pain of searching for a lifecycle name or its ID to attach it to the newly created object; User can do it by using keyword default at the time of attaching a new Object instance to a life cycle.
But the important point to note here is just by specifying a default lifecycle an object will not be attached to its default lifecycle. The Creator or the application has to specifically attach that object to the lifecycle.

2) Constraints

You can do validation of a property by adding constrains to it. The possible types of constraints are the following. An important point to note here is Content server does not enforce these constraints even though you define in Data Dictionary. Typically the Client application should read these constrains and enforces it.  You can also specify the localized error messages in for the validation error in the Data Dictionary.

a) Primary key
Primary key should be added in combination with not- null constraint. Primary keys are inherited. One or more attributes can make primary key but only single value properties can be a part of it. One object type can have only one primary key definition, (But can have more if it inherits primary key from its supertype). Primary key constraints can be either the object type level or the property level. If the key has more than one participating properties it should be defined at the type level. If the key is a single property then it’s a good idea to define it at the property level.

b) Unique Key
A unique key constraint is used to enforce a property or combination of properties for which all the object of that type should have a unique value. The key can be a combination of one or more

single-valued properties or one or more repeating properties which are defined in that object type itself (Not Inherited). Another important point is the key for a Unique constraint cannot be a combination of single-valued and repeating properties. These are inherited too.

c) Foreign key
Foreign key constraint identifies a relationship between one or more properties for one object type and one or more properties in another. The number and data types of the properties in each set of properties must match. Foreign key constraints can be at object type level or at the property level. It should be defined at type level If the key has two or more participating properties. Also, both object types must be set in the same repository, and corresponding parent and child Properties should be of the same data type.

d) Not Null
A NOT NULL constraint sets on a property that will not allow having a null value. It can be defined only at the property level and only for single properties

e) Check
Check constraints are used for validating data. An expression or script can be provided in the constraint’s definition that the client application can run to validate a given property’s value. This can be on Object level or Attribute level

How is Data Dictionary modified

Data Dictionary modification can be either adding a new Object type information or can be modifying existing Object type information.

For adding a new Object type and its any of the above-mentioned details can be done by either calling CREATE TYPE DQL Script or by creating a new type in a new or Existing DAR and deploying it.

Modifying the Existing Object type information can be done by editing type information in the doc app or DAR or by calling Alter type DQL script.

Please note that DAR or Documentum Archive is applicable only for repositories those are running on Documentum 6 or higher

Data Dictionary Publishing Job

When you update the Data Dictionary it, in essence, updates the internal object types and you need to run Data Dictionary Publishing job. This job is responsible for creating the necessary dmi_dd_attr_info , dmi_dd_type_info  and dmi_dd_common_info objects. You can configure and run this job from Documentum Administrator.

What makes a Data Dictionary

I had mentioned three object types that are getting created when the Data Dictionary publishing job publishes the Data Dictionary information. Let’s see those objects briefly here

dmi_dd_common_info
This object type contains information about an object type or an attribute that are common. All the objects of this type will have r_object_id starting with 68.

dmi_dd_type_info
This is a subtype of dmi_dd_common_info. This object type contains information about an object type. (which has already been published in the data dictionary) All the objects of this type will have r_object_id starting with 69.

dmi_dd_attr_info
This is a subtype of dmi_dd_common_info. This object type has information about a property (which is already published to the data dictionary) All the objects of this type will have  r_object_id starting with 6a.

You would have noticed that all these object types starts with keyword dmi this means we cannot create or modify this object type, Only Data Dictionary publishing job can modify or create this type.

Download this Study Note (PDF)

Documentum Object types Naming Convention


All Out of the box Documentum object types follows the following naming convention

  • All object types that are commonly used and visible to users starts with letters dm (Example dm_document, dm_sysobject, dm_user )
  • All Object types that are dynamically cached (means changes to it is visible to applications and users) starts with letters dmc  (Example dmc_completed_workitem dmc_jar dmc_java_library )
  • All object types that read only will start with letters dmr There are only object types that starts with letters dmr they are  dmr_content and dmr_containment
  • All Object types that are internally used by Content server starts with the letters dmi (Example dmi_package, dmi_queue_item, dmi_session)

Immutable Objects in Documentum


Immutable objects are those objects, which cannot be changed. That means (most of the) properties or contents of these objects cannot be edited.  I had discussed few points about immutability on my notes about Virtual Documents. Lets see some other aspects of Immutability here.

 Now lets see how can we make an object immutable and what are the exception to it

  1. Versioning an Object (Sys object or any sub type of Sys object)
    When an Object is versioned (made a new version by check in) the old version of the versioned object becomes immutable
  2. Branching an Object
    When you branch an Object the parent of the new Branched object becomes Immutable.In both the cases mentioned above Immutability of an object is controlled by an attribute with Boolean value called r_immutable_flag, which is part of dm_sysobject . Content server sets the r_immutable_flag to true on the old version of the object in both these cases.
     
  3. Retention Policy
    If the Object is governed by a retention policy that makes its immutable then also the r_immutable_flag to true making the Object immutable.
  4. Freezing a Document by calling freeze()
    Freeze method is used to explicitly set a object as immutable. When you call freeze method it sets r_immutable_flag to true and also sets r_frozen_flag to true.
    Setting r_frozen_flag to true indicates that freeze method is called on that object. In other words r_frozen_flag is set to true only if freeze method is called on that object, not by versioning branching etc.
    Unfreezing a Document
    Unfreeze
    method sets the value of r_frozen_flag to false and also r_immutable_flag to false and hence makes that object mutable again

Freezing and Unfreezing a Virtual Document
If you chose to freeze an associated snapshot in a Virtual Document, the r_has_frzn_assembly attribute is also set to TRUE on that Virtual Document object.

When you freeze a snapshot r_immutable_flag attributes for each component in the snapshot is set to true and also value of r_frzn_assembly_cnt is incremented. The r_frzn_assembly count attribute contains a count of the number of frozen snapshots that contain this component.

If value of r_frzn_assembly_cnt is greater than zero, you cannot delete or modify the object.

Calling a Freeze method to freeze a snapshot automatically freezes the document with which the snapshot is associated. To freeze only the snapshot and not the document, first execute a Freeze method and include the argument to freeze the snapshot then execute an Unfreeze method to unfreeze only the document.

Exceptions

Even though if an Objects is set to immutable there are some attributes of that object that can be changed, lets see what all are those attributes are

 These are the attributes that content server can change on a immutable Objects

  • a_archive 
  • i_isdeleted 
  • i_reference_cnt 
  • i_vstamp
  • r_access_date 
  • r_alias_set_id 
  • r_current_state
  • r_resume_stat
  • r_frozen_flag
  • r_frzn_assembly_cnt
  • r_immutable_flag
  • r_policy_id

There are few attributes that an application or a DQL can change on a Frozen Object

  • i_folder_id
  • a_special_app
  • a_compound_architecture
  • a_full_text
  • a_storage_type
  • Version label (r_version_label) Symbolic labels only
  • acl_domain
  • acl_name
  • owner_name
  • group_name
  • owner_permit
  • group_permit
  • world_permit

Changing i_folder_id means you can link or unlink a Frozen document with any folders or cabinets)

 Download this Study Note (PDF)

Difference between Super User and Sysadmin


Most of the budding Documentum developers get confused about the differences between a Super User and a Sysadmin. Though I had mentioned these points on my Documentum Security notes PDF file, I feel this needs a separate entry here. So just listing few important privileges of Sysadmin and Super User here. This list is not exhaustive but I guess I have most of it here, if you feel that I missed some important please feel free to add it as a comment.

Sysadmin

  • Create, alter, and drop users and groups
  • Create, modify, and delete system-level ACLs
  • Grant and revoke Create Type, Create Cabinet, and Create Group privileges
  • Create types, cabinets, and printers
  • Manipulate workflows or work items, regardless of ownership
  • Manage any object’s lifecycle
  • Set the a_full_text attribute

 The Sysadmin privilege does not override object-level permissions

 Super User

  • Perform all the functions of a user with Sysadmin privileges
  • Unlock objects in the repository
  • Modify or drop another user’s user-defined object type
  • Create subtypes that have no supertype
  • Register and unregister another user’s tables
  • Select from any underlying RDBMS table regardless of whether it is registered or not
  • Modify or remove another user’s groups or private ACLs
  • Create, modify, or remove system ACLs
  • Grant and revoke Superuser and Sysadmin privileges
  • Grant and revoke extended privileges
  • View audit trail entries

Download this Study Note (PDF)

Federation in Documentum


Federation is one among the most common distributed Documentum model. This means multiple Documentum repositories run as a federation. There will be a Governing repository and multiple member repositories in this model. Lets try to find out more about Federation

 

Take this typical scenario A Major Pharmaceutical Company ABC Corporation has multiple research centers and production plants across the glob and they have multiple Documentum repositories used for storing various information. A user logged into a corporate application needs to fetch documents from these various repositories in a Single session. Each repository in this scenario should have same set of users, groups and ACL for this architecture to work, manually managing these kind of scenario is trouble some and error prone.

 

Now lets see what a federation can do to make it less complex.

As I mentioned above Federations consists of Governing and Member repositories all the changes that has been made to global users and groups and external ACLS in the governing repository are automatically reproduced in the member Repository.

 

Requirements for Federation

·         Object types definition should be same in the all participating repositories.

·         User and group definition should be same in all participating repositories.

·         The server on which governing repository runs must project to the connection brokers at the servers where member repository runs

·         The server on which member repositories runs must project to the connection brokers at the servers where governing repository runs

·         If any of the participating Content Servers are with trusted server licenses Either
The servers should be configured to listen on both secure and native port or
The secure connection default for clients allows the clients to request a connection on a native or secure port

 

Few Bullet points about Federation

·         Any alteration done to any of the object type will not be automatically pushed to the participating repositories

·         Only users or groups marked as Global while creating them will be pushed / synchronized with participating repositories

·         The users those are part of any object types that are extended from dm_user will not automatically pushed. This will happen only if you specify this type in the Federation configuration.

·         Each repositories can be part of a single federation

·         A federation may contain different Content Server versions

·         A federation may contain a mix of trusted and non-trusted Content Servers.

 

 Download this Study Note (PDF)

Non Qualifiable properties and Property Bag in Documentum Objects


Before getting into details of Property Bags lets quickly see what are Qualifiable and Non-Qualifiable properties?

 

Qualifiable Properties

Most of the Object attributes are Qualifiable properties. The properties are qualifiable if it is saved (persisted) in a column of that Objects underlying tables (_r or _s table) in the Database. Attributes are Qualifiable by default.  I am not getting into much detail of Qualifiable properties here. See the following link for more on this

 

Object Attribute :- Repeated and Single Value Attributes in Database

 

Non – Qualifiable Properties

These Attributes of objects does not have column of its own in the Object’s underlying _r or s tables. They are saved in the serialized format in the i_property_bag property of the underlying object. See the below noted bullet points that reveal some interesting facts about Non – Qualifiable attributes.

 

·         Though these properties can be returned using a DQL Query, this cannot be used in the Qualifying clause [in Where Clause of the Query]. The Exception to this rule is that Non-Qualifiable properties can be used in the where clause of FTQL queries

·         These properties can be full text indexed.

·         IF the Non-Qualifiable properties are part of the select part of the Query, the query should have r_object_id in the select list.

·         If a property is Non-Qualifiable and it is of type String the length of that attribute must be less than the value of max_nqa_string key in the server.ini (Only if this key has a value set in server.ini) (The default value is 2000)

 

 

Lets See Few Related DQL’s

 

The following DQL creates an object type mycustomtype with first name a Qualifiable Attribute and country a Single Non-Qualifiable attribute and phone a Non Qualifiable Repating attribute.

 

CREATE TYPE “mycustomtype” (“firstname” string(64), country string(64) NOT QUALIFIABLE, phone string(10) REPEATING NOT QUALIFIABLE ) WITH SUPERTYPE “dm_document”

 

The following Query will create an object of type mycustomtype (You may notice that there is no difference in the create Query when compared with Qualifiable Properties

 

CREATE mycustomype OBJECT SET “firstname” = ‘Hello World’, SET “country”= ‘US’, SET phone [0]= ‘1111111111’

 

The following Query will return the Attributes from mycustomtype.
Note:
Make sure that you have r_object_id in the select query if you have non-Qualifiable attributes otherwise you will get following error
DM_QUERY2_E_MISSING_OBJECTID_IN_SELECT_LIST

 

Select r_object_id, firstname, country from mycustomype;

 

What is Property Bag

Property bag is a relatively new term in Documentum. This is a property, which is used to store other properties and values of an Object.  Non Qualifiable properties and its values of an Object is stored in its property bag (both Single and Repeated)

Other than Non-Qualifiable properties Property bag can also hold Properties and values of Aspect if the aspect properties are enabled with OPTIMIZEFETCH.

 

i_property_bag and r_property_bag

 

The i_property_bag property is defined in dm_sysobject , This Attribute is of datatype String and  can hold up to 2000 characters. This makes sure that all the object types that are inheriting from dm_sysobject have the ability to have its own property bag.

 

In the scenarios where you don’t have a Parent type defined in the Object definition and you create a non-Qualifiable attribute this property is automatically added to the object type.

 

If you add property bag to an object type it can never be removed from that object type.

 

The r_property_bag is silently added to the Object’s type definition when we add i_property_bag. This repeating attribute property is used to store the overflow from the i_property_bag. That means if the names and values of properties stored in i_property_bag exceed 2000 chars, the overflow is stored in r_property_bag. This is repeating string property with 2000 characters.

 

Download This Study Note (PDF)