Dark Star1
Dark Star1

Reputation: 7393

Why is cmis returning an error on datalist item creation in alfresco?

I have the following piece of code

    try {
          dataList.asInstanceOf[AlfrescoFolder].createItem(
          Map("cmis:objectTypeId" -> "D:dl:contact",
          "cmis:name" -> (data.emailAddress + "_Newsletter_sub"),
          "dl:contactEmail" -> data.emailAddress)
           )
   }
   catch{
          case e: CmisRuntimeException => Logger.error("\n\n ====> silently ignoring this exception because the item is created\n"+e.getMessage+"\n\n");
   }

which works fine and creates the data list item. but it throws an exception with the message
Execution exception[[CmisRuntimeException: Newly created object is not an item! New id: Object Id:
I'd like to know if this a normal/known issue with this api method and why it's happening. Thanks

Upvotes: 0

Views: 239

Answers (1)

Paul Sweatte
Paul Sweatte

Reputation: 24617

There are a couple of likely reasons which are triggered by constraint violations:

constraint If the cmis:objectTypeId property value is not an object-type whose base type is cmis:item.

constraint If the cmis:objectTypeId property value is NOT in the list of AllowedChildObjectTypeIds of the parent-folder specified by folderId.

References

Upvotes: 1

Related Questions