Projects
XAOP Labs 
The ActiveDCTM Boost
I am getting questions about ActiveDCTM via email.
Whether you could use it to have models in Documentum (ala ActiveRecord)? How close is it to completion, stablility, etc. and how do we plan on releasing (cost, license, etc).
Existing clients have the privilege to use the framework for free. They help us test the framework in different environments.
By the end of the year, we will release our simple object level backup/ restore solution for Documentum, ActiveDCTM will be shipped as part of this solution.
We have no plans yet to release it as a separate product/framework.
Anyway this post shares some design ideas/concepts of the frame work. The code listing is only an indication, how it currently works.
ActiveDCTM, an ActiveRecord ressemblance for Documentum.
Like ActiveRecord, ActiveDCTM will automatically generate Ruby objects from every type in your docbase.
The framework is fully developed with an object oriented and even aspect oriented spirit..
For instance it respects the inheritance of your custom types.
p types["dm_type"]
p types["dm_document"]
p self::DmDocument
p self::DmServerConfig
dm_doc = self::DmDocument
p [dm_doc, dm_doc.superclass, dm_doc.superclass.superclass, dm_doc.superclass.supe
rclass.superclass]
p doc_base::DmCabinet.attributes.keys
p dm_doc.attributes.keys
So if you customize the save or checkout on dm_document, your custom_d ocument which inherits from dm_document, will also get this behaviour.
There is also a callback mechanism, which is similar to the mechanism i n ActiveRecord.
module Documentum::Types
define :DmDocument do
before_save :warn_me
def warn_me
puts "WARNING YOU NOW!"
puts "You are trying to save #{inspect}"
true # Make sure save happens
end
after_save :congratulate_me
def congratulate_me
puts "CONGRATULATIONS"
puts "You've saved #{inspect}"
true # Be kind to other callbacks
end
end
end
The difference with the Documentum BOF framework is the simplicity, for instance you don’t have to confige a DBOR for type based objects an ymore. CONVENTION over CONFIGURATION
Here is a listing of other goodies :
1. There is a dmcl.yaml file, that is replacing the dmcl.ini file. This file works with profiles like the database.yml in rails does. So you configure development, production the same way as in a standard Rails app. This is the only config file you need to use ActiveDCTM in your environment.
2. Session handling can be managed by the use of Ruby blocks, so no mor e session leaks. This design idea is also used for queries. So no more collection leaks.
3. You can write Documentum methods in Ruby, the standard ruby exit met hods are interpreted by the Documentum workflow.
4. If you do a query in ActiveDCTM, the query result object contains a ‘convenience’ array in order to automatically introspect your query. So Ruby knows the attributes that are queried, even when you do a select * on your custom types.
The query result includes the standard Ruby enumerable module. So you c an do qr.each …
Documentum.connect(CONFIG) do
# block form
query("select object_name, r_object_id from dm_document where folder('/Temp
')") do |qr|
# p qr.attributes.keys
# p qr.attributes
# Enumerable
qr.each do |row|
p row.values # hash : names => values
p row.value(:r_object_id) # value of r_object_id
p row.object_name # value of object_name
object_name, r_object_id = *row
p [object_name, r_object_id]
end
end
# non-block form, requires ecpilcit close
qr = query("select * from dm_document where folder('/Temp')")
p qr.map { |r| r.r_creation_date }
# p qr.map(&:r_creation_date)
qr.close
end
5. All atomic types of Ruby are mapped directly to the types in Documen tum. This makes it very natural to use ActiveDCTM, if you know Ruby.
6. Access to the complete datadictionary and display configs if you wan t to use Rails as a frontend for your Documentum repository.
7. Documentum error handling is implemented :
p Documentum::Exception::FatalError::DmExpression::CondIdExprBadVstamp
8. There is multi-docbroker support
Documentum::DocBroker.new("192.168.65.128")
9. Working with the queues or events ?
Documentum.connect(CONFIG) do
p inbox
p inbox.events?
inbox.registered?(self::DmDocument, "dm_save") or
inbox.register(self::DmDocument, "dm_save", "Document was saved
")
end
10. Transaction support
Documentum.connect(CONFIG) do
transaction do
obj = self::DmDocument.find_by_dql("FOLDER('/Temp')")
p obj.object_name
obj.object_name += ".bak"
puts " -> " + obj.object_name
obj.save
abort
end
end
11. Relation support
Documentum.connect(CONFIG) do
p self::DmDocument.child_relations
obj = self::DmDocument.find_by_dql("FOLDER('/Temp')")
p obj.child_relation("dm_category_assign")
end
12. Several find methods
Documentum.connect(CONFIG) do
obj = self::DmDocument.find_by_dql("FOLDER('/Temp')")
p obj.dmr_contents
p self::DmFormat.all.map { |f| f.name }
end
Documentum.connect(CONFIG) do
p Documentum::Types::Tata
p self::DmDocument.find_by_dql("FOLDER('/Temp')").name
self::DmDocument.find_by_dql("FOLDER('/Temp')").name = "howdy&quo
t;
p self::DmDocument.find_by_dql("FOLDER('/Temp')").name
end
# Documentum.connect(CONFIG) do
# oid = "58001a0a800003ad"
# obj = self::DmSysobject.find_by_id(oid)
# p obj.contents
# end
13. Version and VDM support have been added in September.
Documentum.connect(CONFIG) do
obj = self::DmSysobject.find_all_by_path("/dmadmin/itest").last
p obj
p obj.versions
p obj.original
p obj.original.current_version
p obj.version("1.0")
p obj.version("1.0").children
end
That’s all for today.
A final note for those interested in performance, ActiveDCTM with dctmruby on the native DMCL C is very fast. For developers and end users ! :-))
