Hi Florian,

Thanks for your answers. I solve my issue by using a webscript Alfresco and it 
works fine. 


To launch webscript without authenticate again I get AuthenticationProvider 
from the session and use it with an HttpURLConnection.

The only point after an update of type the cmis cache is unsynchronised so you 
need to clear the session. (not surprised)


You are correct a type can't be updated without checking the new type is a 
child of current type.

Regards


Willy




________________________________
De : Florian Müller <[email protected]>
À : [email protected]
Cc : Reinhardt Willy <[email protected]>; "Hermes, Martin" 
<[email protected]>
Envoyé le : Vendredi 2 Septembre 2011 17h19
Objet : Re: Re : update PropertyIds.OBJECT_TYPE_ID

Hi Willy,

Actually, the OpenCMIS client removes all readonly and oncreate properties 
before it sends the property values to the server. That's why you don't see any 
server error messages.

But, although changing the type in Alfresco is possible, you should do that 
with care since it may have side-effects that you don't expect.

HttpUtils and BindingSession are internal OpenCMIS interfaces and not meant to 
be used as an API. If really want to build a BindingSession object (again: not 
recommended), have a look at 
org.apache.chemistry.opencmis.client.bindings.impl.CmisBindingImpl .


- Florian


On 01/09/2011 15:17, Reinhardt Willy wrote:
> Hi Martin,
> 
> Thanks to point me on the specification  I didn't have the reaction to look 
> there. So I will use an Alfresco web script to work around that limitation. 
> 
> 
> To avoid an authentication I would try to use the cmis session to call web 
> script request. I see the class 
> 
> 
> org.apache.chemistry.opencmis.client.bindings.spi.atompub.HttpUtils with a 
> method invokeGET that need a BindingSession as parameter. Have you an idea 
> how to build a BindingSession from the 
> org.apache.chemistry.opencmis.client.api.Session ? 
> 
> 
> Thanks
> 
>  
> Willy
> 
> 
> 
> 
> ________________________________
> De : "Hermes, Martin" <[email protected]>
> À : "[email protected]" <[email protected]>
> Envoyé le : Mercredi 31 Août 2011 8h15
> Objet : RE: update PropertyIds.OBJECT_TYPE_ID
> 
> Hi Willy,
> the property definition of the property object_type_id has according to the 
> CMIS specification "updatability = oncreate". This means the property value 
> can only be updated during the create operation of an object. 
> Exceptions are in this case repository specific.
> 
> Regards,
> Martin
> 
> -----Original Message-----
> From: Reinhardt Willy [mailto:[email protected]] 
> Sent: Dienstag, 30. August 2011 17:55
> To: [email protected]
> Subject: update PropertyIds.OBJECT_TYPE_ID
> 
> Hi,
> 
> Based on sample 
> http://chemistry.apache.org/java/examples/example-create-update.html 
> 
> I tried to update properties, it works fine for property I create like Date, 
> String, ...
> 
> But I couldn't update the property  "cmis:objectTypeId" nothing append no 
> error, no exception.
> 
> Code is:
> CmisObject obj = this.sessionBean.getSession().getObject(documentId); 
> HashMap<String, Object> properties = new HashMap<String, Object>();
> properties.put(PropertyIds.OBJECT_TYPE_ID, "laa:Facture");
> obj=obj.updateProperties(properties);
> 
> 
> My question:
> Could I change the object type id using updateProperties ?
> If not how could I update the  OBJECT_TYPE_ID ?
> 
> Thanks for your help.
> 
> Note:
> - I am using Alfresco 4.0.0 as DM
> - The new type can be setted (I can change it on Alfresco interface)
> - Chemistry client 0.4
> 
> Willy

Reply via email to