Tuesday, April 19, 2011

DQL-Query to get the user belong to which group.



select group_name from dm_group where any  i_all_users_names = 'dmadmin'

Your second question is clear to me. Are you trying to get a latest version of a document?

A regular DQL statement will always return a lastest document only.


Sol::
1. select i_all_users_names from dm_group where group_name='<insert value here>' or select users_names from dm_group where group_name='<insert value here>'

Take a look at the object reference manual for dm_group for the difference in the requested data

2. select r_object_id from dm_document where i_chronicle_id='<value here>'

Queries will return the latest version by default..

Monday, October 18, 2010

WebTop Viewer for viewing the document in Documentum WebTop



Issue:--



I am just start working on preparing an application for viewing different type of documents like MO: DCA, TIFF, PDF, Word, Excel and other format inside the Documentum WebTop application. So I am looking for some sample code or application to connect my viewer application with the WebTop.
I have found some sample code but it is not working for me.
i am using Documentum 6.5


Resol:--


There is a simple way of doing it.
  1. Login to Webtop
  2. In the Menu Bar , Goto Tools -> Preferences
  3. Click on the Formats Tab
  4. In the Custom Viewing and Editing Applications, click Add
  5. Select your object type e.g. dm_document
  6. Select the Format ( eg. pdf, tiff)
  7. In the Application for Viewing, you can select the application in the list box, or if your application is not found in the list, click on "Select Application" link and browse for the application you want to view with.
  8. Same steps for setting the application for Editing purpose.


Issue--2--

For Viewing only, you could also have a look at Oracle's AutoVue Web edition in conjunction with Oracle's VueLink (that's the part that actually connects to Webtop to get the documents, save the markups etc.. in the Docbase etc....

a Bit expensive but great stuff. supports more thatn 200 formats and can be configured for viewing in the current object list window or in a separate browser window...

But my question was how I will install my viewer application (java web application) inside the Documentum WebTop application.
We are developing a custom application in eclipse using WDK. We want to make the application part of the Documentum WebTop so that we can download the files from the content server annotate them and save back in the content server. We are developing server based application.




Resol:--

I am not 100% sure of your requirement but let me take a long shot.
As the documents have to be viewed by end client so I guess you want a way to install your viewer (or its client component) on the client machine.
Probably you want this to be automatic, where you dont need to manually do it on all client machines.
In that case, you might wish to use a feature in the webtop's content transfer facility (aka UCF).
You can specify the application to be installed in the ucf.installer.config.xml (inside <webtop_home>/wdk/contentXfer) as follows:

<executables>
         <executable version="your_version"
                     href="name_of_the_installable_placed_in_same_dir "
                     installOptions='switches_for_install_option_passed_if_u_used_cmd_prompt'
                     uninstallOptions='switches_for_uninstall_option_passed_if_u_used_cmd_prompt'/>
</executables>

You will also have to include a checksum file for the installer in the applet(ucfinit.jar) and re-sign it.

Next comes a step, which you would have to do to make sure webtop picks your application to view those specific mime types.
This would be required even if you have the automatic client components installation capability in your viewer application.
For this, you would have to make some registry entries under “HKEY_CLASSES_ROOT\Applications\[APP]\shell\[open/edit]\command” or  “*\OpenWithList” or “*\OpenWithProgids” (I can confirm if required).
This registry modification is also achievable through UCF.

For annotations where you want to change the content, probably you would like to have a TBO where you override doSetContent() or doSave().

In case your requirement is not as I guessed, please clarify it a bit more for us.


Issue--3--

I am preparing application for opening the files, viewer get embedded in the WebTop when we click on the file in the WebTop workList.

I am using WDK SDK for connecting with the Documentum Content directory. I have some question in my mind before start working on coding part of the application.

1)    How the viewer get embedded in the WebTop
2)    How I will get the document stream (data) to display in the viewer.
3)    How I will upload the modified or update document in the Documentum database, is there any specific key with the document.
4)    How I link my document and annotation file (annotation file stored the data of the document annotations like line, arrow, stamp, etc)

I am attaching snapshots of my proposed application with the message.




Resol:--

Here are some of your answers:
2) If you have the object's id, you can fetch the object using the valid session to docbase and then obtain a ByteArrayInputStream using getContent method,
     IDfSysObject obj = (IDfSysObject) session.getObject(new DfId("your_id"));
     ByteArrayInputStream stream = obj.getContent();

   Now this stream can be fed anywhere you wish.

3) Use the setter counterpart: setContent (ByteArrayOutputStream content).
You can put this logic in a TBO also where you can override doSetContent() or doSave() method and make this as the type for the mime types that you wish to have this behavior.

4) Normally annotations are part of content; then you can use the setContent API to merge the content of your annotation with the original doc's content.
However, you can use the way documentum manages annotations.
Then you will need to create a DfNote object with the content of your note and then attach it with the original document by using
noteObj.addNote(IDfId parentID, boolean keepPermanent);
Alternately you can use aspects.

I guess Francois answered 1). However I would need to understand the architecture of your viewer app better to comment more on this.


Review:--
We are working on creating an application for viewing documents inside the Documentum (WebTop) as a WebTop Viewer (Viewer would get embedded in the Documentum WebTop). We have a viewer application which supports most of the image and document formats like PDF, Office formats, MO: DCA (IBM image format), CAD, DGM, DICOM (Medical image format), TIFF, PCX, DCX, HTML and other. Viewer also supports Document conversion in different image formats, scanning and OCR etc.

So we want to add the application into the Documentum WebTop application as a component for viewing and annotate documents. Using the viewer user shall have the ability to view the documents inside the Documentum.

Architecture of the Application:-

Goal of the application is to add the viewer as a WebTop component in the Documentum for viewing documents. So user would have the ability to open the documents from the Documentum workList after double click on the file or after selecting open option from the right click menu.

Question:  how I would get the events and other information of the document when I click on the document in the Documentum WebTop like username, document name, document data and document property.

I need the event to invoke the application (Viewer application).

Application is a client –server based application so processing done on the server and image displayed in the applet at client side.

 is it possible to get some sample code or a sample example to start working on the application. I am using Documentum Web Development toolkit for developing the application.



Response:--

These are questions pertaining to WDK implementation and unfortunately that's not my area of expertise.
But I will try to give you some pointers to proceed.

Today out-of-the-box view opeartion in WDK proceeds as follows:
1. There is some pre-processing - selected object and its properties are determined.
2. Content is fetched from docbase to appserver when DFC operation's execute is complete
3. There is post processing on the content - content is moved from appserver to client machine and opened in the suitable viewer available on the client machine.

So probably for your requirement you would need to extend the WDK's view component and change the post processing.
If you dont want the content to be downloaded to the client machine as file rather stream it to the applet to render, you would need to feed the ByteArrayInputStream obtained from sysobject to applet.
You would need to turn off automatic launching of the application by UCF component by calling IDfContentPackageItem.setShouldBeOpenedByClient(false);
From my understanding, once you have gotten past the small task of fetching the object Ids etc (in preprocess probably), it would be a simple DFC program to get the content as stream/file and display using your application. When you get there I can help with DFC code if you need..