Document Upload to Studio via API

Hi there,

I want to upload a number of documents to Studio and store them int the repository without attaching to a process as yet (that will come later).

I have the following code in a java program that seems to work but when I open studio there is nothing in the repository.

What am I missing?

public static void createDocumentInRepository() {
	DocumentBuilder docToBuild = new DocumentBuilder();
	
	docToBuild.createNewInstance("Test Doc", true);
	docToBuild.setContentMimeType("text/docx");
	docToBuild.setDescription("Test Doc");
	docToBuild.setFileName("C:\\Users\\user\\Desktop\\test doc.docx");

// docToBuild.setURL(String documentUrl)
docToBuild.done() ;

}

Hi,

the DocumentBuilder is to build Definition of document for the Runtime.

In the Studio, you can upload a number of document (one by one) that you will be able to use later on on every process via the Browse->Import… when creating a new document.

Another way, which is not the safest one, is to shutdown the studio and put your files in /workspace/default/attachments. Before doing it, please backup all your environment as it is not a tested behavior.

regards,

Many thanks, the NoT safest way worked a charm.

All I can say is it’s nice to have my 100+ documents uploaded and usable. It may seem excessive but it’s what I require :slight_smile:

regards
Seán