top-image

LATEST ARTICLES

Hello,

Documentum proposes the Java method server as a means of improving the performance and scalability of its method architecture, indeed, it is possible to execute custom code on behalf of the Content Server via Documentum methods written in Java or DocBasic.
 
 
Presentation of Java Method Server
The method server itself is a Java-based web application communicating with the Content Server via HTTP calls. Each time a method is invoked, the Content Server makes an HTTP request passing the name of the Java class which implements the method along with any specified arguments to a servlet which knows how to execute the specified method. Methods in documentum are defined via dm_method objects. To indicate that a Java method should execute via the Java method server, set the dm_method.method_type attribute to java, the dm_method.use_method_server attribute to 1, and the dm_method.method_verb attribute to the classname of the method implemenation. When the Content Server sees a method matching this pattern, it opens a HTTP request to the Java method server requesting executing of the method with the specified class. This simple architecture solves the overhead problem and also introduces a convenient mechanism for dramatically improving the scalability of the Content Server. Although it is not configured out-of-the-box to support this, Method servers may be executed on a machine physically separate from the Content Server. It is even possible to run the method server on a platform different from the Content Server (ie. running the Content Server on Solaris and the method server on Windows). This offloads work from the Content Server which might enable the Content Server to handle more users. If the methods are expensive to execute, it is also possible to load-balance method servers using industry standard HTTP load balancers. There is nothing special or complicated about the method server. It simply requires a J2EE-compatible servlet container.

 
 
Starting / State / Stopping of Java Method Server
Sometimes, the “java.lang.Exception: Application Server test failed” error occurs during the starting of JMS. In Windows, there are the standard Windows Services allowing the starting and stopping of JMS. However before any action, it is advised to probe the following URL of the JMS because the Windows services do not reflect the real state of JMS.
 
app_server_uri = http://[DCTM_JBOSS_SERVER]:9080/DmMethods/servlet/DoMethod

 

In DCTM 6.5, there is a known issue concerning the restarting of JMS via the WINDOWS service for which the above support note was written. It states that there is a BATCH dctmServerStatus.bat allowing Content Server to check if the JMS is UP or DOWN via port 9084. Therefore, the error message may be due to a wrong config when using this BATCH tool in the DmMethodServer.xml file.


Symptoms
Java Method Server fails to start while started as a Windows Service but is starting correctly using [DOCUMENTUM]\jboss4.2.0\server\startMethodServer.cmd

The [DOCUMENTUM]\jboss4.2.0\server\serviceConfig\MethodServer\DmMethodServerService.log is showing "java.lang.Exception: Application Server test failed"

Cause
The root cause could be multiple and the purpose of this Support Note is to help investigating where the problem relies by looking at more meaningful logs.

Resolution
The Windows Service relies on 2 files: wrapper.conf and DmMethodServer.xml (both found on [DOCUMENTUM]\jboss4.2.0\server\serviceConfig\MethodServer\conf).
First suggestion is to check those files for any wrong setting (path, hostname).

In order to determine that the Windows Service is started correctly after startup sequence is initiated, the Service Wrapper issues the command described by status node on DmMethodServer.xml: dctmServerStatus.bat vm4425 9084 MethodServer.
This status command generates log files that should be of interest: twiddle.log and [HOSTNAME]_9084_status_output.txt (both found on [DOCUMENTUM]\jboss4.2.0\bin).
Those logs should contain a more explicit Java stack trace that would help understand the current issue ("java.net.UnknownHostException: VM4425: VM4425" for example).


 

For your information, the binding port 9083 is defined in [DOCUMENTUM_FOLDER]\jboss4.2.0\server\DctmServer_MethodServer\conf\jboss-service.xml file:

   <!-- ==================================================================== -->
   <!-- Class Loading                                                        -->
   <!-- ==================================================================== -->

   <!-- A mini webserver used for dynamic and class and resource loading --> 
   <mbean code="org.jboss.web.WebService"
      name="jboss:service=WebService">
      <!-- The Bind address and Port -->
      <attribute name="BindAddress">${jboss.bind.address}</attribute>      
      <attribute name="Port">9083</attribute>
      <!--  The address to use for the host portion of the RMI codebase URL -->
      <attribute name="Host">${java.rmi.server.hostname}</attribute>
      <!-- Should non-EJB .class files be downloadable -->
      <attribute name="DownloadServerClasses">true</attribute>
      <!-- Should resources other than .class files be downloadable. Both
         DownloadServerClasses and DownloadResources must be true for resources
         to be downloadable. This is false by default because its generally a
         bad idea as server configuration files that container security
         information can be accessed.
       -->
      <attribute name="DownloadResources">false</attribute>

      <!-- Use the default thread pool for dynamic classa loading -->
      <depends optional-attribute-name="ThreadPool"
         proxy-type="attribute">jboss.system:service=ThreadPool</depends>
   </mbean>

 
 
More Explanations
In fact in DCTM 6.5, the problem with starting the Java Method Server (JMS) WINDOWS service is that it is unable to map port 9083, because during the shutdown of the Windows service (during the stop), the associated java (java.exe) process has not been stopped, so the port is always used.
 
This problem should be resolved in DCTM 7.2 because the version of the wrapper service – the tool that creates the Windows service associated with the Java Method Server – is no longer the same;
 
More, in addition to use of dctmServerStatus.bat and/or checking of http://[DCTM_JBOSS_SERVER]:9080/DmMethods/servlet/DoMethod, another solution (in sequencing) would be to “kill” of java processes (there are 2) when shutting down the JMS (relatively laborious solution, because it will be necessary to retrieve the PID of the good java processes to avoid killer other java processes that have nothing to do, and under windows it is not as trivial as in Unix environment).
 
 

Test with DCTM 6.5
The DmMethodServer.xml contains:
dctmServerStatus.bat MYSERVERDCTM 9084 MethodServer
http://MYSERVERDCTM:9080

<wrapperService displayName="Documentum Java Method Server" name="DmMethodServer" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="wrapperService.xsd" startsOtherServices="true">
    <component name="Application Server" >
        <start timeout="1200" commandReturns="false" executionDir="C:\Documentum\jboss4.2.0\server">startMethodServer.cmd</start>
        <status timeout="60" executionDir="C:\Documentum\jboss4.2.0\bin">dctmServerStatus.bat MYSERVERDCTM 9084 MethodServer</status>
        <stop timeout="600" executionDir="C:\Documentum\jboss4.2.0\server">stopMethodServer.cmd</stop>
        <heartbeat>
		<url>http://MYSERVERDCTM:9080</url>
        </heartbeat>
    </component>
</wrapperService>     

…execution of dctmServerStatus.bat MYSERVERDCTM 9084 MethodServer command:

…the previous command produces a TXT file containing the result : true or false:

twiddle.log

17:13:05,975 DEBUG [Twiddle] args[0]=--server
17:13:05,975 DEBUG [Twiddle] args[1]=MYSERVER:9084
17:13:05,975 DEBUG [Twiddle] args[2]=-u
17:13:05,975 DEBUG [Twiddle] args[3]=admin
17:13:05,975 DEBUG [Twiddle] args[4]=-p
17:13:05,975 DEBUG [Twiddle] args[5]=admin
17:13:05,975 DEBUG [Twiddle] args[6]=get
17:13:05,975 DEBUG [Twiddle] args[7]=--noprefix
17:13:05,975 DEBUG [Twiddle] args[8]=jboss.system:type=Server
17:13:05,975 DEBUG [Twiddle] args[9]=Started
17:13:05,991 DEBUG [SecurityAssociation] Using ThreadLocal: false
17:13:05,991 DEBUG [Twiddle] Command name: get
17:13:05,991 DEBUG [Twiddle] Command arguments: --noprefix,jboss.system:type=Server,Started
17:13:05,991 DEBUG [Twiddle] command proto type properties: jar:file:/C:/Documentum/jboss4.2.0/bin/twiddle.jar!/org/jboss/console/twiddle/commands.properties
17:13:05,991 DEBUG [Twiddle] Adding command 'jsr77'; proto: org.jboss.console.twiddle.command.JSR77Command@df8f5e
17:13:05,991 DEBUG [Twiddle] Adding command 'xmbean'; proto: org.jboss.console.twiddle.command.XMBeanCommand@1bca5f1
17:13:06,007 DEBUG [Twiddle] Adding command 'info'; proto: org.jboss.console.twiddle.command.InfoCommand@1749757
17:13:06,007 DEBUG [Twiddle] Adding command 'get'; proto: org.jboss.console.twiddle.command.GetCommand@147ee05
17:13:06,007 DEBUG [Twiddle] Adding command 'invoke'; proto: org.jboss.console.twiddle.command.InvokeCommand@1fcf0ce
17:13:06,007 DEBUG [Twiddle] Adding command 'create'; proto: org.jboss.console.twiddle.command.CreateCommand@82701e
17:13:06,007 DEBUG [Twiddle] Adding command 'setattrs'; proto: org.jboss.console.twiddle.command.SetAttrsCommand@19a0c7c
17:13:06,007 DEBUG [Twiddle] Adding command 'unregister'; proto: org.jboss.console.twiddle.command.UnregisterCommand@145e044
17:13:06,007 DEBUG [Twiddle] Adding command 'query'; proto: org.jboss.console.twiddle.command.QueryCommand@17e6a96
17:13:06,007 DEBUG [Twiddle] Adding command 'set'; proto: org.jboss.console.twiddle.command.SetCommand@1960f05
17:13:06,007 DEBUG [Twiddle] Adding command 'serverinfo'; proto: org.jboss.console.twiddle.command.ServerInfoCommand@e5b723
17:13:06,007 DEBUG [GetCommand] processing arguments: --noprefix,jboss.system:type=Server,Started
17:13:06,007 DEBUG [GetCommand] mbean name: jboss.system:type=Server
17:13:06,007 DEBUG [GetCommand] adding attribute name: Started
17:13:06,007 DEBUG [GetCommand] attribute names: [Started]
17:13:06,163 DEBUG [GetCommand] as string[]: Started
17:13:06,225 DEBUG [GetCommand] attribute list: [javax.management.Attribute@19e15c]

…the last URL http://MYSERVERDCTM:9080 is the JBOSS application server hosting the JMS:

 
 
 

Test with DCTM 7.2
The DmMethodServer.xml contains:
dctmServerStatus.bat MYSERVERDCTM2 9084
http://MYSERVERDCTM2:9080

<wrapperService displayName="Documentum Java Method Server" name="DmMethodServer" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="wrapperService.xsd" startsOtherServices="true">
    <component name="Application Server" >
        <start timeout="1200" commandReturns="false" executionDir="D:\Documentum\jboss7.1.1\server">startMethodServer.cmd</start>
        <status timeout="60" executionDir="D:\Documentum\jboss7.1.1\bin">dctmServerStatus.bat MYSERVERDCTM2 9084</status>
        <stop timeout="600" executionDir="D:\Documentum\jboss7.1.1\server">stopMethodServer.cmd</stop>
        <heartbeat>
		<url>http://MYSERVERDCTM2:9080</url>
        </heartbeat>
    </component>
</wrapperService>     

…execution of dctmServerStatus.bat MYSERVERDCTM2 9084 command:

…the previous command produces a TXT file containing the result : true or false:

…the last URL http://MYSERVERDCTM2:9080 is the JBOSS application server hosting the JMS:

 
 
 

Resources:
http://www.bluefishgroup.com/2004/the-documentum-java-method-server/

Best regards,

Huseyin OZVEREN

Hi,

Just a simple post concerning a useful functionality provided by Documentum in com.documentum.xml.xdql DFC package.

As you would see in my previous post http://www.javablog.fr/xstream-presentation-serialization-deserialization-xml.html, there is another solutions/frameworks like Xstream for the serialization and deserialization of XML in Java applications.

This package com.documentum.xml.xdql contains only the Interface IDfXmlQuery. This interface provides functionality for running queries against a repository, returning the results as XML.
The structure of the XML output is a root element, specified by setRootTag, followed by each query result row. The following is an example of the XML output:

<?xml version="1.0"?>
 <root>
     <object ID="09017e1080001932">
         <r_object_id>09017e1080001932</r_object_id>
         <object_name>catalog A</object_name>
     </object>
     <object ID="09017e10800019aa">
         <r_object_id>09017e10800019aa</r_object_id>
         <object_name>catalog B</object_name>
     </object>
 </root>

There are many options available for customizing the XML output, such as specifying the whether object content should be included in the output. Each option has a default value, so you only need to set the options that you want to override.

 
 
Sample DFC code to get document as XML

package com.huo.test.ecm.test2;

import java.io.FileOutputStream;
import java.io.IOException;

import com.documentum.fc.client.DfClient;
import com.documentum.fc.client.IDfClient;
import com.documentum.fc.client.IDfQuery;
import com.documentum.fc.client.IDfSession;
import com.documentum.fc.client.IDfSessionManager;
import com.documentum.fc.client.IDfSysObject;
import com.documentum.fc.common.DfException;
import com.documentum.fc.common.DfLoginInfo;
import com.documentum.fc.common.IDfLoginInfo;
import com.documentum.xml.xdql.DfXmlQuery;
import com.documentum.xml.xdql.IDfXmlQuery;

/*
 Documentum DFC Standalone Sample Program

 Sample DFC code to get document as XML
*/
public class DocumentRecordsAsXMLTest {

	IDfSysObject sysObject = null;
	IDfSession idfSession = null;
	IDfSessionManager sessMgr = null;

	public DocumentRecordsAsXMLTest(String user, String passwd, String docbase) throws Exception {
		getDfSession(user, passwd, docbase);
	}

	public IDfSession getDfSession(String args1, String args2, String args3) throws Exception {
		IDfLoginInfo login = new DfLoginInfo();
		login.setUser(args1);
		login.setPassword(args2);
		IDfClient client = DfClient.getLocalClient(); //new DfClient();
		sessMgr = client.newSessionManager();
		sessMgr.setIdentity(args3, login);
		idfSession = sessMgr.getSession(args3);

		if (idfSession != null)
			System.out.println("Session created successfully");

		return idfSession;
	}


	public void releaseSession() throws Exception {
		sessMgr.release(idfSession);
	}
	
	public String getdm_documentRecordsAsXML(String dql, String fileStoring) throws DfException {
		System.out.println("#################################################");

		IDfXmlQuery objDfXmlQuery = new DfXmlQuery();
		objDfXmlQuery.init();
		objDfXmlQuery.setDql(dql);
		objDfXmlQuery.setContentAsLink(true);
		objDfXmlQuery.setMetaDataAsAttributes(false);
		//objDfXmlQuery.setPreserveSpace(true);
		objDfXmlQuery.setRepeatingAsNested(true);
		objDfXmlQuery.setRepeatingIncludeIndex(true);
		objDfXmlQuery.includeMetaData(true);
		objDfXmlQuery.useNullAttributeIndicator(true);
		objDfXmlQuery.includeDCTMChunkInfo(true);
		objDfXmlQuery.includeContent(true);
		objDfXmlQuery.execute(IDfQuery.DF_READ_QUERY, idfSession);
		String xml = objDfXmlQuery.getXMLString();
		System.out.println("XML is  : " + xml);
		
		FileOutputStream fos = null;
		 try {
			fos = new FileOutputStream(fileStoring);
			objDfXmlQuery.getXMLString(fos);
		} catch (Exception e) {
			e.printStackTrace();
		}finally{
			if(fos != null){
			 try { fos.flush(); } catch (IOException e) { e.printStackTrace(); }
			 try { fos.close(); } catch (IOException e) { e.printStackTrace(); }
			}
		}
		
		return xml;
	}

	
	
	public static void main(String[] args) throws Exception {

		String user = "myuser";
		String passwd = "passeord4myus";
		String docbase = "MY_DOC_BASE";
		DocumentRecordsAsXMLTest object = new DocumentRecordsAsXMLTest(user, passwd, docbase);

		try {
			// To get document as XML
			object.getdm_documentRecordsAsXML("select * from dm_document where r_object_id='090xxxxxxxxxxxxf1d'", "C:\\Workspaces\\TestDCTMHUO\\src\\com\\huo\\test\\ecm\\test2\\documentXML.xml");
		} finally {
			// to release a docbase session
			object.releaseSession();
		}
	}
}

….outputs:

Session created successfully
#################################################
XML is  : <?xml version="1.0"?>
<root>
    <object ID="090xxxxxxxxxxxxf1d">
        <r_object_id>090xxxxxxxxxxxxf1d</r_object_id>
        <object_name>Test 12</object_name>
        <title>null</title>
        <subject>null</subject>
        <resolution_label>null</resolution_label>
        <owner_name>gedadm</owner_name>
        <owner_permit>6</owner_permit>
        <group_name>null</group_name>
        <group_permit>1</group_permit>
        <world_permit>1</world_permit>
        <log_entry>null</log_entry>
        <acl_domain>PWCCOMPANYDEV</acl_domain>
        <acl_name>dm_450220c580068103_8005a971</acl_name>
        <language_code>null</language_code>
        <r_object_type>pwc_client_document</r_object_type>
        <r_creation_date>12/02/2014 15:20:56</r_creation_date>
        <r_modify_date>18/11/2016 15:18:21</r_modify_date>
        <a_content_type>dxl</a_content_type>
        <content r_object_id="090xxxxxxxxxxxxf1d">dctm://MY_DOC_BASE/090xxxxxxxxxxxxf1d?DMS_OBJECT_SPEC=OBJECT_ID</content>
    </object>
</root>

 
 
Document with aspect attached

// To get document-aspect as XML
object.getdm_documentRecordsAsXML("select r_object_id, r_modifier, r_modify_date, r_aspect_name, object_name, aspect_huo.huo_request_num from dm_document where r_object_id='090xxxxxxxxxxxx36'", "C:\\Workspaces\\TestDCTMHUO\\src\\com\\huo\\test\\ecm\\test2\\documentXML.xml");

….outputs:

Session created successfully
#################################################
XML is  : <?xml version="1.0"?>
<root>
    <object ID="090xxxxxxxxxxxx36">
        <r_object_id>090xxxxxxxxxxxx36</r_object_id>
        <r_modifier>gedadm</r_modifier>
        <r_modify_date>19/10/2016 14:38:41</r_modify_date>
        <r_aspect_name>
            <r_aspect_name-value index="0">aspect_huo</r_aspect_name-value>
            <r_aspect_name-value index="1">aspect_copy</r_aspect_name-value>
            <r_aspect_name-value index="2">aspect_email</r_aspect_name-value>
        </r_aspect_name>
        <object_name>HUO value object name.
            Residential II S.A.</object_name>
        <aspect_huo.huo_request_num>900971</aspect_huo.huo_request_num>
        <content r_object_id="090xxxxxxxxxxxx36">dctm://MY_DOC_BASE/090xxxxxxxxxxxx36?DMS_OBJECT_SPEC=OBJECT_ID</content>
    </object>
</root>

That’s all!!!

Huseyin OZVEREN

Hello,

Just a post concerning the BUG of use of DATEFLOOR, DATEDIFF, DATETOSTRING and DATEADD together.

To illustrate this problem, for example, we would like to list the documents (r_object_id) modified during the last year:

#### Docs modified during the LAST YEAR ; ex: >= 01/01/2016 00:00:00 et < 01/01/2017 00:00:00
# error
SELECT r_object_id 
FROM dm_document 
WHERE r_modify_date >= DATEFLOOR(year,DATEADD(year, -1, DATE(TODAY))) 
AND r_modify_date < DATEFLOOR(year,DATE(TODAY));

==> Error occured during query execution :[DM_QUERY_E_SYNTAX]error: “A Parser Error (syntax error) has occurred in the vicinity of: SELECT r_object_id FROM dm_document WHERE r_modify_date >= “
 

# same error
SELECT r_object_id, r_modify_date, DATEFLOOR(year,DATE(TODAY)) as dte0, DATEFLOOR(year,DATE(NOW)) as dte1, DATEADD(year, -1, DATE(TODAY)) as dte2, DATEFLOOR(year,DATEADD(year, -1, DATE(TODAY))) as dte3
FROM dm_document 
WHERE r_modify_date < DATEFLOOR(year,DATE(TODAY))
;

==> Error occured during query execution :[DM_QUERY_E_SYNTAX]error: “A Parser Error (syntax error) has occurred in the vicinity of: SELECT r_object_id, r_modify_date, DATEFLOOR(year,DATE(TODAY)) “
 

# NO any error
SELECT r_object_id, r_modify_date, DATEFLOOR(year,DATE(TODAY)) as dte0, DATEFLOOR(year,DATE(NOW)) as dte1, DATEADD(year, -1, DATE(TODAY)) as dte2
FROM dm_document 
WHERE r_modify_date < DATEFLOOR(year,DATE(TODAY))
;

==> NO any error
 

==> The problem that’s because DQL does not allow to imbricate these functions DATEFLOOR, DATEADD, DATEDIFF and DATETOSTRING.

# OK
select count(object_name) from dm_document where DATETOSTRING("r_creation_date",'mm/yyyy') = DATETOSTRING(DATE(TODAY),'mm/yyyy');
# NOK : ERROR
select count(object_name) from dm_document where DATETOSTRING("r_creation_date",'mm/yyyy') = DATETOSTRING(DATEADD(year, -1, DATE(TODAY)),'mm/yyyy');

 

# OK
SELECT * from dm_document WHERE DATEDIFF(day, r_modify_date,DATE(TODAY))<7;
# NOK : ERROR
SELECT * from dm_document WHERE DATEDIFF(day, r_modify_date,DATEADD(month, -1, DATE(TODAY)))<30;

 
 

The alternative DQL query to return all documents modified in last year :

SELECT DATE(TODAY) as dte_today, DATE(NOW) as dte_now, DATETOSTRING(DATE(TODAY),'yyyy') as current_year, DATETOSTRING(DATE(TODAY),'yyyy')-1  as last_year from dm_docbase_config;
dte_today = 14/02/2017 00:00:00
dte_today = 14/02/2017 11:23:53
current_year = 2017
last_year = 2016

 

SELECT count(r_object_id) 
FROM dm_document a
WHERE 
DATETOSTRING(a.r_modify_date,'yyyy') = (DATETOSTRING(DATE(TODAY),'yyyy')-1)
;

 

That’s all!!!

Huseyin OZEVEREN

Hello,

I would like to present a solution in order to encrypt/decrypt the passwords of registry for example the password in the dfc.properties via Java programming with the following Documentum utilities classes:

com.documentum.fc.tools.RegistryPasswordUtils.encrypt("password to be encrypted") ;
com.documentum.fc.tools.RegistryPasswordUtils.decrypt ("password to be decrypted") ;

Dfc.properties

dfc.globalregistry.repository=globalr
dfc.globalregistry.username=dm_bof_registry
dfc.globalregistry.password=XXXXXfsfezrezxxxxxrezrzrXXX/0ezxxxxxxIGAL

 
To encrypt/decrypt this value via JAVA programming:

  1. Java decrypting method:
    /**
     * Decrypting with BOF utils - shorter, base64 encoded passwords
     * 
     * @param passwordEncrypted
     * @return
     */
    public static String decryptWithBOFUtils(String passwordEncrypted) {
    	String ret = null;
    	try {
    		System.out.print("\tBOF Utils (decrypt) -> " + passwordEncrypted + "\t\t\t\t");
    		ret = com.documentum.fc.tools.RegistryPasswordUtils.decrypt(passwordEncrypted);
    	} catch (Exception e) {
    		System.out.println("ERROR: " + e.getMessage());
    	}
    	return ret;
    }
    

     

  2. Java encrypting method:
    /**
     * Encrypting with BOF utils - shorter, base64 encoded passwords
     * 
     * @param passwordToEncrypt
     * @return
     */
    public static String encryptWithBOFUtils(String passwordToEncrypt) {
    	String ret = null;
    	try {
    		System.out.print("\tBOF Utils (encrypt) -> " + passwordToEncrypt+ "\t\t\t\t");
    		ret = com.documentum.fc.tools.RegistryPasswordUtils.encrypt(passwordToEncrypt);
    	} catch (Exception e) {
    		System.out.println("ERROR: " + e.getMessage());
    	}
    	return ret;
    }
    

     

  3. Test decrypting and encrypting method:
    // --------------------------------- Encrypting/Decrypting with BOF utils
    String password = null;
    String clearText = null;
                            
    password = "XXXXXfsfezrezxxxxxrezrzrXXX/0ezxxxxxxIGAL";
    // try decrypting with BOF utils - shorter, base64 encoded passwords
    System.out.println("\nTrying to decrypt '" + password + "'...\n");
    clearText = decryptWithBOFUtils(password);
    if ((clearText != null) && (clearText.length() > 0)) {
    	System.out.println("'" + clearText + "'");
    }else{
    	System.exit(1);
    }
                
    clearText = "TEST-javablog-Documentum@123";
                
    // try decrypting with BOF utils - shorter, base64 encoded passwords
    System.out.println("\nTrying to encrypt '" + clearText + "'...\n");
    password = encryptWithBOFUtils(clearText);
    if ((password != null) && (password.length() > 0)) {
    	System.out.println("'" + password + "'");
    }else{
    	System.exit(1);
    }
                
    // try decrypting with BOF utils - shorter, base64 encoded passwords
    System.out.println("\nTrying to decrypt again '" + password + "'...\n");
    clearText = decryptWithBOFUtils(password);
    if ((clearText != null) && (clearText.length() > 0)) {
    	System.out.println("'" + clearText + "'");
    }else{
    	System.exit(1);
    }
    

     

 
 
Here, a code found to decrypt BOF and database passwords (https://www.snip2code.com/Snippet/242104/Decrypt-Documentum-database-passwords-) :

/*
 * (C) 2012 MSRoth - msroth.wordpress.com
 * 
 * recoverPW v2
 * 
 * This code will decrypt BOF and database passwords.  It will *NOT* decrypt inline user passwords.
 * 
 * From the D6.5 EMC Documentum Content Server Administration Guide, p. 353:
 * "Passwords encrypted with encryptPassword cannot be decrypted explicitly 
 * by an application or user."
 * 
 * usage:  c:>java recoverPW <password>
 * 
 * aek.key file must exist in c:\documentum\config
 * 
 */

package com.dm_misc.recoverpw;

import com.documentum.fc.client.impl.crypto.CryptoUtils;
import com.documentum.fc.tools.RegistryPasswordUtils;
import com.documentum.dmcl.impl.DmclApi;
import com.documentum.web.formext.session.TrustedAuthenticatorTool;
import com.documentum.web.formext.session.TrustedAuthenticatorUtils;
import java.io.*;

public class RecoverPW {

    private static final String AEK_PATH = "c:/documentum/config/aek.key";
    private static boolean decrypted = false;
    private static String password = "";

    public static void main(String args[]) {

        try {
            if (args.length != 1) {
                System.out.println("usage: c:>java recoverPW <password>");
                System.exit(1);
            }

            File file = new File(AEK_PATH);
            if (!file.exists()) {
                System.out.println("Could not find aek.key file.  Please copy from Content Server to " + AEK_PATH);
                System.exit(1);
            }

            // get encrypted password from command line
            password = args[0];
            System.out.println("\nTrying to decrypt '" + password + "'...\n");

            // try decrypting with BOF utils - shorter, base64 encoded passwords
            try {
                String clearText = "";
                System.out.print("\tBOF Utils ->\t\t\t\t");
                clearText = RegistryPasswordUtils.decrypt(password);
                if ((clearText != null) && (clearText.length() > 0)) {
                    System.out.println("'" + clearText + "'");
                    decrypted = true;
                }

            } catch (Exception e) {
                System.out.println("ERROR: " + e.getMessage());
            }

            // try decrypting with API - longer, dm_encrypt_password passwords
            try {
                String clearText = "";
                System.out.print("\tAPI ->\t\t\t\t\t");
                DmclApi.getInstance().exec("initcrypto,c," + AEK_PATH);
                clearText = DmclApi.getInstance().get("decrypttext,c,DM_ENCR_TEXT=" + password);
                if ((clearText != null) && (clearText.length() > 0)) {
                    System.out.println("'" + clearText + "'");
                    decrypted = true;
                }

            } catch (Exception e) {
                System.out.println("ERROR: " + e.getMessage());
            }

            // try decrypting with CryptoUtils(Password)
            try {
                String clearText = "";
                System.out.print("\tCryptoUtils (password) ->\t\t");
                CryptoUtils c = CryptoUtils.getInstance();
                clearText = c.decryptPassword("DM_ENCR_PASS=" + password);
                if ((clearText != null) && (clearText.length() > 0)) {
                    System.out.println("'" + clearText + "'");
                    decrypted = true;
                }

            } catch (Exception e) {
                System.out.println("ERROR: " + e.getMessage());
            }

            // try decrypting with CryptoUtils(Text)
            try {
                String clearText = "";
                System.out.print("\tCryptoUtils (text) ->\t\t\t");
                CryptoUtils c = CryptoUtils.getInstance();
                clearText = c.decryptText("DM_ENCR_TEXT=" + password, "p6lo3ly1oj5ne&");
                if ((clearText != null) && (clearText.length() > 0)) {
                    System.out.println("'" + clearText + "'");
                    decrypted = true;
                }

            } catch (Exception e) {
                System.out.println("ERROR: " + e.getMessage());
            }

            // try WDK DES
            try {
                String clearText = "";
                System.out.print("\tTrustedAuthenticatorUtils (DES) ->\t");
                clearText = TrustedAuthenticatorUtils.decryptByDES(password);
                if ((clearText != null) && (clearText.length() > 0)) {
                    System.out.println("'" + clearText + "'");
                    decrypted = true;
                }

            } catch (Exception e) {
                System.out.println("ERROR: " + e.getMessage());
            }

            // try WDK decrypt
            try {
                String clearText = "";
                System.out.print("\tTrustedAuthenticatorUtils (decrypt) ->\t");
                clearText = TrustedAuthenticatorUtils.decrypt(password);
                if ((clearText != null) && (clearText.length() > 0)) {
                    System.out.println("'" + clearText + "'");
                    decrypted = true;
                }

            } catch (Exception e) {
                System.out.println("ERROR: " + e.getMessage());
            }

            // try WDK Authenticator Tool - just uses TrustedAuthenticatorUtils to encrypt
            // This will never decrypt, running the main() only does encrypt.
            try {
                System.out.print("\tWDK authenticator tool -> \t\t");

                // create a stream to hold the output since WDK authenticator tool
                // prints to console
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                PrintStream ps = new PrintStream(baos);
                PrintStream old = System.out;
                System.setOut(ps);

                // call tool to decrypt text
                TrustedAuthenticatorTool.main(new String[]{password});

                // put things back 
                System.out.flush();
                System.setOut(old);

                // see what happened 
                String clearText = baos.toString();
                int idx = clearText.indexOf("Decrypted:");
                if (idx > 0) {
                    clearText = clearText.substring(idx + "Decrypted: [".length(), clearText.length() - 3);
                    System.out.println("'" + clearText + "'");
                    if (clearText.equalsIgnoreCase(password)) {
                        decrypted = false;
                    } else {
                        decrypted = true;
                    }
                } else {
                    System.out.println("ERROR: could not decrypt with WDK Authenticator Tool");
                }

            } catch (Exception e) {
                System.out.println("ERROR: " + e.getMessage());
            }

        } catch (Exception e) {
            System.out.println("General Error: " + e.getMessage());
        }

        System.out.println();
        if (!decrypted) {
            System.out.println("\nSorry, could not decrypt '" + password + "'.");
        }
        System.out.println("Done.");
    }
}

 

That’s all!!!

Huseyin OZVEREN

Page 1 of 43:1 2 3 4 »Last »
bottom-img
Copyright ® 2012 Huseyin Ozveren. No reproduction, even partial, can be used from this site and all its contents including text, documents, images, etc.. without the express permission of the author.