Search in sources :

Example 1 with ContentDAO

use of com.tomasio.projects.trainning.dao.ContentDAO in project trainning by fernandotomasio.

the class ECMServiceSimpleImpl method findDocumentByUUID.

@Override
public DocumentDTO findDocumentByUUID(String uuid) {
    ContentDAO dao = factory.getContentDAO();
    DocumentDTO document = dao.findDocumentByUUID(uuid);
    return document;
}
Also used : DocumentDTO(com.tomasio.projects.trainning.dto.DocumentDTO) ContentDAO(com.tomasio.projects.trainning.dao.ContentDAO)

Example 2 with ContentDAO

use of com.tomasio.projects.trainning.dao.ContentDAO in project trainning by fernandotomasio.

the class ECMServiceSimpleImpl method removeContent.

@Override
public void removeContent(String uuid) {
    ContentDAO dao = factory.getContentDAO();
    dao.removeContent(uuid);
}
Also used : ContentDAO(com.tomasio.projects.trainning.dao.ContentDAO)

Example 3 with ContentDAO

use of com.tomasio.projects.trainning.dao.ContentDAO in project trainning by fernandotomasio.

the class ECMServiceSimpleImpl method createDocumentWithUUIDParent.

@Override
public String createDocumentWithUUIDParent(DocumentDTO document, String uuidParent) {
    ContentDAO dao = factory.getContentDAO();
    String uuid;
    uuid = dao.createDocumentWithUUIDParent(document, uuidParent);
    return uuid;
}
Also used : ContentDAO(com.tomasio.projects.trainning.dao.ContentDAO)

Example 4 with ContentDAO

use of com.tomasio.projects.trainning.dao.ContentDAO in project trainning by fernandotomasio.

the class ECMServiceSimpleImpl method createFolder.

@Override
public String createFolder(FolderDTO folder, String path) {
    ContentDAO dao = factory.getContentDAO();
    String uuid;
    uuid = dao.createFolder(folder, path);
    return uuid;
}
Also used : ContentDAO(com.tomasio.projects.trainning.dao.ContentDAO)

Example 5 with ContentDAO

use of com.tomasio.projects.trainning.dao.ContentDAO in project trainning by fernandotomasio.

the class ImportTurmasImplEfetivasFromTabelao method recuperarDocumentos.

private void recuperarDocumentos(String codCurso, String numeroTurma, TurmaEfetiva turmaCriada, Connection conn) {
    SimpleDateFormat df = new SimpleDateFormat("yyyy");
    ContentDAO contentDAO = new AlfrescoContentDAO();
    TurmaDAO turmaDAO = new HibernateTurmaDAO();
    String documentsRoot = "SGC/Documentos de Treinamentos/testes";
    String oldFolderName = "D-CTP/Documentos de Treinamentos/2013/" + codCurso + "-" + numeroTurma;
    String newFolderName = df.format(turmaCriada.getExercicio()) + "_" + turmaCriada.getCurso().getCodigo() + "_" + turmaCriada.getNumeroTurma() + "_" + turmaCriada.getId();
    try {
        WebServiceFactory.setEndpointAddress("http://dctp.decea.intraer:8080/ecm/api");
        boolean existsOldFolder = contentExistsByPath(oldFolderName);
        if (existsOldFolder) {
            WebServiceFactory.setEndpointAddress("http://10.32.63.32:8080/alfresco/api");
            FolderDTO folder = new FolderDTO();
            folder.setName(newFolderName);
            String folderId = contentDAO.createFolder(folder, documentsRoot);
            turmaCriada.setFolderId(folderId);
            turmaDAO.update(turmaCriada);
            WebServiceFactory.setEndpointAddress("http://dctp.decea.intraer:8080/ecm/api");
            ContentDTO[] contents = findAllContentByPath(oldFolderName);
            for (ContentDTO content : contents) {
                WebServiceFactory.setEndpointAddress("http://dctp.decea.intraer:8080/ecm/api");
                DocumentDTO document = findDocumentByUUID(content.getUid());
                document.setMimeType("application/pdf");
                WebServiceFactory.setEndpointAddress("http://10.32.63.32:8080/alfresco/api");
                contentDAO.createDocumentWithUUIDParent(document, folderId);
            }
        }
    } catch (Exception ex) {
        Logger.getLogger(ImportTurmasImplEfetivasFromTabelao.class.getName()).log(Level.SEVERE, null, ex);
    }
}
Also used : ParseException(java.text.ParseException) RemoteException(java.rmi.RemoteException) DAOException(com.tomasio.projects.trainning.exception.DAOException) ContentDAO(com.tomasio.projects.trainning.dao.ContentDAO) AlfrescoContentDAO(com.tomasio.projects.trainning.dao.AlfrescoContentDAO) ContentDTO(com.tomasio.projects.trainning.dto.ContentDTO) FolderDTO(com.tomasio.projects.trainning.dto.FolderDTO) HibernateTurmaDAO(com.tomasio.projects.trainning.dao.HibernateTurmaDAO) DocumentDTO(com.tomasio.projects.trainning.dto.DocumentDTO) AlfrescoContentDAO(com.tomasio.projects.trainning.dao.AlfrescoContentDAO) HibernateTurmaDAO(com.tomasio.projects.trainning.dao.HibernateTurmaDAO) TurmaDAO(com.tomasio.projects.trainning.dao.TurmaDAO) SimpleDateFormat(java.text.SimpleDateFormat)

Aggregations

ContentDAO (com.tomasio.projects.trainning.dao.ContentDAO)9 DocumentDTO (com.tomasio.projects.trainning.dto.DocumentDTO)4 AlfrescoContentDAO (com.tomasio.projects.trainning.dao.AlfrescoContentDAO)2 HibernateTurmaDAO (com.tomasio.projects.trainning.dao.HibernateTurmaDAO)1 TurmaDAO (com.tomasio.projects.trainning.dao.TurmaDAO)1 ContentDTO (com.tomasio.projects.trainning.dto.ContentDTO)1 FolderDTO (com.tomasio.projects.trainning.dto.FolderDTO)1 DAOException (com.tomasio.projects.trainning.exception.DAOException)1 FileOutputStream (java.io.FileOutputStream)1 OutputStream (java.io.OutputStream)1 RemoteException (java.rmi.RemoteException)1 ParseException (java.text.ParseException)1 SimpleDateFormat (java.text.SimpleDateFormat)1