help.axcms.netAxinom Logo
Save Save Chapter Send Feedback

Activities

Activities are encapsulated operations applicable to elements, e.g. publish, check-in, classify, etc. You can create your own activities and even override the built-in activities.

What is Activity?

An Activity (or CmsActivity) is an operation applicable for particular element. For example classify an document, check-in a text, publish a page. (An older name for Activities is Bulk Operations, which goes back to the intention to have operations applicable for multiple objects).  These steps are encapsulated into classes inheriting from CmsActivity. There is also some GUI support for activities - buttons, result messages, etc. Acitvities can be executed synchronously or asynchronously via AxCMS.Service.

What activities are there?

AxCMS.net comes with the following activites out-of-the-box:

Name

Description

addStructureElement

Create a new structure element. This activity is not supposed to be reused.
checkin Check in (remove the edit lock) IClassifiable elements.
classify

Classify IClassifiable elements to one or several categories or navigation points. Needs an extra parameter - Categories collection to classify to.

clone

"Clone" (copy) a named structure element together with all its child content into a placeholder. Additional parameters required - ID of the parent placeholder, name of the structure element and sequence number for the new structure element in the children collection of its parent placeholder.

delete Delete IClassifiable elements.
fillProperties Creates a teaser for the pages passed as elements (the teaser functionality is still have to be documented in the user's guide). 
generateReports This activity will be started once a day and generates all email reports defined in the system.

moveDown

Move IClassifiable elements one step down to the end of their parent placeholder's children collection.
moveUp Move IClassifiable elements one step up to the start of their parent placeholder's children collection.
recover Set publication state to dirty for pages or documents passed.
restoreSnapshot Restore a document from its previously snapshoted version.
createPageSnaphotFile Create a version snaphot of a page after publishing. This activity is not supposed to be reused.
publishPage Publish pages.
publishDocument Publish documents
publishMailTemplate Publish mail templates.
publishNewsletter Publish newsletters.

How to create your own activity?

Just inherit your class from CmsActivity and name it XxxActivity. This "Xxx" part will then be used as name (or operation code) for the activity.

Example:

public class LockActivity: CmsActivity ....

LockActivity activity = (LockActivity) CmsActivity.CreateOperation("lock");

 

How to add custom Activity to an overview page?

To use your activity in an overview page, override the following method of the overview helper and add your activity name to the returned list. Overview page automatically renders a button in the left column for each activity.

protected override string[] Operations()
{
  return new string[] {"publishPage", "delete", "lock"};
}

If you create a custom overview, don't forget to add this panel to your .aspx page (don't get confused by the old name BulkOperations - it just means Activities: 

<AxMP:Content runat="server" id="Buttons">
 <Ax:AxinomPanel id="actionsPanel" runat="server" Headline="Aktionen" width="100%" CssClass="keyarea">
  <table cellpadding="0" cellspacing="5">
   <AxCMS:BulkOperationButtons runat="server" id="bulkOperationButtons" />
  </table>
 </Ax:AxinomPanel>
</AxMP:Content>

How to override existing AxCMS.net activity?

Create your own activity with the same name and other namespace. It is recommended to inherit from the activity you are overriding. Custom implementation has precedence over the built-in version.

Example:

public class PublishPageActivity: Axinom.AECMS.Publish.PublishPageActivity ...

Note: AxCMS.net doesn't always use activities to implement some operation. For example, if you override ClassifyActivity, don't expect your activity will be called any time users will classify objects in the AxCMS.net.