-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/ONLYOFFICE/onlyoffice-alf…
- Loading branch information
Showing
23 changed files
with
89 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,2 @@ | ||
.gradle/ | ||
.idea/ | ||
*.iml | ||
build/ | ||
gradle/ | ||
gradlew* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,90 +1,57 @@ | ||
# Alfresco Onlyoffice Integration | ||
# Alfresco ONLYOFFICE integration | ||
|
||
This Share plugin enables users to edit Office documents within Onlyoffice from Alfresco Share. Tested with Enterprise 5.0.\* | ||
This Share plugin enables users to edit Office documents within ONLYOFFICE from Alfresco Share. This will create a new **Edit in ONLYOFFICE** action within the document library for Office documents. This allows multiple users to collaborate in real time and to save back those changes to Alfresco. | ||
|
||
## Features | ||
* This will create a new **Edit in Onlyoffice** action within the document library for Office documents. | ||
* This allows multiple users to collaborate in real time and to save back those changes to Alfresco. | ||
Tested with Enterprise 5.0.\*, 5.1.\* and Community 5.1.\* | ||
|
||
|
||
## Requirements | ||
* For Alfresco Enterprise 5.0.\* and later | ||
## Compiling | ||
|
||
## Installation | ||
You will need: | ||
|
||
### OnlyOffice | ||
* Java 7 SDK or above | ||
|
||
You will need an instance of onlyoffice that is resolvable and | ||
connectable both from alfresco and any end clients. Onlyoffice must | ||
also be able to POST to alfresco directly. | ||
* Gradle | ||
|
||
The easiest way to start an instance of onlyoffice is to use Docker: https://github.com/ONLYOFFICE/Docker-DocumentServer | ||
* Parashift's alfresco amp plugin from here: https://bitbucket.org/parashift/alfresco-amp-plugin | ||
|
||
### Alfresco | ||
* Run `gradle amp` from the `share` and `repo` directories | ||
|
||
* Deploy the amp to both the repo and share end using alfresco-mmt or | ||
other methods | ||
|
||
* Add the `onlyoffice.url` property to alfresco-global.properties: | ||
* e.g: `onlyoffice.url=http://onlyoffice.mycompany.com/` or `onlyoffice.url=http://localhost/` | ||
|
||
This will tell Alfresco to find onlyoffice instance via port 80, if you need to start onlyoffice via other port rather than 80, then you need to add port information as well | ||
Also, you need to make sure the `/etc/hosts` file contain the right mapping, i.e., `127.0.0.1 localhost` | ||
## Installation | ||
|
||
## Compiling | ||
If you've alfready downloaded the compiled amps, please skip this section | ||
### ONLYOFFICE | ||
|
||
You will need: | ||
You will need an instance of ONLYOFFICE that is resolvable and connectable both from alfresco and any end clients. ONLYOFFICE must also be able to POST to alfresco directly. | ||
|
||
* Java 7 SDK or above | ||
The easiest way to start an instance of ONLYOFFICE is to use Docker: https://github.com/ONLYOFFICE/Docker-DocumentServer | ||
|
||
* Gradle | ||
|
||
* Parashift's alfresco amp plugin from here: https://bitbucket.org/parashift/alfresco-amp-plugin | ||
### Alfresco | ||
|
||
* Run the command below under the project folder | ||
``` | ||
gradle -b repo/build.gradle amp | ||
gradle -b share/build.gradle amp | ||
``` | ||
|
||
## Usage | ||
In document detail page, new action option `Edit in OnlyOffice` will be able to use as below: | ||
|
||
![editinonlyoffice](edit_in_onlyoffice.png) | ||
|
||
### How it works | ||
|
||
The Onlyoffice integration follows the API documented here | ||
https://api.onlyoffice.com/editors/basic: | ||
|
||
* User navigates to a document within Alfresco Share and selects the | ||
`Edit in Onlyoffice` action | ||
* Alfresco Share makes a request to the repo end (URL of the form: `/parashift/onlyoffice/prepare?nodeRef={nodeRef}`) | ||
* Alfresco Repo end prepares a JSON object for Share with the following | ||
properties: | ||
* **docUrl**: the URL that onlyoffice uses to download the document | ||
(includes the `alf_ticket` of the current user) | ||
* **callbackUrl**: the URL that onlyoffice needs to POST a callback to | ||
when finished editing | ||
* **onlyofficeUrl**: the URL that the client needs to talk to onlyoffice | ||
(given by the onlyoffice.url property) | ||
* **key**: the UUID+Modified Timestamp to instruct onlyoffice whether to download the document again or not | ||
* **docTitle**: the Title (name) of the document | ||
* Alfresco Share takes this object and constructs a page from a | ||
freemarker template, filling in all of those values so that the client | ||
browser can load up the editor | ||
* The client browser makes a request for the javascript library from | ||
onlyoffice and sends onlyoffice the docEditor configuration with the | ||
properties as above | ||
* Onlyoffice then downloads the document from alfresco and the user begins editing | ||
* Onlyoffice sends a POST request to the callback URL to inform Alfresco | ||
that a user is editing the document | ||
* Alfresco locks the document, but still allows other users with write access | ||
the ability to collaborate in real time with onlyoffice by leaving the Action present | ||
* When all users and client browsers are finished, they close the | ||
editing window | ||
* After 10 seconds of inactivity, onlyoffice sends a POST to the | ||
callback URL letting Alfresco know that the clients have finished. | ||
* Alfresco downloads the new version of the document, replacing the old | ||
one | ||
* Deploy the amp to both the repo and share end using alfresco-mmt or other methods | ||
|
||
* Add the `onlyoffice.url` property to alfresco-global.properties: | ||
* e.g: `onlyoffice.url=http://documentserver/` | ||
|
||
|
||
## How it works | ||
|
||
The ONLYOFFICE integration follows the API documented here https://api.onlyoffice.com/editors/basic: | ||
|
||
* User navigates to a document within Alfresco Share and selects the `Edit in ONLYOFFICE` action. | ||
* Alfresco Share makes a request to the repo end (URL of the form: `/parashift/onlyoffice/prepare?nodeRef={nodeRef}`). | ||
* Alfresco Repo end prepares a JSON object for Share with the following properties: | ||
* **docUrl**: the URL that ONLYOFFICE uses to download the document (includes the `alf_ticket` of the current user), | ||
* **callbackUrl**: the URL that ONLYOFFICE informs about status of the document editing, | ||
* **onlyofficeUrl**: the URL that the client needs to talk to ONLYOFFICE (given by the onlyoffice.url property), | ||
* **key**: the UUID+Modified Timestamp to instruct ONLYOFFICE whether to download the document again or not, | ||
* **docTitle**: the Title (name) of the document. | ||
* Alfresco Share takes this object and constructs a page from a freemarker template, filling in all of those values so that the client browser can load up the editor. | ||
* The client browser makes a request for the javascript library from ONLYOFFICE and sends ONLYOFFICE the docEditor configuration with the properties as above. | ||
* ONLYOFFICE then downloads the document from alfresco and the user begins editing. | ||
* ONLYOFFICE sends a POST request to the callback URL to inform Alfresco that a user is editing the document. | ||
* Alfresco locks the document, but still allows other users with write access the ability to collaborate in real time with ONLYOFFICE by leaving the Action present. | ||
* When all users and client browsers are finished, they close the editing window. | ||
* After 10 seconds of inactivity, ONLYOFFICE sends a POST to the callback URL letting Alfresco know that the clients have finished. | ||
* Alfresco downloads the new version of the document, replacing the old one. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
repo/src/main/resources/alfresco/templates/webscripts/onlyoffice/callback.post.desc.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<webscript> | ||
<shortname>Onlyoffice CallBack URL</shortname> | ||
<description>Callback URL for Onlyoffice to inform Alfresco</description> | ||
<shortname>ONLYOFFICE CallBack URL</shortname> | ||
<description>Callback URL for ONLYOFFICE to inform Alfresco</description> | ||
<url>/parashift/onlyoffice/callback</url> | ||
<authentication>user</authentication> | ||
</webscript> |
4 changes: 2 additions & 2 deletions
4
repo/src/main/resources/alfresco/templates/webscripts/onlyoffice/prepare.get.desc.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<webscript> | ||
<shortname>Onlyoffice Prepare URL</shortname> | ||
<description>Sends information to Share to prepare the Onlyoffice Edit Page</description> | ||
<shortname>ONLYOFFICE Prepare URL</shortname> | ||
<description>Sends information to Share to prepare the ONLYOFFICE Edit Page</description> | ||
<url>/parashift/onlyoffice/prepare</url> | ||
<authentication>user</authentication> | ||
</webscript> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
share/src/main/resources/META-INF/components/onlyoffice/onlyoffice.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.