diff --git a/modules/bibformat/web/.cvsignore b/modules/bibformat/web/.cvsignore index 7cf70d354..a3e7a53fe 100644 --- a/modules/bibformat/web/.cvsignore +++ b/modules/bibformat/web/.cvsignore @@ -1,7 +1,8 @@ Makefile Makefile.in z_* *.O *~ *.shtml +*.php *.py \ No newline at end of file diff --git a/modules/bibformat/web/Makefile.am b/modules/bibformat/web/Makefile.am index 20ef3a3b8..58a636d07 100644 --- a/modules/bibformat/web/Makefile.am +++ b/modules/bibformat/web/Makefile.am @@ -1,32 +1,32 @@ ## $Id$ ## This file is part of the CERN Document Server Software (CDSware). ## Copyright (C) 2002 CERN. ## ## The CDSware is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## The CDSware is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDSware; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. SUBDIRS = admin webdir=$(WEBDIR)/bibformat FILESWML=$(wildcard *.wml) web_DATA=$(FILESWML:.wml=) EXTRA_DIST = $(wildcard *.wml) -CLEANFILES = $(wildcard *.shtml) *~ *.tmp +CLEANFILES = $(wildcard *.php) *~ *.tmp -%.shtml: %.shtml.wml ../../../config/config.wml ../../../config/configbis.wml ../../../config/cdspage.wml +%.php: %.php.wml ../../../config/config.wml ../../../config/configbis.wml ../../../config/cdspage.wml $(WML) -o $@ $< diff --git a/modules/bibformat/web/admin/.cvsignore b/modules/bibformat/web/admin/.cvsignore index 7cf70d354..a3e7a53fe 100644 --- a/modules/bibformat/web/admin/.cvsignore +++ b/modules/bibformat/web/admin/.cvsignore @@ -1,7 +1,8 @@ Makefile Makefile.in z_* *.O *~ *.shtml +*.php *.py \ No newline at end of file diff --git a/modules/bibformat/web/admin/BEH_ACTION_add.shtml.wml b/modules/bibformat/web/admin/BEH_ACTION_add.php.wml similarity index 96% rename from modules/bibformat/web/admin/BEH_ACTION_add.shtml.wml rename to modules/bibformat/web/admin/BEH_ACTION_add.php.wml index 7fb342c72..f14e0aedf 100644 --- a/modules/bibformat/web/admin/BEH_ACTION_add.shtml.wml +++ b/modules/bibformat/web/admin/BEH_ACTION_add.php.wml @@ -1,171 +1,171 @@ ## $Id$ ## This file is part of the CERN Document Server Software (CDSware). ## Copyright (C) 2002 CERN. ## ## The CDSware is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## The CDSware is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDSware; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. #include "cdspage.wml" \ title="Behaviours" \ navbar_name="admin" \ navbar_select="BEH_display" \ cdspageboxlefttopadd=" " ## $Id$ //========================================================================== -// File: BEH_ACTION_add.shtml (flexElink WI) +// File: BEH_ACTION_add.php (flexElink WI) // Description: Displays necessary controls to define a new behavior action // or adds a defined behavior action to the DB if all the parameters are // set // POST parameters: // otype --> (required) Behavior label the action corresponds to // eorder -> (required) Evaluation order of the condition the actions // corresponds to // process -> (optional) If defined (value not relevant) the script adds // the action to the DB; if not it displays options for defining it // code ----> (optional) Action's EL code // locator -> (optional) Not relevant // aorder --> (optional) Action application order inside its corresponding // condition; if i isn't specified, the script will look for the // last one in the database for that condition // Notes: If an action is succesfully added to the DB it refreshes the caller // Requires: DB, ERROR // Author: Hector.Sanchez@cern.ch //========================================================================== include(DB); include(ERROR); if( (!isset($otype)) or (trim($otype)=="") ) { print "Output type hasn't been specified"; print "
"; print "[Close]"; exit; } $otype=trim(strtoupper($otype)); if( (!isset($eorder)) or (trim($eorder)=="") ) { print "Condition evaluation order hasn't been specified"; print "
"; print "[Close]"; exit; } if(!isset($process)) { ?> -
+
Add new action for condition ''
Apply order:
Locator(only IENRICH types):
EL Code:
checkCode( $temp_code ); if(!$ok) { print "Code incorrect: $msg
[Go Back]"; exit; } } if( (!isset($locator)) ) $locator=""; if(!get_magic_quotes_gpc()) { $code=addslashes($code); $locator=addslashes($locator); } $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ) or errormsg("Couldn't connect to mySQL"); mysql_selectdb( $DB_DB ); if( (!isset($aorder)) or (trim($aorder)=="") ) { $qry="select max(apply_order)+1 from flxBEHAVIORCONDITIONSACTIONS where otype='$otype' and eval_order='$eorder'"; $res=mysql_query( $qry ); $aorder=mysql_fetch_array( $res ); $aorder=$aorder[0]; if($aorder==null) { $aorder=0; } } $qry="insert into flxBEHAVIORCONDITIONSACTIONS (otype, eval_order, apply_order, locator, el_code) values ('$otype', '$eorder', '$aorder', '$locator', '$code')"; if(!mysql_query( $qry )) { errorpage("Impossible to insert new action:
".mysql_error()); mysql_close( $db ); exit; } mysql_close( $db ); ?> diff --git a/modules/bibformat/web/admin/BEH_ACTION_del.shtml.wml b/modules/bibformat/web/admin/BEH_ACTION_del.php.wml similarity index 94% rename from modules/bibformat/web/admin/BEH_ACTION_del.shtml.wml rename to modules/bibformat/web/admin/BEH_ACTION_del.php.wml index d87150391..3cb7f7343 100644 --- a/modules/bibformat/web/admin/BEH_ACTION_del.shtml.wml +++ b/modules/bibformat/web/admin/BEH_ACTION_del.php.wml @@ -1,83 +1,83 @@ ## $Id$ ## This file is part of the CERN Document Server Software (CDSware). ## Copyright (C) 2002 CERN. ## ## The CDSware is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## The CDSware is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDSware; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. ## $Id$ //========================================================================== -// File: BEH_ACTION_del.shtml (flexElink WI) +// File: BEH_ACTION_del.php (flexElink WI) // Description: Delete an existing new behavior action from the DB // POST parameters: // otype --> (required) Behavior label the action corresponds to // eorder -> (required) Evaluation order of the condition the actions // corresponds to // aorder --> (required) Action application order inside its corresponding // condition. // Notes: If the deletion is succesful it redirects the browser to the // showing of the // Requires: DB, ERROR // Author: Hector.Sanchez@cern.ch //========================================================================== - include("localconf.inc.shtml"); + include("localconf.inc.php"); include(DB); include(ERROR); if( (!isset($otype)) or (trim($otype)=="") ) { errorpage("Output type name hasn't been specified"); exit; } $otype=strtoupper(trim($otype)); if( (!isset($eorder)) or (trim($eorder)=="") ) { errorpage("Condition evaluation order hasn't been specified"); exit; } if( (!isset($aorder)) or (trim($aorder)=="") ) { errorpage("Action evaluation order hasn't been specified"); exit; } $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ) or errormsg("Couldn't connect to mySQL") or exit; mysql_selectdb( $DB_DB ); $qry="delete from flxBEHAVIORCONDITIONSACTIONS where otype='$otype' and eval_order='$eorder' and apply_order='$aorder'"; if(!mysql_query( $qry )) { errorpage("Impossible to delete action:
".mysql_error()); mysql_close( $db ); exit; } mysql_close( $db ); - header("location: BEH_OTYPE_showone.shtml?otype=$otype"); + header("location: BEH_OTYPE_showone.php?otype=$otype"); ?> diff --git a/modules/bibformat/web/admin/BEH_ACTION_edit.shtml.wml b/modules/bibformat/web/admin/BEH_ACTION_edit.php.wml similarity index 96% rename from modules/bibformat/web/admin/BEH_ACTION_edit.shtml.wml rename to modules/bibformat/web/admin/BEH_ACTION_edit.php.wml index 42f303ffd..0ebc46b6f 100644 --- a/modules/bibformat/web/admin/BEH_ACTION_edit.shtml.wml +++ b/modules/bibformat/web/admin/BEH_ACTION_edit.php.wml @@ -1,233 +1,233 @@ ## $Id$ ## This file is part of the CERN Document Server Software (CDSware). ## Copyright (C) 2002 CERN. ## ## The CDSware is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## The CDSware is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDSware; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. #include "cdspage.wml" \ title="Behaviours" \ navbar_name="admin" \ navbar_select="BEH_display" \ cdspageboxlefttopadd=" " ## $Id$ //========================================================================== -// File: BEH_ACTION_edit.shtml (flexElink WI) +// File: BEH_ACTION_edit.php (flexElink WI) // Description: Allows to edit a single behavior action from the DB and apply // changes in the action's data to the DB // POST parameters: // otype --> (required) Behavior label the action corresponds to // eorder -> (required) Evaluation order of the condition the actions // corresponds to // process -> (optional) If defined (value not relevant) the script updates // action's in the DB; if not it displays options for modifiying it // aorder --> (required if process is not defined) Action application order // inside its corresponding condition. When process is set, it // contains the new order for this action; if it's empty, the // script will look for the last apply order of the actions for // the corresponding condition. // original_aorder --> (required if process is defined) Original action // application order inside its corresponding condition. // code ----> (optional) Action's EL code // locator -> (optional) Not relevant // Notes: If the update of the action is succesful it closes the current i // browser and refreshes the caller one // Requires: DB, ERROR // Author: Hector.Sanchez@cern.ch //========================================================================== include(DB); include(ERROR); if( (!isset($otype)) or (trim($otype)=="") ) { print "Output type hasn't been specified"; print "
"; print "[Close]"; exit; } $otype=trim(strtoupper($otype)); if( (!isset($eorder)) or (trim($eorder)=="") ) { print "Condition evaluation order hasn't been specified"; print "
"; print "[Close]"; exit; } $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ); mysql_selectdb( $DB_DB ); if(!isset($process)) { if( (!isset($aorder)) or (trim($aorder)=="") ) { print "Action apply order hasn't been specified"; print "
"; print "[Close]"; exit; } $qry="select locator, el_code from flxBEHAVIORCONDITIONSACTIONS where otype='$otype' and eval_order=$eorder and apply_order=$aorder"; $qh=mysql_query( $qry ); list($locator, $code)=mysql_fetch_array( $qh ); ?> -
+
Modifying action ''
Apply order:
Locator(only IENRICH types):
EL Code:
Action orginal apply order hasn't been specified"; print "
"; print "[Close]"; exit; } if( (!isset($code)) ) $code=""; else { $temp_code=$code; if(get_magic_quotes_gpc()) $temp_code=stripslashes($temp_code); include(EXECUTOR); $a=new AELExecutor(); list($ok, $msg)=$a->checkCode( $temp_code ); if(!$ok) { print "Code incorrect: $msg
[Go Back]"; exit; } } if( (!isset($locator)) ) $locator=""; if(!get_magic_quotes_gpc()) { $code=addslashes($code); $locator=addslashes($locator); } if( (!isset($aorder)) or (trim($aorder)=="") ) { $qry="select max(apply_order)+1 from flxBEHAVIORCONDITIONSACTIONS where otype='$otype' and eval_order='$eorder'"; $res=mysql_query( $qry ); $aorder=mysql_fetch_array( $res ); $aorder=$aorder[0]; if($aorder==null) { $aorder=0; } } if($aorder==$original_aorder) { $qry="update flxBEHAVIORCONDITIONSACTIONS set locator='$locator', el_code='$code' where otype='$otype' and eval_order='$eorder' and apply_order='$aorder'"; if(!mysql_query( $qry )) { print "Impossible to update action: ".mysql_error()."
[Go Back]"; mysql_close( $db ); exit; } } else { $qry="delete from flxBEHAVIORCONDITIONSACTIONS where otype='$otype' and eval_order='$eorder' and apply_order='$original_aorder'"; if(!mysql_query( $qry )) { print "Impossible to delete old action: ".mysql_error()."
[Go Back]"; mysql_close( $db ); exit; } $qry="insert into flxBEHAVIORCONDITIONSACTIONS (otype, eval_order, apply_order, locator, el_code) values ('$otype', '$eorder', '$aorder', '$locator', '$code')"; if(!mysql_query( $qry )) { print "Impossible to insert new action: ".mysql_error()."
[Go Back]"; mysql_close( $db ); exit; } } mysql_close( $db ); ?> diff --git a/modules/bibformat/web/admin/BEH_COND_add.shtml.wml b/modules/bibformat/web/admin/BEH_COND_add.php.wml similarity index 96% rename from modules/bibformat/web/admin/BEH_COND_add.shtml.wml rename to modules/bibformat/web/admin/BEH_COND_add.php.wml index 04251056c..5b0d070d2 100644 --- a/modules/bibformat/web/admin/BEH_COND_add.shtml.wml +++ b/modules/bibformat/web/admin/BEH_COND_add.php.wml @@ -1,154 +1,154 @@ ## $Id$ ## This file is part of the CERN Document Server Software (CDSware). ## Copyright (C) 2002 CERN. ## ## The CDSware is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## The CDSware is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDSware; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. #include "cdspage.wml" \ title="Behaviours" \ navbar_name="admin" \ navbar_select="BEH_display" \ cdspageboxlefttopadd=" " ## $Id$ //========================================================================== -// File: BEH_COND_add.shtml (flexElink WI) +// File: BEH_COND_add.php (flexElink WI) // Description: Displays necessary controls to define a new behaviour condition // or adds a defined behavior condition (by the values passed as // parameters) to the DB // POST parameters: // otype --> (required) Behavior label the condition corresponds to // process -> (optional) If defined (value not relevant) the script adds // the condition to the DB. // eorder -> (optional) Evaluation order of the condition inside the owner // behaviour. If this parameter is not set, the script will look // for the last evaluation order value inside the corresponding // behaviour // code ----> (optional) Action's EL code // Notes: If an action is succesfully added to the DB it closes the current // browser and refreshes the opener one // Requires: DB, ERROR // Author: Hector.Sanchez@cern.ch //========================================================================== include(DB); include(ERROR); if( (!isset($otype)) or (trim($otype)=="") ) { print "Output type hasn't been specified"; print "
"; print "[Close]"; exit; } $otype=trim(strtoupper($otype)); if(!isset($process)) { ?> -
+
Add new condition for output type''
Evaluation order:
EL Code:
checkCode( $temp_code ); if(!$ok) { print "Condition code incorrect: $msg
[Go Back]"; exit; } } if(!get_magic_quotes_gpc()) $code=addslashes($code); $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ) or errormsg("Couldn't connect to mySQL") or exit; mysql_selectdb( $DB_DB ); if( (!isset($eorder)) or (trim($eorder)=="") ) { $qry="select max(eval_order)+1 from flxBEHAVIORCONDITIONS where otype='$otype'"; $res=mysql_query( $qry ); $order=mysql_fetch_array( $res ); $order=$order[0]; if($order==null) { $order=0; } } $qry="insert into flxBEHAVIORCONDITIONS (otype, eval_order, el_condition) values ('$otype', '$order', '$code')"; if(!mysql_query( $qry )) { print "Impossible to insert new condition:
".mysql_error(); print "
"; print "[Go Back]"; mysql_close( $db ); exit; } mysql_close( $db ); ?> diff --git a/modules/bibformat/web/admin/BEH_COND_del.shtml.wml b/modules/bibformat/web/admin/BEH_COND_del.php.wml similarity index 94% rename from modules/bibformat/web/admin/BEH_COND_del.shtml.wml rename to modules/bibformat/web/admin/BEH_COND_del.php.wml index 296a66cf1..12443af83 100644 --- a/modules/bibformat/web/admin/BEH_COND_del.shtml.wml +++ b/modules/bibformat/web/admin/BEH_COND_del.php.wml @@ -1,79 +1,79 @@ ## $Id$ ## This file is part of the CERN Document Server Software (CDSware). ## Copyright (C) 2002 CERN. ## ## The CDSware is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## The CDSware is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDSware; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. ## $Id$ //========================================================================== -// File: BEH_COND_del.shtml (flexElink WI) +// File: BEH_COND_del.php (flexElink WI) // Description: Deletes a given condition (and its depending items) from the DB // POST parameters: // otype --> (required) Behaviour label the condition corresponds to // eorder -> (required) Evaluation order of the condition // Notes: If the condition is succesfully deleted from the DB it redirects // the current browser to the detailed display of the corresponding // behaviour // Requires: DB, ERROR // Author: Hector.Sanchez@cern.ch //========================================================================== - include("localconf.inc.shtml"); + include("localconf.inc.php"); include(DB); include(ERROR); if( (!isset($otype)) or (trim($otype)=="") ) { errorpage("Output type name hasn't been specified"); exit; } $otype=strtoupper(trim($otype)); if( (!isset($eorder)) or (trim($eorder)=="") ) { errorpage("Condition evaluation order hasn't been specified"); exit; } $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ) or errormsg("Couldn't connect to mySQL") or exit; mysql_selectdb( $DB_DB ); $qry="delete from flxBEHAVIORCONDITIONSACTIONS where otype='$otype' and eval_order='$eorder'"; if(!mysql_query( $qry )) { errorpage("Impossible to delete actions related to this condition:
".mysql_error()); mysql_close( $db ); exit; } $qry="delete from flxBEHAVIORCONDITIONS where otype='$otype' and eval_order='$eorder'"; if(!mysql_query( $qry )) { errorpage("Impossible to delete condition:
".mysql_error()); mysql_close( $db ); exit; } mysql_close( $db ); - header("Location: BEH_OTYPE_showone.shtml?otype=$otype"); + header("Location: BEH_OTYPE_showone.php?otype=$otype"); ?> diff --git a/modules/bibformat/web/admin/BEH_COND_edit.shtml.wml b/modules/bibformat/web/admin/BEH_COND_edit.php.wml similarity index 97% rename from modules/bibformat/web/admin/BEH_COND_edit.shtml.wml rename to modules/bibformat/web/admin/BEH_COND_edit.php.wml index d82ae2063..dce7a5814 100644 --- a/modules/bibformat/web/admin/BEH_COND_edit.shtml.wml +++ b/modules/bibformat/web/admin/BEH_COND_edit.php.wml @@ -1,197 +1,197 @@ ## $Id$ ## This file is part of the CERN Document Server Software (CDSware). ## Copyright (C) 2002 CERN. ## ## The CDSware is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## The CDSware is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDSware; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. #include "cdspage.wml" \ title="Behaviours" \ navbar_name="admin" \ navbar_select="BEH_display" \ cdspageboxlefttopadd=" " ## $Id$ //========================================================================== -// File: BEH_COND_edit.shtml (flexElink WI) +// File: BEH_COND_edit.php (flexElink WI) // Description: Allows to modify a condition data and updates changes in // the configuration DB // POST parameters: // otype --> (required) Behavior label the condition corresponds to // process -> (optional) If defined (value not relevant) the script updates // condition data in the DB with the new values passed as // parameters // eorder -> (required if process is not set) Evaluation order of the // condition inside the owner behaviour. If this parameter is not // set, the script will look for the last evaluation order value // inside the corresponding behaviour // old_eorder -> (required if process is set) Original evaluation order of // the condition to be modified // code ----> (optional) Action's EL code // Notes: If an action is succesfully added to the DB it closes the current // browser and refreshes the opener one // Requires: DB // Author: Hector.Sanchez@cern.ch //========================================================================== include(DB); if( (!isset($otype)) or (trim($otype)=="") ) { print "Output type hasn't been specified"; print "
"; print "[Close]"; exit; } $otype=trim(strtoupper($otype)); $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ) or errormsg("Couldn't connect to mySQL") or exit; mysql_selectdb( $DB_DB ); if(!isset($process)) { if( (!isset($eorder)) or (trim($eorder)=="") ) { print "Condition evaluation order hasn't been specified"; print "
"; print "[Close]"; exit; } $qry="select el_condition from flxBEHAVIORCONDITIONS where otype='$otype' and eval_order='$eorder'"; $qh=mysql_query($qry, $db); list($code)=mysql_fetch_array($qh); mysql_close($db); ?> -
+
Editing condition for output type''
Evaluation order:
EL Code:
Condition original evaluation order hasn't been specified"; print "
"; print "[Close]"; exit; } if( (!isset($code)) ) $code=""; else { $temp_code=$code; if(get_magic_quotes_gpc()) $temp_code=stripslashes($temp_code); include(EXECUTOR); $a=new AELExecutor(); list($ok, $msg)=$a->checkCode( $temp_code ); if(!$ok) { print "Condition code incorrect: $msg
[Go Back]"; exit; } } if(!get_magic_quotes_gpc()) $code=addslashes($code); if( (!isset($eorder)) or (trim($eorder)=="") ) { $qry="select max(eval_order)+1 from flxBEHAVIORCONDITIONS where otype='$otype' and eval_order<>$old_eorder"; $res=mysql_query( $qry ); $order=mysql_fetch_array( $res ); $eorder=$order[0]; if($eorder==null) { $eorder=0; } } if($eorder!=$old_eorder) { $qry="update flxBEHAVIORCONDITIONSACTIONS set eval_order='$eorder' where otype='$otype' and eval_order='$old_eorder'"; if(!mysql_query( $qry )) { print "Impossible to update actions related to this condition:
".mysql_error(); print "
"; print "[Go Back]"; mysql_close( $db ); exit; } } $qry="update flxBEHAVIORCONDITIONS set eval_order='$eorder', el_condition='$code' where otype='$otype' and eval_order='$old_eorder'"; if(!mysql_query( $qry )) { print "Impossible to insert update condition:
".mysql_error(); print "
"; print "[Go Back]"; mysql_close( $db ); exit; } mysql_close( $db ); ?> diff --git a/modules/bibformat/web/admin/BEH_OTYPE_add.shtml.wml b/modules/bibformat/web/admin/BEH_OTYPE_add.php.wml similarity index 95% rename from modules/bibformat/web/admin/BEH_OTYPE_add.shtml.wml rename to modules/bibformat/web/admin/BEH_OTYPE_add.php.wml index 0b9528fe8..382a53d4d 100644 --- a/modules/bibformat/web/admin/BEH_OTYPE_add.shtml.wml +++ b/modules/bibformat/web/admin/BEH_OTYPE_add.php.wml @@ -1,84 +1,84 @@ ## $Id$ ## This file is part of the CERN Document Server Software (CDSware). ## Copyright (C) 2002 CERN. ## ## The CDSware is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## The CDSware is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDSware; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. ## $Id$ //========================================================================== -// File: BEH_OTYPE_add.shtml (flexElink WI) +// File: BEH_OTYPE_add.php (flexElink WI) // Description: Adds a new behaviour to the DB from the data passed as // parameteres // POST parameters: // otype --> (required) Behaviour label the action corresponds to // type ---> (required, possible values: NORMAL, IENRICH) Behaviour type. // doc ----> (optional) Documentation describing the behaviour // Notes: If the behaviour is succesfully added to the DB it redirects the // browser to the behaviour list display // Requires: DB, ERROR // Author: Hector.Sanchez@cern.ch //========================================================================== - include("localconf.inc.shtml"); + include("localconf.inc.php"); include(DB); include(ERROR); if( (!isset($otype)) or (trim($otype)=="") ) { errorpage("Output type name hasn't been specified"); exit; } $otype=strtoupper(trim($otype)); if( (!isset($type)) or (trim($type)=="") ) $type=""; $type=strtoupper(trim($type)); if(!in_array($type, array( "NORMAL", "IENRICH" ))) { errorpage("Behavior type incorrect!!"); exit; } if( !isset($doc) ) $doc=""; $doc=strtoupper(trim($doc)); if(!get_magic_quotes_gpc()) { $doc=addslashes($doc); } $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ) or errormsg("Couldn't connect to mySQL") or exit; mysql_selectdb( $DB_DB ); $qry="insert into flxBEHAVIORS(name, type, doc) values ('$otype', '$type', '$doc')"; if(!mysql_query( $qry )) { errorpage("Impossible to insert new output type:
".mysql_error()); mysql_close( $db ); exit; } mysql_close( $db ); - header("location: BEH_display.shtml"); + header("location: BEH_display.php"); ?> diff --git a/modules/bibformat/web/admin/BEH_OTYPE_del.shtml.wml b/modules/bibformat/web/admin/BEH_OTYPE_del.php.wml similarity index 96% rename from modules/bibformat/web/admin/BEH_OTYPE_del.shtml.wml rename to modules/bibformat/web/admin/BEH_OTYPE_del.php.wml index 63ddab33a..2cc14d328 100644 --- a/modules/bibformat/web/admin/BEH_OTYPE_del.shtml.wml +++ b/modules/bibformat/web/admin/BEH_OTYPE_del.php.wml @@ -1,92 +1,92 @@ ## $Id$ ## This file is part of the CERN Document Server Software (CDSware). ## Copyright (C) 2002 CERN. ## ## The CDSware is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## The CDSware is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDSware; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. #include "cdspage.wml" \ title="Behaviours" \ navbar_name="admin" \ navbar_select="BEH_display" \ cdspageboxlefttopadd=" " ## $Id$ //========================================================================== -// File: BEH_OTYPE_del.shtml (flexElink WI) +// File: BEH_OTYPE_del.php (flexElink WI) // Description: Deletes an existing behaviour (and all the items that depend // on them) from the DB // parameteres // POST parameters: // otype --> (required) Behaviour label the action corresponds to // Notes: If the behaviour is succesfully deleted from the DB it closes the // current browser and refreshes the opener one // Requires: DB, ERROR // Author: Hector.Sanchez@cern.ch //========================================================================== include(DB); include(ERROR); if( (!isset($otype)) or (trim($otype)=="") ) { errorpage("Output type name hasn't been specified"); exit; } $otype=strtoupper(trim($otype)); $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ) or errormsg("Couldn't connect to mySQL") or exit; mysql_selectdb( $DB_DB ); $qry="delete from flxBEHAVIORCONDITIONSACTIONS where otype='$otype'"; if(!mysql_query( $qry )) { errorpage("Impossible to delete actions related to this output type:
".mysql_error()); mysql_close( $db ); exit; } $qry="delete from flxBEHAVIORCONDITIONS where otype='$otype'"; if(!mysql_query( $qry )) { errorpage("Impossible to delete conditions related to this output type:
".mysql_error()); mysql_close( $db ); exit; } $qry="delete from flxBEHAVIORS where name='$otype'"; if(!mysql_query( $qry )) { errorpage("Impossible to delete output type:
".mysql_error()); mysql_close( $db ); exit; } mysql_close( $db ); ?> diff --git a/modules/bibformat/web/admin/BEH_OTYPE_edit.shtml.wml b/modules/bibformat/web/admin/BEH_OTYPE_edit.php.wml similarity index 96% rename from modules/bibformat/web/admin/BEH_OTYPE_edit.shtml.wml rename to modules/bibformat/web/admin/BEH_OTYPE_edit.php.wml index 95e8ad261..7a7690e0c 100644 --- a/modules/bibformat/web/admin/BEH_OTYPE_edit.shtml.wml +++ b/modules/bibformat/web/admin/BEH_OTYPE_edit.php.wml @@ -1,186 +1,186 @@ ## $Id$ ## This file is part of the CERN Document Server Software (CDSware). ## Copyright (C) 2002 CERN. ## ## The CDSware is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## The CDSware is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDSware; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. ## $Id$ //========================================================================== -// File: BEH_OTYPE_edit.shtml (flexElink WI) +// File: BEH_OTYPE_edit.php (flexElink WI) // Description: Allows to modify a behavior's data and updates it, according // with the made changes, in the DB // POST parameters: // otype --> (required) Behavior label // otype_orig -> (optional) If defined the script updates the data passed // parameters in the DB. When defined, it contains the DB label(the // original one as it can be changed) of the behaviour to be // modified // type ---> (required if otype_orig is set, possible values: NORMAL, // IENRICH) Behaviour type. // doc ----> (optional) Documentation describing the behaviour // Notes: If the behaviour data is succesfully updated in the DB it redirects // the current browser to the detailed display of the updated behaviour // Requires: DB, ERROR, FUNCTION_LIB // Author: Hector.Sanchez@cern.ch //========================================================================== - include("localconf.inc.shtml"); + include("localconf.inc.php"); include(DB); include(ERROR); include(FUNCTION_LIB); if((!isset($otype))||(trim($otype)=="")) { print "ERROR: Output type label hasn't been specified!!
"; print "[Go Back]"; exit; } if(get_magic_quotes_gpc()) { $otype=stripslashes($otype); } $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ); mysql_selectdb( $DB_DB ); if(isset($otype_orig)) { $otype=trim(strtoupper($otype)); $otype_orig=trim(strtoupper($otype_orig)); if(!isset($type)) { $type="NORMAL"; } else { $type=strtoupper(trim($type)); } if(($type!="NORMAL")&&($type!="IENRICH")) { print "Incorrect value for type"; print "
"; print "[Back]"; exit; } if(!isset($doc)) { $doc=""; } if(!get_magic_quotes_gpc()) { $type=addslashes($type); $doc=addslashes($doc); $otype=addslashes($otype); $otype_orig=addslashes($otype_orig); } if($otype!=$otype_orig) { $qry="update flxBEHAVIORCONDITIONSACTIONS set otype='$otype' where otype='$otype_orig'"; if(!mysql_query($qry)) { print "Impossible to update actions for output type '$otype_orig': ".mysql_error(); print "
"; print "[Back]"; mysql_close( $db ); exit; } $qry="update flxBEHAVIORCONDITIONS set otype='$otype' where otype='$otype_orig'"; if(!mysql_query($qry)) { print "Impossible to update conditions for output type '$otype_orig': ".mysql_error(); print "
"; print "[Back]"; mysql_close( $db ); exit; } } $qry="update flxBEHAVIORS set name='$otype', type='$type', doc='$doc' where name='$otype_orig'"; if(!mysql_query($qry)) { print "Impossible to update output type '$otype_orig': ".mysql_error(); print "
"; print "[Back]"; mysql_close( $db ); exit; } if($errors!="") { print $errors; print "
"; print "[Back]"; mysql_close( $db ); exit; } - header("location: BEH_OTYPE_showone.shtml?otype=$otype"); + header("location: BEH_OTYPE_showone.php?otype=$otype"); exit; } //----------------------------------------------------------------- $qry="select type, doc from flxBEHAVIORS where name='".addslashes($otype)."'"; $qh=mysql_query($qry, $db); list($type, $doc)=mysql_fetch_row($qh); ?> -
+
Modifying output type ''
Name
Type
Documentation
diff --git a/modules/bibformat/web/admin/BEH_OTYPE_showone.shtml.wml b/modules/bibformat/web/admin/BEH_OTYPE_showone.php.wml similarity index 77% rename from modules/bibformat/web/admin/BEH_OTYPE_showone.shtml.wml rename to modules/bibformat/web/admin/BEH_OTYPE_showone.php.wml index 905875765..355e467f3 100644 --- a/modules/bibformat/web/admin/BEH_OTYPE_showone.shtml.wml +++ b/modules/bibformat/web/admin/BEH_OTYPE_showone.php.wml @@ -1,162 +1,162 @@ ## $Id$ ## This file is part of the CERN Document Server Software (CDSware). ## Copyright (C) 2002 CERN. ## ## The CDSware is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## The CDSware is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDSware; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. #include "cdspage.wml" \ title="Behaviours" \ navbar_name="admin" \ navbar_select="BEH_display" \ cdspageboxlefttopadd=" " ## $Id$ //========================================================================== -// File: BEH_OTYPE_showone.shtml (flexElink WI) +// File: BEH_OTYPE_showone.php (flexElink WI) // Description: Shows the complete structure for a given behaviour. It presents // the behavior data, conditions and actions; it also allows its management // POST parameters: // otype --> (required) Behavior label that identifies the behavior to be // shown // Requires: DB, ERROR, FUNCTION_LIB // Author: Hector.Sanchez@cern.ch //========================================================================== include(DB); include(ERROR); include(FUNCTION_LIB); ?> ERROR: Behavior label hasn't been specified!!
"; print "[Close]"; exit; } $otype=trim(strtoupper($otype)); if(get_magic_quotes_gpc()) { $otype=stripslashes($otype); } $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ); mysql_selectdb( $DB_DB ); $qry="select type, doc from flxBEHAVIORS where name='".addslashes($otype)."'"; $qh=mysql_query($qry, $db); list($type, $doc)=mysql_fetch_row($qh); ?>
Details of output type ''
Type
Documentation ", $doc);?>
- - - + + +
[Add condition][Modify][Delete][Add condition][Modify][Delete]
=1) { ?> - - + + "; } mysql_close( $db ); ?> diff --git a/modules/bibformat/web/admin/BEH_display.shtml.wml b/modules/bibformat/web/admin/BEH_display.php.wml similarity index 93% rename from modules/bibformat/web/admin/BEH_display.shtml.wml rename to modules/bibformat/web/admin/BEH_display.php.wml index fc119edcb..484ccbad3 100644 --- a/modules/bibformat/web/admin/BEH_display.shtml.wml +++ b/modules/bibformat/web/admin/BEH_display.php.wml @@ -1,136 +1,136 @@ ## $Id$ ## This file is part of the CERN Document Server Software (CDSware). ## Copyright (C) 2002 CERN. ## ## The CDSware is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## The CDSware is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDSware; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. #include "cdspage.wml" \ title="Behaviours" \ navbar_name="admin" \ navbar_select="BEH_display" \ cdspageboxlefttopadd=" " ## $Id$ //========================================================================== -// File: BEH_display.shtml (flexElink WI) +// File: BEH_display.php (flexElink WI) // Description: Shows a list of the existing behaviors in the DB, and allows to // access to their details or to add new ones // POST parameters: // Notes: // Requires: DB, ERROR // Author: Hector.Sanchez@cern.ch //========================================================================== include(DB); include(ERROR); include(HEADER); ?>

Define one or more output BibFormat behaviours. These are then passed as parameters to the BibFormat modules while executing formatting. Example: You can tell BibFormat that is has to enrich the incoming metadata file by the created format, or that it only has to print the format out.

CONDITIONS
Action () ')">[Modify][Delete]')">[Modify][Delete]
- ')">[Add Action] - ')">[Modify] - [Delete] + ')">[Add Action] + ')">[Modify] + [Delete]
- + "; ?> - +
Name Type Documentation
 [Details][Details]
Add new OUPUT TYPE
Output Type Name
Behavior Type
Documentation
diff --git a/modules/bibformat/web/admin/BIBREFORMAT_display.shtml.wml b/modules/bibformat/web/admin/BIBREFORMAT_display.php.wml similarity index 92% rename from modules/bibformat/web/admin/BIBREFORMAT_display.shtml.wml rename to modules/bibformat/web/admin/BIBREFORMAT_display.php.wml index 5cd087c22..0faad4e15 100644 --- a/modules/bibformat/web/admin/BIBREFORMAT_display.shtml.wml +++ b/modules/bibformat/web/admin/BIBREFORMAT_display.php.wml @@ -1,111 +1,111 @@ ## $Id$ ## This file is part of the CERN Document Server Software (CDSware). ## Copyright (C) 2002 CERN. ## ## The CDSware is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## The CDSware is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDSware; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - #include "cdspage.wml" \ title="Reformat Records" \ navbar_name="admin" \ navbar_select="BIBREFORMAT_display" \ cdspageboxlefttopadd=" " ## DO NOT EDIT THIS FILE! IT WAS AUTOMATICALLY GENERATED FROM CDSware WML SOURCES. //========================================================================== -// File: BIBREFORMAT_display.shtml +// File: BIBREFORMAT_display.php // Description: Displays and manages the current reformatting processes // POST parameters: // Notes: // Requires: DB, ERROR // Author: Eduardo.Margallo@cern.ch //========================================================================== ## load config variables: $TMPDIR = ""; $BINDIR = ""; include(DB); include(ERROR); include(HEADER); ?> Have some pre-stored behaviours rebuilt. This tool queues the requests for administration convenience. Each request goes through three phases. First the XML file for the record(s) gets downloaded. Then it is fed to BibFormat so as to generate the desired behaviour data. Finally it is uploaded, possibly upgrading the old data.

Add new requests

If you want to make a new request for record reformatting, use the links at the bottom. The first one allows for full collections, whereas the second one permits more complex queries to be made.
- Reformat Collections
- Manual Choice + Reformat Collections
+ Manual Choice

Request status

This page shows the currently queued reformat queries. Being lengthy tasks, they are stored for administration convenience. Cancelling a task is possible, though individual phases must be completed before it can be removed. Therefore, it might take some time before a task disappears. 0 ) { ?>

Running tasks as of :
 Please bear in mind that this page only reflects the state of the processes - at the time of your request (Refresh). + at the time of your request (Refresh).

»No running tasks.
"; for( $i=1;$i<6;$i++ ) print ""; - print ""; print ""; } ?>
UserDateRecords Output FormatStateAction
" . limit_length( $row[$i], 30 ) . "". "Cancel
diff --git a/modules/bibformat/web/admin/BIBREFORMAT_hand.shtml.wml b/modules/bibformat/web/admin/BIBREFORMAT_hand.php.wml similarity index 94% rename from modules/bibformat/web/admin/BIBREFORMAT_hand.shtml.wml rename to modules/bibformat/web/admin/BIBREFORMAT_hand.php.wml index 2523ca204..bd8beb417 100644 --- a/modules/bibformat/web/admin/BIBREFORMAT_hand.shtml.wml +++ b/modules/bibformat/web/admin/BIBREFORMAT_hand.php.wml @@ -1,119 +1,119 @@ ## This file is part of the CERN Document Server Software (CDSware). ## Copyright (C) 2002 CERN. ## ## The CDSware is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## The CDSware is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDSware; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. #include "cdspage.wml" \ title="Reformat Records" \ navbar_name="admin" \ navbar_select="bibformat" \ cdspageboxlefttopadd=" " ## $Id$ ## DO NOT EDIT THIS FILE! IT WAS AUTOMATICALLY GENERATED FROM CDSware WML SOURCES. //========================================================================== -// File: BIBREFORMAT_hand.shtml +// File: BIBREFORMAT_hand.php // Description: Shows the collection tree together with the available // formats. The user chooses // POST parameters: // Notes: // Requires: DB, ERROR // Author: Eduardo.Margallo@cern.ch //========================================================================== include(DB); include(ERROR); include(HEADER); $db = mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ) or errormsg( "Coudn't connect to mySQL" ); mysql_select_db( $DB_DB ) or errrormsg( "Couldn't connect into database " . $DB_DB ); ?> Start a task selecting records using the CGI search script parameters. This method permits complex record choices to be made. To use it, just make a search query from the main page and use the string after the "?" in the URL bar to fill the form below.
- If you want to reformat a full collection use Reformat Collections + If you want to reformat a full collection use Reformat Collections
Example:   p=neutrino&c=Preprints
This string will choose all records containing the word "neutrino" in any field within the "Preprints" cathegory.
-

+
Add a new task
Search string:
Behaviours to reformat:
value=" ?>
diff --git a/modules/bibformat/web/admin/BIBREFORMAT_process.shtml.wml b/modules/bibformat/web/admin/BIBREFORMAT_process.php.wml similarity index 95% rename from modules/bibformat/web/admin/BIBREFORMAT_process.shtml.wml rename to modules/bibformat/web/admin/BIBREFORMAT_process.php.wml index bf8c4aadb..7fc5348df 100644 --- a/modules/bibformat/web/admin/BIBREFORMAT_process.shtml.wml +++ b/modules/bibformat/web/admin/BIBREFORMAT_process.php.wml @@ -1,123 +1,123 @@ ## $Id$ ## This file is part of the CERN Document Server Software (CDSware). ## Copyright (C) 2002 CERN. ## ## The CDSware is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## The CDSware is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDSware; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - #include "config.wml" #include "configbis.wml" ## DO NOT EDIT THIS FILE! IT WAS AUTOMATICALLY GENERATED FROM CDSware WML SOURCES. //========================================================================== -// File: BIBREFORMAT_process.shtml +// File: BIBREFORMAT_process.php // Description: Displays and manages the current reformatting processes // POST parameters: // Notes: // Requires: DB, // Author: Eduardo.Margallo@cern.ch //========================================================================== ## load config variables: $TMPDIR = ""; $CGIBINDIR = ""; include(DB); /* returns a string limited to $length, truncating the original one if necessary and adding ... */ function limit_length( $name, $length ) { return strlen( $name ) < $length ? $name : substr( $name, 0, $length-3 ) . "..."; } /* Creates a query file in the temporary directory and starts a new bibreformat process in the background so as to handle it. */ function admit_query( $QUERY, $FLEXELINK ) { global $uid_email, $CGIBINDIR, $TMPDIR; $bibreformat = $CGIBINDIR . "/bibreformat"; $date = addslashes( date("Y-m-d h:m:s") ); $user = addslashes( $uid_email ); $QUERY = addslashes( urlencode($QUERY) ); $FLEXELINK = addslashes( $FLEXELINK ); $query = "insert into flxREFORMAT values (NULL,'".$user."', '".$date."', '".$QUERY."', '".$FLEXELINK."', 'waiting')"; mysql_query( $query ); exec( $bibreformat . " > /dev/null 2> /tmp/bibreformat.err &" ); } if ( !empty($HTTP_GET_VARS) ) { $cancel = 0; $file = ""; while( $var = each($HTTP_GET_VARS) ) { if( $var["key"] == "action" && $var["value"] == "cancel" ) $cancel = 1; if( $var["key"] == "id" ) $id = $var["value"]; } if( $cancel && isset($id) ) { $query = "delete from flxREFORMAT where id=$id"; mysql_query( $query ); } } else if( !empty($HTTP_POST_VARS) ) { $dict = array(); while( $var = each($HTTP_POST_VARS) ) { if( $var["key"] <> "QUERY" ) { $parts = split( "_", $var["key"] ); if( "chk" == $parts[0] ) { $format = $var["value"]; $id = $parts[1]; if( $id <> "" ) { $query = "select name from collection where id=$id"; $result = mysql_query( $query ); $row = mysql_fetch_array( $result ); $name = urlencode( $row["name"] ); } else $name= "all"; if( !$dict[$name] ) { $dict = array_merge( $dict, array( $name=>"$format," ) ); } else { $dict[$name] = $dict[$name] . "$format,"; } } } } while( $var = each( $dict ) ) { if( $var[key]!=all ) $QUERY = "'c=" . $var["key"] . "'"; $FLEXELINK = "otype=" . substr( $var["value"], 0 , -1 ); admit_query( $QUERY, $FLEXELINK ); } } - Header("Location:BIBREFORMAT_display.shtml"); + Header("Location:BIBREFORMAT_display.php"); ?> \ No newline at end of file diff --git a/modules/bibformat/web/admin/BIBREFORMAT_tree.shtml.wml b/modules/bibformat/web/admin/BIBREFORMAT_tree.php.wml similarity index 96% rename from modules/bibformat/web/admin/BIBREFORMAT_tree.shtml.wml rename to modules/bibformat/web/admin/BIBREFORMAT_tree.php.wml index 6568bced6..0124ceab5 100644 --- a/modules/bibformat/web/admin/BIBREFORMAT_tree.shtml.wml +++ b/modules/bibformat/web/admin/BIBREFORMAT_tree.php.wml @@ -1,167 +1,167 @@ ## This file is part of the CERN Document Server Software (CDSware). ## Copyright (C) 2002 CERN. ## ## The CDSware is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## The CDSware is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDSware; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. #include "cdspage.wml" \ title="Reformat Records" \ navbar_name="admin" \ navbar_select="bibformat" \ cdspageboxlefttopadd=" " ## $Id$ ## DO NOT EDIT THIS FILE! IT WAS AUTOMATICALLY GENERATED FROM CDSware WML SOURCES. //========================================================================== -// File: BIBREFORMAT_tree.shtml +// File: BIBREFORMAT_tree.php // Description: Shows the collection tree together with the available // formats. The user chooses there the collections and formats // to be updated. // POST parameters: // Notes: // Requires: DB, ERROR // Author: Eduardo.Margallo@cern.ch //========================================================================== include(DB); include(ERROR); include(HEADER); ?>

This utility allows you to reformat all the records in a collection and upload them back to the database. Selecting an output type in an upper node will cause all the subtree to be rebuilt.

If you need more specific patterns to choose records please use - Manual Choice. + Manual Choice.

$num_fmts % 4; $i++ ) print ""; ?>
value=" ?>  
"; for( $i = 1; $i < 2 * $level; $i++ ) echo "  "; echo "" . $syms[$level%3] . $name . ""; print_formats( $id ); echo "\n"; } else { ?> - + \n"; echo "
Collection name Output Format Selection
\n"; echo "\n"; } } generate_tree( 0, 0 ); include(FOOTER) ?> diff --git a/modules/bibformat/web/admin/FORMAT_add.shtml.wml b/modules/bibformat/web/admin/FORMAT_add.php.wml similarity index 96% rename from modules/bibformat/web/admin/FORMAT_add.shtml.wml rename to modules/bibformat/web/admin/FORMAT_add.php.wml index 5336ea41d..5d09cdedd 100644 --- a/modules/bibformat/web/admin/FORMAT_add.shtml.wml +++ b/modules/bibformat/web/admin/FORMAT_add.php.wml @@ -1,95 +1,95 @@ The CDSware is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The CDSware is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with CDSware; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *********************************************************************/ //========================================================================== -// File: FORMAT_add.shtml (flexElink WI) +// File: FORMAT_add.php (flexElink WI) // Description: Adds a new format to the DB. It will only add the format if the // EL code is syntactically correct and it's "interpretable". It serializes // the EL code into the corresponding semantic structure and stores it // in the DB for optimization (no need to re-compile afterwards) // POST parameters: // fname --> (required) Name (id) of the format to be added // doc ----> (optional) Description of the purpose of the format // code ---> (optional) Format's EL code // Notes: If the format is succesfully added to the DB it redirects the current // browser to the format display list // Requires: DB, ERROR, EXECUTOR // Author: Hector.Sanchez@cern.ch //========================================================================== - include("localconf.inc.shtml"); + include("localconf.inc.php"); include(DB); include(ERROR); if( (!isset($fname)) or (trim($fname)=="") ) { errorpage("Format name hasn't been specified"); exit; } if(!isset($doc)) $doc=""; if(!isset($code)) $code=""; else { $temp_code=$code; if(get_magic_quotes_gpc()) $temp_code=stripslashes($temp_code); include(EXECUTOR); $a=new AELExecutor(); list($ok, $msg)=$a->checkCode( $temp_code, array($fname) ); if(!$ok) { errorpage("Code incorrect: $msg"); exit; } $ser=addslashes(serialize($msg)); } $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ) or errormsg("Couldn't connect to mySQL") or exit; mysql_selectdb( $DB_DB ); $fname=trim(strtoupper($fname)); if(!get_magic_quotes_gpc()) { $doc=addslashes($doc); } $qry="insert into flxFORMATS (name, value, doc, serialized) values ('$fname', '$code', '$doc', '$ser')"; if(!mysql_query( $qry )) { errorpage("Impossible to insert new format:
".mysql_error()); mysql_close( $db ); exit; } mysql_close( $db ); - header("location: FORMAT_display.shtml"); + header("location: FORMAT_display.php"); ?> diff --git a/modules/bibformat/web/admin/FORMAT_del.shtml.wml b/modules/bibformat/web/admin/FORMAT_del.php.wml similarity index 94% rename from modules/bibformat/web/admin/FORMAT_del.shtml.wml rename to modules/bibformat/web/admin/FORMAT_del.php.wml index 9b1f1e58a..f31700611 100644 --- a/modules/bibformat/web/admin/FORMAT_del.shtml.wml +++ b/modules/bibformat/web/admin/FORMAT_del.php.wml @@ -1,66 +1,66 @@ The CDSware is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The CDSware is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with CDSware; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *********************************************************************/ //========================================================================== -// File: FORMAT_del.shtml (flexElink WI) +// File: FORMAT_del.php (flexElink WI) // Description: Deletes a certain format from the DB. // POST parameters: // fname --> (required) Name (id) of the format to be deleted // Notes: If the behaviour is succesfully added to the DB it redirects the // browser to the behaviour list display // Requires: DB, ERROR // Author: Hector.Sanchez@cern.ch //========================================================================== - include("localconf.inc.shtml"); + include("localconf.inc.php"); include(DB); include(ERROR); if( (!isset($fname)) or (trim($fname)=="") ) { errorpage("Format name hasn't been specified"); exit; } $fname=strtoupper(trim($fname)); if(!get_magic_quotes_gpc()) { $fname=addslashes($fname); } $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ) or errormsg("Couldn't connect to mySQL") or exit; mysql_selectdb( $DB_DB ); $qry="delete from flxFORMATS where name='$fname'"; if(!mysql_query( $qry )) { errorpage("Impossible to delete format:
".mysql_error()); mysql_close( $db ); exit; } mysql_close( $db ); - header("location: FORMAT_display.shtml"); + header("location: FORMAT_display.php"); ?> diff --git a/modules/bibformat/web/admin/FORMAT_display.shtml.wml b/modules/bibformat/web/admin/FORMAT_display.php.wml similarity index 89% rename from modules/bibformat/web/admin/FORMAT_display.shtml.wml rename to modules/bibformat/web/admin/FORMAT_display.php.wml index fa1884ffb..bb22f18b4 100644 --- a/modules/bibformat/web/admin/FORMAT_display.shtml.wml +++ b/modules/bibformat/web/admin/FORMAT_display.php.wml @@ -1,139 +1,139 @@ ## $Id$ ## This file is part of the CERN Document Server Software (CDSware). ## Copyright (C) 2002 CERN. ## ## The CDSware is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## The CDSware is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDSware; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. #include "cdspage.wml" \ title="Formats" \ navbar_name="admin" \ navbar_select="FORMAT_display" \ cdspageboxlefttopadd=" " ## $Id$ //========================================================================== -// File: FORMAT_display.shtml (flexElink WI) +// File: FORMAT_display.php (flexElink WI) // Description: Shows a list of the existing formats in the DB, and allows to // access to their details, add or delete // POST parameters: // Notes: // Requires: DB, ERROR // Author: Hector.Sanchez@cern.ch //========================================================================== include(DB); include(ERROR); include(HEADER); ?>

Define the output formats, i.e. how to create the output out of internal BibFormat variables that were extracted in a previous step. This is the functionality you would want to configure most of the time. It may reuse formats, user defined functions, knowledge bases, etc. Example: You can tell that authors should be printed in italic, that if there are more than 10 authors only the first three should be printed, etc.

'; $color=""; while($format=mysql_fetch_array($res_format)) { list($name, $doc)=$format; if($color==$cCells) $color="#FFFFFF"; else $color=$cCells; $doc=str_replace("\n", "
", $doc); $doc=str_replace(" ", " ", $doc); print ""; print "$name"; print "$doc "; - print "[Code]"; - print "[Modify]"; - print "[Delete]"; + print "[Code]"; + print "[Modify]"; + print "[Delete]"; print ""; print ""; print "".str_replace("\n", "
", htmlspecialchars($code)).""; print ""; } print ""; mysql_close( $db ); ?>



-
+
Add new FORMAT
Format Name
Format documentation
EL Code
diff --git a/modules/bibformat/web/admin/FORMAT_edit.shtml.wml b/modules/bibformat/web/admin/FORMAT_edit.php.wml similarity index 96% rename from modules/bibformat/web/admin/FORMAT_edit.shtml.wml rename to modules/bibformat/web/admin/FORMAT_edit.php.wml index 4c37704c9..4cc736f14 100644 --- a/modules/bibformat/web/admin/FORMAT_edit.shtml.wml +++ b/modules/bibformat/web/admin/FORMAT_edit.php.wml @@ -1,170 +1,170 @@ The CDSware is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The CDSware is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with CDSware; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *********************************************************************/ //========================================================================== -// File: FORMAT_edit.shtml (flexElink WI) +// File: FORMAT_edit.php (flexElink WI) // Description: Allows to modify format data and updates the changes in the DB. // It will only update the format data if the EL code is syntactically // correct and it's "interpretable". It serializes the EL code into the // corresponding semantic structure and stores it in the DB for // optimization (no need to re-compile afterwards) // POST parameters: // fname --> (required) Name (id) of the format to be modified // process -> (optional) When is set, the script updates the format data // in the DB with the parameter values // fname_orig -> (required if process is set) Original name of the format // to be updated (the name format can be changed) // doc ----> (optional) Description of the purpose of the format // code ---> (optional) Format's EL code // Notes: If the format is succesfully updated in the DB it closes the current // browser and refreshes the opener one // Requires: DB, ERROR, EXECUTOR // Author: Hector.Sanchez@cern.ch //========================================================================== - include("localconf.inc.shtml"); + include("localconf.inc.php"); include(DB); include(ERROR); if( (!isset($fname)) or (trim($fname)=="") ) { print "Format name hasn't been specified"; print "
"; print "[Close]"; exit; } $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ); mysql_selectdb( $DB_DB ); $fname=trim(strtoupper($fname)); //--------DISPLAY if(!isset($process)) { $qry="select value, doc from flxFORMATS where name='$fname'"; $qh=mysql_query( $qry ); if(mysql_num_rows( $qh )<1) { print "Format not found"; print "
"; print "[Close]"; exit; } $row=mysql_fetch_array($qh); list($code, $doc)=$row; ?> -
+
Editing format ''
Format Name
Documentation
EL Code
checkCode( $temp_code, array( $fname ) ); if(!$ok) { print "Code incorrect: $msg
[Go Back]"; exit; } else { $serialized=addslashes(serialize($msg)); } } if(!isset($doc)) { $doc=""; } if(!get_magic_quotes_gpc()) { $fname=addslashes($fname); $code=addslashes($code); $doc=addslashes($doc); } $qry="update flxFORMATS set name='$fname', value='$code', doc='$doc', serialized='$serialized' where name='$fname_orig'"; if(!mysql_query( $qry )) { print "Impossible to update format: $fname
".mysql_error()."
[Go Back]"; mysql_close( $db ); exit; } mysql_close( $db ); ?> diff --git a/modules/bibformat/web/admin/FORMAT_showone.shtml.wml b/modules/bibformat/web/admin/FORMAT_showone.php.wml similarity index 97% rename from modules/bibformat/web/admin/FORMAT_showone.shtml.wml rename to modules/bibformat/web/admin/FORMAT_showone.php.wml index bca650913..81e6e1e2e 100644 --- a/modules/bibformat/web/admin/FORMAT_showone.shtml.wml +++ b/modules/bibformat/web/admin/FORMAT_showone.php.wml @@ -1,89 +1,89 @@ The CDSware is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The CDSware is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with CDSware; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *********************************************************************/ //========================================================================== -// File: BEH_showone.shtml (flexElink WI) +// File: BEH_showone.php (flexElink WI) // Description: Shows the details for a given format (code and documentation). // POST parameters: // fname --> (required) Name (id) of the format to be shown // Requires: DB, ERROR, FUNCTION_LIB // Author: Hector.Sanchez@cern.ch //========================================================================== - include("localconf.inc.shtml"); + include("localconf.inc.php"); include(DB); include(ERROR); include(FUNCTION_LIB); if( (!isset($fname)) or (trim($fname)=="") ) { errorpage("Format name hasn't been specified"); exit; } $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ) or errormsg("Couldn't connect to mySQL") or exit; mysql_selectdb( $DB_DB ); $fname=trim(strtoupper($fname)); $qry="select value, doc from flxFORMATS where name='$fname'"; $res=mysql_query( $qry ); list($code, $doc) =mysql_fetch_array( $res ); $code=text2HTML($code); $doc=str_replace("\n","
",$doc); $doc=str_replace(" "," ",$doc); ?> Format <?print $fname;?>
Details of format ''
Documentation
EL Code
diff --git a/modules/bibformat/web/admin/KB_VALUE_add.shtml.wml b/modules/bibformat/web/admin/KB_VALUE_add.php.wml similarity index 94% rename from modules/bibformat/web/admin/KB_VALUE_add.shtml.wml rename to modules/bibformat/web/admin/KB_VALUE_add.php.wml index 3ec62b6e1..7dbf4b0e8 100644 --- a/modules/bibformat/web/admin/KB_VALUE_add.shtml.wml +++ b/modules/bibformat/web/admin/KB_VALUE_add.php.wml @@ -1,81 +1,81 @@ The CDSware is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The CDSware is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with CDSware; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *********************************************************************/ //========================================================================== -// File: KB_VALUE_add.shtml (flexElink WI) +// File: KB_VALUE_add.php (flexElink WI) // Description: Adds a new pair key-value to the DB table which corresponds to // the indicated KB. // POST parameters: // name --> (required) Name (id) of the KB to which the value will be added // key ---> (required) Key value to be added // value -> (required) Value that maps the indicated key // Notes: If the KB is succesfully added to the DB it redirects the current // browser to the indicated KB display // Requires: DB, ERROR // Author: Hector.Sanchez@cern.ch //========================================================================== - include("localconf.inc.shtml"); + include("localconf.inc.php"); include(DB); include(ERROR); if( (!isset($kb_name)) or (trim($kb_name)=="") ) { errorpage("KB name hasn't been specified"); exit; } if( (!isset($key)) or (trim($key)=="") ) { errorpage("KB entry key hasn't been specified"); exit; } if( (!isset($value)) or (trim($value)=="") ) { errorpage("KB entry value hasn't been specified"); exit; } $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ); mysql_selectdb( $DB_DB ); $kb_name=strtoupper(trim($kb_name)); $qry="select kb_table from flxKBS where kb_name='$kb_name'"; $res=mysql_query( $qry, $db ); list($kb_table)=mysql_fetch_array( $res ); $qry="insert into $kb_table(vkey, value) values ('$key', '$value')"; if(!mysql_query( $qry )) { errorpage("Impossible to insert new KB entry:
".mysql_error()); mysql_close( $db ); exit; } mysql_close( $db ); - header("location: KB_showone.shtml?name=".urlencode($kb_name)); + header("location: KB_showone.php?name=".urlencode($kb_name)); ?> diff --git a/modules/bibformat/web/admin/KB_VALUE_del.shtml.wml b/modules/bibformat/web/admin/KB_VALUE_del.php.wml similarity index 94% rename from modules/bibformat/web/admin/KB_VALUE_del.shtml.wml rename to modules/bibformat/web/admin/KB_VALUE_del.php.wml index e25da081d..95074ecc4 100644 --- a/modules/bibformat/web/admin/KB_VALUE_del.shtml.wml +++ b/modules/bibformat/web/admin/KB_VALUE_del.php.wml @@ -1,73 +1,73 @@ The CDSware is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The CDSware is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with CDSware; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *********************************************************************/ //========================================================================== -// File: KB_del.shtml (flexElink WI) +// File: KB_del.php (flexElink WI) // Description: Deletes a pair key-value from the DB table of the indicated KB. // POST parameters: // name --> (required) Name (id) of the KB from which the key-value has to // be deleted // key ---> (required) Key value to be deleted (the mapping value is also // deleted) // Notes: If the KB is succesfully added to the DB it redirects the current // browser to the indicated KB display // Requires: DB, ERROR // Author: Hector.Sanchez@cern.ch //========================================================================== - include("localconf.inc.shtml"); + include("localconf.inc.php"); include(DB); include(ERROR); if( (!isset($kb_name)) or (trim($kb_name)=="") ) { errorpage("KB name hasn't been specified"); exit; } if( (!isset($key)) or (trim($key)=="") ) { errorpage("KB entry key hasn't been specified"); exit; } $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ); mysql_selectdb( $DB_DB ); $kb_name=strtoupper(trim($kb_name)); $qry="select kb_table from flxKBS where kb_name='$kb_name'"; $res=mysql_query( $qry, $db ); list($kb_table)=mysql_fetch_array( $res ); $qry="delete from $kb_table where vkey='$key'"; if(!mysql_query( $qry )) { errorpage("Impossible to delete KB entry:
".mysql_error()); mysql_close( $db ); exit; } mysql_close( $db ); - header("location: KB_showone.shtml?name=".urlencode($kb_name)); + header("location: KB_showone.php?name=".urlencode($kb_name)); ?> diff --git a/modules/bibformat/web/admin/KB_add.shtml.wml b/modules/bibformat/web/admin/KB_add.php.wml similarity index 96% rename from modules/bibformat/web/admin/KB_add.shtml.wml rename to modules/bibformat/web/admin/KB_add.php.wml index b1b3f9362..060434904 100644 --- a/modules/bibformat/web/admin/KB_add.shtml.wml +++ b/modules/bibformat/web/admin/KB_add.php.wml @@ -1,96 +1,96 @@ The CDSware is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The CDSware is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with CDSware; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *********************************************************************/ //========================================================================== -// File: KB_add.shtml (flexElink WI) +// File: KB_add.php (flexElink WI) // Description: Adds a new KB to the DB. It also creates a table in the // configuration DB that will keep the KB values. // POST parameters: // name --> (required) Name (id) of the KB to be added // table -> (optional) DB table name; if it is not provided (normal i // situation), the script will generate it automatically ensuring // that is unique in this DB // doc ----> (optional) Description of the purpose of the KB // Notes: If the KB is succesfully added to the DB it redirects the current // browser to the KB display list // Requires: DB, ERROR, EXECUTOR // Author: Hector.Sanchez@cern.ch //========================================================================== - include("localconf.inc.shtml"); + include("localconf.inc.php"); include(DB); include(ERROR); if( (!isset($name)) or (trim($name)=="") ) { errorpage("KB name hasn't been specified"); exit; } if( !isset($table) ) $table=""; if( !isset($doc) ) $doc=""; $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ) or errormsg("Couldn't connect to mySQL"); mysql_selectdb( $DB_DB ); $name=trim(strtoupper($name)); $table=trim(strtoupper($table)); if($table=="") { $table="flxKB$name"; } $qry="create table $table( vkey varchar(255) not null, value text default '', primary key(vkey))"; if(!mysql_query( $qry )) { errorpage("Impossible to create KB table:
".mysql_error()); mysql_close( $db ); exit; } if(!get_magic_quotes_gpc()) { $doc=addslashes($doc); } $qry="insert into flxKBS(kb_name, kb_table, doc) values ('$name', '$table', '$doc')"; if(!mysql_query( $qry )) { errorpage("Impossible to insert new KB:
".mysql_error()); $qry="drop table $table"; mysql_query( $qry ); mysql_close( $db ); exit; } mysql_close( $db ); - header("location: KB_display.shtml"); + header("location: KB_display.php"); ?> diff --git a/modules/bibformat/web/admin/KB_del.shtml.wml b/modules/bibformat/web/admin/KB_del.php.wml similarity index 95% rename from modules/bibformat/web/admin/KB_del.shtml.wml rename to modules/bibformat/web/admin/KB_del.php.wml index 1613a67a8..ce23a4b0d 100644 --- a/modules/bibformat/web/admin/KB_del.shtml.wml +++ b/modules/bibformat/web/admin/KB_del.php.wml @@ -1,74 +1,74 @@ The CDSware is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The CDSware is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with CDSware; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *********************************************************************/ //========================================================================== -// File: KB_del.shtml (flexElink WI) +// File: KB_del.php (flexElink WI) // Description: Deletes an existing KB from the DB. It also deletes its // corresponding DB table. // POST parameters: // name --> (required) Name (id) of the KB to be added // Notes: If the KB is succesfully added to the DB it redirects the current // browser to the KB display list // Requires: DB, ERROR // Author: Hector.Sanchez@cern.ch //========================================================================== - include("localconf.inc.shtml"); + include("localconf.inc.php"); include(DB); include(ERROR); if( (!isset($name)) or (trim($name)=="") ) { errorpage("KB name hasn't been specified"); exit; } $name=strtoupper(trim($name)); $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ) or errormsg("Couldn't connect to mySQL") or exit; mysql_selectdb( $DB_DB ); $qry="select kb_table from flxKBS where kb_name='$name'"; $qh=mysql_query($qry, $db); list($table)=mysql_fetch_array($qh); $qry="delete from flxKBS where kb_name='$name'"; if(!mysql_query( $qry )) { errorpage("Impossible to delete KB:
".mysql_error()); mysql_close( $db ); exit; } $qry="drop table $table"; if(!mysql_query( $qry )) { errorpage("KB entry deleted but not table:
".mysql_error()); mysql_close( $db ); exit; } mysql_close( $db ); - header("location: KB_display.shtml"); + header("location: KB_display.php"); ?> diff --git a/modules/bibformat/web/admin/KB_display.shtml.wml b/modules/bibformat/web/admin/KB_display.php.wml similarity index 88% rename from modules/bibformat/web/admin/KB_display.shtml.wml rename to modules/bibformat/web/admin/KB_display.php.wml index 80c06c1f2..24742dbf1 100644 --- a/modules/bibformat/web/admin/KB_display.shtml.wml +++ b/modules/bibformat/web/admin/KB_display.php.wml @@ -1,138 +1,138 @@ ## $Id$ ## This file is part of the CERN Document Server Software (CDSware). ## Copyright (C) 2002 CERN. ## ## The CDSware is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## The CDSware is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDSware; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. #include "cdspage.wml" \ title="Knowledge Bases (KBs)" \ navbar_name="admin" \ navbar_select="KB_display" \ cdspageboxlefttopadd=" " ## $Id$ //========================================================================== -// File: KB_display.shtml (flexElink WI) +// File: KB_display.php (flexElink WI) // Description: Shows a list of the existing KBs in the DB, and allows to // access to their list of values, add new ones or delete existing ones // POST parameters: // Notes: // Requires: DB, ERROR // Author: Hector.Sanchez@cern.ch //========================================================================== include(DB); include(ERROR); include(HEADER); ?>

Define one or more knowledge bases that enables you to transform various forms of input data values into the unique standard form on the output. Example: You can tell that Phys Rev D and Physical Review D are both the same journal and that these names should be standardized to Phys Rev : D.

'; print ""; print "KB name"; print "Table name"; print "Documentation"; print " "; print ""; while($row=mysql_fetch_array($res)) { list($kb_name, $kb_table, $doc)=$row; $doc=str_replace("\n", "
", $doc); $doc=str_replace(" ", " ", $doc); print ""; print " $kb_name "; print "$kb_table"; print "$doc "; print " - [Values]"; + [Values]"; print " - [Modify]"; + [Modify]"; print " - [Delete] + [Delete] "; print ""; } print ""; mysql_close( $db ); ?>
-

+
Add new KNOWLEDGE BASE
Knowledge base name
Knowledge base table name (normally leave it blank)
KB documentation
diff --git a/modules/bibformat/web/admin/KB_edit.shtml.wml b/modules/bibformat/web/admin/KB_edit.php.wml similarity index 97% rename from modules/bibformat/web/admin/KB_edit.shtml.wml rename to modules/bibformat/web/admin/KB_edit.php.wml index 8c22a7b35..7860aef22 100644 --- a/modules/bibformat/web/admin/KB_edit.shtml.wml +++ b/modules/bibformat/web/admin/KB_edit.php.wml @@ -1,129 +1,129 @@ The CDSware is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The CDSware is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with CDSware; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *********************************************************************/ //========================================================================== -// File: KB_edit.shtml (flexElink WI) +// File: KB_edit.php (flexElink WI) // Description: Allows to modify KB data and updates the changes in the DB. // DB table is not available for modifcation // POST parameters: // name --> (required) Name (id) of the KB to be modified // process -> (optional) When is set, the script updates the KB data // in the DB with the parameter values // name_orig -> (required if process is set) Original name of the KB // to be updated (the KB format may be changed) // doc ----> (optional) Description of the purpose of the KB // Notes: If the KB is succesfully updated in the DB it closes the current // browser and refreshes the opener one // Requires: DB, ERROR // Author: Hector.Sanchez@cern.ch //========================================================================== - include("localconf.inc.shtml"); + include("localconf.inc.php"); include(DB); include(ERROR); if( (!isset($name)) or (trim($name)=="") ) { print "KB name hasn't been specified"; print "
"; print "[Close]"; exit; } $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ); mysql_selectdb( $DB_DB ); $name=trim(strtoupper($name)); //--------DISPLAY if(!isset($process)) { $qry="select kb_table, doc from flxKBS where kb_name='$name'"; $qh=mysql_query( $qry ); if(mysql_num_rows( $qh )<1) { print "KB '$name' not found"; print "
"; print "[Close]"; exit; } $row=mysql_fetch_array($qh); list($table, $doc)=$row; ?> -
+
Editing KB ''
KB Name Table name:
Documentation
[Go Back]"; exit(); } mysql_close( $db ); ?> diff --git a/modules/bibformat/web/admin/KB_showone.shtml.wml b/modules/bibformat/web/admin/KB_showone.php.wml similarity index 91% rename from modules/bibformat/web/admin/KB_showone.shtml.wml rename to modules/bibformat/web/admin/KB_showone.php.wml index b92569ca6..1739f2ee8 100644 --- a/modules/bibformat/web/admin/KB_showone.shtml.wml +++ b/modules/bibformat/web/admin/KB_showone.php.wml @@ -1,98 +1,98 @@ The CDSware is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The CDSware is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with CDSware; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *********************************************************************/ //========================================================================== -// File: KB_showone.shtml (flexElink WI) +// File: KB_showone.php (flexElink WI) // Description: Shows the list of values for a given KB (it also shows complete // KB reated data: documentation, DB table name). It allows to add or // delete values to the displayed KB // POST parameters: // name --> (required) Name (id) of the KB to be shown // Requires: DB, ERROR // Author: Hector.Sanchez@cern.ch //========================================================================== - include("localconf.inc.shtml"); + include("localconf.inc.php"); include(DB); include(ERROR); if( (!isset($name)) or (trim($name)=="") ) { errorpage("KB name hasn't been specified"); exit; } $cBorder="#CCCCCC"; $cHeaders="#FFCC33"; $cCells="#FFFFFF"; $cImpCells="#FFCC99"; $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ); mysql_selectdb( $DB_DB ); $qry="select kb_table, doc from flxKBS where kb_name='$name'"; $res=mysql_query( $qry, $db ); list($table, $doc)=mysql_fetch_array( $res ); $doc=str_replace("\n", "
", $doc); $doc=str_replace(" ", " ", $doc); $qry="select vkey, value from $table order by vkey"; $res=mysql_query( $qry, $db ); - print "
"; + print ""; print ""; print ''; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; while($row=mysql_fetch_array($res)) { list($key, $value)=$row; print ""; print ""; print ""; - print ""; + print ""; print ""; } print "
Values of KB '$name' ".mysql_num_rows($res)." values
Table Name$table
Documentation$doc
ADD VALUE: Key Value
$key$value[Delete][Delete]
"; print "
"; mysql_close( $db ); ?> diff --git a/modules/bibformat/web/admin/LINK_ACTION_add_edit.shtml.wml b/modules/bibformat/web/admin/LINK_ACTION_add_edit.php.wml similarity index 97% rename from modules/bibformat/web/admin/LINK_ACTION_add_edit.shtml.wml rename to modules/bibformat/web/admin/LINK_ACTION_add_edit.php.wml index ad6af0bb7..b555a64aa 100644 --- a/modules/bibformat/web/admin/LINK_ACTION_add_edit.shtml.wml +++ b/modules/bibformat/web/admin/LINK_ACTION_add_edit.php.wml @@ -1,221 +1,221 @@ The CDSware is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The CDSware is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with CDSware; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *********************************************************************/ //========================================================================== -// File: LINK_ACTION_add_edit.shtml (flexElink WI) +// File: LINK_ACTION_add_edit.php (flexElink WI) // Description: Adds a new action to an existing link condtion or allows to // modify the data of an existing action of a link condition. // POST parameters: // linktype --> (required) Name (id) of the link definition which the // action's condition belongs (or will belong) to // eorder ----> (required) Action's condition evaluation order number for // the given link definition // action ----> (optional, possible values: ADD, EDIT) Determines which // operations wants to be performed: adding a new action or // editing an existing one. When is set, the update or insert is // made in the DB; if not, the needed controls for the adding or // modifying are displayed // aorder ---> (required if action is EDIT) Apply order of the // cation inside the corresponding link condition. When adding, // if this parameter is not set the script will look for the last // apply order number assigned in this link action // el_code -> (optional) Action's EL code // Notes: If the condition is succesfully added to the DB it closes the current // browser and refreshes the opener one // Requires: DB, ERROR // Author: Hector.Sanchez@cern.ch //========================================================================== - include("localconf.inc.shtml"); + include("localconf.inc.php"); include(DB); include(ERROR); if( (!isset($linktype)) or (trim($linktype)=="") ) { print "Link type hasn't been specified"; print "
"; print "[Close]"; exit; } if( (!isset($eorder)) or (trim($eorder)=="") ) { print "Link condition evaluation order hasn't been specified"; print "
"; print "[Close]"; exit; } if(get_magic_quotes_gpc()) $linktype=stripslashes($linktype); $linktype=trim(strtoupper($linktype)); if(!isset($action)) { $action="ADD"; if( (isset($aorder)) or (trim($aorder)!="") ) { $action="EDIT"; } else { $aorder=""; } $el_code=""; $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ); mysql_selectdb( $DB_DB ); if($action=="EDIT") { $qry="select el_code from flxLINKTYPECONDITIONSACTIONS where linktype='$linktype' and eval_order='$eorder' and apply_order=$aorder"; $qh=mysql_query($qry); if(mysql_num_rows($qh)<=0) { print "Action not found"; print "
"; print "[Close]"; mysql_close($db); exit; } list($el_code)=mysql_fetch_array($qh); } mysql_close($db); ?> -
+
action for linktype ' - '
Apply order: " value="">
Action EL Code:
"; }?>
checkCode( $temp_code ); if(!$ok) { print "Action code incorrect: $msg
[Go Back]"; exit; } } $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ); mysql_selectdb( $DB_DB ); if( (!isset($aorder)) or (trim($aorder)=="")) { $qry="select max(apply_order)+1 from flxLINKTYPECONDITIONSACTIONS where linktype='$linktype' and eval_order=$eorder"; $qh=mysql_query($qry, $db); list($aorder)=mysql_fetch_array( $qh ); if($aorder==null) $aorder=0; } if(!get_magic_quotes_gpc()) { $el_code=addslashes($el_code); } $qry=""; if($action=="ADD") { $qry="insert into flxLINKTYPECONDITIONSACTIONS (linktype, eval_order, apply_order, el_code) values ('$linktype', '$eorder', '$aorder', '$el_code')"; } elseif($action=="EDIT") { $qry="update flxLINKTYPECONDITIONSACTIONS set linktype='$linktype', eval_order='$eorder', apply_order='$aorder', el_code='$el_code' where linktype='$linktype' and eval_order='$eorder' and apply_order='$aorder'"; } if(!mysql_query( $qry )) { print "Impossible to $action action:
".mysql_error()."
". "[Go Back]"; mysql_close($db); exit; } mysql_close($db); ?> diff --git a/modules/bibformat/web/admin/LINK_ACTION_del.shtml.wml b/modules/bibformat/web/admin/LINK_ACTION_del.php.wml similarity index 94% rename from modules/bibformat/web/admin/LINK_ACTION_del.shtml.wml rename to modules/bibformat/web/admin/LINK_ACTION_del.php.wml index 8dfb70607..a5e147caa 100644 --- a/modules/bibformat/web/admin/LINK_ACTION_del.shtml.wml +++ b/modules/bibformat/web/admin/LINK_ACTION_del.php.wml @@ -1,77 +1,77 @@ The CDSware is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The CDSware is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with CDSware; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *********************************************************************/ //========================================================================== -// File: LINK_ACTION_del.shtml (flexElink WI) +// File: LINK_ACTION_del.php (flexElink WI) // Description: Deletes an existing action of a certain condition for a given // link definition from the DB. // POST parameters: // linktype --> (required) Name (id) of the link definition the condition // belongs to // eorder ----> (required) Action's condition evaluation order number for // the given link definition // aorder ----> (required) Action's apply order number inside the given // condition // Notes: If the action is succesfully added to the DB the current browser is // redirectred to the link detailed definition display // Requires: DB, ERROR // Author: Hector.Sanchez@cern.ch //========================================================================== - include("localconf.inc.shtml"); + include("localconf.inc.php"); include(DB); include(ERROR); if( (!isset($linktype)) or (trim($linktype)=="") ) { errorpage("Link type hasn't been specified"); exit(); } if( (!isset($eorder)) or (trim($eorder)=="") ) { errorpage("Evaluation order hasn't been specified"); exit(); } if( (!isset($aorder)) or (trim($aorder)=="") ) { errorpage("Apply order hasn't been specified"); exit(); } $linktype=strtoupper(trim($linktype)); $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ); mysql_selectdb( $DB_DB ); $qry="delete from flxLINKTYPECONDITIONSACTIONS where linktype='$linktype' and eval_order='$eorder' and apply_order='$aorder'"; if(!mysql_query( $qry )) { errorpage("Impossible to delete action:
".mysql_error()); } mysql_close( $db ); - header("location: LINK_showone.shtml?linktype=".urlencode($linktype)); + header("location: LINK_showone.php?linktype=".urlencode($linktype)); ?> diff --git a/modules/bibformat/web/admin/LINK_COND_add_edit.shtml.wml b/modules/bibformat/web/admin/LINK_COND_add_edit.php.wml similarity index 98% rename from modules/bibformat/web/admin/LINK_COND_add_edit.shtml.wml rename to modules/bibformat/web/admin/LINK_COND_add_edit.php.wml index 2b3c6ece1..9bc0bbe6a 100644 --- a/modules/bibformat/web/admin/LINK_COND_add_edit.shtml.wml +++ b/modules/bibformat/web/admin/LINK_COND_add_edit.php.wml @@ -1,309 +1,309 @@ The CDSware is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The CDSware is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with CDSware; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *********************************************************************/ //========================================================================== -// File: LINK_COND_add_edit.shtml (flexElink WI) +// File: LINK_COND_add_edit.php (flexElink WI) // Description: Adds a new condition to an existing link or allows to modify // the data of an existing condition of a link. // POST parameters: // linktype --> (required) Name (id) of the link definition which the // condition belongs (or will belong) to // action ----> (optional, possible values: ADD, EDIT) Determines which // operations wants to be performed: adding a new condition or // editing an existing one. When is set, the update or insert is // made in the DB; if not, the needed controls for the adding or // modifying are displayed // eorder ---> (required if action is EDIT) Evalutation order of the // condition inside the corresponding link definition. When adding, // if this parameter is not set the script will look for the last // evaluation order number assigned in this link definition // stype ----> (optional, allowed values: EXT, INT) Condition solving type; // if it isn't specified is put to the default value (EXT) // el_condition -> (optional) Condition's EL code // bfile ----> (optional) Base file path for internal link solving // burl -----> (optional) Base url path for internal link solving // formats --> (optional) List of file formats ids separated by "|" // Notes: If the condition is succesfully added to the DB it closes the current // browser and refreshes the opener one // Requires: DB, ERROR // Author: Hector.Sanchez@cern.ch //========================================================================== - include("localconf.inc.shtml"); + include("localconf.inc.php"); include(DB); include(ERROR); if( (!isset($linktype)) or (trim($linktype)=="") ) { print "Link type hasn't been specified"; print "
"; print "[Close]"; exit; } if(get_magic_quotes_gpc()) $linktype=stripslashes($linktype); $linktype=trim(strtoupper($linktype)); if(!isset($action)) { $action="ADD"; if( (isset($eorder)) or (trim($eorder)!="") ) { $action="EDIT"; } else { $eorder=""; } $el_condition=""; $formats=""; $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ); mysql_selectdb( $DB_DB ); if($action=="EDIT") { $qry="select el_condition, solvingtype, base_file, base_url from flxLINKTYPECONDITIONS where linktype='$linktype' and eval_order='$eorder'"; $qh=mysql_query($qry); if(mysql_num_rows($qh)<=0) { print "Condition not found"; print "
"; print "[Close]"; mysql_close($db); exit; } list($el_condition, $stype, $bfile, $burl)=mysql_fetch_array($qh); $qry="select f.name from flxLINKTYPECONDITIONSFILEFORMATS cf, flxFILEFORMATS f where cf.linktype='$linktype' and cf.eval_order='$eorder' and f.name=cf.fname"; $qh=mysql_query($qry); $formats=""; while($row=mysql_fetch_array($qh)) { $f=$row[0]; $formats.="$f | "; } } else //Add action { $qry="select solvingtype, base_file, base_url from flxLINKTYPES where linktype='".addslashes($linktype)."'"; $qh=mysql_query($qry, $db); list($stype, $bfile, $burl)=mysql_fetch_array($qh); } mysql_close($db); ?> -
+
condition for linktype ' '
Evaluation order: " value="">
Condition EL Code:
Solving type
Base file path
Base url
Associated file formats
"; }?>
checkCode( $temp_code ); if(!$ok) { print "Condition code incorrect: $msg
[Go Back]"; exit; } } $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ); mysql_selectdb( $DB_DB ); if( (!isset($eorder)) or (trim($eorder)=="")) { $qry="select max(eval_order)+1 from flxLINKTYPECONDITIONS where linktype='$linktype'"; $qh=mysql_query($qry, $db); list($eorder)=mysql_fetch_array( $qh ); if($eorder==null) $eorder=0; } if(!isset($formats)) { $formats=""; } if(!get_magic_quotes_gpc()) { $el_condition=addslashes($el_condition); $bfile=addslashes($bfile); $burl=addslashes($burl); } $qry=""; if($action=="ADD") { $qry="insert into flxLINKTYPECONDITIONS (linktype, eval_order, el_condition, solvingtype, base_file, base_url) values ('$linktype', '$eorder', '$el_condition', '$stype', '$bfile', '$burl')"; } elseif($action=="EDIT") { $qry="update flxLINKTYPECONDITIONS set linktype='$linktype', eval_order='$eorder', el_condition='$el_condition', solvingtype='$stype', base_file='$bfile', base_url='$burl' where linktype='$linktype' and eval_order='$eorder'"; } if(!mysql_query( $qry )) { print "Impossible to $action condition:
".mysql_error()."
". "[Go Back]"; mysql_close($db); exit; } $qry="delete from flxLINKTYPECONDITIONSFILEFORMATS where linktype='$linktype' and eval_order='$eorder'"; if(!mysql_query( $qry )) { print "Impossible to update associated formats
".mysql_error(). "[Go Back]"; mysql_close($db); exit; } $f=split("\|", $formats); $errors=""; foreach($f as $format) { $format=strtoupper(trim($format)); if($format=="") continue; $qry="select name from flxFILEFORMATS where name='$format'"; $qh=mysql_query($qry); if(mysql_num_rows($qh)<1) { $errors.="Format '$format' doesn't exist, couldn't associate
"; continue; } $qry="insert into flxLINKTYPECONDITIONSFILEFORMATS(linktype, eval_order, fname) values ('$linktype', '$eorder', '$format')"; if(!mysql_query( $qry )) { $errors.="Couldn't associate format '$format'
".mysql_error(); } } if($errors!="") { print "Record succesfully updated but ERRORS found associating formats:
$errors
[Go Back]"; mysql_close($db); exit; } mysql_close($db); ?> diff --git a/modules/bibformat/web/admin/LINK_COND_del.shtml.wml b/modules/bibformat/web/admin/LINK_COND_del.php.wml similarity index 95% rename from modules/bibformat/web/admin/LINK_COND_del.shtml.wml rename to modules/bibformat/web/admin/LINK_COND_del.php.wml index 17dcc6980..7b4600553 100644 --- a/modules/bibformat/web/admin/LINK_COND_del.shtml.wml +++ b/modules/bibformat/web/admin/LINK_COND_del.php.wml @@ -1,92 +1,92 @@ The CDSware is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The CDSware is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with CDSware; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *********************************************************************/ //========================================================================== -// File: LINK_COND_del.shtml (flexElink WI) +// File: LINK_COND_del.php (flexElink WI) // Description: Deletes an existing condition(and all its depending // items) for a given link definition from the DB. // POST parameters: // linktype --> (required) Name (id) of the link definition the condition // belongs to // eorder ----> (required) Condition evaluation order number for the given // link definition // Notes: If the format is succesfully added to the DB the current browser is // redirectred to the link detailed definition display // Requires: DB, ERROR // Author: Hector.Sanchez@cern.ch //========================================================================== - include("localconf.inc.shtml"); + include("localconf.inc.php"); include(DB); include(ERROR); if( (!isset($linktype)) or (trim($linktype)=="") ) { errorpage("Link type hasn't been specified"); exit(); } if( (!isset($eorder)) or (trim($eorder)=="") ) { errorpage("Evaluation order hasn't been specified"); exit(); } $linktype=strtoupper(trim($linktype)); $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ) or errormsg("Couldn't connect to mySQL") or exit; mysql_selectdb( $DB_DB ); $qry="delete from flxLINKTYPECONDITIONSACTIONS where linktype='$linktype' and eval_order='$eorder'"; if(!mysql_query( $qry )) { errorpage("Impossible to delete actions related to this condition:
".mysql_error()); mysql_close( $db ); exit; } $qry="delete from flxLINKTYPECONDITIONSFILEFORMATS where linktype='$linktype' and eval_order='$eorder'"; if(!mysql_query( $qry )) { errorpage("Impossible to delete formats related to this condition:
".mysql_error()); mysql_close( $db ); exit; } $qry="delete from flxLINKTYPECONDITIONS where linktype='$linktype' and eval_order='$eorder'"; if(!mysql_query( $qry )) { errorpage("Impossible to delete conditions related to this link type:
".mysql_error()); mysql_close( $db ); exit; } mysql_close( $db ); - header("location: LINK_showone.shtml?linktype=".urlencode($linktype)); + header("location: LINK_showone.php?linktype=".urlencode($linktype)); ?> diff --git a/modules/bibformat/web/admin/LINK_FORMAT_add.shtml.wml b/modules/bibformat/web/admin/LINK_FORMAT_add.php.wml similarity index 95% rename from modules/bibformat/web/admin/LINK_FORMAT_add.shtml.wml rename to modules/bibformat/web/admin/LINK_FORMAT_add.php.wml index 854f7292d..72943d1ec 100644 --- a/modules/bibformat/web/admin/LINK_FORMAT_add.shtml.wml +++ b/modules/bibformat/web/admin/LINK_FORMAT_add.php.wml @@ -1,74 +1,74 @@ The CDSware is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The CDSware is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with CDSware; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *********************************************************************/ - include("localconf.inc.shtml"); + include("localconf.inc.php"); include(DB); include(ERROR); if( (!isset($name)) or (trim($name)=="") ) { errorpage("File format name hasn't been specified"); exit; } if( (!isset($text))) { $text=""; } if( (!isset($extensions))) { $extensions=""; } if(get_magic_quotes_gpc()) { $extensions=stripslashes($extensions); $text=stripslashes($text); } $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ) or errormsg("Couldn't connect to mySQL") or exit; mysql_selectdb( $DB_DB ); $name=trim(strtoupper($name)); if(!get_magic_quotes_gpc()) { $extensions=addslashes($extensions); $text=addslashes($text); } $qry="insert into flxFILEFORMATS (name, text, extensions) values ('$name', '$text', '$extensions')"; if(!mysql_query( $qry )) { errorpage("Impossible to insert new file format:
".mysql_error()); mysql_close( $db ); exit; } mysql_close( $db ); - header("location: LINK_FORMAT_display.shtml"); + header("location: LINK_FORMAT_display.php"); ?> diff --git a/modules/bibformat/web/admin/LINK_FORMAT_del.shtml.wml b/modules/bibformat/web/admin/LINK_FORMAT_del.php.wml similarity index 95% rename from modules/bibformat/web/admin/LINK_FORMAT_del.shtml.wml rename to modules/bibformat/web/admin/LINK_FORMAT_del.php.wml index 19ba3b883..ce75c914d 100644 --- a/modules/bibformat/web/admin/LINK_FORMAT_del.shtml.wml +++ b/modules/bibformat/web/admin/LINK_FORMAT_del.php.wml @@ -1,56 +1,56 @@ The CDSware is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The CDSware is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with CDSware; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *********************************************************************/ - include("localconf.inc.shtml"); + include("localconf.inc.php"); include(DB); include(ERROR); if( (!isset($name)) or (trim($name)=="") ) { errorpage("Format file name hasn't been specified"); exit; } $name=strtoupper(trim($name)); if(!get_magic_quotes_gpc()) { $name=addslashes($name); } $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ) or errormsg("Couldn't connect to mySQL") or exit; mysql_selectdb( $DB_DB ); $qry="delete from flxFILEFORMATS where name='$name'"; if(!mysql_query( $qry )) { errorpage("Impossible to delete file format:
".mysql_error()); mysql_close( $db ); exit; } mysql_close( $db ); - header("location: LINK_FORMAT_display.shtml"); + header("location: LINK_FORMAT_display.php"); ?> diff --git a/modules/bibformat/web/admin/LINK_FORMAT_display.shtml.wml b/modules/bibformat/web/admin/LINK_FORMAT_display.php.wml similarity index 91% rename from modules/bibformat/web/admin/LINK_FORMAT_display.shtml.wml rename to modules/bibformat/web/admin/LINK_FORMAT_display.php.wml index 1e83f041a..cff234e7e 100644 --- a/modules/bibformat/web/admin/LINK_FORMAT_display.shtml.wml +++ b/modules/bibformat/web/admin/LINK_FORMAT_display.php.wml @@ -1,118 +1,118 @@ ## $Id$ ## This file is part of the CERN Document Server Software (CDSware). ## Copyright (C) 2002 CERN. ## ## The CDSware is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## The CDSware is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDSware; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. #include "cdspage.wml" \ title="File Formats" \ navbar_name="admin" \ navbar_select="LINK_FORMAT_display" \ cdspageboxlefttopadd=" " ## $Id$ include(DB); include(ERROR); include(HEADER); ?>

Define file format types based on file extensions. This will be used when proposing various fulltext services. Example: You can tell that *.pdf files will be treated as PDF files.

'; print ""; print "Format Id"; print "Format Description"; print "File Extensions"; print ""; print ""; while($format=mysql_fetch_array($res)) { list($name, $text, $ext)=$format; print ""; print "$name"; print "$text"; print "$ext"; - print "[Modify]"; - print "[Delete]"; + print "[Modify]"; + print "[Delete]"; print ""; } print ""; mysql_close( $db ); ?>



-
+
Add new File FORMAT
Format Name
Format Description
File Extensions
diff --git a/modules/bibformat/web/admin/LINK_add.shtml.wml b/modules/bibformat/web/admin/LINK_add.php.wml similarity index 96% rename from modules/bibformat/web/admin/LINK_add.shtml.wml rename to modules/bibformat/web/admin/LINK_add.php.wml index 570d95034..8fdfda372 100644 --- a/modules/bibformat/web/admin/LINK_add.shtml.wml +++ b/modules/bibformat/web/admin/LINK_add.php.wml @@ -1,119 +1,119 @@ The CDSware is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The CDSware is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with CDSware; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *********************************************************************/ //========================================================================== -// File: LINK_add.shtml (flexElink WI) +// File: LINK_add.php (flexElink WI) // Description: Adds a new link definition to the DB. // POST parameters: // linktype --> (required) Name (id) of the link definition to be added // params ----> (optional) List of parameters that the link will accept; // they have to be separated with "," and the order in which they // are specified is the order the values will have to be passed // when solving the link // stype ----> (optional, allowed values: EXT, INT) Link solving type; if // it isn't specified is put to the default value (EXT) // bfile ----> (optional) Base file path for internal link solving // burl -----> (optional) Base url path for internal link solving // Notes: If the format is succesfully added to the DB it redirects the current // browser to the link display list // Requires: DB, ERROR // Author: Hector.Sanchez@cern.ch //========================================================================== - include("localconf.inc.shtml"); + include("localconf.inc.php"); include(DB); include(ERROR); if( (!isset($linktype)) or (trim($linktype)=="") ) { errorpage("Link Type hasn't been specified"); exit; } $linktype=trim(strtoupper($linktype)); if( !isset($params) ) { $params=""; } if(!isset($stype)) { $stype="EXT"; } else { $stype=strtoupper(trim($stype)); } if(($stype!="EXT")&&($stype!="INT")) { errorpage("Incorrect value for solving type"); exit; } if(!isset($bfile)) $bfile=""; if(!isset($burl)) $burl=""; if(!get_magic_quotes_gpc()) { $stype=addslashes($stype); $bfile=addslashes($bfile); $burl=addslashes($burl); } $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ); mysql_selectdb( $DB_DB ); $qry="insert into flxLINKTYPES(linktype, check_exists, solvingtype, base_file, base_url) values('$linktype', '$check', '$stype', '$bfile', '$burl')"; if(!mysql_query( $qry )) { errorpage("Impossible to insert new type:
".mysql_error()); mysql_close( $db ); exit; } if(trim($params)!="") { $params=split(",", $params); $order=0; foreach($params as $param) { $param=trim(strtoupper($param)); $qry="insert into flxLINKTYPEPARAMS values('$linktype', '$param', $order)"; if(!mysql_query( $qry )) { errorpage("Impossible to insert parameter '$param':
".mysql_error()); mysql_close( $db ); exit; } $order++; } } mysql_close( $db ); - header("location: LINK_display.shtml"); + header("location: LINK_display.php"); ?> diff --git a/modules/bibformat/web/admin/LINK_del.shtml.wml b/modules/bibformat/web/admin/LINK_del.php.wml similarity index 97% rename from modules/bibformat/web/admin/LINK_del.shtml.wml rename to modules/bibformat/web/admin/LINK_del.php.wml index 9529d340d..8300efc77 100644 --- a/modules/bibformat/web/admin/LINK_del.shtml.wml +++ b/modules/bibformat/web/admin/LINK_del.php.wml @@ -1,95 +1,95 @@ The CDSware is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The CDSware is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with CDSware; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *********************************************************************/ //========================================================================== -// File: LINK_del.shtml (flexElink WI) +// File: LINK_del.php (flexElink WI) // Description: Deletes an existing link definition (and all its depending // items) from the DB. // POST parameters: // linktype --> (required) Name (id) of the link definition to be deleted // Notes: If the format is succesfully added to the DB the current browser is // closed and the opener one is refreshed // Requires: DB, ERROR // Author: Hector.Sanchez@cern.ch //========================================================================== - include("localconf.inc.shtml"); + include("localconf.inc.php"); include(DB); include(ERROR); if( (!isset($linktype)) or (trim($linktype)=="") ) { errorpage("Link type hasn't been specified"); exit; } $linktype=strtoupper(trim($linktype)); $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ) or errormsg("Couldn't connect to mySQL") or exit; mysql_selectdb( $DB_DB ); $qry="delete from flxLINKTYPECONDITIONSACTIONS where linktype='$linktype'"; if(!mysql_query( $qry )) { errorpage("Impossible to delete actions related to this link type:
".mysql_error()); mysql_close( $db ); exit; } $qry="delete from flxLINKTYPECONDITIONSFILEFORMATS where linktype='$linktype'"; if(!mysql_query( $qry )) { errorpage("Impossible to delete formats related to this link type:
".mysql_error()); mysql_close( $db ); exit; } $qry="delete from flxLINKTYPECONDITIONS where linktype='$linktype'"; if(!mysql_query( $qry )) { errorpage("Impossible to delete conditions related to this link type:
".mysql_error()); mysql_close( $db ); exit; } $qry="delete from flxLINKTYPEPARAMS where linktype='$linktype'"; if(!mysql_query( $qry )) { errorpage("Impossible to delete parameters related to this link type:
".mysql_error()); mysql_close( $db ); exit; } $qry="delete from flxLINKTYPES where linktype='$linktype'"; if(!mysql_query( $qry )) { errorpage("Impossible to delete link type:
".mysql_error()); mysql_close( $db ); exit; } mysql_close( $db ); ?> diff --git a/modules/bibformat/web/admin/LINK_display.shtml.wml b/modules/bibformat/web/admin/LINK_display.php.wml similarity index 93% rename from modules/bibformat/web/admin/LINK_display.shtml.wml rename to modules/bibformat/web/admin/LINK_display.php.wml index d6c441850..c52c877e4 100644 --- a/modules/bibformat/web/admin/LINK_display.shtml.wml +++ b/modules/bibformat/web/admin/LINK_display.php.wml @@ -1,166 +1,166 @@ ## $Id$ ## This file is part of the CERN Document Server Software (CDSware). ## Copyright (C) 2002 CERN. ## ## The CDSware is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## The CDSware is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDSware; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. #include "cdspage.wml" \ title="Link Rules" \ navbar_name="admin" \ navbar_select="LINK_display" \ cdspageboxlefttopadd=" " ## $Id$ //========================================================================== -// File: LINK_display.shtml (flexElink WI) +// File: LINK_display.php (flexElink WI) // Description: Shows a list of the existing links and their parameters, and // allows to access to their details or add new link definitions // POST parameters: // Notes: // Requires: DB, ERROR, FUNCTION_LIB // Author: Hector.Sanchez@cern.ch //========================================================================== include(DB); include(ERROR); include(HEADER); ?>

Define rules for automated creation of URI links from mapped internal variables. Example: You can tell a rule how to create a link to People database out of the $100.a internal variable repesenting author's name. (The $100.a variable was mapped in the previous step, see the Extraction Rules.)

'; print ""; print "Link type label"; print "Parameters"; print " "; print ""; while($row=mysql_fetch_array($qh)) { list($linktype)=$row; $qry_par="select pname from flxLINKTYPEPARAMS where linktype='".addslashes($linktype)."' order by ord"; $qh_par=mysql_query($qry_par); $pars=""; while($row=mysql_fetch_array($qh_par)) { $pars.=$row[0].","; } print ""; print "$linktype"; print "$pars"; print " - + [Details]"; print ""; } print ""; mysql_close( $db ); ?> -

+
Add new Link Type
Name
Params
Solving type
Base file path
Base url
diff --git a/modules/bibformat/web/admin/LINK_edit.shtml.wml b/modules/bibformat/web/admin/LINK_edit.php.wml similarity index 98% rename from modules/bibformat/web/admin/LINK_edit.shtml.wml rename to modules/bibformat/web/admin/LINK_edit.php.wml index 815a6fb61..f0242c7cb 100644 --- a/modules/bibformat/web/admin/LINK_edit.shtml.wml +++ b/modules/bibformat/web/admin/LINK_edit.php.wml @@ -1,221 +1,221 @@ The CDSware is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The CDSware is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with CDSware; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *********************************************************************/ //========================================================================== -// File: LINK_edit.shtml (flexElink WI) +// File: LINK_edit.php (flexElink WI) // Description: Allows to modify the data of an existing link definition by // the user. // POST parameters: // linktype --> (required) Name (id) of the link definition to be modified // linktype_orig -> (optional) Contains the original name (name in the DB) // of the link definition which has to be modified. When this // parameter is set, the update in the DB is done with the // parameter values received by the script. // params ----> (optional) List of parameters that the link will accept; // they have to be separated with "," and the order in which they // are specified is the order the values will have to be passed // when solving the link // stype ----> (optional, allowed values: EXT, INT) Link solving type; if // it isn't specified is put to the default value (EXT) // bfile ----> (optional) Base file path for internal link solving // burl -----> (optional) Base url path for internal link solving // Notes: If the format is succesfully added to the DB it redirects the current // browser to the link detailed definition display // Requires: DB, ERROR // Author: Hector.Sanchez@cern.ch //========================================================================== - include("localconf.inc.shtml"); + include("localconf.inc.php"); include(DB); include(ERROR); include(FUNCTION_LIB); if((!isset($linktype))||(trim($linktype)=="")) { print "ERROR: Link type label hasn't been specified!!
"; print "[Go Back]"; exit; } if(get_magic_quotes_gpc()) { $linktype=stripslashes($linktype); } $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ); mysql_selectdb( $DB_DB ); if(isset($linktype_orig)) { if(get_magic_quotes_gpc()) { $linktype_orig=stripslashes($linktype_orig); } $linktype=trim(strtoupper($linktype)); $linktype_orig=trim(strtoupper($linktype_orig)); if( !isset($params) ) { $params=""; } if(!isset($stype)) { $stype="EXT"; } else { $stype=strtoupper(trim($stype)); } if(($stype!="EXT")&&($stype!="INT")) { print "Incorrect value for solving type"; print "
"; print "[Back]"; exit; } if(!isset($bfile)) $bfile=""; if(!isset($burl)) $burl=""; if(!get_magic_quotes_gpc()) { $stype=addslashes($stype); $bfile=addslashes($bfile); $burl=addslashes($burl); } $qry="delete from flxLINKTYPEPARAMS where linktype='$linktype'"; if(!mysql_query($qry)) { print "Impossible to delete old link params for '$linktype': ". mysql_error(); print "
"; print "[Back]"; mysql_close( $db ); exit; } $qry="update flxLINKTYPES set solvingtype='$stype', base_file='$bfile', base_url='$burl' where linktype='$linktype'"; if(!mysql_query($qry)) { print "Impossible to update link type '$linktype': ".mysql_error(); print "
"; print "[Back]"; mysql_close( $db ); exit; } if(trim($params)!="") { $params=split(",", $params); $order=0; foreach($params as $param) { if(trim($param)=="") continue; $param=trim(strtoupper($param)); $qry="insert into flxLINKTYPEPARAMS values('$linktype', '$param', $order)"; $errors=""; if(!mysql_query( $qry )) { $errors.="Impossible to insert parameter '$param':
". mysql_error()."

"; } $order++; } if($errors!="") { print $errors; print "
"; print "[Back]"; mysql_close( $db ); exit; } } - header("location: LINK_showone.shtml?linktype=$linktype"); + header("location: LINK_showone.php?linktype=$linktype"); exit; } $qry="select solvingtype, base_file, base_url from flxLINKTYPES where linktype='".addslashes($linktype)."'"; $qh=mysql_query($qry); print "
"; print ''; print ""; print ""; print ""; list($stype, $bfile, $burl)=mysql_fetch_row($qh); $qry_par="select pname from flxLINKTYPEPARAMS where linktype='".addslashes($linktype)."' order by ord"; $qh_par=mysql_query($qry_par); $pars=""; while($row=mysql_fetch_array($qh_par)) { $pars.=$row[0].","; } ?>
Modifying link type '$linktype'
Parameters
Solving type
Base file path
Base url
diff --git a/modules/bibformat/web/admin/LINK_showone.shtml.wml b/modules/bibformat/web/admin/LINK_showone.php.wml similarity index 85% rename from modules/bibformat/web/admin/LINK_showone.shtml.wml rename to modules/bibformat/web/admin/LINK_showone.php.wml index a639c26a3..35cc19ae7 100644 --- a/modules/bibformat/web/admin/LINK_showone.shtml.wml +++ b/modules/bibformat/web/admin/LINK_showone.php.wml @@ -1,212 +1,212 @@ The CDSware is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The CDSware is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with CDSware; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *********************************************************************/ //========================================================================== -// File: LINK_add.shtml (flexElink WI) +// File: LINK_add.php (flexElink WI) // Description: Show the details of a link definition which is in the DB. It // shows link definition data (parameters, type, base paths) and // corresponding link condtions with their actions. It allows to perform // management operations (delete, add, modifiy) over all the items diplayed // POST parameters: // linktype --> (required) Name (id) of the link definition to be shown // Requires: DB, ERROR, FUNCTION_LIB // Author: Hector.Sanchez@cern.ch //========================================================================== - include("localconf.inc.shtml"); + include("localconf.inc.php"); include(DB); include(ERROR); include(FUNCTION_LIB); ?> ERROR: Link type label hasn't been specified!!
"; print "[Close]"; exit; } if(get_magic_quotes_gpc()) { $linktype=stripslashes($linktype); } $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ); mysql_selectdb( $DB_DB ); $qry="select solvingtype, base_file, base_url from flxLINKTYPES where linktype='".addslashes($linktype)."'"; $qh=mysql_query($qry); print ''; print ""; print ""; print ""; list($stype, $bfile, $burl)=mysql_fetch_row($qh); $qry_par="select pname from flxLINKTYPEPARAMS where linktype='".addslashes($linktype)."' order by ord"; $qh_par=mysql_query($qry_par); $pars=""; while($row=mysql_fetch_array($qh_par)) { $pars.=$row[0].","; } print ""; print ""; print ""; print ""; print ""; print ""; $temp="Internal"; if($stype=="EXT") { $temp="External"; } print ""; print ""; if($stype=="INT") { print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; } print "
Details of link type '$linktype'
Parameters$pars
Solving type$temp
Base file path$bfile
Base url$burl
"; print ''; print ""; print ""; - print ""; - print ""; + [Add condition]"; + print ""; + print ""; print ""; print "
- [Add condition][Modify][Delete][Modify][Delete]
"; $qry="select eval_order, el_condition, el_action, solvingtype, base_file, base_url from flxLINKTYPECONDITIONS where linktype='".addslashes($linktype)."' order by eval_order"; $qh=mysql_query($qry, $db); if(mysql_num_rows($qh)>=1) { print ''; print ""; print ""; print ""; while($row=mysql_fetch_array($qh)) { print ""; print ""; print ""; print ""; print ""; print ""; list($eorder, $condition, $action, $stype, $bfile, $burl)=$row; $qry_fmts="select f.name from flxLINKTYPECONDITIONSFILEFORMATS cf, flxFILEFORMATS f where cf.linktype='".addslashes($linktype)."' and cf.eval_order='$eorder' and f.name=cf.fname"; $qh_fmts=mysql_query($qry_fmts, $db); $fmts=""; while($fmt=mysql_fetch_array($qh_fmts)) { $fmts.=$fmt[0]."
"; } print ""; print ""; print ""; print ""; print ""; print ""; if($stype=="INT") { print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; } $qry_ac="select apply_order, el_code from flxLINKTYPECONDITIONSACTIONS where linktype='".addslashes($linktype)."' and eval_order=$eorder order by apply_order"; $qh_ac=mysql_query($qry_ac, $db); while($row_ac=mysql_fetch_array($qh_ac)) { list($aorder, $action)=$row_ac; print ""; print ""; print ""; print ""; + [Modify]"; print ""; + [Delete]"; print ""; } print ""; print ""; print ""; } print "
CONDITIONS
Evaluation OrderCondition EL CodeSolve typeFormats
$eorder".text2HTML($condition)."$stype$fmts
Base FILE$bfile
Base URL$burl
Action ($aorder)".text2HTML($action)." - [Modify] - [Delete]
- [Add Action] - [Modify] - [Delete] + [Add Action] + [Modify] + [Delete]
"; } mysql_close( $db ); ?> diff --git a/modules/bibformat/web/admin/Makefile.am b/modules/bibformat/web/admin/Makefile.am index cc9227db7..a95cd7cee 100644 --- a/modules/bibformat/web/admin/Makefile.am +++ b/modules/bibformat/web/admin/Makefile.am @@ -1,30 +1,30 @@ ## $Id$ ## This file is part of the CERN Document Server Software (CDSware). ## Copyright (C) 2002 CERN. ## ## The CDSware is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## The CDSware is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDSware; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. webdir=$(WEBDIR)/admin/bibformat FILESWML=$(wildcard *.wml) web_DATA=$(FILESWML:.wml=) EXTRA_DIST = $(wildcard *.wml) -CLEANFILES = $(wildcard *.shtml) *~ *.tmp +CLEANFILES = $(wildcard *.php) *~ *.tmp -%.shtml: %.shtml.wml ../../../../config/config.wml ../../../../config/configbis.wml ../../../../config/cdspage.wml ../../../../config/cdsnavbar.wml +%.php: %.php.wml ../../../../config/config.wml ../../../../config/configbis.wml ../../../../config/cdspage.wml ../../../../config/cdsnavbar.wml $(WML) -o\(ALL-LANG_*\)+LANG_EN:$@ $< diff --git a/modules/bibformat/web/admin/OAIER_SF_add.shtml.wml b/modules/bibformat/web/admin/OAIER_SF_add.php.wml similarity index 96% rename from modules/bibformat/web/admin/OAIER_SF_add.shtml.wml rename to modules/bibformat/web/admin/OAIER_SF_add.php.wml index b39459b77..17db7fe0d 100644 --- a/modules/bibformat/web/admin/OAIER_SF_add.shtml.wml +++ b/modules/bibformat/web/admin/OAIER_SF_add.php.wml @@ -1,144 +1,144 @@ # $Id$ ## This file is part of the CERN Document Server Software (CDSware). ## Copyright (C) 2002 CERN. ## ## The CDSware is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## The CDSware is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDSware; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. #include "cdspage.wml" \ title="Extraction Rules" \ navbar_name="admin" \ navbar_select="OAIER_display" \ cdspageboxlefttopadd=" " ## $Id$ //========================================================================== -// File: OAIER_SF_add.shtml (flexElink WI) +// File: OAIER_SF_add.php (flexElink WI) // Description: Adds a new field and its ER to the DB for a defined variable. // POST parameters: // type -----> (required) Input type the variable belongs to // varname --> (required) Internal variable name the field is going to be // added to // process --> (optional) When is set, it adds the field and its ER to // the DB according to the values specified via the parameters // sfname ---> (required when process is set) Name of the field to be // added // label ---> (optional) subfield element attribute LABEL value // Notes: If the field-ER is succesfully added to the DB the current browser // is closed and the opener one is refreshed // Requires: DB, ERROR // Author: Hector.Sanchez@cern.ch //========================================================================== include(DB); include(ERROR); if( (!isset($type)) or (trim($type)=="") ) { print "Input type hasn't been specified"; print "
"; print "[Close]"; exit; } $otype=trim(strtoupper($otype)); if( (!isset($varname)) or (trim($varname)=="") ) { print "Variable name hasn't been specified"; print "
"; print "[Close]"; exit; } $varname=trim(strtoupper($varname)); if(!isset($process)) { ?> -
+
Add new subfield to variable''
Subfield name:
Attribute "label" value:
Subfield name hasn't been specified"); print ""; exit; } $sfname=trim(strtoupper($sfname)); if( (!isset($label)) or (trim($label)=="") ) { outWarning( "Attribute 'label' value hasn't been specified"); print ""; exit; } $label=trim($label); $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ) or errormsg("Couldn't connect to mySQL") or exit; mysql_selectdb( $DB_DB ); $qry="insert into flxXMLMARCEXTRULESUBFIELDS(type, varname, sfname, att_label) values ('$type', '$varname', '$sfname', '$label')"; if(!mysql_query( $qry )) { print "Impossible to insert new subfield rule:
".mysql_error(); print "
"; print "[Go Back]"; mysql_close( $db ); exit; } mysql_close( $db ); ?> diff --git a/modules/bibformat/web/admin/OAIER_SF_del.shtml.wml b/modules/bibformat/web/admin/OAIER_SF_del.php.wml similarity index 95% rename from modules/bibformat/web/admin/OAIER_SF_del.shtml.wml rename to modules/bibformat/web/admin/OAIER_SF_del.php.wml index 5f9838dfb..8af72ac4d 100644 --- a/modules/bibformat/web/admin/OAIER_SF_del.shtml.wml +++ b/modules/bibformat/web/admin/OAIER_SF_del.php.wml @@ -1,81 +1,81 @@ The CDSware is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The CDSware is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with CDSware; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *********************************************************************/ //========================================================================== -// File: OAIER_SF_del.shtml (flexElink WI) +// File: OAIER_SF_del.php (flexElink WI) // Description: Deletes an existing field and its corresponding ER from the // configuration DB for the specified variable. // POST parameters: // type -----> (required) Input type the ER belongs to // varname --> (required) Internal variable name the field to be deleted // belongs to // sfname ---> (required) Field name to be deleted // Notes: If the variable-ER is succesfully deleted from the DB the current // browser is redirected to the OAI extraction rules list // Requires: DB, ERROR // Author: Hector.Sanchez@cern.ch //========================================================================== - include("localconf.inc.shtml"); + include("localconf.inc.php"); include(DB); include(ERROR); if( (!isset($type)) or (trim($type)=="") ) { errorpage("Type of the rule hasn't been specified"); exit; } $type=strtoupper(trim($type)); if( (!isset($varname)) or (trim($varname)=="") ) { errorpage("Variable name hasn't been specified"); exit; } $varname=strtoupper(trim($varname)); if( (!isset($sfname)) or (trim($sfname)=="") ) { errorpage("Subfield name hasn't been specified"); exit; } $sfname=strtoupper(trim($sfname)); $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ); mysql_selectdb( $DB_DB ); $qry="delete from flxXMLMARCEXTRULESUBFIELDS where type='$type' and varname='$varname' and sfname='$sfname'"; if(!mysql_query( $qry )) { errorpage("Impossible to delete variable subfields:
".mysql_error()); mysql_close( $db ); exit; } mysql_close( $db ); - header("location: OAIER_display.shtml"); + header("location: OAIER_display.php"); ?> diff --git a/modules/bibformat/web/admin/OAIER_add.shtml.wml b/modules/bibformat/web/admin/OAIER_add.php.wml similarity index 96% rename from modules/bibformat/web/admin/OAIER_add.shtml.wml rename to modules/bibformat/web/admin/OAIER_add.php.wml index 99ffe5909..9ff32c1db 100644 --- a/modules/bibformat/web/admin/OAIER_add.shtml.wml +++ b/modules/bibformat/web/admin/OAIER_add.php.wml @@ -1,94 +1,94 @@ ## $Id$ ## This file is part of the CERN Document Server Software (CDSware). ## Copyright (C) 2002 CERN. ## ## The CDSware is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## The CDSware is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDSware; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. ## $Id$ //========================================================================== -// File: OAIER_add.shtml (flexElink WI) +// File: OAIER_add.php (flexElink WI) // Description: Adds a new variable and the corresponding ER to the // configuration DB. // POST parameters: // type -----> (required) Input type the ER belongs to // varname --> (required) Internal variable name // att_id ---> (optional) varfield element attribute ID value // att_i1 ---> (optional) varfield element attribute I1 value (only // relevant if ftype=DATAFIELD) // att_i2 ---> (optional) varfield element attribute I2 value (only // relevant if ftype=DATAFIELD) // ftype ----> (required) field type (DATAFIELD, CONTROLFIELD), default // value DATAFIELD // Notes: If the variable-ER is succesfully added to the DB the current browser // is redirected to the OAI extraction rules list // Requires: DB, ERROR // Author: Hector.Sanchez@cern.ch //========================================================================== - include("localconf.inc.shtml"); + include("localconf.inc.php"); include(DB); include(ERROR); if( (!isset($type)) or (!trim($type)) ) { errorpage("Rule type hasn't been specified"); exit; } if( (!isset($varname)) or (!trim($varname)) ) { errorpage("Rule varname hasn't been specified"); exit; } if( (!isset($ftype))||(($ftype!="DATAFIELD")&&($ftype!="CONTROLFIELD")) ) $ftype="DATAFIELD"; if(!isset($att_id)) $att_id=""; if(!isset($att_i1)) $att_i1=""; if(!isset($att_i2)) $att_i2=""; $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ) or errormsg("Couldn't connect to mySQL") or exit; mysql_selectdb( $DB_DB ); $type=trim(strtoupper($type)); $varname=trim(strtoupper($varname)); $att_id=trim($att_id); $att_i1=trim($att_i1); $att_i2=trim($att_i2); $qry="insert into flxXMLMARCEXTRULES(type, varname, att_id, att_i1, att_i2, ftype) values ('$type', '$varname', '$att_id', '$att_i1', '$att_i2', '$ftype')"; if(!mysql_query( $qry )) { errorpage("Impossible to insert new rule:
".mysql_error()); mysql_close( $db ); exit; } mysql_close( $db ); - header("location: OAIER_display.shtml"); + header("location: OAIER_display.php"); ?> diff --git a/modules/bibformat/web/admin/OAIER_del.shtml.wml b/modules/bibformat/web/admin/OAIER_del.php.wml similarity index 95% rename from modules/bibformat/web/admin/OAIER_del.shtml.wml rename to modules/bibformat/web/admin/OAIER_del.php.wml index d0f809bde..57d67543f 100644 --- a/modules/bibformat/web/admin/OAIER_del.shtml.wml +++ b/modules/bibformat/web/admin/OAIER_del.php.wml @@ -1,83 +1,83 @@ ## $Id$ ## This file is part of the CERN Document Server Software (CDSware). ## Copyright (C) 2002 CERN. ## ## The CDSware is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## The CDSware is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDSware; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. ## $Id$ //========================================================================== -// File: OAIER_del.shtml (flexElink WI) +// File: OAIER_del.php (flexElink WI) // Description: Deletes an existing variable and the corresponding ER from the // configuration DB. // POST parameters: // type -----> (required) Input type the ER belongs to // varname --> (required) Internal variable name to be deleted // Notes: If the variable-ER is succesfully deleted from the DB the current // browser is redirected to the OAI extraction rules list // Requires: DB, ERROR // Author: Hector.Sanchez@cern.ch //========================================================================== - include("localconf.inc.shtml"); + include("localconf.inc.php"); include(DB); include(ERROR); if( (!isset($type)) or (trim($type)=="") ) { errorpage("Type of the rule hasn't been specified"); exit; } if( (!isset($varname)) or (trim($varname)=="") ) { errorpage("Variable name hasn't been specified"); exit; } $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ); mysql_selectdb( $DB_DB ); $type=trim(strtoupper($type)); $varname=trim(strtoupper($varname)); $qry="delete from flxXMLMARCEXTRULESUBFIELDS where type='$type' and varname='$varname'"; if(!mysql_query( $qry )) { errorpage("Impossible to delete variable subfields:
".mysql_error()); mysql_close( $db ); exit; } $qry="delete from flxXMLMARCEXTRULES where type='$type' and varname='$varname'"; if(!mysql_query( $qry )) { errorpage("Impossible to delete rule:
".mysql_error()); mysql_close( $db ); exit; } mysql_close( $db ); - header("location: OAIER_display.shtml"); + header("location: OAIER_display.php"); ?> diff --git a/modules/bibformat/web/admin/OAIER_display.shtml.wml b/modules/bibformat/web/admin/OAIER_display.php.wml similarity index 91% rename from modules/bibformat/web/admin/OAIER_display.shtml.wml rename to modules/bibformat/web/admin/OAIER_display.php.wml index 795c7d1ca..db6695d91 100644 --- a/modules/bibformat/web/admin/OAIER_display.shtml.wml +++ b/modules/bibformat/web/admin/OAIER_display.php.wml @@ -1,227 +1,227 @@ ## $Id$ ## This file is part of the CERN Document Server Software (CDSware). ## Copyright (C) 2002 CERN. ## ## The CDSware is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## The CDSware is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDSware; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. #include "cdspage.wml" \ title="Extraction Rules" \ navbar_name="admin" \ navbar_select="OAIER_display" \ cdspageboxlefttopadd=" " ## $Id$ //========================================================================== -// File: OAIER_display.shtml (flexElink WI) +// File: OAIER_display.php (flexElink WI) // Description: Shows a list of defined internal variables and their // corresponding extraction rules (ER); it also shows fields of each // variable. Besides, it provides access to management operations // POST parameters: // Notes: // Requires: DB, ERROR // Author: Hector.Sanchez@cern.ch //========================================================================== include(DB); include(ERROR); include(HEADER); $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ); mysql_selectdb( $DB_DB ); $qry_rules="select * from flxXMLMARCEXTRULES order by type, varname"; $res=mysql_query( $qry_rules, $db ); $old_type=""; ?>

Define how the metadata tags from input are mapped into internal BibFormat variable names. The variable names can afterwards be used in formatting and linking rules. Example: You can tell that 100 $a field should be mapped into $100.a internal variable that you could use later.

'; $color1="#FFFFFF"; $color2="#66CCCC"; while($row=mysql_fetch_array($res)) { list($type, $varname, $att_id, $att_i1, $att_i2, $mvalues, $ftype)=$row; if(($old_type=="") or ($type!=$old_type)) { print "\t\n"; print "\t\t$type\n"; print "\t\n"; print "\t\n"; print "\t\tVarname\n"; print "\t\tMapping Tag\n"; print "\t\tAllow multiple values\n"; print "\t\t \n"; print "\t\n"; $old_type=$type; $color=$color2; } if($color==$color1) $color=$color2; else $color=$color1; print "\t\n"; print "\t\t$varname\n"; if($ftype=="DATAFIELD") { print "\t\t".htmlspecialchars("")."\n"; } else { print "\t\t".htmlspecialchars("")."\n"; } if($mvalues=="S") print "\t\tYes\n"; else print "\t\tNo\n"; print "\t\t[Modify]\n"; if($ftype=="DATAFIELD") { - print "\t\t[Add Subfield]\n"; + print "\t\t[Add Subfield]\n"; } else { print "\t\t "; } - print "\t\t[Delete]\n"; + print "\t\t[Delete]\n"; print "\t\n"; if($ftype!="DATAFIELD") continue; $qry_sf="select sfname, att_label from flxXMLMARCEXTRULESUBFIELDS where type='$type' and varname='$varname' order by sfname"; $res_sf=mysql_query($qry_sf); if(mysql_num_rows($res_sf)>=1) { print "\t\n"; print "\t\t\n"; print "\t\t\t".''."\n"; print "\t\t\t\t\n"; print "\t\t\t\t\t\n"; print "\t\t\t\t\n"; print "\t\t\t\t\n"; print "\t\t\t\t\t\n"; print "\t\t\t\t\t\n"; print "\t\t\t\t\t\n"; print "\t\t\t\t\n"; while($row_sf=mysql_fetch_array($res_sf)) { list($sfname, $att_label)=$row_sf; print "\t\t\t\t\n"; print "\t\t\t\t\t\n"; print "\t\t\t\t\t\n"; print "\t\t\t\t\t\n"; - print "\t\t\t\t\t\n"; + print "\t\t\t\t\t\n"; print "\t\t\t\t\n"; } print "\t\t\t
"; print "SUBFIELDS"; print "
SF NameMapping Tag 
$sfname".htmlspecialchars("")."[Modify][Delete][Delete]
\n"; print "\t\t\n"; print "\t\n"; } while($row_sf=mysql_fetch_array($res_sf)) { print ""; print "$sfname"; print "$att_label"; print ""; print "[Delete]"; print ""; } } print ""; ?>


-
+
Add new Extraction Rule
Type
Variable name
Field Type
Attribute TAG value
Attribute IND1 value
(only for datafield)
Attribute IND2 value
(only for datafield)
diff --git a/modules/bibformat/web/admin/UDF_add.shtml.wml b/modules/bibformat/web/admin/UDF_add.php.wml similarity index 96% rename from modules/bibformat/web/admin/UDF_add.shtml.wml rename to modules/bibformat/web/admin/UDF_add.php.wml index f4c3ebc9b..5fd9f4457 100644 --- a/modules/bibformat/web/admin/UDF_add.shtml.wml +++ b/modules/bibformat/web/admin/UDF_add.php.wml @@ -1,105 +1,105 @@ The CDSware is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The CDSware is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with CDSware; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *********************************************************************/ //========================================================================== -// File: UDF_add.shtml (flexElink WI) +// File: UDF_add.php (flexElink WI) // Description: Adds a new UDF definition to the DB. It also stores the // UDF's parameters. // POST parameters: // fname --> (required) Name (id) of the UDF to be added // params -> (required) Contains the UDF param list. UDF parameters are // separated by using "," // doc ----> (optional) Description of the purpose of the UDF // code ---> (optional) UDF's PHP code // Notes: If the UDF is succesfully added to the DB it redirects the current // browser to the UDF display list // Requires: DB, ERROR // Author: Hector.Sanchez@cern.ch //========================================================================== - include("localconf.inc.shtml"); + include("localconf.inc.php"); include(DB); include(ERROR); if( (!isset($fname)) or (trim($fname)=="") ) { errorpage("Function name hasn't been specified"); exit; } if(!isset($params)) { errorpage("Params hasn't been specified"); exit; } if(!isset($code)) $code=""; if(!isset($doc)) $doc=""; $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ) or errormsg("Couldn't connect to mySQL") or exit; mysql_selectdb( $DB_DB ); $fname=trim(strtoupper($fname)); $rtype=trim(strtoupper($rtype)); if(!get_magic_quotes_gpc()) { $code=addslashes($code); $doc=addslashes($doc); } $qry="insert into flxUDFS (fname, rtype, code, doc) values ('$fname', '$rtype', '$code', '$doc')"; if(!mysql_query( $qry )) { errorpage("Impossible to insert new UDF:
".mysql_error()); mysql_close( $db ); exit; } $pars=explode(",", trim($params)); $counter=0; foreach($pars as $parname) { $parname=trim($parname); if($parname=="") continue; $qry="insert into flxUDFPARAMS(fname, pname, ord) values('$fname', '$parname', '$counter')"; if(!mysql_query( $qry )) { errorpage("Impossible to insert UDF parameter '$parname':
".mysql_error()); mysql_close( $db ); exit; } $counter++; } mysql_close( $db ); - header("location: UDF_display.shtml"); + header("location: UDF_display.php"); ?> diff --git a/modules/bibformat/web/admin/UDF_del.shtml.wml b/modules/bibformat/web/admin/UDF_del.php.wml similarity index 95% rename from modules/bibformat/web/admin/UDF_del.shtml.wml rename to modules/bibformat/web/admin/UDF_del.php.wml index 238489176..90a8ae6ee 100644 --- a/modules/bibformat/web/admin/UDF_del.shtml.wml +++ b/modules/bibformat/web/admin/UDF_del.php.wml @@ -1,72 +1,72 @@ The CDSware is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The CDSware is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with CDSware; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *********************************************************************/ //========================================================================== -// File: UDF_delete.shtml (flexElink WI) +// File: UDF_delete.php (flexElink WI) // Description: Deletes an existing UDF from the DB. // POST parameters: // fname --> (required) Name (id) of the UDF to be deleted // Notes: If the UDF is succesfully added to the DB it redirects the current // browser to the UDF display list // Requires: DB, ERROR // Author: Hector.Sanchez@cern.ch //========================================================================== - include("localconf.inc.shtml"); + include("localconf.inc.php"); include(DB); include(ERROR); if( (!isset($fname)) or (trim($fname)=="") ) { errorpage("Function name hasn't been specified"); exit; } $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ) or errormsg("Couldn't connect to mySQL") or exit; mysql_selectdb( $DB_DB ); $fname=trim(strtoupper($fname)); $qry="delete from flxUDFS where fname='$fname'"; if(!mysql_query( $qry )) { errorpage("Impossible to delete function:
".mysql_error()); mysql_close( $db ); exit; } $qry="delete from flxUDFPARAMS where fname='$fname'"; if(!mysql_query( $qry )) { errorpage("Impossible to delete function parameters:
".mysql_error()); mysql_close( $db ); exit; } mysql_close( $db ); - header("location: UDF_display.shtml"); + header("location: UDF_display.php"); ?> diff --git a/modules/bibformat/web/admin/UDF_display.shtml.wml b/modules/bibformat/web/admin/UDF_display.php.wml similarity index 90% rename from modules/bibformat/web/admin/UDF_display.shtml.wml rename to modules/bibformat/web/admin/UDF_display.php.wml index 8a6c54beb..b4ccedf81 100644 --- a/modules/bibformat/web/admin/UDF_display.shtml.wml +++ b/modules/bibformat/web/admin/UDF_display.php.wml @@ -1,146 +1,146 @@ ## $Id$ ## This file is part of the CERN Document Server Software (CDSware). ## Copyright (C) 2002 CERN. ## ## The CDSware is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## The CDSware is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDSware; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. #include "cdspage.wml" \ title="User Defined Functions (UDFs)" \ navbar_name="admin" \ navbar_select="UDF_display" \ cdspageboxlefttopadd=" " ## $Id$ //========================================================================== -// File: UDF_display.shtml (flexElink WI) +// File: UDF_display.php (flexElink WI) // Description: Shows a list of the existing UDFs and their parameters, and // allows to access to their details, add or delete // POST parameters: // Notes: // Requires: DB, ERROR, FUNCTION_LIB // Author: Hector.Sanchez@cern.ch //========================================================================== include(DB); include(ERROR); include(FUNCTION_LIB); include(HEADER); ?>

Define your own functions that you can reuse when creating your own output formats. This enables you to do complex formatting without ever touching the BibFormat core code. Example: You can define a function how to match and extract email addresses out of a text file.

'."\n"; print "\n Function name\n"; print "Params\n"; print "Description\n"; print " \n"; while($func=mysql_fetch_array($res_func)) { list($fname, $rtype, $doc)=$func; $doc=str_replace("\n", "
", $doc); $doc=str_replace(" ", " ", $doc); print ""; print "$fname\n"; $qry_par="select pname from flxUDFPARAMS where fname='$fname' order by ord"; $pars=""; $res_par=mysql_query( $qry_par ); while($par=mysql_fetch_array( $res_par )) { $par=$par["pname"]; $pars.=$par."
"; } print "$pars \n"; print "$doc \n"; - print "[Code]\n"; - print "[Modify]\n"; - print "[Delete]\n"; + print "[Code]\n"; + print "[Modify]\n"; + print "[Delete]\n"; print ""; } print "\n"; mysql_close( $db ); ?>
-

+
Add new function
Function Name
Params
PHP Code
UDF documentation
diff --git a/modules/bibformat/web/admin/UDF_edit.shtml.wml b/modules/bibformat/web/admin/UDF_edit.php.wml similarity index 97% rename from modules/bibformat/web/admin/UDF_edit.shtml.wml rename to modules/bibformat/web/admin/UDF_edit.php.wml index d865010f5..91dda2dc9 100644 --- a/modules/bibformat/web/admin/UDF_edit.shtml.wml +++ b/modules/bibformat/web/admin/UDF_edit.php.wml @@ -1,197 +1,197 @@ The CDSware is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The CDSware is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with CDSware; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *********************************************************************/ //========================================================================== -// File: UDF_edit.shtml (flexElink WI) +// File: UDF_edit.php (flexElink WI) // Description: Allows to modify UDF data and updates the changes in the DB. // POST parameters: // fname --> (required) Name (id) of the UDF to be modified // process -> (optional) When is set, the script updates the UDF data // in the DB with the parameter values // params -> (optional) Contains the UDF param list. UDF parameters are // separated by using "," // fname_orig -> (required if process is set) Original name of the UDF // to be updated (the UDF name can be changed) // doc ----> (optional) Description of the purpose of the UDF // code ---> (optional) UDF's PHP code // Notes: If the format is succesfully updated in the DB it closes the current // browser and refreshes the opener one // Requires: DB, ERROR, EXECUTOR // Author: Hector.Sanchez@cern.ch //========================================================================== - include("localconf.inc.shtml"); + include("localconf.inc.php"); include(DB); include(ERROR); if( (!isset($fname)) or (trim($fname)=="") ) { print "Function name hasn't been specified"; print "
"; print "[Close]"; exit; } $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ); mysql_selectdb( $DB_DB ); $fname=trim(strtoupper($fname)); //-------DISPLAY if(!isset($process)) { $qry="select code, doc from flxUDFS where fname='$fname'"; $qh=mysql_query( $qry ); if(mysql_num_rows( $qh )<1) { print "Function not found"; print "
"; print "[Close]"; exit; } $row=mysql_fetch_array($qh); list($code, $doc)=$row; $qry="select pname from flxUDFPARAMS where fname='$fname' order by ord"; $qh=mysql_query($qry, $db); $params=""; while($row=mysql_fetch_array($qh)) { $params.=$row[0].","; } $params=substr($params, 0, strlen($params)-1); ?> -
+
Editing udf ''
Function Name Params

Documentation

PHP Code


[Go Back]"; exit; } if( (!isset($code)) ) $code=""; if( (!isset($doc)) ) $doc=""; if( (!isset($params)) ) $params=""; if(!get_magic_quotes_gpc()) { $doc=addslashes($doc); $code=addslashes($code); } $qry="update flxUDFS set fname='$fname', code='$code', doc='$doc' where fname='$fname_orig'"; if(!mysql_query( $qry )) { print "Impossible to update udf '$fname_orig':
".mysql_error(); print "
[Go Back]"; exit(); } $qry="delete from flxUDFPARAMS where fname='$fname_orig'"; if(!mysql_query( $qry )) { print "Function was updated but couldn't update udf params:
".mysql_error(); print "
[Go Back]"; exit(); } $params=explode(",", $params); $count=0; foreach($params as $param) { $param=trim($param); if($param=="") continue; $qry="insert into flxUDFPARAMS(fname, pname, ord) values('$fname', '$param', $count)"; if(!mysql_query( $qry )) { print "Function parameter '$param' couldn't be inserted:
".mysql_error(); print "
[Go Back]"; exit(); } $count++; } mysql_close( $db ); ?> diff --git a/modules/bibformat/web/admin/UDF_showone.shtml.wml b/modules/bibformat/web/admin/UDF_showone.php.wml similarity index 96% rename from modules/bibformat/web/admin/UDF_showone.shtml.wml rename to modules/bibformat/web/admin/UDF_showone.php.wml index 2c64de957..8bc5650f1 100644 --- a/modules/bibformat/web/admin/UDF_showone.shtml.wml +++ b/modules/bibformat/web/admin/UDF_showone.php.wml @@ -1,124 +1,124 @@ The CDSware is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The CDSware is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with CDSware; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *********************************************************************/ //========================================================================== -// File: UDF_showone.shtml (flexElink WI) +// File: UDF_showone.php (flexElink WI) // Description: Shows the details for a given UDF (parameters, code and // documentation) and allows to test the PHP for user-entered parameter // values // POST parameters: // fname --> (required) Name (id) of the UDF to be shown // Requires: DB, ERROR, FUNCTION_LIB // Author: Hector.Sanchez@cern.ch //========================================================================== - include("localconf.inc.shtml"); + include("localconf.inc.php"); include(DB); include(ERROR); include(FUNCTION_LIB); if( (!isset($fname)) or (trim($fname)=="") ) { errorpage("Function hasn't been specified"); exit; } $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ) or errormsg("Couldn't connect to mySQL") or exit; mysql_selectdb( $DB_DB ); $fname=trim(strtoupper($fname)); $qry="select rtype, code, doc from flxUDFS where fname='$fname'"; $res=mysql_query( $qry ); list($rtype, $code, $doc) =mysql_fetch_array( $res ); $code=text2HTML($code); $doc=str_replace("\n","
",$doc); $doc=str_replace(" "," ",$doc); $qry="select pname from flxUDFPARAMS where fname='$fname' order by ord"; $pars=""; $res=mysql_query( $qry ); $allpars=array(); while($par=mysql_fetch_array( $res )) { $par=$par["pname"]; $pars.=$par.", "; array_push($allpars, $par); } $pars=substr( $pars, 0, strlen($pars)-2 ); ?> PHP Code for <?print $fname;?>
Details of UDF ''
Parameters
Documentation
PHP Code

-
+ "; print ""; } ?>
Test this function
$pname value
diff --git a/modules/bibformat/web/admin/UDF_testcode.shtml.wml b/modules/bibformat/web/admin/UDF_testcode.php.wml similarity index 96% rename from modules/bibformat/web/admin/UDF_testcode.shtml.wml rename to modules/bibformat/web/admin/UDF_testcode.php.wml index 905b0b6cf..332d75d23 100644 --- a/modules/bibformat/web/admin/UDF_testcode.shtml.wml +++ b/modules/bibformat/web/admin/UDF_testcode.php.wml @@ -1,74 +1,74 @@ The CDSware is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The CDSware is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with CDSware; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *********************************************************************/ //========================================================================== -// File: UDF_testcode.shtml (flexElink WI) +// File: UDF_testcode.php (flexElink WI) // Description: Allows to test a UDF for a given set of parameter values. // Parameter values have to be specified in the correct order and the // parameter name is not relevant (only the order and the value). It // shows a web page with the result of executing the UDF with those // parameter values // POST parameters: // fname ---> (required) Name (id) of the UDF to be tested // -> (optional, multiple) Parameter value, they have to come in // the same order as the UDF definition specifies // Requires: ERROR, UDF_RETRIEVER // Author: Hector.Sanchez@cern.ch //========================================================================== - include("localconf.inc.shtml"); + include("localconf.inc.php"); include(ERROR); include(UDF_RETRIEVER); if(!isset($fname) || (trim($fname)=="")) { errorpage("Function not set!!"); } global $HTTP_POST_VARS; $pars=array(); foreach($HTTP_POST_VARS as $var=>$value) { if(get_magic_quotes_gpc()) $value=stripslashes($value); if($var!="fname") array_push($pars, $value); } print_r($pars); $ret=new UDFRetriever(); list($ecode, $emsg)=$ret->execute( $fname, $pars, 0, 0); $ret->destroy(); if($ecode) { print "Result:

$emsg

"; } else { print "ERROR!! $emsg"; } print "
"; print "[Go back]"; ?> diff --git a/modules/bibformat/web/admin/error.inc.shtml.wml b/modules/bibformat/web/admin/error.inc.php.wml similarity index 94% rename from modules/bibformat/web/admin/error.inc.shtml.wml rename to modules/bibformat/web/admin/error.inc.php.wml index e859b3b62..1615a4462 100644 --- a/modules/bibformat/web/admin/error.inc.shtml.wml +++ b/modules/bibformat/web/admin/error.inc.php.wml @@ -1,38 +1,38 @@ The CDSware is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The CDSware is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with CDSware; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *********************************************************************/ function errormsg( $msg ) { print "

Error:


"; print "$msg"; print ""; exit; } function errorpage( $msg ) { - include("header.inc.shtml"); + include("header.inc.php"); print "

Error:


"; print "$msg"; - include("footer.inc.shtml"); + include("footer.inc.php"); } ?> diff --git a/modules/bibformat/web/admin/footer.inc.shtml.wml b/modules/bibformat/web/admin/footer.inc.php.wml similarity index 100% rename from modules/bibformat/web/admin/footer.inc.shtml.wml rename to modules/bibformat/web/admin/footer.inc.php.wml diff --git a/modules/bibformat/web/admin/header.inc.shtml.wml b/modules/bibformat/web/admin/header.inc.php.wml similarity index 100% rename from modules/bibformat/web/admin/header.inc.shtml.wml rename to modules/bibformat/web/admin/header.inc.php.wml diff --git a/modules/bibformat/web/admin/index.shtml.wml b/modules/bibformat/web/admin/index.php.wml similarity index 89% rename from modules/bibformat/web/admin/index.shtml.wml rename to modules/bibformat/web/admin/index.php.wml index e7743ff72..a9f27bb4c 100644 --- a/modules/bibformat/web/admin/index.shtml.wml +++ b/modules/bibformat/web/admin/index.php.wml @@ -1,208 +1,208 @@ ## $Id$ ## This file is part of the CERN Document Server Software (CDSware). ## Copyright (C) 2002 CERN. ## ## The CDSware is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## The CDSware is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDSware; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. #include "cdspage.wml" \ title="BibFormat Admin" \ navbar_name="admin" \ navbar_select="bibformat" \ cdspageboxlefttopadd=" " ## $Id$ ## DO NOT EDIT THIS FILE! IT WAS AUTOMATICALLY GENERATED FROM CDSware WML SOURCES. ?>

The BibFormat admin interface enables you to specify how the bibliographic data is presented to the end user in the search interface and search results pages. For example, you may specify that titles should be printed in bold font, the abstract in small italic, etc. Moreover, the BibFormat is not only a simple bibliographic data output formatter, but also an automated link constructor. For example, from the information on journal name and pages, it may automatically create links to publisher's site based on some configuration rules.

Configuring BibFormat

By default, a simple HTML format based on the most common fields (title, author, abstract, keywords, fulltext link, etc) is defined. You certainly want to define your own ouput formats in case you have a specific metadata structure.

Here is a short guide of what you can configure:

-
Behaviours +
Behaviours
Define one or more output BibFormat behaviours. These are then passed as parameters to the BibFormat modules while executing formatting.
Example: You can tell BibFormat that is has to enrich the incoming metadata file by the created format, or that it only has to print the format out. -
Extraction Rules +
Extraction Rules
Define how the metadata tags from input are mapped into internal BibFormat variable names. The variable names can afterwards be used in formatting and linking rules.
Example: You can tell that 100 $a field should be mapped into $100.a internal variable that you could use later. -
Link Rules +
Link Rules
Define rules for automated creation of URI links from mapped internal variables.
Example: You can tell a rule how to create a link to People database out of the $100.a internal variable repesenting author's name. (The $100.a variable was mapped in the previous step, see the Extraction Rules.) -
File Formats +
File Formats
Define file format types based on file extensions. This will be used when proposing various fulltext services.
Example: You can tell that *.pdf files will be treated as PDF files. -
User Defined Functions (UDFs) +
User Defined Functions (UDFs)
Define your own functions that you can reuse when creating your own output formats. This enables you to do complex formatting without ever touching the BibFormat core code.
Example: You can define a function how to match and extract email addresses out of a text file. -
Formats +
Formats
Define the output formats, i.e. how to create the output out of internal BibFormat variables that were extracted in a previous step. This is the functionality you would want to configure most of the time. It may reuse formats, user defined functions, knowledge bases, etc.
Example: You can tell that authors should be printed in italic, that if there are more than 10 authors only the first three should be printed, etc. -
Knowledge Bases (KBs) +
Knowledge Bases (KBs)
Define one or more knowledge bases that enables you to transform various forms of input data values into the unique standard form on the output.
Example: You can tell that Phys Rev D and Physical Review D are both the same journal and that these names should be standardized to Phys Rev : D. -
Execution Test +
Execution Test
Enables you to test your formats on your sample data file. Useful when debugging newly created formats.

To learn more on BibFormat configuration, you can consult the BibFormat Admin Guide. +href="BibFormatAdminGuide.php">BibFormat Admin Guide.

Running BibFormat

From the Web interface

-Run Reformat Records tool. +Run Reformat Records tool. This tool permits you to update stored formats for bibliographic records.
It should normally be used after configuring BibFormat's -Behaviours and -Formats. +Behaviours and +Formats. When these are ready, you can choose to rebuild formats for selected collections or you can manually enter a search query and the web interface will accomplish all necessary formatting steps.
Example: You can request Photo collections to have their HTML brief formats rebuilt, or you can reformat all the records written by Ellis.

From the command-line interface

Consider having an XML MARC data file that is to be uploaded into the CDSware. (For example, it might have been harvested from other sources and processed via BibConvert.) Having configured BibFormat and its default output type behaviour, you would then run this file throught BibFormat as follows:

 $ bibformat < /tmp/sample.xml > /tmp/sample_with_fmt.xml
 
 
that would create default HTML formats and would "enrich" the input XML data file by this format. (You would then continue the upload procedure by calling successively BibUpload and BibWords.)

Now consider a different situation. You would like to add a new possible format, say "HTML portfolio" and "HTML captions" in order to nicely format multiple photographs in one page. Let us suppose that these two formats are called hp and hc and are already loaded in the collection_format table. (TODO: describe how this is done via WebAdmin.) You would then proceed as follows: firstly, you would prepare the corresponding output behaviours called HP +href="BEH_display.php">output behaviours called HP and HC (TODO: note the uppercase!) that would not enrich the input file but that would produce an XML file with only 001 and FMT tags. (This is in order not to update the bibliographic information but the formats only.) You would -also prepare corresponding formats +also prepare corresponding formats at the same time. Secondly, you would launch the formatting as follows:

 $ bibformat otype=HP,HC < /tmp/sample.xml > /tmp/sample_fmts_only.xml
 
 
that should give you an XML file containing only 001 and FMT tags. Finally, you would upload the formats:
 $ bibupload < /tmp/sample_fmts_only.xml
 
 
and that's it. The new formats should now appear in WebSearch. diff --git a/modules/bibformat/web/admin/localconf.inc.shtml.wml b/modules/bibformat/web/admin/localconf.inc.php.wml similarity index 75% rename from modules/bibformat/web/admin/localconf.inc.shtml.wml rename to modules/bibformat/web/admin/localconf.inc.php.wml index 34eb43597..2fd81fd1a 100644 --- a/modules/bibformat/web/admin/localconf.inc.shtml.wml +++ b/modules/bibformat/web/admin/localconf.inc.php.wml @@ -1,38 +1,38 @@ ## $Id$ ## This file is part of the CERN Document Server Software (CDSware). ## Copyright (C) 2002 CERN. ## ## The CDSware is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## The CDSware is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDSware; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. ## read config variables: #include "config.wml" #include "configbis.wml" ## $Id$ ## DO NOT EDIT THIS FILE! IT WAS AUTOMATICALLY GENERATED FROM CDSware WML SOURCES. - include("/php/cdsware/bibformat/common/global.inc.shtml"); - include("/php/cdsware/errors/errorHandling.shtml"); - include("/sessinit.inc.shtml"); + include("/php/cdsware/bibformat/common/global.inc.php"); + include("/php/cdsware/errors/errorHandling.php"); + include("/sessinit.inc.php"); - define(ERROR, WEBCONF_DIR."/error.inc.shtml"); - define(HEADER, WEBCONF_DIR."/header.inc.shtml"); - define(FOOTER, WEBCONF_DIR."/footer.inc.shtml"); + define(ERROR, WEBCONF_DIR."/error.inc.php"); + define(HEADER, WEBCONF_DIR."/header.inc.php"); + define(FOOTER, WEBCONF_DIR."/footer.inc.php"); ?> diff --git a/modules/bibformat/web/admin/security.inc.shtml.wml b/modules/bibformat/web/admin/security.inc.php.wml similarity index 100% rename from modules/bibformat/web/admin/security.inc.shtml.wml rename to modules/bibformat/web/admin/security.inc.php.wml diff --git a/modules/bibformat/web/admin/test.shtml.wml b/modules/bibformat/web/admin/test.php.wml similarity index 96% rename from modules/bibformat/web/admin/test.shtml.wml rename to modules/bibformat/web/admin/test.php.wml index 65058a45b..39327d742 100644 --- a/modules/bibformat/web/admin/test.shtml.wml +++ b/modules/bibformat/web/admin/test.php.wml @@ -1,189 +1,189 @@ ## $Id$ ## This file is part of the CERN Document Server Software (CDSware). ## Copyright (C) 2002 CERN. ## ## The CDSware is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## The CDSware is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDSware; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. #include "cdspage.wml" \ title="Execution Test" \ navbar_name="admin" \ navbar_select="test" \ cdspageboxlefttopadd=" " ## $Id$ include(DB); $db=mysql_connect( $DB_HOST, $DB_USER, $DB_PASSWD ); mysql_selectdb( $DB_DB ); //---DISPLAY if(!isset($process)) { include(HEADER); $qry="select distinct(type) from flxXMLMARCEXTRULES"; $qh=mysql_query($qry, $db); $itype_opts=""; while($row=mysql_fetch_array($qh)) { $itype_opts.=""; } $qry="select name from flxBEHAVIORS"; $qh=mysql_query($qry, $db); $otype_opts=""; while($row=mysql_fetch_array($qh)) { $otype_opts.=""; } ?>

Enables you to test your formats on your sample data file. Useful when debugging newly created formats.

From this page you'll be able to launch BibFormat over a file which contains bibliographic MARC21 XML


-

+
XML File (URL)
Input Type
Output Type
Print debug information

XML file hasn't been specified"); print ""; mysql_close($db); exit; } if( (!isset($itype)) || (trim($itype)=="") ) { outWarning("The input type hasn't been specified"); print ""; mysql_close($db); exit; } if( (!isset($otype)) || (trim($otype)=="") ) { outWarning("The ouput type hasn't been specified"); print ""; mysql_close($db); exit; } $qry="select type from flxBEHAVIORS where name='$otype'"; $qh=mysql_query($qry, $db); $modeshow="NORMAL"; list($modeshow)=mysql_fetch_array($qh); include_once(MAIN); - include_once(CORE_DIR."Timing.inc.shtml"); + include_once(CORE_DIR."Timing.inc.php"); $timing=new Timing(); $fxk=new FlexElink(); $error=$fxk->initialise("OAIMARC", $file); if($error) { errorpage("Error initialising: $error"); exit; } $code=0; while(1) { $timing->start("TOTAL"); list($code, $res)=$fxk->getRecordResult(array($otype), $debug); $timing->end("TOTAL"); if($code<0) break; if($code==0) { print "ERROR: $res
"; } else { if(isset($debug)&&($modeshow=="NORMAL")) print "
".text2HTML($res)."


"; if($modeshow=="IENRICH") print text2HTML($res)."
"; else print $res."
"; } $timing->debug(); print "

"; } } ?> diff --git a/modules/bibformat/web/bibformat.shtml.wml b/modules/bibformat/web/bibformat.php.wml similarity index 94% rename from modules/bibformat/web/bibformat.shtml.wml rename to modules/bibformat/web/bibformat.php.wml index 4059a81db..37ea98173 100644 --- a/modules/bibformat/web/bibformat.shtml.wml +++ b/modules/bibformat/web/bibformat.php.wml @@ -1,100 +1,100 @@ ## $Id$ ## This file is part of the CERN Document Server Software (CDSware). ## Copyright (C) 2002 CERN. ## ## The CDSware is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## The CDSware is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDSware; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. ## read config variables: #include "config.wml" #include "configbis.wml" ## $Id$ ## DO NOT EDIT THIS FILE! IT WAS AUTOMATICALLY GENERATED FROM CDSware WML SOURCES. - include("/php/cdsware/bibformat/common/global.inc.shtml"); + include("/php/cdsware/bibformat/common/global.inc.php"); include_once(MAIN); - include_once(CORE_DIR."/Timing.inc.shtml"); + include_once(CORE_DIR."/Timing.inc.php"); define(DEFAULT_ITYPE, "DEFAULT"); define(DEFAULT_OTYPE, "FULL"); $itype=DEFAULT_ITYPE; if(!isset($id)) { print "Not id specified!!"; exit; } $id=trim($id); if(isset($otype) && trim($otype)!="") { $otype=strtoupper(trim($otype)); } else { $otype=DEFAULT_OTYPE; } $t=new Timing(); $t->start("TOTAL"); $t->start("GetRecord method"); $file="/search.py?id=$id&of=xm"; $fxk=new FlexElink(); $error=$fxk->initialise("OAIMARC", $file); $t->end("GetRecord method"); if($error) { print "Error initialising: $error"; exit; } $t->start("FlexElink processing"); list($code, $res)=$fxk->getRecordResult(array($otype)); if($code>0) $record=$res; else $err=$res; print eval("?>$recordend("FlexElink processing"); if($err!="") { print "--------------------------------------------------------\n"; print "Errors processing record\n"; print "$err\n"; print "--------------------------------------------------------\n"; } $t->end("TOTAL"); if(isset($timing)) { print $t->debug(); } ?>