As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
String urlStringPut = "http://192.168.0.33:8070/alfresco/service/api/node/workspace/SpacesStore/689ab69e-39ab-4e50-ac02-8663d9824a8a?alf_ticket=" + authTicket; PutMethod put = new PutMethod(urlStringPut ); String test = FileUtils.readFileToString(new File("E:\\updateNode.xml")); //you can construct xml thro proggram,this is just a test. put.setDoAuthentication(true); put.setRequestHeader("Content-Type", "application/atom+xml"); put.setRequestEntity(new StringRequestEntity(test, "application/atom+xml", "UTF-8")); int status = client.executeMethod(put); if (status != HttpStatus.SC_OK) { System.err.println("Method failed: " + put.getStatusLine()); } String resultString = put.getResponseBodyAsString();
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:alf="http://www.alfresco.org"> <summary>test modify cm:description property ahhahahah</summary> <!– summary is cm:description property–> <title>test modify cm_name property</title> <!– title is cm:name property–> <cmisra:object> <cmis:properties> <cmis:propertyInteger propertyDefinitionId="cmis:contentStreamLength" displayName="Content Stream Length" queryName="cmis:contentStreamLength"> <cmis:value>98495335</cmis:value> </cmis:propertyInteger> <alf:setAspects> <alf:aspectsToAdd>P:cm:titled</alf:aspectsToAdd> <alf:properties> <cmis:propertyString propertyDefinitionId="cm:title" queryName="cm:title"> <cmis:value>New Title hahahahh</cmis:value> </cmis:propertyString> </alf:properties> </alf:setAspects> </cmis:properties> </cmisra:object> </entry>