Content Launch

Document created by resplin Employee on Jun 6, 2015Last modified by alfresco-archivist on Aug 31, 2016
Version 5Show Document
  • View in full screen mode

Obsolete Pages{{Obsolete}}

The official documentation is at: http://docs.alfresco.com



{{AVMWarning}}
AVM


Introduction


This page explains the WCM Content Launch capabilities added to the 2.1 release.


Features


For WCM web projects configured with a workflow, content launch provides the ability to specify a launch date on content submission for a change set. Post approval, ability to view pending list of site updates, preview, cancel, or immediately promote.


Setting A Launch Date


A new section has been added to the Submit Dialog in the 2.1 release allowing a launch date to be applied to all submitted items. This section, as shown below, will appear if the web project is configured with a workflow.

Launch_section.gif

To set a date, click on the 'None' label, the standard Alfresco date selector component will be shown where a launch date can be specified as shown in the screenshot below.

Launch_date.gif

Once a launch date has been specified and the Submit Dialog completed the submission will be routed for review via the workflow associated with the web project. If a web project does not have a workflow the Content Launch section will not be shown in the submit dialog (this is because content launch is managed via workflow).


Examining Items Awaiting Launch


After a submission has gone through the review process the workflow is progressed to a 'Submission Pending' state, this can be seen in the task list dashlet for the user that performed the submission. A typical task may look like the one shown in the screenshot below.

Launch_task.gif

The standard Manage Task dialog can be opened to view the details of the pending launch, for example the actual launch date and time, the items that will be updated and any comments made during the review process.

The other and arguably better way to view the items awaiting launch is to go to the web project itself. In the Staging Sandbox view there is now a new progressive panel named 'Content Awaiting Launch'. Expanding the panel displays a list of pending submissions as shown below.

Launch_pending.gif

In addition to the information shown several actions are available, the first action shows details of the submission (this actually launches the manage task dialog mentioned above), the next 2 actions allow previewing of the site on it's own and as a side-by-side comparison with the current site. The final 2 icons allow the submission to be launched immediately or cancelled respectively, these are explained in the following sections.


Launch Immediately


If for some reason the submission needs to complete immediately the launch date can be bypassed by clicking the action icon in the 'Content Awaiting Launch' panel or by going to the manage task dialog representing the pending submission and pressing the 'Submit Now' button.


Canceling A Pending Launch


If for some reason the submission needs to cancelled it can be done by clicking the action icon in the 'Content Awaiting Launch' panel or by going to the manage task dialog representing the pending submission and pressing the 'Abort Submission' button.


Implementation


A majority of the implementation for the content launch capabilities reside within the submission workflow.

Firstly, a new property was added to the submission aspect to represent the launch date, this can be found in wcmWorkflowModel.xml and is shown below.



<aspect name='wcmwf:submission'>
  <properties>
    ...
    <property name='wcmwf:launchDate'>
      <title>Launch Date</title>
      <description>Date the content in the submission should be committed</description>
      <type>d:datetime</type>
    </property>
    ...
  </properties>
</aspect>

The Submit Dialog now allows the user to enter a launch date and populates the property shown above. The submission workflow definition (submit_processdefinition.xml) now takes this date and decides what to do depending on whether it's set or not. This is done via a decision node:



<decision name='onapprove'>
  <transition name='launchnow' to='submitted' />
  <transition name='launchpending' to='submitpending'>
    <condition>#{wcmwf_launchDate != null}</condition>
  </transition>
</decision>

If a launch date has been specified the workflow instance will transition to the 'submitpending' task node, the definition of this node is:



<task-node name='submitpending'>
  <task name='wcmwf:submitpendingTask' swimlane='initiator'>
    <event type='task-create'>
      <script>
        taskInstance.dueDate = wcmwf_launchDate;
      </script>
    </event>       
    <timer duedate='#{wcmwf_launchDate}' transition='launch' >
      <action class='org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript'>
        <script>
          logger.log('WCM Submission ' + bpm_workflowDescription + ' submitted at ' +
                     wcmwf_launchDate + ' by ' + person.properties.userName);
        </script>
      </action>
    </timer>
  </task>
  <transition name='cancel' to='submitcancelled' />
  <transition name='launch' to='submitted' />
</task-node>

The 'submitpending' task node makes use of the workflow timer functionality present in JBPM. The timer task periodically checks whether the date (in this case the launch date) has been reached (by default this is done every 1.5 minutes, see the Configuration section for how to change this), once it has, it signals the launch transition, which in turn, transitions the workflow to the 'submitted' task node. The 'submitted' node then performs the steps required to apply the changes to the staging sandbox as done in previous releases. For more information on workflow and the timer capabilities please consult the Workflow wiki page.


Configuration


The workflow timer task polls every 1.5 mins (90 secs) by default, this can be changed in a file called jbpm.cfg.xml in the org/alfresco/repo/workflow/jbpm package. To change the 'idleInterval' value, either edit this file directly or using the standard override mechanism, copy jpbm.cfg.xml and point to it by overriding the 'jbpm_configuration' bean in workflow-context.xml.

Note: this config setting applies to all JBPM jobs. Hence (as of Alfresco 2.2.3 and 3.1.0) this will also affect WCM submits, including direct submits (which are now done asynchronously in the background).

By default the standard date selector only goes a couple years into the future. If a launch date is required further ahead than that then the date selector will need to be configured, to see how this can be achieved read this example.


Debugging


As mentioned in the Implementation section all the processing of the content launch date is handled by the workflow engine. There is already some logging information in the default submit_processdefinition.xml i.e. what launch date is being used and who performed the submisson, if more information is required further log() calls can be added.

For more general Workflow debugging and diagnostic tips see the workflow administation wiki page and in particular the workflow console page.

Outcomes