My content creation code (based on Web Publisher template) is returning error when session is created with non administrator users.
public void createContent(IDfSession session) throws Exception
{
IWcmAppContext wcmContext = new WcmAppContext(session.getSessionManager(), session.getDocbaseName(), Locale.getDefault(), new Hashtable(),null, null);
IWcmContentCreationService contentCreationService = (IWcmContentCreationService)wcmContext.getService((com.documentum.wcm.services.IWcmContentCreationService.class).getName());
IDfId templateId = new DfId("0900c360802b3a29"); //noticia_######
IDfId newContentId = contentCreationService.importContent(templateId, null, "D:/Temp/myContent.xml", "xml");
IDfSysObject contentObj = (IDfSysObject)session.getObject(newContentId);
contentObj.setString("title", "Content Title");
contentObj.setString("gerado_por", "abastecimento");
contentObj.save();
contentCreationService.performPostImportContent(newContentId, templateId, null, null, null, new Boolean(false));
}
The command contentCreationService.importContent is throwing the error below:
WcmException:: THREAD: main; MSG: [9024] Copy object failed: Can't copy document 'noticia_######'.Write permission required on folder 'Temp'.; ERRORCODE: 2340; NEXT: null
I believe the code is right, because any administrator user is able to create content by this code.
Using regular WP, all non administrator users are able to write in that Temp folder. By the way, from WP is easy to realize the Temp folder is in fact "/WebPublisher Configuration/User Preferences/<user name>/Temp".
What am I missing here?
Thanks!