Retrieves a Document from the repository based on a folder path.
private List<String> getPropertiesToRead() {
List<String> props = new List<String>();
//the list of all available properties displays below but to increase efficiency in your searches, you can omit unnecessary properties from your application and those values will not be returned
props.add("version");
props.add("subject");
props.add("categories");
props.add("createdOn");
props.add("createdBy");
props.add("modifiedBy");
props.add("modifiedOn");
props.add("name");
props.add("author");
props.add("authorDate");
props.add("size");
//the contentType is only relevant to a document of type FILE
props.add("contentType");
//the contentType is only relevant to a document of type FILE
props.add("content");
props.add("type");
props.add("parentFolder");
props.add("checkedOutBy");
props.add("checkedOutOn");
props.add("checkedInBy");
props.add("checkedInOn");
props.add("versionText");
//the url is only relevant to a document of type HYPERLINK
props.add("url");
//the contentType is only relevant to a document of type SHORTCUT
props.add("shortcutToDocument");
return props;
}
private Document readDocumentByPath() throws Exception {
//the first parameter, path, identifies the document folder path to
the target document whose specified properties to return
Document document = documentRepository.readDocumentByPath("TopLevel_Users_john",
getPropertiesToRead());
return document;
}