You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chemistry.apache.org by Mano Swerts <m....@aca-it.be> on 2011/01/24 15:07:16 UTC

Update Object Type

Hi all,

I use OpenCMIS 0.2 to connect to an Alfresco 3.4 repository.

I try to update the object type using the following code:

Map<String, Object> properties = new HashMap<String, Object>();
properties.put(PropertyIds.OBJECT_TYPE_ID, "D:" + ParkTypeIds.EMPLOYEE_DOCUMENT);
document.updateProperties(properties);

But this doesn't work. There is no exception, but the type doesn't change.
Is it possible to change the type after creation?

Kind regards, 

Mano Swerts



_________________________________________________

 We published a new company movie featuring YOU!
         See http://www.aca-it.be/movie
_________________________________________________


Re: Update Object Type

Posted by Florian Müller <fl...@alfresco.com>.
Hi Mano,

It is not planed for CMIS 1.1. So the CMIS specification will not support this within the next 3-4 years. Not many repositories support this behavior.
There are also no plans to support this in Alfresco through CMIS anytime soon.

So, yes, you have to create a new object.


Regards,

Florian


On 24/01/2011 14:16, Mano Swerts wrote:
> Hi Florian,
> 
> Thanks for the quick reply.
> 
> I understand that it is not logical to update the type, but in my case the object is of a parent type park:Document and I want to change it to the child type park:employeeDocument. So this is theoretically possible because the child only defines some extra fields.
> 
> Will this be possible in the future for parent-child types or is my only solution to create a new object of the child type and copy all property values?
> 
> Kind regards,
> 
> Mano
> 
> On 24 Jan 2011, at 15:12, Florian Müller wrote:
> 
>> Hi Mano,
>>
>> It is not possible to change the object type after creation.
>> OpenCMIS silently removes the property from the properties map because it is not valid for a property update.
>>
>>
>> Regards,
>>
>> Florian
>>
>>
>>
>> On 24/01/2011 14:07, Mano Swerts wrote:
>>> Hi all,
>>>
>>> I use OpenCMIS 0.2 to connect to an Alfresco 3.4 repository.
>>>
>>> I try to update the object type using the following code:
>>>
>>> Map<String, Object>   properties = new HashMap<String, Object>();
>>> properties.put(PropertyIds.OBJECT_TYPE_ID, "D:" + ParkTypeIds.EMPLOYEE_DOCUMENT);
>>> document.updateProperties(properties);
>>>
>>> But this doesn't work. There is no exception, but the type doesn't change.
>>> Is it possible to change the type after creation?
>>>
>>> Kind regards,
>>>
>>> Mano Swerts
>>>
>>>
>>>
>>> _________________________________________________
>>>
>>>   We published a new company movie featuring YOU!
>>>           See http://www.aca-it.be/movie
>>> _________________________________________________
>>>
>>>
> 


Re: Update Object Type

Posted by Mano Swerts <m....@aca-it.be>.
Hi Florian,

Thanks for the quick reply.

I understand that it is not logical to update the type, but in my case the object is of a parent type park:Document and I want to change it to the child type park:employeeDocument. So this is theoretically possible because the child only defines some extra fields.

Will this be possible in the future for parent-child types or is my only solution to create a new object of the child type and copy all property values?

Kind regards,

Mano

On 24 Jan 2011, at 15:12, Florian Müller wrote:

> Hi Mano,
> 
> It is not possible to change the object type after creation.
> OpenCMIS silently removes the property from the properties map because it is not valid for a property update.
> 
> 
> Regards,
> 
> Florian
> 
> 
> 
> On 24/01/2011 14:07, Mano Swerts wrote:
>> Hi all,
>> 
>> I use OpenCMIS 0.2 to connect to an Alfresco 3.4 repository.
>> 
>> I try to update the object type using the following code:
>> 
>> Map<String, Object>  properties = new HashMap<String, Object>();
>> properties.put(PropertyIds.OBJECT_TYPE_ID, "D:" + ParkTypeIds.EMPLOYEE_DOCUMENT);
>> document.updateProperties(properties);
>> 
>> But this doesn't work. There is no exception, but the type doesn't change.
>> Is it possible to change the type after creation?
>> 
>> Kind regards,
>> 
>> Mano Swerts
>> 
>> 
>> 
>> _________________________________________________
>> 
>>  We published a new company movie featuring YOU!
>>          See http://www.aca-it.be/movie
>> _________________________________________________
>> 
>> 


Re: Update Object Type

Posted by Florian Müller <fl...@alfresco.com>.
Hi Mano,

It is not possible to change the object type after creation.
OpenCMIS silently removes the property from the properties map because 
it is not valid for a property update.


Regards,

Florian



On 24/01/2011 14:07, Mano Swerts wrote:
> Hi all,
>
> I use OpenCMIS 0.2 to connect to an Alfresco 3.4 repository.
>
> I try to update the object type using the following code:
>
> Map<String, Object>  properties = new HashMap<String, Object>();
> properties.put(PropertyIds.OBJECT_TYPE_ID, "D:" + ParkTypeIds.EMPLOYEE_DOCUMENT);
> document.updateProperties(properties);
>
> But this doesn't work. There is no exception, but the type doesn't change.
> Is it possible to change the type after creation?
>
> Kind regards,
>
> Mano Swerts
>
>
>
> _________________________________________________
>
>   We published a new company movie featuring YOU!
>           See http://www.aca-it.be/movie
> _________________________________________________
>
>