cancel
Showing results for 
Search instead for 
Did you mean: 

How to update metadata using CMIS

himvj
Champ in-the-making
Champ in-the-making
Hi,

I am trying to work with dotcmis source code,
I have downloaded vs 2010 and dotcmis,after opening the dotcmis project it is showing only classes and no any user interface.
can any body provide me a sample code to update the metadata in alfresco using cmis in .net.



Thanks in advance,
1 REPLY 1

pedronaranjo
Champ in-the-making
Champ in-the-making
This sample is not using dotcmis on VS2010.

I have used Alfresco web services CMIS: http://localhost:8080/alfresco/cmisws/ObjectService on VS2010

Using function: updateProperties you can update properties, but remember that you can not change readonly properties. You can change "cmis:name" property for example, but you can not change "cmis:lastModificationDate".
However you can create your own properties and update it.

           

Dim objObject As New Alfresco_WS_CMIS.ObjectServicePortClient
Dim objProperties As New Alfresco_WS_CMIS.cmisPropertiesType()
Dim objProperty(0) As Alfresco_WS_CMIS.cmisProperty

'/* Se definen los distintos Tipos de Propiedades */
Dim objPropertyID(0) As Alfresco_WS_CMIS.cmisPropertyId
Dim objPropertyString(0) As Alfresco_WS_CMIS.cmisPropertyString
        
objPropertyID(0) = New Alfresco_WS_CMIS.cmisPropertyId
objPropertyString(0) = New Alfresco_WS_CMIS.cmisPropertyString

objProperties.Items = objProperty

With objPropertyString(0)
      .propertyDefinitionId = "cmis:name"
       Dim aValor(0) As String
       aValor(0) = NEW_PROPERTY_VALUE
       .value = aValor
End With

objProperties.Items(0) = objPropertyString(0)

objObject.updateProperties(Me.RepositoryID, ObjetID, Nothing, objProperties, Nothing)

i hope this helps