chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Florian Müller <>
Subject RE: Creating a folder
Date Mon, 10 May 2010 15:28:06 GMT
Hi Ugo,

I have seen that before.
Are you using an Alfresco server? There is a bug that has been fixed in Alfresco 3.3g.



-----Original Message-----
From: Ugo Cei [] 
Sent: Montag, 10. Mai 2010 17:08
Subject: Creating a folder


I am trying to write some code that creates a folder using OpenCMIS (AtomPub binding, in case
this is relevant) and here is the code that I came up with:

        Folder root = session.getRootFolder();
        ObjectId parentId = session.createObjectId(root.getId());
	Map<String, Object> properties = new HashMap<String, Object>();
	properties.put(PropertyIds.OBJECT_TYPE_ID, BaseTypeId.CMIS_FOLDER.value());
        String name = "New Folder (" + System.currentTimeMillis() + ")";
	properties.put(PropertyIds.NAME, name);
	List<Ace> addAces = new LinkedList<Ace>();
	List<Ace> removeAces = new LinkedList<Ace>();
	List<Policy> policies = new LinkedList<Policy>();
	session.createFolder(properties, parentId, policies, addAces, removeAces);

However, this code throws the following exception:

Exception in thread "main" org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException:
Property cmis:objectTypeId must be set!
	at org.apache.chemistry.opencmis.client.bindings.spi.atompub.ObjectServiceImpl.checkCreateProperties(
	at org.apache.chemistry.opencmis.client.bindings.spi.atompub.ObjectServiceImpl.createFolder(
	at org.apache.chemistry.opencmis.client.runtime.PersistentSessionImpl.createFolder(

Apparently, it is complaining about the missing cmis:objectTypeId, which I did put in the
properties. It looks like, however, that the property does not survive the conversion performed

                objectFactory.convertProperties(properties, null, CREATE_UPDATABILITY),

(line 790 of Is this the right way to go about creating a folder
or am I missing something?


Ugo Cei
Sourcesense - making sense of Open Source:

View raw message