SR-A88245: CMIS Filenet - upload unfiled document
Using CMIS connected to a Filenet server, when uploading a document, even if we put "" in pyFolderId in pySaveFileContent, the CMISConnector.java still setup folder id based on root folder id instead of passing null value.
It implies only few lines of code in CMISConnector.java in Pega:
if (("").equals(folderIdString))
{
//TODO: CMIS spec considers folder id mandatory only if repository does not have unfiling support but OpenCMIS considers folder id as a mandatory value for creating a document.
//get the root folder id
oLog.debug("Folder Id is absent, creating document in root folder");
try
{
Folder root = mSession.getRootFolder();
folderIdString = root.getId();
}
catch(Exception ex)
{
throw new RemoteApplicationException("Folder Id was not specified, failed to access Root folder: ", ex);
}
}
return folderIdString;
becomes :
if (("").equals(folderIdString))
{
//get the root folder id
oLog.debug("Folder Id is absent, creating unfiled");
folderIdString = null;
}
return folderIdString;
We need to pass null value to be able to upload unfiled documents.
Using CMIS connected to a Filenet server, when uploading a document, even if we put "" in pyFolderId in pySaveFileContent, the CMISConnector.java still setup folder id based on root folder id instead of passing null value.
It implies only few lines of code in CMISConnector.java in Pega:
if (("").equals(folderIdString))
{
//TODO: CMIS spec considers folder id mandatory only if repository does not have unfiling support but OpenCMIS considers folder id as a mandatory value for creating a document.
//get the root folder id
oLog.debug("Folder Id is absent, creating document in root folder");
try
{
Folder root = mSession.getRootFolder();
folderIdString = root.getId();
}
catch(Exception ex)
{
throw new RemoteApplicationException("Folder Id was not specified, failed to access Root folder: ", ex);
}
}
return folderIdString;
becomes :
if (("").equals(folderIdString))
{
//get the root folder id
oLog.debug("Folder Id is absent, creating unfiled");
folderIdString = null;
}
return folderIdString;
We need to pass null value to be able to upload unfiled documents.
***Updated by moderator: Lochan. Removed user added Ask the Expert tag. Apologies for confusion, shouldn't have been an end-user option; updated Category***