cancel
Showing results for 
Search instead for 
Did you mean: 

method to set a property value

_valerio_
Champ in-the-making
Champ in-the-making
hi everybody
I had to put some value into a custom property of a document. I'd like to set this property trough my webservice.
I'd like to know if the method to do this is the updateProperties exposed by ObjectServicePort

thanks
3 REPLIES 3

openpj
Elite Collaborator
Elite Collaborator
You have to create your custom CmisProperty using the ObjectFactory class.
Then you need to add your custom value to the values list.

You can take a look at the sample code that I have shared here:
http://forums.alfresco.com/en/viewtopic.php?f=45&t=14882#p83415
Hope this helps.

_valerio_
Champ in-the-making
Champ in-the-making
thanks OpenPj
but I don't have to develop a web service through a java class (like the example in the SDK), probably my question was asked in a bad way.
I'd like to know if there's an out-of-box method (like those on http://localhost:8080/alfresco/cmis ) to put some value into a custom property of a document.
What I need to do is to develop a soap envelope (I'm trying to use soapUI) that should load a document in alfresco (probably through the method addObjectToFolder), add some custom properties to de document (presently I'm able to do so through the business rule "add aspect to item") and, lastly, put a value in the field of the custom properties previously added (probably through the method updateProperties).

thanx Smiley Very Happy

_valerio_
Champ in-the-making
Champ in-the-making
HI everybody Smiley Very Happy
I solved the problem of adding a custom aspect with the value I want; with the method updateProperties I'm able to do it, fillin the field as the example below:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xmlns:ns1="http://docs.oasis-open.org/ns/cmis/core/200908/">
   <soapenv:Header/>
   <soapenv:Body>
      <ns:updateProperties>
         <ns:repositoryId>my_repo_id</ns:repositoryId>
         <ns:objectId>my_object_id</ns:objectId>
<ns:properties>
            <!–You have a CHOICE of the next 8 items at this level–>
            <ns1:propertyId propertyDefinitionId="custom:my_custom_aspect"  localName=  displayName= queryName=>
               <!–Zero or more repetitions:–>
               <ns1:value>my_value</ns1:value>
            </ns1:propertyId>
                   …
                   …
  </ns:properties>
         <ns:extension>
            <!–You may enter ANY elements at this point–>
         </ns:extension>
      </ns:updateProperties>
   </soapenv:Body>
</soapenv:Envelope>

Hope this post will help other people that have the same necessities Smiley Very Happy