org.alfresco.repo.googledocs
Class GoogleDocsServiceImpl

java.lang.Object
  extended by org.alfresco.repo.transaction.TransactionListenerAdapter
      extended by org.alfresco.repo.googledocs.GoogleDocsServiceImpl
All Implemented Interfaces:
GoogleDocsModel, GoogleDocsService, TransactionListener

public class GoogleDocsServiceImpl
extends TransactionListenerAdapter
implements GoogleDocsService, GoogleDocsModel

Google docs integration service implementation


Field Summary
static java.lang.String TYPE_DOCUMENT
          Google document types
static java.lang.String TYPE_PDF
           
static java.lang.String TYPE_PRESENTATION
           
static java.lang.String TYPE_SPREADSHEET
           
 
Fields inherited from interface org.alfresco.repo.googledocs.GoogleDocsModel
ASPECT_GOOGLEEDITABLE, ASPECT_GOOGLERESOURCE, GOOGLE_DOCS_MODEL_1_0_URI, GOOGLE_DOCS_PREFIX, PROP_RESOURCE_ID, PROP_RESOURCE_TYPE, PROP_URL
 
Constructor Summary
GoogleDocsServiceImpl()
           
 
Method Summary
 void afterCommit()
          Invoked after transaction commit.
 void afterRollback()
          Invoked after transaction rollback.
 void createGoogleDoc(org.alfresco.service.cmr.repository.NodeRef nodeRef, GoogleDocsPermissionContext permissionContext)
          Create a google doc from a given node.
 void deleteGoogleResource(org.alfresco.service.cmr.repository.NodeRef nodeRef)
          Deletes the google resource associated with the node reference.
 java.io.InputStream getGoogleDocContent(org.alfresco.service.cmr.repository.NodeRef nodeRef)
          Gets the content as an input stream of google doc associated with the given node.
 void initialise()
          Initialise google docs services
 void setAuthorityService(AuthorityService authorityService)
           
 void setContentService(ContentService contentService)
           
 void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
           
 void setDownloadUrl(java.lang.String downloadUrl)
           
 void setGoogleDocumentService(com.google.gdata.client.docs.DocsService googleDocumentService)
           
 void setMimetypeService(org.alfresco.service.cmr.repository.MimetypeService mimetypeService)
           
 void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
           
 void setOwnableService(OwnableService ownableService)
           
 void setPassword(java.lang.String password)
           
 void setPermissionMap(java.util.Map permissionMap)
           
 void setPermissionService(org.alfresco.service.cmr.security.PermissionService permissionService)
           
 void setPersonService(PersonService personService)
           
 void setSpreadsheetsService(com.google.gdata.client.GoogleService spreadsheetsService)
           
 void setUrl(java.lang.String url)
           
 void setUsername(java.lang.String username)
           
 
Methods inherited from class org.alfresco.repo.transaction.TransactionListenerAdapter
beforeCommit, beforeCompletion, flush
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_DOCUMENT

public static final java.lang.String TYPE_DOCUMENT
Google document types

See Also:
Constant Field Values

TYPE_SPREADSHEET

public static final java.lang.String TYPE_SPREADSHEET
See Also:
Constant Field Values

TYPE_PRESENTATION

public static final java.lang.String TYPE_PRESENTATION
See Also:
Constant Field Values

TYPE_PDF

public static final java.lang.String TYPE_PDF
See Also:
Constant Field Values
Constructor Detail

GoogleDocsServiceImpl

public GoogleDocsServiceImpl()
Method Detail

setGoogleDocumentService

public void setGoogleDocumentService(com.google.gdata.client.docs.DocsService googleDocumentService)
Parameters:
googleDocumentService - google document service

setSpreadsheetsService

public void setSpreadsheetsService(com.google.gdata.client.GoogleService spreadsheetsService)
Parameters:
spreadsheetsService - spread sheets service

setNodeService

public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
Parameters:
nodeService - node service

setContentService

public void setContentService(ContentService contentService)
Parameters:
contentService - content service

setPersonService

public void setPersonService(PersonService personService)
Parameters:
personService - person service

setMimetypeService

public void setMimetypeService(org.alfresco.service.cmr.repository.MimetypeService mimetypeService)
Parameters:
mimetypeService - mime type service

setPermissionService

public void setPermissionService(org.alfresco.service.cmr.security.PermissionService permissionService)
Parameters:
permissionService - permission service

setOwnableService

public void setOwnableService(OwnableService ownableService)
Parameters:
ownableService - ownable service

setAuthorityService

public void setAuthorityService(AuthorityService authorityService)
Parameters:
authorityService - authority service

setDictionaryService

public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
Parameters:
dictionaryService - dictionary service

setUrl

public void setUrl(java.lang.String url)
Parameters:
url - root googleDoc URL

setDownloadUrl

public void setDownloadUrl(java.lang.String downloadUrl)
Parameters:
downloadUrl - root download URL

setUsername

public void setUsername(java.lang.String username)
Parameters:
username - google service user name

setPassword

public void setPassword(java.lang.String password)
Parameters:
password - google service password

setPermissionMap

public void setPermissionMap(java.util.Map permissionMap)
Parameters:
permissionMap - permission map

initialise

public void initialise()
                throws GoogleDocsServiceInitException
Initialise google docs services

Specified by:
initialise in interface GoogleDocsService
Throws:
GoogleDocsServiceInitException

createGoogleDoc

public void createGoogleDoc(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                            GoogleDocsPermissionContext permissionContext)
Description copied from interface: GoogleDocsService
Create a google doc from a given node. The content of the node will be used as a basis of the associated google doc. If the node has no content a new, empty google doc of the correct type will be created. The permission context provides information about how google sharing permissions should be set on the created google doc.

Specified by:
createGoogleDoc in interface GoogleDocsService
Parameters:
nodeRef - node reference
permissionContext - permission context
See Also:
org.alfresco.google.docs.GoogleDocsService#upload(org.alfresco.service.cmr.repository.NodeRef)

deleteGoogleResource

public void deleteGoogleResource(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Description copied from interface: GoogleDocsService
Deletes the google resource associated with the node reference. This could be a folder or document.

Specified by:
deleteGoogleResource in interface GoogleDocsService
Parameters:
nodeRef - node reference
See Also:
org.alfresco.google.docs.GoogleDocsService#deleteGoogleResource(org.alfresco.service.cmr.repository.NodeRef)

getGoogleDocContent

public java.io.InputStream getGoogleDocContent(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Description copied from interface: GoogleDocsService
Gets the content as an input stream of google doc associated with the given node. The node must have the google resource aspect and the associated resource should not be a folder.

Specified by:
getGoogleDocContent in interface GoogleDocsService
Parameters:
nodeRef - node reference
Returns:
InputStream the content of the associated google doc
See Also:
org.alfresco.google.docs.GoogleDocsService#getGoogleDocContent(org.alfresco.service.cmr.repository.NodeRef)

afterCommit

public void afterCommit()
Description copied from class: TransactionListenerAdapter
Invoked after transaction commit.

Any exceptions generated here will cause the transaction to rollback.

Although all transaction resources are still available, this method should be used only for cleaning up resources after a commit has occured.

Specified by:
afterCommit in interface TransactionListener
Overrides:
afterCommit in class TransactionListenerAdapter
See Also:
TransactionListenerAdapter.afterCommit()

afterRollback

public void afterRollback()
Description copied from class: TransactionListenerAdapter
Invoked after transaction rollback.

Although all transaction resources are still available, this method should be used only for cleaning up resources after a rollback has occured.

Specified by:
afterRollback in interface TransactionListener
Overrides:
afterRollback in class TransactionListenerAdapter
See Also:
TransactionListenerAdapter.afterRollback()


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.