cancel
Showing results for 
Search instead for 
Did you mean: 

cant edit custom Property with the cmis-extension

schurik
Champ in-the-making
Champ in-the-making
Hello,

i use Alfresco 4.0.d and the alfresco-opencmis-extension-0.4. I created a action in Alfresco where i want to edit a custom property. For that i add the Parameter  "parameter.put(SessionParameter.OBJECT_FACTORY_CLASS, "org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl");" to the session and tried to update a Property with that code.


public void updateDocTest(Session session, Document doc){
      Map<String, Object> properties = new HashMap<String, Object>();
      properties.put("do:myid", "000011");
      doc.updateProperties(properties);
   }

After run the action, the custom Property is emty and i can't understand why…
When i create a simple java class and run the code outside from alfresco, it work fine. But when i use the code in Alfresco in a action, then the code dont work.

Can someone help me pls.

Thank you
4 REPLIES 4

aevans713
Champ in-the-making
Champ in-the-making
Hi,

Could you post any logs or other information to help us see what happens when you try to run the script?

schurik
Champ in-the-making
Champ in-the-making
Hi,

i have no error in the logs. When i run the action with "properties.put(PropertyIds.NAME, "name");", it works fine. So i can edit the standard properties, but not the custom properties.

Is it possible, that alfresco dont find the alfresco-opencmis-extension? I put the jar in the classpath from the Project. Need alfresco the jar in a other folder too?

americanolinhar
Champ on-the-rise
Champ on-the-rise

I have the same problem. Via CMIS I can update the document's name but I can't update others properties neither the custom aspect property (sc:isActiveDadosIncoerentes). There is no error message but only the name is updated.
My code:

                        Document doc = (AlfrescoDocument) session.getObject(valueList[4]);
         Map<String, Object> documentProperties = new HashMap<String, Object>();
         documentProperties.put( PropertyIds.CREATED_BY,"operadoralfresco");
         documentProperties.put( PropertyIds.CREATION_DATE,"01012010");
         documentProperties.put( PropertyIds.NAME,"teste2");
         documentProperties.put("sc:isActiveDadosIncoerentes", "true");
         doc.updateProperties(documentProperties,true);

Can anyone help me?