#****h* VAdmind/QUERIES * # NAME # QUERIES - Definition of queries exchanged between client-server # communication. # COPYRIGHT # (c) Urivan Saaib. All rights reserverd. # DESCRIPTION # This file describes the format and syntax of the valid XML queries # exchanged between the client and the server. # AUTHOR # Urivan Saaib # CREATION DATE # 12-Apr-2002 # MODIFICATION HISTORY # 12-Apr-2002 - First Version. # 13-Apr-2002 - Some abstraction to the strings. # 15-Apr-2002 - A little bit of more abstraction. # 27-Sep-2003 - Improvement due to code changes. # 11-Dec-2003 - Some corrections here and there. Also made the text fit on # 80x25 text terminals. # 31-Jan-2006 - Include reference to the Discover.pm plugin. # 10-Jul-2006 - Update XML schema. # LICENSE # This file is subject to the terms and conditions of the GNU # General Public License. #*** The XML queries exchanged must consist of 2 lines : A).- Header B).- Body NOTE: Both, Header and Body, should be sent as a single line of text. We show here the XML in separated lines for better understanding only. ------------------------------------------------------------------------------- A. HEADER STRING ------------------------------------------------------------------------------- The HEADER string provides the authentication mechanism for VAdmind to succesfuly process the request to be made which are on the BODY string. The HEADER sintax is : Server reply should be something similar to : Where the 'resultvalue' should be either : - 320 (valid) - 321 (invalid) depending on the pair of data supplied to the daemon. Header Document Type Definition (DTD): ]> ------------------------------------------------------------------------------- 1. BODY STRING ------------------------------------------------------------------------------- The BODY string provides all the information related to what plugin and functions to execute as well as the information that shoulw be passed on to the function. The BODY sintax is : PARAMETERS GOES HERE ... (NOTE: I wrote this multilines only for easy reading, but all of it should be in a single line) Identifies the group of modules requested to the server. . name=""/> Identifies the module to load. A Unique numeric identifier for this task. Body Document Type Definition (DTD): ]> Note that we do not declare "task" child elements, since we don't know what kind of information each task in a given module will suffice in order to have a success excecution. ------------------------------------------------------------------------------- 2. VALID MODULES ------------------------------------------------------------------------------- The name of the modules specified by the atribute "name" in the "module" element should be any of the modules located in the plugins folder, but without the file extention. As an example, let's think that we wrote a module for user management and we put all the perl code and functions in VAdmind/Plugins/Users.pm. Now lets think that one of the functions coded is named show_info () and that function requires at least a username (of which it will show information). The incomming XML should look something like this: root Remember that the task child elements does not requires attributes. Please, take a look to the DEVELOPERS documentation for more information about developing new modules or changing existing ones. ------------------------------------------------------------------------------- 3. STRING EXAMPLES : ------------------------------------------------------------------------------- To identify against the virtual server : Lets now take our previous example of a module implemented for user management. To add a new user 'foo' with password 'bar' name 'Foo Bar' with directory on '/home/intranet/foo' with shell 'sh' with 'ftp' and 'mail' privs and with a '15M' quota : foo bar Foo Bar /home/intranet/foo sh ftp,mail 15360 To add 'user1' with default values and delete 'user2' and his directory, then reboot the server: user1 user2 ------------------------------------------------------------------------------- 4. DETECTING INSTALLED PLUGINS ------------------------------------------------------------------------------- In the 0.1.4 release we included a the new module Discover.pm which was developed with the following criteria: - Provide an easy way to detect installed modules in a VAdmind enabled server. - Application client be able to build a dynamic user interface (UI) based on the specific required data, type and length. - Previous configuration of plugins free on client application. Those were the main reasons, if you find a cool way to use this new features let me know in order to include them :) Example of a BODY xml query: Will return something like: