02-03-2014 05:26 AM
03-07-2014 10:50 PM
policyBehaviourFilter.disableBehaviour(nodeRef, ContentModel.ASPECT_AUDITABLE);
// Update properties of cm:auditable aspect
nodeService.setProperty(nodeRef, ContentModel.PROP_CREATOR, "xxxxxx");
nodeService.setProperty(nodeRef, ContentModel.PROP_MODIFIER, "xxxxxx");
// Enable auditable aspect
policyBehaviourFilter.enableBehaviour(nodeRef, ContentModel.ASPECT_AUDITABLE);
03-10-2014 01:51 PM
public void beforeUpdateNode(NodeRef arg0)
{
policyBehaviourFilter.disableBehaviour(arg0, ContentModel.ASPECT_AUDITABLE);
}
public void onUpdateNode(NodeRef nodo)
{
//if I uncomment this lines below, it takes the values fine but I don´t want to put this values in the behavior
//nodeService.setProperty(nodo, ContentModel.PROP_CREATOR, "Barack Obama");
//nodeService.setProperty(nodo, ContentModel.PROP_MODIFIER, "Michael Jackson");
}
}
public static String pruebaChangeOwner () throws Exception
{
String strParams="{\"prop_cm_name\":\"pruebaREAL\",\"prop_cm_title\":\"JOJO\",\"prop_cm_modifier\":\"danone\",\"prop_mimetype\":\"application/pdf\",\"prop_cm_author\":\"aaaaa\",\"prop_cm_taggable\":\"\"}";
String result=executePOST (cookieStore, "http://localhost:8080/share/proxy/alfresco/api/node/workspace/SpacesStore/85118fe0-c681-4d61-9f3f-3f...", strParams,"application/json");
System.out.println(result);
return result;
}
private static String executePOST (CookieStore cookieStore, String url, String parametros, String strContentType) throws Exception
{
try
{
DefaultHttpClient client = new DefaultHttpClient();
client.setCookieStore(cookieStore);
HttpPost post = new HttpPost(url);
post.setHeader("Content-Type", strContentType);
post.setEntity(new StringEntity(parametros,"UTF-8"));
ResponseHandler<String> responseHandler = new BasicResponseHandler();
String response = client.execute(post, responseHandler);
return response;
}
catch (ClientProtocolException ex){return ex.getMessage();}
catch (IOException ex){return ex.getMessage();}
catch (Exception ex){return ex.getMessage();}
}//execute
{
"persistedObject": "workspace://SpacesStore/85118fe0-c681-4d61-9f3f-3f4311315499",
"message": "Successfully persisted form for item [node]workspace/SpacesStore/85118fe0-c681-4d61-9f3f-3f4311315499"
}
03-11-2014 01:06 AM
policyBehaviourFilter.disableBehaviour(nodeRef, ContentModel.ASPECT_AUDITABLE);
03-17-2014 12:48 PM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.