Personal Services: Execution Engine

Submitted by code_admin on Mon, 07/23/2018 - 11:10

TODO REfactor page without use of PHP filter drupal module

This page holds my notes for the execution engine used in Personal Services Hub

Definition: Action - this is an icon that appears in the Socket display. Actions include the socket itself.

All Actions have the following (optional) attributes:

  • Left
  • Top

All Actions have the following properties:

  • Name
  • ID

All apart from socket have the ID and NAME property
NAMES must be unique and must not contain '/' or '$' characters

function getIMGURL($img) {
return "/sites/default/files/2018-07/obj_" . strtolower($img) . "_icon.png";
};

function dispArrayAsTable($arr) {
print "

";

$keys = array();
$c = 0;
reset($arr[0]);
while (list($key,$value) = each($arr[0])) {
$keys[$c] = $key;
$c++;
print "

";
};
print "

";
reset($arr);
while (list($key,$value) = each($arr)) {
print "

";
for ($c=0;$c print "

";
};
print "

";
};
print "

" . $key . "
" . $value[$keys[$c]] ."

";
}

$c = 0;
$object['Name'] = "Socket";
$object['notes'] = "";
$object['icon'] = "";
$object['categories'] = "WEBSERVER,SINGLEUSERMACHINE";
$object['properties'] = "None";
$object['Description'] = "Used to represent a socket. This becomes the root element of each process";
$objects[$c++] = $object;

$object['Name'] = "Plug";
$object['notes'] = "";
$object['icon'] = "";
$object['categories'] = "WEBSERVER,SINGLEUSERMACHINE";
$object['properties'] = "TODO";
$object['Description'] = "Used to represent a call to another socket.";
$objects[$c++] = $object;

$object['Name'] = "Shell";
$object['notes'] = "";
$object['icon'] = "";
$object['categories'] = "SINGLEUSERMACHINE";
$object['properties'] = "Command, ParamString";
$object['Description'] = "Executes a shell command on the host machine.
Example Windows:
Command=cmd
ParamString=/c \"dir l*\"
Example Linux:
Command=bash
ParamString=-c \"ls | grep a\"";
$objects[$c++] = $object;

$object['Name'] = "Transform";
$object['notes'] = "";
$object['icon'] = "";
$object['categories'] = "WEBSERVER,SINGLEUSERMACHINE";
$object['properties'] = "TODO";
$object['Description'] = "TODO.";
$objects[$c++] = $object;

$object['Name'] = "TransformToString";
$object['notes'] = "";
$object['icon'] = "";
$object['categories'] = "WEBSERVER,SINGLEUSERMACHINE";
$object['properties'] = "TODO";
$object['Description'] = "TODO.";
$objects[$c++] = $object;

$object['Name'] = "RestCall";
$object['notes'] = "265";
$object['icon'] = "";
$object['categories'] = "WEBSERVER,SINGLEUSERMACHINE";
$object['properties'] = "TODO";
$object['Description'] = "TODO.";
$objects[$c++] = $object;

$object['Name'] = "If";
$object['notes'] = "";
$object['icon'] = "";
$object['categories'] = "WEBSERVER,SINGLEUSERMACHINE";
$object['properties'] = "TODO";
$object['Description'] = "TODO.";
$objects[$c++] = $object;

dispArrayAsTable($objects);

?>

xml: The namespace for the xml schema is "http://metcarob.com.personalservices.library.db.Socket.data" and a prefix of "sc" is normally used.

Categories

Actions can be in a number of categories, a server will have a single InstanceActionCategory which dictates what actions are available to users on that server.

WEBSERVER
SINGLEUSERMACHINE

Tags

RJM Article Type
Work Notes