use of com.tomasio.projects.trainning.dao.ContentDAO in project trainning by fernandotomasio.
the class Main method main.
public static void main(String[] args) throws Exception {
// WebServiceFactory.setEndpointAddress("http://localhost:8084/alfresco/api");
ContentDAO service = new AlfrescoContentDAO();
DocumentDTO content = service.findDocumentSWFByUUID("6c8c1aad-79f6-46ce-a6f6-2380f7341271");
OutputStream out = new FileOutputStream("DOCUMENT.pdf");
out.write(content.getContentStream());
out.close();
// DocumentDTO document = new DocumentDTO();
// FolderDTO folder = new FolderDTO();
//
// document.setDescription("Description");
// document.setTitle("Title");
// document.setName("meusteste5s5.pdf");
// document.setMimeType("application/pdf");
// document.setCharset("UTF-8");
//
//
// InputStream viewStream = new FileInputStream(new File("/home/fernandofot/identidade.pdf"));
// byte[] bytes = org.apache.commons.io.IOUtils.toByteArray(viewStream);
//
// document.setContentStream(bytes);
//
// ContentDTO [] contents = service.findAllContentByPath("D-CTP");
// for(ContentDTO content: contents){
// System.out.println(content.getTitle());
// }
// service.addDocumentToTreinamento(document,"COMGAR", "2018", "AP005", "2");
// Open the file and convert to byte array
//
//
// folder.setDescription("My description folder");
// folder.setName("CTP001-3");
// folder.setTitle("Minha Linda Pasta");
//
//
//
//
//
// ECMService service = new AlfrescoECMService();
//
// ContentDTO content = service.findDocumentoByUUID("5e587e0b-f0ca-4264-abdc-dc791197b7f7");
// content.setName("new_name.pdf");
// content.setTitle("New Title");
// content.setDescription("New Description");
// DocumentDTO documento = (DocumentDTO) content;
// System.out.println(documento.getContentStream().length);
// ContentDTO [] docs = service.findDocumentosByTreinamento("CTP004", "5", "2015");
// for (ContentDTO documentDTO : docs) {
// System.out.println(documentDTO.getName());
// }
// ContentDTO [] documentos = service.findDocumentosByTreinamento("TEL007", "1", "2017");
//
// for (ContentDTO contentDTO : documentos) {
// System.out.println(contentDTO.getName());
// }
// String uid = service.createDocument(document, "D-CTP/Documentos de Treinamentos/CTP001-3");
// System.out.println(uid);
// String uid = service.createFolder(folder, "D-CTP/Documentos de Treinamentos");
// System.out.println(uuid);
// service.findContentByUUID(uid);
// System.out.println(service.contentExistsByPath("D-CTP/Documentos de Treinamentos"));
}
use of com.tomasio.projects.trainning.dao.ContentDAO in project trainning by fernandotomasio.
the class ECMServiceSimpleImpl method createFolderWithUUIDParent.
@Override
public String createFolderWithUUIDParent(FolderDTO folder, String uuidParent) {
ContentDAO dao = factory.getContentDAO();
String uuid;
uuid = dao.createFolderWithUUIDParent(folder, uuidParent);
return uuid;
}
use of com.tomasio.projects.trainning.dao.ContentDAO in project trainning by fernandotomasio.
the class ECMServiceSimpleImpl method createDocument.
@Override
public String createDocument(DocumentDTO document, String path) {
ContentDAO dao = factory.getContentDAO();
String uuid;
uuid = dao.createDocument(document, path);
return uuid;
}
use of com.tomasio.projects.trainning.dao.ContentDAO in project trainning by fernandotomasio.
the class ECMServiceSimpleImpl method findDocumentSWFByUUID.
@Override
public DocumentDTO findDocumentSWFByUUID(String uuid) {
ContentDAO dao = factory.getContentDAO();
DocumentDTO document = dao.findDocumentSWFByUUID(uuid);
return document;
}
Aggregations