Hi;
I'm trying to write a job to import MSG files as dm_message_archive objects.
I de-compiled webtop's :
com.documentum.webcomponent.library.contenttransfer.importcontent.messagearchive.EMFImportProcessor
class and tried to figure out how to achieve this objective.
In my DFC application I'm roughly using the below code :
IMessageService service = getMessageService(mySession);
IDfImportPackage pkg = createImportPackage();
IDfImportPackageItem emfPkgItem =null;
String messageFilename =null;
MessageConverter converter = MessageConverter.getInstance();
File f =new File("C:/temp/Notlu.msg");
File[] files = converter.convertMailMsgToEef(f);
for (int j=0; j<files.length; j++) {
System.out.println(files[j].getAbsolutePath());
if (files[j].getName().substring(files[j].getName().lastIndexOf('.')+1).equalsIgnoreCase("EMCMF"))
{
messageFilename = files[j].getAbsolutePath();
emfPkgItem = addMessage(mySession, pkg, files[j].getAbsolutePath(),false);
}
else
{
addAttachment(mySession, files[j].getAbsolutePath(), files[j].getName(), pkg,false);
}
}
IMessageImportConfig importConfig = createImportConfig(service, emfPkgItem, pkg,"/dmadmin");
File messageFile =new File(messageFilename);
IMessageIdentities identities = service.importMessageURL(messageFile.toURL(), importConfig);
But this code throws an error on "service.importMessageURL" line:
C:\temp\4EE746E338CDBBCA66A7FA6302D23665DA146C82AB34319100\4EE746E338CDBBCA66A7FA6302D23665DA146C82AB34319100.EMCMF
C:\temp\4EE746E338CDBBCA66A7FA6302D23665DA146C82AB34319100\Notlu Kopyala.doc
Exception has been thrown: There is no server file and client file is not an instance of IDfInboundRemoteClientFile
There is no server file and client file is not an instance of IDfInboundRemoteClientFile
at com.documentum.services.message.impl.MessageService.convertToMessageArchiveException(MessageService.java:877)
at com.documentum.services.message.impl.MessageService.importMsg(MessageService.java:796)
at com.documentum.services.message.impl.MessageService.importMessageURL(MessageService.java:47)
at ggsoft.DFCProgram.main(DFCProgram.java:229)
Does anybody have a simpler code to import MSG files? Or any JavaDoc explaining IDfImportPackageItem, IDfImportPackage would be great. Because I'm really confused about client file name - server file name in these packages.
Thank you for your interest.