cancel
Showing results for 
Search instead for 
Did you mean: 

CMIS Folder.addToFolder(target, true) fails?

aweber1nj
Champ in-the-making
Champ in-the-making
I keep getting an exception thrown when trying to "link" an existing folder to another existing-folder-location (for multiple locations).

The exception says:
org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException: Object is not a document!
   at org.alfresco.opencmis.AlfrescoCmisServiceImpl.addObjectToFolder(AlfrescoCmisServiceImpl.java:2030)
Well, that's correct, the object is a Folder, which also is a FileableCmisObject, so has the addToFolder() method, and is what I'm trying to add to the target folder.

I will re-compile and re-test, but the only thing I can think of is that the error message is incorrect, and the complaint is in the second parameter to the addToFolder method (true = link all versions)?  One would think that would be ignored if it's not used for Folder nodes, but maybe that's what the exception is trying to tell me?

Has anyone else tried using this method to link a folder to a second (or more) location in the repository successfully?

Thanks,
AJ
3 REPLIES 3

jpotts
World-Class Innovator
World-Class Innovator
According to the spec (page 35 of the PDF)…
Every folder object, except for one which is called the Root Folder, MUST have one and only one parent folder.

Folder objects are not multi-fileable.

Jeff

aweber1nj
Champ in-the-making
Champ in-the-making
Ah, RTFM, huh? Smiley Wink

I take it this is a CMIS limitation, not an Alfresco one?

Thanks,
AJ

jpotts
World-Class Innovator
World-Class Innovator
Yes, I believe the underlying Alfresco API supports multi-filing of folders.

Jeff