Thursday, May 22, 2008

How to Insert HTML into a Webtop component using a label

Below I will show you how to output plain text or HTML to your custom component. Thats right! You can output HTML to the component screen from the class using the Label tag!
Documentum outputs dynamic text and controls to Webtop Components via custom JSP tags.

Example outputting plain text to the component screen

JSP file:
<dmf:label name="documentumMessage"  />
Class file:
Label msg1 = (Label) getControl("documentumMessage",Label.class);
msg1.setLabel("documentum is crazy");


Example outputting html to the component screen:

JSP file:
<dmf:label name="documentumMessageWithHtml" encodelabel="false"/>
Class file:
Label msg2 = (Label) getControl("documentumMessageWithHtml",Label.class);
msg2.setLabel("<strong>documentum is <em>crazy</em></strong><br />");

If you do not set encodelabel="false", the HTML will be printed to the screen instead of rendered. (Do not try and set this attribute from the Class file because it will not work.)


Output

Friday, May 16, 2008

How to view the difference between two files

I found an easy way to view the dif between the text of two files. Originally the only way I knew of was to load them into subversion. Then I realized Notepad++ (the best text editor I have found by far!) has a built inplugin called Compare which highlights the differences like subversion does.

Check out this screen shot

Wednesday, May 14, 2008

Dell Inspiron Desktop 530 no sound

My roomate just received a Dell Inspiron 530 and the sound did not work, and flash videos would freeze.

To fix this download the Realtek ALC888 HD Audio drivers from Dell. This should fix the sound problem and the video problem.

Reason: The 530's were designed to run Vista. Do to high demand for XP they started loading XP onto them, but not installing the proper drivers. For some reason this fixed the flash video freezing as well.

How to export a Virtual Document in Documentum.

First you will need to convert the IDfSysObject to an IDfVirtualDocument.

        //verify the object is a virtual document
//the variable doc is the IDfSysObject that you are working with
if (doc.isVirtualDocument()) {
IDfVirtualDocument v = doc.asVirtualDocument("CURRENT",false);
exportVirtualDocument(v, exportDir, "");
} else {
throw new DfException("Must be a virtual document to export.");
}


Then take the doc variable and call this method:

    /**
* Exports virtual document to the destination directory
*
* @param doc virtual document to be exported
* @param destDir directory virtual document should be exported to
* @param exportFormat export format (such as html, or you can use the da to create a new one)
* @throws Exception
*/

private void exportVirtualDocument(IDfVirtualDocument doc,
String destDir, String exportFormat) throws Exception {
IDfClientX clientx = new DfClientX();

IDfExportOperation operation = clientx.getExportOperation();
operation.setDestinationDirectory(destDir);
IDfExportNode node = (IDfExportNode) operation.add(doc);
node.setFormat(exportFormat);

// Execute the operation
boolean executeFlag = operation.execute();

// Check if any errors occured during the execution of the operation
if (executeFlag == false) {
// Get the list of errors
IDfList errorList = operation.getErrors();
String message = "";
IDfOperationError error = null;

// Iterate through the errors and concatenate the error messages
for (int i = 0; i < errorList.getCount(); i++) {
error = (IDfOperationError) errorList.get(i);
message += error.getMessage();
}

if (message.length() > 0) {
// Create a DfException to report the errors
DfException e = new DfException();
e.setMessage(message);
throw e;
}
}
}

How to create a new page in Webtop - Documentum

New to Documentum or Webtop and trying to create a custom page for getting input or changing settings or sending an item to a queue?

Want to get to the page using that dropdown menu Webtop has?

Important terminology.
  • A page in Webtop is called a Component
  • The dropdown menu above the objects is called the Menubar
This is all part of the documentum WDK (Web Development Kit). I recommend downloading the JavaDoc from EMC Developer Network. You will need to sign up but it is free and there is lots of good Documentum related stuff on there.

Anyway on to creating your Webtop Component. This document will guide you through the creation.
Read this document on Scribd: HelloWorldWDKComponent


Tips:
If you want to do some actions when the Ok or Cancel buttons are pressed in the component.... Here is the code for the webtop OK button and Cancel button events:

    public boolean onCommitChanges() {
//this method is called when the user clicks the OK button
}

public boolean onCancelChanges() {
//this method is called when the user clicks the cancel button
}
And remember to download the WDK API javadoc. This zip also contains the difference between WDK version 5.3 and 6.

Post a comment or email me if you have any questions.






Read this doc on Scribd: HelloWorldWDKComponent