This plugin is used for reservation of any resource using mysql database .
For example, this can be used as library reservation system, where books can be reserved by users for a particular period and it allows to delete the reservations made ( by the user only) and retrieve the reservation list on particular date or paricular period.
One can also retrieve the free resources on a particular date or particular period , by which the user can make the decision of reserving the free resources according to his will. The plugin also facilitate the user to create and delete the tables ( which are used for maintaining reservations) from TWIKi only.
The pre-requiste for accessing mysql database is that the Admin has to create the database named
Reservation.
Syntax Rules
Recognized Variables (for usage).
This is a list of all the variables available. The names should be self-explanatory. The table parameter in the following variables has to be created using the create option in the topic
ResourceAdminstator.
SHOW_ALL_RESERVATIONS
This variable is used to show all the reservations done in the future and past. Parameters:
-
Table: The table where all reservations has been stored
RESERVE_RESOURCE
This variable is used to reserve a resource from one date to another date.This variable takes following parameters
-
Table :The table where all reservations has to be stored
-
resource : The resource to be reserved
-
fromdate : The starting date of reservation
-
todate : The end date of reservation
-
username : On whom name, the reservation has to be made..Generally %WIKIUSERNAME%
is enough
-
comment : Any comment to be attached to reservation The required parameters for the variable to get working is Table,resource,fromdate,todate,username
SHOW_FREE_RESOURCES
This variable is used to show free resources from a date to another date.The parameters required are given below
-
Table : The table where reservations are stored
-
ResourceList : The resources list
-
Fromdate : The starting date
-
Todate : The end date
GET_RESOURCE_DELETE
This variable is used to generate all the reservations done from current date. The list contains all the reservation details along with the delete option. The parameters required are given below
-
Table : The table where reservations are stored
-
UserName : The reservtions done by the user will be displayed. If no username is given, all the reservations will be displayed.
SHOW_RESERVATION_ON_DATE
This variable is used to show the reservations made from a particular date to another date. The parameters required are
-
Table : The table where reservations are stored
-
date :
DELETE_SPECIFIED_RESOURCE
This variable is used to delete the specified reservation.This variable has to be defined in a topic named
DeleteResourceReservation. The following code should be there inorder to work as expected.
%DELETE_SPECIFIED_RESOURCE{ Table="ReservationTable" reservationid="%URLPARAM{"reservationid"}%"}%
Variables(For Adminstrator)
Mysql has been used for storing the reservations. For working of plugin,
Reservation database has to be created. After that, the administrator has to create tables in the topic
ResourceAdministrator.The username for the mysql should be
root and the password is nil.
Variables(For display)
These variables has been defined inorder to lessen the burden of writing code, by which the variables for reserving the resources can be directly used. How to use these variables has been given along with the variable definition
DISPLAY_FORM
The resource reservation form will be rendered as the output of this variable. The form will have the resource,from date , to date and comment fields which are named as
Resource,=Rdate=,=Tdate=,=comment=.An example of usage of the variable is given.
%DISPLAYFORM{ResourceList="ResourceDetail"}% The requirement of the
ResourceList parameter is defined below in the Requirements header .
DISPLAY_FORM1
The search form will be rendered as the output of this variable. The form will have the fromdate and todate fields which are named as
Fdate and
Tdate.There are no parameters required.
The usage of the variable is given in the
CheckResources.
Requirements
The requirements for the plugin to work is that Reservation database has to be created in mysql page. Then after wards tables has to be created using the
%CREATE%
. The
ResourceList parameter in
SHOW_FREE_RESOURCE should be given a topicname. The topic should be in the following format
%STARTINCLUDE%<option>Resource1</option><option>Resource 2</option>%STOPINCLUDE%
The user can has many resources which can be embedded in the INCLUDE tags as specified above.
Examples
1. If properly installed you will see a form asking to check resources
%DISPLAY_FORM1%
2. Check the reservations on a particular date in the
ReservationOnDate
Plugin Settings
- One line description, is shown in the TextFormattingRules topic:
- Set SHORTDESCRIPTION = Reservation system for resources using mysql database
- Debug plugin: (See output in
data/debug.txt)
Screenshot:
Here is the screen shot of Reservation Plugin
Plugin Installation Instructions
Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the TWiki server.
- Download the ZIP file from the Plugin Home (see below)
- Unzip
ReservationPlugin.zip in your twiki installation directory. Content:
| File: |
Description: |
data/TWiki/ReservationPlugin.txt |
Plugin topic |
data/TWiki/ReservationPlugin.txt,v |
Plugin topic repository |
lib/TWiki/Plugins/ReservationPlugin.pm |
Plugin Perl module |
data/TWiki/ResourceAdministrator |
Administrator page |
data/TWiki/CheckResources |
Sample page |
data/TWiki/ReservationOnDate |
Reservation done on particular date |
- Configure the Plugin:
- TWiki 4.0 and up: Run the configure script to enable the Plugin
- Using mysql, create a database named "Reservation"
- Then go to ResourceAdministrator and create all the tables required and reserve the resources as required. The plugin has been developed and tested using mysql 5.0.51.
Plugin Info
Related Topics: TWikiPlugins,
DeveloperDocumentationCategory,
AdminDocumentationCategory,
TWikiPreferences
--
TWiki:Main.SrikanthRevanuru
- 09 Jul 2008