How to configure RenderTasks
Instructions about how to configure RenderTasks in the Cinnamon RenderServer.
What is a RenderTask?
A RenderTask is an external process that is started by the Cinnamon RenderServer. It connects to a Cinnamon repository by way of the server's API, performs some operation with the permission level of the user who started the specific task instance.
How can I create a new RenderTask?
You will need to either install an existing program or code a new implementation. There exists the foo2pdf module which is the current reference implementation for Java based RenderTasks.
How to enable / disable RenderTasks?
RenderTasks need to be listed in the RenderServer's configuration file:
<config>
<taskQueryFile>taskQuery.xml</taskQueryFile>
<sleepDuration>10000</sleepDuration> <!-- sleep between runs in milliseconds -->
<threadCount>5</threadCount> <!-- number of parallel threads -->
<repositories>
<repository>
<name>cmn_test</name>
<url>http://172.16.13.130:8080/cinnamon/cinnamon</url>
<username>admin</username>
<password>admin</password>
<lifeCycleName>_RenderServerLC</lifeCycleName> <!-- do not change lifeCycleName. -->
<registeredTasks>
<taskName>foo2pdf</taskName>
</registeredTasks>
</repository>
</repositories>
<tasks>
<task>
<name>foo2pdf</name>
<exec>java -jar lib/foo2pdf.jar __id__ __repository__</exec>
</task>
</tasks>
</config>
1. you need to add a <task> element to the <tasks> section. A task has both a <name> and an <exec> element. The name has to be the same that is used by the client program through which the user starts the render task. The exec element contains the shell command by which the external process can be started. This is dependent on your operation system and the runtime execution environment of the RenderServer. It may be easier to use absolute path names here, for example
<exec>C:\program files\java\jre6\bin\java.exe -jar D:\lib\foo2pdf.jar</exec> <!-- note: not tested with regard to handling of whitespace in file names. -->
There are five placeholders that you can and should use to customize the exec-command line. Each is preceded and followed by a double underscore:
- __ticket__ = the session ticket
- __user__ = the username for this session
- __host__ = the server url (where to reach the Cinnamon server, for example: http://localhost:8080/cinnamon/cinnamon)
- __repository__ = the name of the repository where the render task object is to be found
- __id__ = the id of the render task
2. you can add the task by name to the configured repositories. If a task is not in the <registeredTasks> list of a repository, it will not be executed on this repository's objects.

