Publishing

1. Contents

2. Publishing via ACIr

There are two ways that content can be published via ACIr.

  1. By dropping a query XML file in a specified directory
  2. By posting the query via http

2.1. Dropping a query XML file

A polling service listens for a file added to a specified directory. By default the directory is /private/tmp/testFileMessageReceiver/queries. This value can be overridden in the cma-cfg.properties file.  

HERE is a link to the trunk version of the cma-cfg.properties file. To override these properties, make the changes to this file and place in a core directory in the classpath: e.g. 'conf/core/cma-cfg.properties'.

A sample query can be found at Query XML file.

2.2. Posting a query

A query xml can be posted to the host, port and path configured. By default these are set to:

acir.rest.hostname=127.0.0.1
acir.rest.port=11110
acir.rest.path=publish-query

These values can be overridden in the cma-cfg.properties file, as outlined above.

The name of the attribute to send the query xml as is 'query'.

To aid the dynamic building and posting of the query from Alfresco, there is an ACIr webscript that can be installed and used. 

2.2.1. Using Alfresco webscript to dynamically build query

2.2.1.1. Install AMP

The ACIr AMP must be installed ahead of time. The main purpose of the AMP is to install an Alfresco webscript that can be used to trigger a publish from ACIr. Essentially, a query is dynamically built and posted to ACIr using parameters passed to the webscript.

Details on installing AMPs can be found on the Alfresco wiki.

2.2.1.2. Upload deployer-extract-request-config.xml file

Once Alfresco is started, a configuration file needs to be uploaded to Alfresco.

  • This file, deployer-extract-request-config.xml, can be found as an attachment to this page.
  • It needs to be uploaded to 'Company Home/Data Dictionary/Web Scripts'.

Details on editing this config file & and invoking the webscript can be found at Using webscript for ACIr publish.

2.2.1.3. Invoking the webscript

Details on how the webscript works and the function of it can be found at Using webscript for ACIr publish.

2.2.1.4. Configuration

Default configuration is:

# url and credentials to connect to cma
cma.service.endpoint.url=[http://localhost:8080/alfresco/service]
cma.username=admin
cma.password=admin

# host, port, path where ACIr listens for query
acir.rest.hostname=127.0.0.1
acir.rest.port=11110
acir.rest.path=publish-query

# query.tmp.dir is where files are temporarily stored while the publish is being performed
# query.ack.dir is the directory where an acknowledgment file (per query) is created that contains details of the files published and any errors that occurred
query.tmp.dir=/private/tmp/testFileMessageReceiver/queries/tmp/
query.ack.dir=/private/tmp/testFileMessageReceiver/queries/acks/

# only come into play when using a drop box to publish the query - though they are part of the core config
query.dir=/private/tmp/testFileMessageReceiver/queries/
query.processed.dir=/private/tmp/testFileMessageReceiver/queries/processed/

HERE is a link to the trunk version of cma-cfg.properties file. To override these properties, make the changes to this file and place in a core directory in the classpath: e.h.. 'conf/core/cma-cfg.properties'.

2.2.1.5. Sample workflow that calls webscript

There is a sample workflow AMP - PublishWorkflow-X.amp - attached to this page that provides an example of invoking the webscript through a workflow.

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.