Tasks

When implementing a content management system there are many aspects to handle. One of the most important ones is usability. As some aspects of site management may involve quite a few steps in the normal tools there are often a need to be able to help the users. One way is to create workflows which will be described later on. Another simpler way is by creating what we in InfoGlue call “tasks”. A task is something you write to extend the normal user interfaces without having to change anything in InfoGlue itself.

A good example of where writing a task is suitable might be if you want to give the Vice President a possibility to write a monthly letter which should be published both on the web and sent to all customers on email without having to teach him all the steps involved using the standard tools. You can write a task which he runs which guides him through all the steps in a very user friendly way. The interface can be totally customized to make him/her feel at home and if the user has proposals those can be taken into consideration as well.

We have examples of people using tasks for the following purposes:

  • Creating whole sub sites with predefined structure
  • Link validation on all contents
  • Export/Import of contents
  • Sending weekly newsletter to all customers
  • Publishing start page news/puffs easy.

The decision whether or not a task is required in a process is up to the developers and the users to agree upon.

Flow of a task

There are basically three steps in an ordinary task:

  • Initially it’s the user input step. Here the central task executor will run the script located in the UserInputHTML-field of the task definition Usually this step is used to present the user with an introduction and let him/her contribute with information needed in the coming steps. You can have several calls to this step if you wish to split the step into smaller screens but this is handled in the same script in that case.
  • Second the task executes the script located in the attribute ScriptCode. This step normally contains the manipulating operations. This can mean creating content, pages, languages as well as any other operation available in the platform as well as in custom logic.
  • Thirdly – when the execution of step 2 is done the script in field UserOutputHTML is executed. Most often this is used to present the user with the result of the process including any files/assets/info the user needs.

A very central thing is of course to understand how to pass data between the different steps. When it comes to passing data the normal servlet API is usually what you need. You can always reach the request-object from your scripts. Also notable is that each step in a task is handled in a separate transaction automatically.