Google Docs Integration - tsgrp/HPI GitHub Wiki

DEPRECATION WARNING

This action described below has been deprecated and will be removed from HPI. See the Edit Online Configurations page to use the updated Google Drive integration.

Note that the below information is only valid for Alfresco 4.x.

Google Docs Integration

This article describes the Google Docs HPI integration. There are several important things to note when using this integration:

  • The integration is currently only supported for Alfresco (tested on version 4.2.3.1)
  • The integration was designed for a controlled docs scenario (i.e. only minor versions may be checked in)
  • You MUST install the TSG Google Docs Share AMP for this integration to work properly

The Google Docs integration allows a user to create a Google document, spreadsheet or presentation. After creating the document, users can share this Google document with other collaborators. When done editing, the user can save the document back to the repository as a new minor version or can choose to discard all the changes. The integration also provides users the ability to edit documents in Google Docs. All "docx", "xlsx" and "pptx" documents can be edited in Google Docs.

The integration uses the OOTB Share Google Docs editor to provide the user an interface for editing Google documents.

Setup

In order to use the Google Docs HPI integration, you must first install the Share AMP. The Share AMP is located at the following SVN location:

http://svn.tsgrp.com/repos/hpi/trunk/setup/alfresco/google-docs/share-amp

The Share AMP works by overriding OOTB files in the Alfresco Google Docs Share AMP. It overrides a few templates, most notably to disable checking in a document as a major version, and it includes a custom JS file to direct REST calls to OpenContent instead of making calls to Alfresco OOTB Google Docs WebScripts.

OpenContent Configuration

To use the Google Docs integration, there are a couple of OC setup steps you must complete.

First, you have to modify your project's build.gradle file to include the 2.google and 3.googleAlfresco modules as child projects to include in the WAR. For example:

project.ext.childProjectsToIncludeWar = [
    ":1.core",
    ":1.core-client", 
    ":2.alfrescoEmb", 
    ":2.activiti", 
    ":2.google",
    ":3.hpi", 
    ":3.universal",
    ":3.universal-client",  
    ":3.transformation",
    ":3.transformation-client",  
    ":3.wizard",
    ":3.wizard-client",  
    ":3.activitiAlfresco", 
    ":3.googleAlfresco",
    ":4.transformicepdf", 
    ":4.wizardAlfresco"
]

And finally, you must include the appropriate module XML files in your project's project-bean-config.xml. For example, you must import the following two files:

<import resource="classpath:google-bean-config.xml" />
<import resource="classpath:google-alfresco-bean-config.xml" />

HPI Configuration

In your environment's configOverride you must provide a URL for your Share instance so that a document can be opened in the Share Google Docs editing interface.

Provide a shareURL field in your environment JSON file like the following:

{
    "port": 8080,
    "context" : "/alfresco",
    "restServiceContext": "/OpenContent",
    "host" : "localhost",
    "configOverride" : {
	    "config" : {
		    "app" : {
			    "shareURL" : "http://localhost:8080/share"
		    }
	    }
    }
}

For more information on creating an environment JSON file, see Building and Deploying HPI 2.x.

HPI Actions

The Google Docs integration has two actions: Create Google Document and Edit Google Document.

The Create Google Document action allows a user to create a new Google document, spreadsheet or presentation.

The Edit Google Document action allows a user to edit any "docx", "xlsx" or "pptx" file in the Google Docs Share interface. The document does not have to be created via the Create Google Document action - any supported file type can be edited in Google Docs.