Archive for the 'Documentum' Category

Flying Squirrel Developer

Flying Squirrel Developer

After reading about interesting style of time management in household I got an idea how to apply it for the development process. “Fly housekeeper” - according to this style you not pay at once much time to keep your house clean. Instead house is being divided into several zones and for each zone separate day is assigned. So during a week you pay small amount of time 15-20 minutes each day to keep this zone clean. With such technique you may keep your house clean and pay just 15-20 minutes per day(but this is 2 hours per week!).

I believe most of developers have a hive of ideas in their heads, but it is always lack of time for their implementation. I want to apply the above technique with some modifications to one bee from my hive.

The idea I want to implement - this is create an open source tool to import files into Documentum repository. I do not have much time to work on it, but I will try to work one hour per day on it’s implementation, so during week this will be about a full working day. I will put a weekly progress report here which is also will be some kind of self-motivation for me.

No Comments »

Documentum Docbase Swing Tree

How To Make a Tree

Do you like trees? I do, I like to spend time in forest, take a walk, listen trees.

Small article how to present Documentum docbase structure using the Swing tree. Example quite simple, but easy to understand and provide some basic functionality.

Well, Documentum structure has two types of object’s Folders(dm_folder) and Documents(dm_document). Folder may include other folders or documents. In the root of the structure always represented as Cabinet(dm_cabinet) which is subclass of the folder.

Here is a basic class diagram which will define the tree model structure:
Swing Model Class Diagram

DocumentumNode is an abstract class which is require to implement the following functions and do almost all Documentum stuff


protected abstract String getChildrenDocuType();
protected abstract String getWherePart();

DocbaseNode return as a children type dm_cabinet, FolderNode return dm_sysobject which is base type for dm_folder and dm_document and DocumentNode return null because it can’t have children(well, it is not really so, because document can be a virtual document, and you may extend it if you need this functionality)

DocumentumNode build children list after the first request, so the tree will fetch children in a lazy style. The following function do the job


private void initializeChildren() {
initialized = true;
IDfSession session = null;
IDfCollection collection = null;
try {
session = manager.getSession(docbase);
IDfQuery query = new DfQuery();
query.setDQL("select r_object_id,r_object_type,object_name from "
+ getChildrenDocuType() + " where 1=1 " + getWherePart());
collection = query.execute(session, IDfQuery.DF_READ_QUERY);
while (collection.next()) {
String objectId = collection.getString("r_object_id");
String objectName = collection.getString("object_name");
DocumentumNode child = factory.create(manager, docbase, objectId, objectName, this);
if (child != null) {
add(child);
}
}
} catch (DfException e) {
} finally {
FinallyClose.close(collection);
FinallyClose.close(session);
}
}

Nothing special, right? The FinallyClose class care about collections and sessions resource leak.


public class FinallyClose {
public static void close(IDfSession session) {
if (session != null) {
session.getSessionManager().release(session);
}
}
public static void close(IDfCollection collection) {
try {
if (collection != null) {
collection.close();
}
} catch (DfException ignore) {
}
}
}

Finally, here is an example which is show how to see this Docbase tree in a work. Note, that it will show documents under folders, if you don’t need it, just change model.setShowDocuments(false) and tree will display only folder structure.


IDfSessionManager manager = new DfClient().newSessionManager();
manager.setIdentity(docbase, login);
JFrame frame = new JFrame();
frame.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e) {
super.windowClosing(e);
System.exit(0);
}
});
Container panel = frame.getContentPane();
panel.setLayout(new BorderLayout());
DocumentumTreeModel model = new DocumentumTreeModel(manager,docbase);
model.setShowDocuments(true);
panel.add(new JScrollPane(new JTree(model)),BorderLayout.CENTER);
panel.setPreferredSize(new Dimension(300,500));
frame.pack();
frame.setVisible(true);

Swing Model Class Diagram

You may download packages with all sources for the Documentum Swing Tree from here.

No Comments »

ABC Documentum Customization - Part 2

ABC Documentum Customizaion - Part 2
The other simple customization you may do with the Application Builder this is

Manage attributes which were visible on the property mask

To do this edit selected type and navigate to “Display Configuration” tab. And just add attributes you want to see.

NOTE: That you need to manage visible attributes for each client scope, so Webtop and Desktop Client may have different set of visible attributes.
Application Builder - Display Configuration

Edit Info Tab Attributes

Also you may add more tabs to group attributes according to some logic.

Create Custom Tab

After these simple steps you will get the following results.

  • New Document
    Customized New Document
  • Properties - “Info Tab” with customized attributes
    Info Tab
  • Properties - Additional Custom Tab
    Custom Tab

Notice, that you make this job without single line of code!

Provide list of available values for the user

The other things you may do to be more attentive to your users this is provide them with a list of possible values. I write some about in Data Forest post. To do this you need to edit target attribute and navigate to “Value Assistance” tab.

Documentum Application Builder - Value Assistance

Several options available as a source for the available values.

Fixed List - this is the simplest way; it is suitable for the limited and non changeable values (e.g. Country regions, Time Zones, Object States, abbreviations). All you need in this case - just add each value in a single line.

Query - this option allow specify a query to populate list of values. If your user don’t need to edit list of possible values often you may use registered table in other case it is better to create a folder structure and populate values as a folder names or other attributes. Also with this way you may show value from one attribute (table field) but save value from other attribute. This is comfortale when you have list of abbreviations which is hard to remember, so you may show description, but store abbreviation itself.
Value Assistance - Query Definition

NOTE: For each option you may specify that list not complete, so in this case Webtop/Desktop will allow adding value different to values in the list, in other case this will be not possible.

Here is a template DQL to create a registered table in DB and Documentum. You may execute it with idql32 command line tool or with the Documentum Administrator DQL executer.

  1.  
  2. #Enable this lines if you run this script several times
  3. #execute exec_sql with query = 'DROP TABLE reg_invoice_type';
  4. #go
  5.  
  6. #this statement create table in the DB schema, note, that raw SQL used here, so this part dependents from DB
  7. execute exec_sql with query='
  8. CREATE TABLE reg_invoice_type(
  9. invoice_type varchar2(5),
  10. invoice_type_info varchar2(30)
  11. )'
  12. go
  13.  
  14. #Enable this lines if you run this script several times
  15. #unregister table reg_invoice_type
  16. #go
  17.  
  18. #register object in Documentum
  19. register table dm_dbo.reg_invoice_type
  20. (
  21. invoice_type char(5),
  22. invoice_type_info char(30)
  23. )
  24. go
  25.  
  26. #setup table permissions
  27. update dm_registered object set owner_table_permit=15 where object_name='reg_invoice_type'
  28. go
  29. update dm_registered object set group_table_permit=1 where object_name='reg_invoice_type'
  30. go
  31. update dm_registered object set world_table_permit=1 where object_name='reg_invoice_type'
  32. go
  33.  
  34. #fill table with values
  35. INSERT INTO dm_dbo.reg_invoice_type(invoice_type,invoice_type_info)
  36. VALUES ('T1','Loan Bill')
  37. go
  38.  
  39. INSERT INTO dm_dbo.reg_invoice_type(invoice_type,invoice_type_info)
  40. VALUES ('T2','Utility Bill')
  41. go
  42.  
  43. #test the values
  44. select * from dm_dbo.reg_invoice_type
  45. go

Wow, here is a result, now your uses for sure will not make any typo mistake.

Value Assistance - Webtop Property Mask

No Comments »

« Prev - Next »