public final class DocumentManager extends Object
Modifier and Type | Field and Description |
---|---|
protected PSSession |
_session
The user connecting to the server.
|
Constructor and Description |
---|
DocumentManager(PSSession user)
Creates a new manager for PageSeeder groups.
|
Modifier and Type | Method and Description |
---|---|
boolean |
create(PSDocument document,
PSGroup group,
PSMember creator)
Create the specified document in PageSeeder.
|
boolean |
create(PSDocument document,
PSGroup group,
PSMember creator,
Map<String,String> parameters)
Create the specified document in PageSeeder passing the specified template parameters.
|
boolean |
editDocumentProperties(PSDocument document,
PSGroup group,
PSMember creator)
Edit the properties for specified document in PageSeeder.
|
static PSEntityCache<PSDocument> |
getCache() |
void |
getContent(Long uri,
org.xml.sax.helpers.DefaultHandler handler)
Write the content of the specified document onto the XML writer.
|
void |
getContent(Long uri,
org.pageseeder.xmlwriter.XMLWriter xml)
Write the content of the specified document onto the XML writer.
|
void |
getContent(String docid,
org.xml.sax.helpers.DefaultHandler handler)
Write the content of the specified document onto the XML writer.
|
void |
getContent(String docid,
org.pageseeder.xmlwriter.XMLWriter xml)
Write the content of the specified document onto the XML writer.
|
PSDocument |
getDocument(long id,
PSGroup group)
Identify a document from a specific URI ID.
|
PSDocument |
getDocument(String url,
PSGroup group)
Identify a document from a specified URL.
|
PSFolder |
getFolder(String url,
PSGroup group)
Identify a document from a specified URL.
|
static PSEntityCache<PSFolder> |
getFoldersCache() |
PSMLFragment |
getFragment(PSDocument document,
PSGroup group,
PSMember editor,
String fragment)
Create the specified document in PageSeeder.
|
List<PSDocument> |
listDocuments(PSGroup group)
List the documents in the specified group in PageSeeder at the top level (maximum returned 200).
|
List<PSDocument> |
listDocuments(PSGroup group,
String folder,
int max)
List the documents in the specified group in PageSeeder under a folder.
|
List<PSDocument> |
listDocumentsForURL(PSGroup group,
String url,
int max)
List the documents in the specified group in PageSeeder under a parent URL.
|
List<PSFolder> |
listFolders(PSGroup group,
String folder,
int max)
List the folders in the specified group in PageSeeder under a folder.
|
List<PSFolder> |
listFoldersForURL(PSGroup group,
String url,
int max)
List the folders in the specified group in PageSeeder under a parent URL.
|
PSMLFragment |
postFragment(PSDocument document,
PSGroup group,
PSMember editor,
PSMLFragment fragment)
Deprecated.
|
PSMLFragment |
putFragment(PSDocument document,
PSGroup group,
PSMember editor,
PSMLFragment fragment)
Edit the specified fragment in PageSeeder by using PUT method.
|
PSSession |
session() |
PSDocument |
upload(PSGroup group,
String url,
File file)
Uploads a file on the server at the specified URL.
|
PSDocument |
upload(PSGroup group,
String url,
InputStream in,
String filename)
Uploads a file on the server at the specified URL.
|
protected final PSSession _session
public DocumentManager(PSSession user)
user
- The user that can connect to PageSeeder.public boolean create(PSDocument document, PSGroup group, PSMember creator) throws APIException
document
- The document to creategroup
- The group the document is part ofcreator
- The member creating the documenttrue
if the document was created.APIException
public boolean create(PSDocument document, PSGroup group, PSMember creator, Map<String,String> parameters) throws APIException
document
- The document to creategroup
- The group the document is part ofcreator
- The member creating the documentparameters
- The parameters for the PSML templatetrue
if the document was created.APIException
public boolean editDocumentProperties(PSDocument document, PSGroup group, PSMember creator) throws APIException
document
- The document to creategroup
- The group the document is part ofcreator
- The member creating the documenttrue
if the document properties was edit.APIException
public PSDocument getDocument(long id, PSGroup group) throws APIException
id
- The URI ID of the document.group
- The group the document is accessible from.APIException
public PSDocument getDocument(String url, PSGroup group) throws APIException
url
- The URLgroup
- The group the document is accessible from.APIException
public PSFolder getFolder(String url, PSGroup group) throws APIException
url
- The URLgroup
- The group the folder is part ofAPIException
public List<PSDocument> listDocuments(PSGroup group) throws APIException
group
- The group instance.APIException
public List<PSDocument> listDocuments(PSGroup group, String folder, int max) throws APIException
group
- the groupfolder
- the relative folder path (e.g. documents/myfolder)max
- the maximum number of return documents.APIException
public List<PSFolder> listFolders(PSGroup group, String folder, int max) throws APIException
group
- the groupfolder
- the relative folder path (e.g. documents/myfolder)max
- the maximum number of return documents.APIException
public List<PSDocument> listDocumentsForURL(PSGroup group, String url, int max) throws APIException
group
- the groupurl
- the parent URLmax
- the maximum number of return documents.APIException
public List<PSFolder> listFoldersForURL(PSGroup group, String url, int max) throws APIException
group
- the groupurl
- the parent URLmax
- the maximum number of return documents.APIException
public PSDocument upload(PSGroup group, String url, File file) throws APIException
group
- The group the file should be uploaded tourl
- The URL of the folder receiving the filefile
- The file to uploadAPIException
public PSDocument upload(PSGroup group, String url, InputStream in, String filename) throws APIException
group
- The group the file should be uploaded tourl
- The URL of the folder receiving the filein
- The input stream for file contentfilename
- The filename for the fileAPIException
public PSMLFragment getFragment(PSDocument document, PSGroup group, PSMember editor, String fragment) throws APIException
document
- The document to creategroup
- The group the document is part ofeditor
- The member editing the documentfragment
- The fragment IDAPIException
public PSMLFragment putFragment(PSDocument document, PSGroup group, PSMember editor, PSMLFragment fragment) throws APIException
document
- The document to creategroup
- The group the document is part ofeditor
- The member editing the documentfragment
- The fragment to editAPIException
@Deprecated public PSMLFragment postFragment(PSDocument document, PSGroup group, PSMember editor, PSMLFragment fragment) throws APIException
putFragment(PSDocument, PSGroup, PSMember, PSMLFragment)
instead.document
- The document to creategroup
- The group the document is part ofeditor
- The member editing the documentfragment
- The fragment to editAPIException
public void getContent(Long uri, org.pageseeder.xmlwriter.XMLWriter xml) throws APIException
uri
- The URI ID of the document.xml
- The XML to write the contentAPIException
public void getContent(Long uri, org.xml.sax.helpers.DefaultHandler handler) throws APIException
uri
- The URI ID to findhandler
- The handler to handle the contentAPIException
public void getContent(String docid, org.pageseeder.xmlwriter.XMLWriter xml) throws APIException
docid
- The document ID to findxml
- The XML to write the contentAPIException
public void getContent(String docid, org.xml.sax.helpers.DefaultHandler handler) throws APIException
docid
- The document ID to findhandler
- The handler to handle the contentAPIException
public static PSEntityCache<PSDocument> getCache()
public static PSEntityCache<PSFolder> getFoldersCache()
public PSSession session()
Copyright © 2016 Allette Systems. All rights reserved.