public interface IGoogle
Modifier and Type | Method and Description |
---|---|
void |
checkOutForGoogleDocsEditing(java.lang.String ticket,
java.lang.String objectId)
Checks out the node referenced by the passed in objectId to be edited in Google Docs.
|
boolean |
completeGoogleDocsAuthentication(java.lang.String authCode)
Completes the OAuth handshake by using the provided authorization code to fetch access and refresh tokens
for future API calls.
|
java.lang.String |
createGoogleDocument(java.lang.String ticket,
java.lang.String parentObjectId,
java.lang.String objectTypeBeanName,
java.lang.String googleDocType)
Creates a new node in the repository that contains a reference to a blank Google document of the specified
Google document type.
|
void |
discardGoogleDocument(java.lang.String ticket,
java.lang.String objectId,
boolean override)
Discards the Google document associated with the passed in objectId and deletes the reference between
the repository node and the Google document that is deleted.
|
java.util.Map<java.lang.String,java.lang.Boolean> |
getEditingInGoogleDocsConditions(java.lang.String ticket,
java.lang.String objectId)
Checks if the node referenced by the passed in objectId is currently in an editing state in Google Docs.
|
java.lang.String |
getGoogleDocsAuthenticationUrl(java.lang.String state)
Constructs a Google Docs authentication URL passing along the provided state parameter that is provided
to the configured redirect URI.
|
boolean |
isGoogleDocsAuthenticated()
Checks if the current user is authenticated with Google Docs.
|
void |
saveGoogleDocument(java.lang.String ticket,
java.lang.String objectId,
boolean override,
java.lang.String description)
Saves the content of the node's associated Google document to the repository node.
|
void |
uploadGoogleDocument(java.lang.String ticket,
java.lang.String objectId)
Uploads the content of a repository node to a newly created Google document that is then linked to the repository
node so the content can be used when the Google document is saved back to the repository.
|
boolean isGoogleDocsAuthenticated()
java.lang.String getGoogleDocsAuthenticationUrl(java.lang.String state)
state
- the state string that will be passed through to the redirect URI. Must not be null.boolean completeGoogleDocsAuthentication(java.lang.String authCode)
authCode
- the authorization code to use to fetch the access and refresh tokens.java.lang.String createGoogleDocument(java.lang.String ticket, java.lang.String parentObjectId, java.lang.String objectTypeBeanName, java.lang.String googleDocType)
ticket
- a valid OC ticket.parentObjectId
- the objectId of the parent folder in which to create the repository node.objectTypeBeanName
- the bean name of the object type to use for the newly created repository object.googleDocType
- one of 'document', 'spreadsheet' or 'presentation' to determine the type of Google document to create.OCAuthenticationException
- if an error occurs authenticating the user prior to document creation.void saveGoogleDocument(java.lang.String ticket, java.lang.String objectId, boolean override, java.lang.String description)
OCRuntimeException
if the save fails.ticket
- a valid OC ticket.objectId
- the objectId of the node that contains the reference to the Google document to save the content for.override
- true to ignore any concurrent edits made by other users, false to error if the document has been
edited by other users in the configured time threshold.description
- the comment to use for the newly created version.OCConflictException
- if the document has concurrent editors and the override parameter is false.void uploadGoogleDocument(java.lang.String ticket, java.lang.String objectId)
ticket
- a valid OC ticket.objectId
- the objectId of the repository node to use to create the Google document.OCAuthenticationException
- if an error occurs authenticating the user prior to document upload.void discardGoogleDocument(java.lang.String ticket, java.lang.String objectId, boolean override)
OCRuntimeException
if the discard fails.ticket
- a valid OC ticket.objectId
- the objectId of the node to discard the associated Google document for.override
- true to ignore any concurrent edits made by other users, false to error if the document has been
edited by other users in the configured time threshold.OCRuntimeException
- if the deletion of the Google document fails.OCConflictException
- if the document has concurrent editors and the override parameter is false.java.util.Map<java.lang.String,java.lang.Boolean> getEditingInGoogleDocsConditions(java.lang.String ticket, java.lang.String objectId)
ticket
- a valid OC ticket.objectId
- the objectId of the node to check if it's being edited currently in Google Docs.void checkOutForGoogleDocsEditing(java.lang.String ticket, java.lang.String objectId)
ticket
- a valid OC ticket.objectId
- the objectId of the repository node to checkout for Google Docs editing.OCRuntimeException
- if checking out the document fails.