Created
December 17, 2019 14:36
-
-
Save doug1n/fae0ee17c0b595dd1d2aee9d6f08b308 to your computer and use it in GitHub Desktop.
Gerar arquivo no e salvar em uma pasta.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function gerarArquivo(conteudo, pastaDestinoId, nomeDocumento) { | |
var docDto = docAPI.newDocumentDto(); | |
docDto.setDocumentId(0); | |
docDto.setDocumentTypeId(""); | |
docDto.setDocumentDescription(nomeDocumento); | |
docDto.setParentDocumentId(parseInt(pastaDestinoId)); | |
var attachArray = new java.util.ArrayList(); | |
var mainAttach = docAPI.newAttachment(); | |
mainAttach.setFileName(nomeDocumento); | |
mainAttach.setPrincipal(true); | |
mainAttach.setAttach(false); | |
mainAttach.setFilecontent(new java.lang.String(conteudo).getBytes("UTF-8")); | |
attachArray.add(mainAttach); | |
var doc = docAPI.createDocument(docDto, attachArray, null, null, null); | |
return doc.getDocumentId(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment