Documentation
CUSTOMCOMMAND
usage
<CUSTOMCOMMAND ID="number">
<INFO>
<ID>number</ID>
<ACTIVITY>1</ACTIVITY>
<ISLOCKED>0</ISLOCKED>
<CREATORID>contactID</CREATORID>
<OWNERID>contactID</OWNERID>
<GROUPID>groupID</GROUPID>
<MODIFIERID>contactID</MODIFIERID>
<CREATIONDATE>YYYY-MM-DD hh:mm:ss</CREATIONDATE><!-- automatically filled by Sushee -->
<MODIFICATIONDATE>YYYY-MM-DD hh:mm:ss</MODIFICATIONDATE><!-- automatically filled by Sushee -->
<OPERATION>text</OPERATION>
<TARGET>text</TARGET>
<PATH>text</PATH>
<CLASSNAME>text</CLASSNAME>
<METHOD>text</METHOD>
</INFO>
</CUSTOMCOMMAND>
paramètres
OPERATION: defines the action executed by the custom command. e.g. SEARCH, CREATE, KILL, ANALYSE, EXECUTE
TARGET: defines the element on which the action is executed. * can be used if you want the command to be available for any kind of target. Leaving this field empty allows to have commands without target.
PATH: the path of the file where the PHP code is
CLASSNAME: the object to instanciate before executing the action
METHOD: the method to call on the object
Defines a custom command in Sushee.
exemples
To create the new custom command:
<CREATE>
<CUSTOMCOMMAND>
<INFO>
<OPERATION>KILL</OPERATION>
<TARGET>ZOMBIE</TARGET>
<PATH>/Public/zombie.class.php</PATH>
<CLASSNAME>Zombie</CLASSNAME>
<METHOD>kill</METHOD>
</INFO>
</CUSTOMCOMMAND>
</CREATE>
The content of the zombie.class.php file:
<?php
class Zombie{
function Zombie( /* XMLNode */ $operationNode){
}
function kill( /* XMLNode */ $operationNode){
return '<BOOM>blood</BOOM>'; // the function must return the result of the command, as a string.
}
}
?>
The new command syntax :
<QUERY>
<KILL>
<ZOMBIE/>
</KILL>
</QUERY>
And the result :
<RESPONSE>
<BOOM>blood</BOOM>
</RESPONSE>
Voir aussi :
VIRTUALMODULE
Fasten the access and creation for a subset of your elements