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;
}
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);
}
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;
}
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;
}
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);
}
}
Aggregations