Search in sources :

Example 1 with CMLDelete

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();
    }
}
Also used : CML(org.alfresco.webservice.types.CML) RepositoryFault(org.alfresco.webservice.repository.RepositoryFault) CMLDelete(org.alfresco.webservice.types.CMLDelete) ParentReference(org.alfresco.webservice.types.ParentReference) Reference(org.alfresco.webservice.types.Reference) AuthenticationFault(org.alfresco.webservice.authentication.AuthenticationFault) RemoteException(java.rmi.RemoteException) Predicate(org.alfresco.webservice.types.Predicate)

Aggregations

RemoteException (java.rmi.RemoteException)1 AuthenticationFault (org.alfresco.webservice.authentication.AuthenticationFault)1 RepositoryFault (org.alfresco.webservice.repository.RepositoryFault)1 CML (org.alfresco.webservice.types.CML)1 CMLDelete (org.alfresco.webservice.types.CMLDelete)1 ParentReference (org.alfresco.webservice.types.ParentReference)1 Predicate (org.alfresco.webservice.types.Predicate)1 Reference (org.alfresco.webservice.types.Reference)1