use of org.alfresco.webservice.types.CMLDelete in project trainning by fernandotomasio.
the class AlfrescoContentDAO method removeContent.
// @Override
// public ContentDTO[] findDocumentosByTreinamento(String curso, String turma,
// String exercicio) {
// String path = DCTP_SPACE + "/" + TREINAMENTOS_SPACE + "/" + exercicio
// + "/" + curso + "-" + turma;
// return findAllContentByPath(path);
// }
@Override
public void removeContent(String uuid) {
try {
AuthenticationUtils.startSession(USERNAME, PASSWORD);
WebServiceFactory.getRepositoryService();
Reference node = new Reference();
node.setStore(STORE);
node.setUuid(uuid);
Predicate predicate = new Predicate(new Reference[] { node }, STORE, null);
// delete content
CMLDelete delete = new CMLDelete();
delete.setWhere(predicate);
// create CML update object
CML cmlRemove = new CML();
cmlRemove.setDelete(new CMLDelete[] { delete });
// perform a CML update to create the node
WebServiceFactory.getRepositoryService().update(cmlRemove);
} catch (AuthenticationFault e) {
Logger.getLogger(AlfrescoContentDAO.class.getName()).log(Level.SEVERE, "Erro de Autenticação");
} catch (RepositoryFault e) {
Logger.getLogger(AlfrescoContentDAO.class.getName()).log(Level.INFO, "Conteúdo não disponível");
} catch (RemoteException e) {
Logger.getLogger(AlfrescoContentDAO.class.getName()).log(Level.SEVERE, "Erro de Acesso a Serviço Web");
} finally {
// End the session
AuthenticationUtils.endSession();
}
}
Aggregations