Search in sources :

Example 11 with Predicate

use of org.alfresco.webservice.types.Predicate 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)11 AuthenticationFault (org.alfresco.webservice.authentication.AuthenticationFault)11 RepositoryFault (org.alfresco.webservice.repository.RepositoryFault)11 Predicate (org.alfresco.webservice.types.Predicate)11 Reference (org.alfresco.webservice.types.Reference)11 RepositoryServiceSoapBindingStub (org.alfresco.webservice.repository.RepositoryServiceSoapBindingStub)9 Node (org.alfresco.webservice.types.Node)9 ParentReference (org.alfresco.webservice.types.ParentReference)8 NamedValue (org.alfresco.webservice.types.NamedValue)7 AlfrescoContentDAO (com.tomasio.projects.trainning.dao.AlfrescoContentDAO)3 ContentDTO (com.tomasio.projects.trainning.dto.ContentDTO)3 DocumentDTO (com.tomasio.projects.trainning.dto.DocumentDTO)3 Content (org.alfresco.webservice.content.Content)3 ContentServiceSoapBindingStub (org.alfresco.webservice.content.ContentServiceSoapBindingStub)3 QueryResult (org.alfresco.webservice.repository.QueryResult)3 Query (org.alfresco.webservice.types.Query)3 ResultSetRow (org.alfresco.webservice.types.ResultSetRow)3 CML (org.alfresco.webservice.types.CML)2 ResultSet (org.alfresco.webservice.types.ResultSet)2 DAOException (com.tomasio.projects.trainning.exception.DAOException)1