Commit 068480de authored by eoin.kim's avatar eoin.kim

AlfStream documentation update

parent ab5cec6d
......@@ -13,14 +13,63 @@
<cm:property name="alfresco.local.username" value="admin"/>
<cm:property name="alfresco.local.password" value="admin"/>
<cm:property name="alfstream.sync.persist.file" value="persist/alfstream-sync" />
<cm:property name="alfstream.categories.persist.file" value="persist/alfstream-categories" />
<cm:property name="alfstream.delete.sync.persist.file" value="persist/alfstream-sync-delete" />
<cm:property name="alfstream.delete.sync.persist.file" value="persist/alfstream-sync-delete" />
<cm:property name="alfstream.categories.sync.enabled" value="false" />
</cm:default-properties>
</cm:property-placeholder>
<bean id="preventEcho" class="com.parashift.alfstream.PreventEcho" />
<bean id="deleteDecorator" class="com.parashift.alfstreamsync.DeleteDecorator" >
<property name="url" value="${alfstream.remote.url}"/>
<property name="username" value="${alfstream.remote.username}"/>
<property name="password" value="${alfstream.remote.password}"/>
</bean>
<bean id="remoteUrls" class="com.parashift.alfstreamsync.RemoteUrl" >
<property name="url" value="${alfstream.remote.url}"/>
<property name="username" value="${alfstream.remote.username}"/>
<property name="password" value="${alfstream.remote.password}"/>
</bean>
<bean id="deleteFilter" class="com.parashift.alfstreamsync.DeleteFilter">
<property name="categorySync" value="${alfstream.categories.sync.enabled}" />
</bean>
<bean id="debugLog" class="com.parashift.alfstreamsync.DebugLog" />
<camelContext id="twoWayAlfStream" xmlns="http://camel.apache.org/schema/blueprint">
<route id="tagsAndCategories" autoStartup="{{alfstream.categories.sync.enabled}}">
<from uri="alfs://{{alfstream.local.url}}?path=/categories&amp;types=cm_category&amp;username={{alfstream.local.username}}&amp;password={{alfstream.local.password}}&amp;persistFile={{alfstream.categories.persist.file}}" />
<onException id="syncFailureNotification">
<exception>java.lang.Exception</exception>
<handled>
<constant>true</constant>
</handled>
<to uri="direct:syncException"/>
</onException>
<filter>
<method ref="preventEcho" />
<bean ref="debugLog" />
<recipientList>
<method ref="remoteUrls" method="getRecipients" />
</recipientList>
</filter>
</route>
<route id="sysDeletedNodeSync">
<from uri="alfs://{{alfstream.local.url}}?types=sys_deleted&amp;username={{alfstream.local.username}}&amp;password={{alfstream.local.password}}&amp;persistFile={{alfstream.delete.sync.persist.file}}" />
<bean ref="deleteDecorator"/>
<bean ref="debugLog"/>
<filter>
<method ref="deleteFilter" />
<recipientList>
<method ref="remoteUrls" method="getRecipients" />
</recipientList>
</filter>
</route>
<route id="localToRemote">
<from uri="alfs://{{alfstream.local.url}}?aspects=alfs_sync&amp;username={{alfstream.local.username}}&amp;password={{alfstream.local.password}}&amp;persistFile={{alfstream.sync.persist.file}}" />
<onException id="syncFailureNotification">
......@@ -46,7 +95,9 @@
</javaScript>
</setHeader>
<bean ref="debugLog" />
<to uri="alfs://{{alfstream.remote.url}}?aspects=alfs_sync&amp;username={{alfstream.remote.username}}&amp;password={{alfstream.remote.password}}" />
<recipientList>
<method ref="remoteUrls" method="getRecipients" />
</recipientList>
<filter>
<javaScript>
request.headers.get('alfs_syncState') == 'Not Synced'
......@@ -68,13 +119,21 @@
<setHeader headerName="exception_message">
<simple>${exception.message}</simple>
</setHeader>
<setHeader headerName="exception">
<simple>${exception}</simple>
</setHeader>
<bean ref="debugLog"/>
<setHeader headerName="alfs_lastSyncStatus">
<javaScript>
result = request.headers.get('exception_message');
if (result.indexOf('503') > 0 || result.indexOf('502') > 0) {
result = 'Remote Service is Unavailable';
} else if (result.indexOf('404') > 0) {
result = 'Request Resource cannot be Found';
if (result != null) {
if (result.indexOf('503') > 0 || result.indexOf('502') > 0) {
result = 'Remote Service is Unavailable';
} else if (result.indexOf('404') > 0) {
result = 'Request Resource cannot be Found';
}
} else {
result = request.headers.get("exception");
}
</javaScript>
</setHeader>
......@@ -92,3 +151,4 @@
</camelContext>
</blueprint>
......@@ -113,6 +113,20 @@ alfstream.local.password=admin
alfstream.sync.persist.file=persist/alfstream-sync
```
If you want to synchronise more instances (e.g. three-way sync), assign a comma separate (no spaces inbetween) list for these properties:
* `alfstream.remote.url`
* `alfstream.remote.username`
* `alfstream.remote.password`
For example, if you want to achieve three-way sync with sidea, sideb, and sidec, on sidea:
```
alfstream.remote.url=http://sideb.dev.parashift.local:8080/alfresco,http://sidec.dev.parashift.local:8080/alfresco
alfstream.remote.username=admin,admin
alfstream.remote.password=admin,admin
```
* Add the provided `kar` file to the deploy directory.
......
......@@ -188,7 +188,7 @@ You will need a log level set to debug within karaf:
### Two Way Blueprint
[Alfstream Sync](./alfstream-sync.md) is used to provide two way syncing between Alfresco instances.
[Alfstream Sync](./alfstream-sync.md) is used to provide two way syncing between Alfresco instances. Having more instances (e.g. three way sync) is also supported.
### Upsert Blueprint
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment