|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface RestClient
A simple interface around the Gliffy REST API. Instances of this class should be instantiated by the call RestClientFactory.getInstance
| Nested Class Summary | |
|---|---|
static class |
RestClient.HttpAction
Supported Http Verbs |
| Method Summary | |
|---|---|
void |
authenticate(java.lang.String accountId,
java.lang.String username,
java.lang.String systemName,
java.lang.String apiKey,
java.lang.String apiSecret)
Authenticates and authorizes the use of this RestClient instance. |
Document |
createDocument(java.lang.String name)
Create a new document. |
Document |
createDocument(java.lang.String name,
Document document)
Create a new document from a copy. |
Document |
createDocument(java.lang.String name,
Document document,
java.lang.String path)
Create a new document from a copy and place it in a folder. |
Document |
createDocument(java.lang.String name,
java.lang.String path)
Create a new document in a folder. |
void |
createFolder(java.lang.String path)
Create a folder providing the path of this folder. |
void |
createUser(java.lang.String username)
Creates a user with the provided username. |
void |
deleteDocument(Document document)
Deletes a document. |
void |
deleteDocument(java.lang.Long id)
Deletes a document by id. |
void |
deleteFolder(java.lang.String path)
Delete a folder by it's path. |
void |
deleteUser(java.lang.String username)
Deletes a user by username. |
void |
deleteUser(User user)
Deletes a user. |
Account |
getAccountInfo(boolean showUsers)
Returns an account object. |
User |
getAuthenticatedUser()
Returns the user associated with this client. |
java.io.InputStream |
getDocumentAs(Document document,
DocumentFileType fileType)
Get the latest version of the document as a different file type. |
java.io.InputStream |
getDocumentAs(Document document,
DocumentFileType fileType,
DocumentSize documentSize)
Get the latest version of the document as a different file type (scale it if possible). |
java.io.InputStream |
getDocumentAs(Document document,
DocumentFileType fileType,
DocumentSize documentSize,
java.lang.Long version)
Get a specific version of the document as a different file type (scale it if possible). |
java.io.InputStream |
getDocumentAs(Document document,
DocumentFileType fileType,
java.lang.Long version)
Get a specific version of a document as a different file type. |
Document |
getDocumentDetails(Document document)
Get a document with revision details. |
Document |
getDocumentDetails(java.lang.Long documentId)
Get a document with revision details. |
java.util.List<Document> |
getDocuments()
Get all documents in an account. |
java.util.List<Document> |
getDocuments(DocumentSecurity access)
Get all documents in an account, filtered by public of private access. |
java.util.List<Document> |
getDocumentsByFolder(java.lang.String path)
Get all documents found in the folder path. |
Folder |
getFolders()
Get the root folder for all users in this account. |
Folder |
getFolders(java.lang.String username)
Get the root folder that the following username has access to. |
Folder |
getFolders(User user)
Get the root folder that this user has access to. |
java.lang.String |
getHost()
Returns the host that this client points to. |
java.net.URL |
getLaunchLink(Document document,
java.net.URL returnLink,
java.lang.String returnButtonText)
Creates an OAuth signed link to launch the Gliffy Editor with the given document. |
java.util.List<User> |
getUsers()
Returns all users associated with the authenticated account. |
java.util.List<User> |
getUsersWithAccessToFolder(java.lang.String path)
Returns a list of users that have access to a given folder path. |
boolean |
isSSLEnabled()
Returns true if all calls will be encrypted. |
boolean |
isValid()
Returns true if this client is authenticated. |
void |
moveDocument(Document document,
java.lang.String path)
Move a document to a new folder path. |
Response |
request(RestClient.HttpAction action,
java.lang.String path)
A convenience method to send any request to the REST API. |
void |
setHost(java.lang.String host)
Sets the host that this client points to. |
void |
setSSLEnabled(boolean sslEnabled)
Sets to true if you want all calls to be encrypted. |
void |
unauthenticate()
Invalidates this GliffyClient by making a call to delete the API Token. |
void |
updateDocument(Document document)
Updates any changes to the document meta-data. |
Document |
updateDocumentContent(Document document,
java.lang.String xmlContent)
Updates a document with changes provided by the Gliffy xml format. |
Document |
updateDocumentContent(java.lang.Long id,
java.lang.String xmlContent)
Updates a document by with changes provided by the Gliffy xml format. |
void |
updateUser(User user)
Updates user information. |
void |
updateUserAccessToFolder(java.lang.String username,
java.lang.String path,
java.util.List<FolderSecurity> access)
Update a user's access to a folder by username. |
void |
updateUserAccessToFolder(User user,
java.lang.String path,
java.util.List<FolderSecurity> access)
Update a user's access to a folder. |
void |
updateUserPassword(User user,
java.lang.String password)
Update the password for this user. |
| Method Detail |
|---|
boolean isSSLEnabled()
void setSSLEnabled(boolean sslEnabled)
sslEnabled - true if the default protocol is httpsjava.lang.String getHost()
void setHost(java.lang.String host)
host - the host address to point the client to.User getAuthenticatedUser()
boolean isValid()
void authenticate(java.lang.String accountId,
java.lang.String username,
java.lang.String systemName,
java.lang.String apiKey,
java.lang.String apiSecret)
throws ClientException
ClientException will be thrown. This is an
administrative API (B2B), you are performing actions as an admin on behalf of a user.
http://www.gliffy.com/developer/apidocs/rest/user.shtml#createusertoken
accountId - the account id provided to you by Gliffyusername - the administrative user that is logging insystemName - a short description of the calling applicationapiKey - the OAuth key that was provided by GliffyapiSecret - the OAuth secret that was provided by Gliffy
ClientException - functional errors
void unauthenticate()
throws ClientException
http://www.gliffy.com/developer/apidocs/rest/user.shtml#deleteusertoken
ClientException - functional errors
Account getAccountInfo(boolean showUsers)
throws ClientException
http://www.gliffy.com/developer/apidocs/rest/account.shtml#getinfo
showUsers - return the list of users true/false
ClientException - functional errors
java.util.List<User> getUsers()
throws ClientException
http://www.gliffy.com/developer/apidocs/rest/user.shtml#getusers
ClientException - functional errors
void createUser(java.lang.String username)
throws ClientException
http://www.gliffy.com/developer/apidocs/rest/user.shtml#createuser
username - create a new user with the following username
ClientException - functional errors
void updateUser(User user)
throws ClientException
http://www.gliffy.com/developer/apidocs/rest/user.shtml#updateuser
user - the user to update
ClientException - functional errors
void updateUserPassword(User user,
java.lang.String password)
throws ClientException
http://www.gliffy.com/developer/apidocs/rest/user.shtml#updateuser
user - the user to updatepassword - the new password
ClientException - functional errors
void deleteUser(User user)
throws ClientException
http://www.gliffy.com/developer/apidocs/rest/user.shtml#deleteuser
user - the user object to delete
ClientException - functional errors
void deleteUser(java.lang.String username)
throws ClientException
http://www.gliffy.com/developer/apidocs/rest/user.shtml#deleteuser
username - the username of the user to delete
ClientException - functional errors
Folder getFolders(User user)
throws ClientException
Folder object will contain all child folders.
http://www.gliffy.com/developer/apidocs/rest/user.shtml#getfolders
user - the user to filter on
ClientException - functional errors
Folder getFolders(java.lang.String username)
throws ClientException
Folder object will contain all child folders.
http://www.gliffy.com/developer/apidocs/rest/user.shtml#getfolders
username - the username of the user
ClientException - functional errors
Folder getFolders()
throws ClientException
Folder object will contain all child folders.
http://www.gliffy.com/developer/apidocs/rest/folder.shtml#list
ClientException - functional errors
void createFolder(java.lang.String path)
throws ClientException
All folder paths must begin with the folder named ROOT. The folder seperator to be used is a forward slash. The following is a valid folder path: "ROOT/my new folder/my sub folder". Note, an exception will be thrown if the folder "my new folder" does not exist.
http://www.gliffy.com/developer/apidocs/rest/folder.shtml#create
path - the full path to the folder
ClientException - functional errors
void deleteFolder(java.lang.String path)
throws ClientException
All folder paths must begin with the folder named ROOT. The folder seperator to be used is a forward slash. The following is a valid folder path: "ROOT/my new folder/my sub folder". Note, an exception will be thrown if the folder "my new folder" does not exist.
http://www.gliffy.com/developer/apidocs/rest/folder.shtml#delete
path - the full path to the folder
ClientException - functional errors
java.util.List<User> getUsersWithAccessToFolder(java.lang.String path)
throws ClientException
All folder paths must begin with the folder named ROOT. The folder seperator to be used is a forward slash. The following is a valid folder path: "ROOT/my new folder/my sub folder". Note, an exception will be thrown if the folder "my new folder" does not exist.
http://www.gliffy.com/developer/apidocs/rest/folder.shtml#listusers
path - the full path to the folder
ClientException - functional errors
void updateUserAccessToFolder(User user,
java.lang.String path,
java.util.List<FolderSecurity> access)
throws ClientException
Folder access is granted or revoked by the properties found in FolderSecurity. A list of desired
properties are included. Any exclusion of a property means that that property is revoked.
All folder paths must begin with the folder named ROOT. The folder seperator to be used is a forward slash. The following is a valid folder path: "ROOT/my new folder/my sub folder". Note, an exception will be thrown if the folder "my new folder" does not exist.
http://www.gliffy.com/developer/apidocs/rest/folder.shtml#grantuser
http://www.gliffy.com/developer/apidocs/rest/folder.shtml#revokeuser
user - the user who desires accesspath - the full path to the folderaccess - the security access to provide
ClientException - functional errors
void updateUserAccessToFolder(java.lang.String username,
java.lang.String path,
java.util.List<FolderSecurity> access)
throws ClientException
Folder access is granted or revoked by the properties found in FolderSecurity. A list of desired
properties are included. Any exclusion of a property means that that property is revoked.
All folder paths must begin with the folder named ROOT. The folder seperator to be used is a forward slash. The following is a valid folder path: "ROOT/my new folder/my sub folder". Note, an exception will be thrown if the folder "my new folder" does not exist.
http://www.gliffy.com/developer/apidocs/rest/folder.shtml#grantuser
http://www.gliffy.com/developer/apidocs/rest/folder.shtml#revokeuser
username - the username of the userpath - the full path to the folderaccess - the security access to provide
ClientException - functional errors
java.util.List<Document> getDocumentsByFolder(java.lang.String path)
throws ClientException
All folder paths must begin with the folder named ROOT. The folder seperator to be used is a forward slash. The following is a valid folder path: "ROOT/my new folder/my sub folder". Note, an exception will be thrown if the folder "my new folder" does not exist.
http://www.gliffy.com/developer/apidocs/rest/folder.shtml#listdiagrams
path - folder path
ClientException - functional errors
java.util.List<Document> getDocuments()
throws ClientException
http://www.gliffy.com/developer/apidocs/rest/document.shtml#list
ClientException - functional errors
java.util.List<Document> getDocuments(DocumentSecurity access)
throws ClientException
http://www.gliffy.com/developer/apidocs/rest/document.shtml#list
access - the security access to filter by
ClientException - functional errors
Document getDocumentDetails(Document document)
throws ClientException
http://www.gliffy.com/developer/apidocs/rest/document.shtml#get
document - the document
ClientException - functional errors
Document getDocumentDetails(java.lang.Long documentId)
throws ClientException
http://www.gliffy.com/developer/apidocs/rest/document.shtml#get
documentId - the document id
ClientException - functional errors
Document createDocument(java.lang.String name)
throws ClientException
http://www.gliffy.com/developer/apidocs/rest/document.shtml#create
name - the document name
ClientException - functional errors
Document createDocument(java.lang.String name,
java.lang.String path)
throws ClientException
http://www.gliffy.com/developer/apidocs/rest/document.shtml#create
All folder paths must begin with the folder named ROOT. The folder seperator to be used is a forward slash. The following is a valid folder path: "ROOT/my new folder/my sub folder". Note, an exception will be thrown if the folder "my new folder" does not exist.
name - the document namepath - the full folder path
ClientException - functional errors
Document createDocument(java.lang.String name,
Document document)
throws ClientException
http://www.gliffy.com/developer/apidocs/rest/document.shtml#create
name - the document namedocument - the document to copy from
ClientException - functional errors
Document createDocument(java.lang.String name,
Document document,
java.lang.String path)
throws ClientException
http://www.gliffy.com/developer/apidocs/rest/document.shtml#create
name - the document namedocument - the document to copy frompath - the full folder path
ClientException - functional errors
java.io.InputStream getDocumentAs(Document document,
DocumentFileType fileType)
throws ClientException
http://www.gliffy.com/developer/apidocs/rest/document.shtml#view
document - the documentfileType - the new file type
ClientException - functional errors
java.io.InputStream getDocumentAs(Document document,
DocumentFileType fileType,
java.lang.Long version)
throws ClientException
http://www.gliffy.com/developer/apidocs/rest/document.shtml#view
document - the documentfileType - the new file typeversion - the version to get
ClientException - functional errors
java.io.InputStream getDocumentAs(Document document,
DocumentFileType fileType,
DocumentSize documentSize)
throws ClientException
http://www.gliffy.com/developer/apidocs/rest/document.shtml#view
document - the documentfileType - the new file typedocumentSize - the compressed size
ClientException - functional errors
java.io.InputStream getDocumentAs(Document document,
DocumentFileType fileType,
DocumentSize documentSize,
java.lang.Long version)
throws ClientException
http://www.gliffy.com/developer/apidocs/rest/document.shtml#view
document - the documentfileType - the new file typedocumentSize - the compressed sizeversion - the version to get
ClientException - functional errors
void updateDocument(Document document)
throws ClientException
http://www.gliffy.com/developer/apidocs/rest/document.shtml#update
document - the document to act on
ClientException - functional errors
Document updateDocumentContent(Document document,
java.lang.String xmlContent)
throws ClientException
http://www.gliffy.com/developer/apidocs/rest/document.shtml#update
document - the document to act onxmlContent - document changes in gliffy xml format
ClientException - functional errors
Document updateDocumentContent(java.lang.Long id,
java.lang.String xmlContent)
throws ClientException
http://www.gliffy.com/developer/apidocs/rest/document.shtml#update
id - the document idxmlContent - document changes in gliffy xml format
ClientException - functional errors
void deleteDocument(Document document)
throws ClientException
http://www.gliffy.com/developer/apidocs/rest/document.shtml#delete
document - the document to act on
ClientException - functional errors
void deleteDocument(java.lang.Long id)
throws ClientException
http://www.gliffy.com/developer/apidocs/rest/document.shtml#delete
id - the document id
ClientException - functional errors
void moveDocument(Document document,
java.lang.String path)
throws ClientException
All folder paths must begin with the folder named ROOT. The folder seperator to be used is a forward slash. The following is a valid folder path: "ROOT/my new folder/my sub folder". Note, an exception will be thrown if the folder "my new folder" does not exist.
http://www.gliffy.com/developer/apidocs/rest/document.shtml#putfolder
document - the document to act onpath - the destination folder path
ClientException - functional errors
java.net.URL getLaunchLink(Document document,
java.net.URL returnLink,
java.lang.String returnButtonText)
http://www.gliffy.com/developer/apidocs/rest/document.shtml#putfolder
document - the document to launchreturnLink - the url to return the user toreturnButtonText - the text on the button that returns the user
Response request(RestClient.HttpAction action,
java.lang.String path)
throws ClientException
action - http verbpath - the portion of the URL immediately following the API ROOT. This path must begin with a forward
slash '/'
ClientException - functional errors
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||