Monday, April 7, 2014

Deep Export to Documentum from local desktop

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

import com.documentum.com.DfClientX;
import com.documentum.com.IDfClientX;
import com.documentum.fc.client.IDfClient;
import com.documentum.fc.client.IDfDocument;
import com.documentum.fc.client.IDfFolder;
import com.documentum.fc.client.IDfSession;
import com.documentum.fc.client.IDfSessionManager;
import com.documentum.fc.common.DfException;
import com.documentum.fc.common.IDfLoginInfo;
import com.documentum.operations.IDfImportNode;
import com.documentum.operations.IDfImportOperation;

/**
 *
 */

/**
 * @author mpoli_fujitsu
 *
 */
public class DeepImport {
  //static String parentLocation="dfgdgdgdg";
/**
* @param args
* @throws DfException
*/
public static void main(String[] args) throws DfException {
System.out.println("dsfsdfsd");
File sourceLocation=new File("dfgdgdgd");
File targetLocation=new File("dfgdgdgdg");

try {
copyDirectory(sourceLocation , targetLocation );
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}


public static void copyDirectory(File sourceLocation , File targetLocation) throws IOException, DfException {
if (sourceLocation.isDirectory()) {

//System.out.println("Folder exists sourece Locaion*********************"+targetLocation.getParent());
// System.out.println("Folder name_________________________________________"+targetLocation.getName());
// System.out.println("ParentFolder name_++++++++++++++++++++++++++++++++++++++"+targetLocation.getParent());
createFolder(targetLocation.getParent(),targetLocation.getName());
//targetLocation.mkdir();



String[] children = sourceLocation.list();
for (int i=0; i<children.length; i++) {
copyDirectory(new File(sourceLocation, children[i]),
new File(targetLocation, children[i]));
//System.out.println("Folder  sourece Locaion*********************"+sourceLocation);
}
} else {
System.out.println("sourece Locaion*********************"+sourceLocation.getName());
IDfSessionManager sesMgr = getSessionMgr();
IDfSession session = sesMgr.getSession("EDMS");
IDfClientX _clientx = new DfClientX();
IDfImportOperation _opi = _clientx.getImportOperation();
_opi.setSession(session);

IDfFolder _folder = session.getFolderByPath((targetLocation.getParent()).replace('\\', '/'));


_opi.setDestinationFolderId(_folder.getObjectId());

IDfImportNode _impNode = (IDfImportNode) _opi.add(sourceLocation.toString());
if (_impNode == null)
System.out.println ("Node is null.");

_impNode.setDocbaseObjectType("qd_project_doc");
_impNode.setNewObjectName(sourceLocation.getName());


//_opi.setSession(_dfcSes);
//
if (_opi.execute())
{
IDfDocument _newObj = (IDfDocument) _impNode.getNewObject();
_newObj.setObjectName(sourceLocation.getName());
_newObj.setString("process_area_name","Lusail Project Management");
_newObj.setString("document_type_name","Letter");
//_newObj.setOwnerName(_OWNER);
String resultString =
("Item" + _opi.getNewObjects().toString() +" imported successfully.");
System.out.println(resultString);
}
else
{
System.out.println ("Error during import operation.");
}

/*IDfDocument newFolder = (IDfDocument) session.newObject("dm_document");
newFolder.setObjectName(sourceLocation.getName());
//.replace('\\', '/');
newFolder.link((targetLocation.getParent()).replace('\\', '/'));
newFolder.save();*/
}
}
private static IDfSessionManager getSessionMgr(){
IDfSessionManager sessionMgr = null;
try{

IDfClientX clientx = new DfClientX();
IDfClient client = clientx.getLocalClient();
sessionMgr = client.newSessionManager();
IDfLoginInfo loginInfoObj = clientx.getLoginInfo();
loginInfoObj.setUser("dmadmin");
loginInfoObj.setPassword("fgfdg");
sessionMgr.setIdentity("dfgdg", loginInfoObj);

}catch(DfException exp){
exp.printStackTrace();
}
return sessionMgr;

}
private static void createFolder(String edmsLocation,String folderName) throws DfException
{
System.out.println("edmsLocation*********************"+edmsLocation);
if(folderName.equalsIgnoreCase("Section - 3")){
System.out.println("Folder Name Washington Parcel A");
}else{
System.out.println("Folder name_________________________________________"+folderName);
IDfSessionManager sesMgr = getSessionMgr();
IDfSession session = sesMgr.getSession("EDMS");
IDfFolder newFolder = (IDfFolder) session.newObject("qd_folder");
newFolder.setObjectName(folderName);
//.replace('\\', '/');
newFolder.link(edmsLocation.replace('\\', '/'));
newFolder.save();
}
}
}

Saturday, December 21, 2013

"Error 0 loading DMCL32.DLL. Make sure the DLL and supporting files are in your path"

issue we have index plus on the client computer and we forgot install the dfc.
solution:
Make sure the DFC installed on the client computer where you have installed index plus client.

Wednesday, December 11, 2013

How to get the repository log: (on CONTENT SERVER MACHINE)

It is <repository_name>.log you can find in <DOCUMENTUM_INSTALL_FOLDER>\dba\log  . 

How to get WDK logs: (on APP SERVER MACHINE)

By default, the log4j.properties (….found in <webtop_home>\WEB-INF\classes) will contain..

log4j.rootCategory=WARN, file, stdout
log4j.category.MUTE=OFF

log4j.appender.stdout.threshold=ERROR
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p [%t] %c - %m%n


log4j.appender.file.File=${user.dir}/documentum/logs/documentum.log

log4j.appender.file.MaxFileSize=10MB
log4j.appender.file.MaxBackupIndex=10
log4j.appender.file.Append=false
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p [%t] %c - %m%n

…we can leave it as such. The WDK log is the documentum.log.

Note: This will need an app server restart.


How to get DFC trace: (on APP SERVER MACHINE)

The "dfc.properties" file to use would be the one that Webtop uses. This should be found in the <webapp deployment directory>/webtop/WEB-INF/classes folder.  For instance if you were using tomcat on windows you might find the file in the following location
<webtop_home>\WEB-INF\classes.  

Can you try the following settings in your dfc.properties for capturing the DFC trace

dfc.tracing.enable=true

dfc.tracing.include_rpcs=true

dfc.tracing.verbose=true

dfc.tracing.mode=standard

dfc.tracing.log.level = DEBUG

dfc.tracing.timing_style=date

dfc.tracing.date_column_width=12

dfc.tracing.date_format=yyyy-MM-dd hh:mm:ss.SSS

dfc.tracing.max_stack_depth=10

dfc.tracing.include_session_id=true
dfc.tracing.dir=${user.dir}/documentum/logs/

and then send us on the resultant trace file from <$TOMCAT_HOME>\documentum\logs.

You can reset dfc.tracing.enable=false when you have captured the trace