CentraSite 10.5 | CentraSite User’s Guide | Policy Management | Managing Design-Time and Change-Time Policies through Command Line Interface | Adding Custom Action Template
 
Adding Custom Action Template
Pre-requisites:
To add a custom action template through CentraSite Command Line Interface, you must have the CentraSite Administrator role.
CentraSite provides a command tool named add Action Template for this purpose.
*To add a custom action template
*Run the command add Action Template.
The syntax is of the format: C:\SoftwareAG\CentraSite\utilities>CentraSiteCommand.cmd add Action Template [-url <CENTRASITE-URL>] -user <USER-ID> -password <PASSWORD> -file <CONFIG-FILE> -implementationzip <IMPLEMENTATION-ZIP>
The input parameters are:
Parameter
Description
CENTRASITE-URL
(Optional). The URL of the CentraSite registry. For example, http://localhost:53307/CentraSite/CentraSite.
USER-ID
The user ID of a registered CentraSite user who has the CentraSite Administrator role. For example, Administrator.
PASSWORD
The password for the registered CentraSite user identified by the parameter USER-ID.
CONFIG-FILE
Name of the action template configuration file that contains the input parameters.
Note:
If you are saving the file in a different location other than the default location <CentraSiteInstall_Directory>/utilities, provide the absolute file path.
IMPLEMENTATION-ZIP
Name of the Java implementation zip file used to construct the action template.
CentraSite has a sample implementation zip file uniquenamechecker.zip that you can use to enforce unique asset names in the CentraSite registry. This sample implementation zip file is located in <CentraSiteInstall_Directory>/ demos\CustomActions\Java.
Note:
If you have saved the zip file to a different location other than the default location <CentraSiteInstall_Directory>/utilities, provide the absolute path to the zip file.
Example (all in one line):
C:\SoftwareAG\CentraSite\utilities>CentraSiteCommand.cmd add Action Template -url http://localhost:53307/CentraSite/CentraSite –user Administrator –password manage –file c:\temp\Custom_Action_Template_Config.xml -implementationzip c:\temp\custom_action_implementation.zip
The response to this command could be:
Executing the command : add Action Template

Action Template named Custom Action Template is created successfully

Successfully executed the command : add Action Template
Action Template Configuration File
You can configure the details for new custom action template in an XML configuration file. Here is a sample configuration file.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<actionTemplate>

<!-- type of the Action Category -->
<actioncategory>CustomActionCategory</actioncategory>
<!-- name of the Action Template -->
<templateName>TestActionTemplate</templateName>
<!-- Description of the Action Template -->
<templateDescription>This is a new action template
for design time policy</templateDescription>
<!-- Scope Object Types of the Action Template -->
<templateObjectTypes>
<objectType>Application</objectType>
</templateObjectTypes>
<!-- Scope Event Types of the Action Template-->
<templateEventTypes>
<eventType>PreCreate</eventType>
<eventType>PreUpdate</eventType>
</templateEventTypes>

<parameterTemplates>

<parameterTemplate>
<!-- Name of the parameter-->
<name>ValidateName</name>
<!-- Type of the parameter-->
<type>Object</type>
<!-- Default values of the parameter-->
<defaultValue>user1</defaultValue>
<possibleValues>user2</possibleValues>
<possibleValues>user3</possibleValues>
<possibleValues>user4</possibleValues>
<!-- Array value of the parameter-->
<array>true</array>
<!-- Is parameter Required-->
<isRequired>true</isRequired>
<parameterTemplates>

<parameterTemplate>
<!-- Name of the parameter-->
<name>ValidateName</name>
<!-- Type of the parameter-->
<type>String</type>
<!-- Default values of the parameter-->
<defaultValue>user1</defaultValue>
<possibleValues>user2</possibleValues>
<possibleValues>user3</possibleValues>
<possibleValues>user4</possibleValues>
<!-- Array value of the parameter-->
<array>true</array>
<!-- Is parameter Required-->
<isRequired>true</isRequired>
</parameterTemplate>
</parameterTemplates>
</parameterTemplate>

<parameterTemplate>
<!-- Name of the parameter-->
<name>ValidateName</name>
<!-- Type of the parameter-->
<type>String</type>
<!-- Default values of the parameter-->
<defaultValue>user1</defaultValue>
<possibleValues>user2</possibleValues>
<possibleValues>user3</possibleValues>
<possibleValues>user4</possibleValues>
<!-- Array value of the parameter-->
<array>true</array>
<!-- Is parameter Required-->
<isRequired>true</isRequired>
</parameterTemplate>

</parameterTemplates>

</actionTemplate>
The contents of the configuration file are listed below:
Tag Name
Description
actioncategory
(Mandatory). Name of the action category.
templateName
(Mandatory). Name of the action template.
templateDescription
(Optional). Description of the action template.
templateObjectTypes
(Mandatory). The type of objects to which this action applies.
For a list of the object types that CentraSite supports, see Classification of Types.
templateEventTypes
(Mandatory). The type of events to which this action applies.
Supported values are - PreCreate, PostCreate, PreUpdate, PostUpdate, PreDelete, PostDelete, PreState Change, PostState Change, OnConsumerRegistration, OnTrigger, OnCollect, OnExport, OnMove.
For details on the individual event types, see Introduction to Design and Change-Time Policies.
parameterTemplates
(Optional). The parameter template with one or more parameters that serve as input to the action.
name
(Mandatory). Name of the parameter that is input to the action at enforcement.
type
(Mandatory). The data type of the parameter.
For a list of the data types that CentraSite supports, see Basic Components of Type.
defaultValue
(Optional). The default value for the parameter.
possibleValues
(Optional). One or multiple possible values for the parameter.
array
(Optional). Indicates whether a parameter's data type can be an array of values.
A value of true allows to pass the parameter's data type as an array during the enforcement of action.
Supported values are - true, false.
isRequired
(Optional). Indicates whether the parameter is mandatory or optional.
A value of true indicates that the parameter is required for the action enforcement.
If the value is false, the parameter is optional.