From: pkiddie <pk...@us...> - 2005-07-18 14:32:22
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14455/scripts Modified Files: stackQuestion.php stackXML.php Log Message: Versioning tag to stackQuestion, and hooking up stackXML to documentation Index: stackXML.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackXML.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** stackXML.php 18 Jul 2005 10:53:37 -0000 1.9 --- stackXML.php 18 Jul 2005 14:32:14 -0000 1.10 *************** *** 7,10 **** --- 7,11 ---- * @subpackage Stack */ + //require_once('stackstd.php'); //<PDK> sqlToSchemaMapping array maps basic SQL data types used in STAKCK to their respective XML schema data types *************** *** 242,246 **** function stack_schema_write_metadata($directory) { ! //take the stackQuestion and extract all the current metadata tags, putting them into a schema //file extension .xsd represents schema $schema_file_name='stack_metadata.xsd'; --- 243,247 ---- function stack_schema_write_metadata($directory) { ! //takethe stackQuestion and extract all the current metadata tags, putting them into a schema //file extension .xsd represents schema $schema_file_name='stack_metadata.xsd'; *************** *** 314,326 **** */ function stack_schema_create_metadata() ! { ! global $sqlToSchemaMapping,$stackQuestion; //use definitive stackQuestion data structure ! $xml = ""; ! //print_r($sqlToSchemaMapping); - //print_r($stackQuestion); - //Do not export questionID - internal SQL variable if (array_key_exists('questionID',$stackQuestion)) { --- 315,330 ---- */ function stack_schema_create_metadata() ! { ! global $sqlToSchemaMapping,$stackQuestion; //use definitive stackQuestion data structure ! include('../stackstd.php'); ! // HACK for now. ! $options = stack_options_set(array()); ! $filename = stack_lang_filename($options,'doc/en_doc.php'); //Include documentation to document the tags if it is available ! include($filename); ! ! $xml = ""; //Do not export questionID - internal SQL variable if (array_key_exists('questionID',$stackQuestion)) { *************** *** 335,345 **** foreach($stackQuestion as $arrayKey=>$questionField) //Iterate through sub array of each array object { ! //Array item is metadata ! if ($questionField['type']=='meta') { //Check that a metadata tag has been supplied and do not write out if tag has not been supplied if (empty($questionField['metatag'])) { ! echo'No metadata tag for stackQuestion field: '.$arrayKey.'.<br> As a consequence it has not been written to the XML metadata schema'; } --- 339,349 ---- foreach($stackQuestion as $arrayKey=>$questionField) //Iterate through sub array of each array object { ! //First check there is a type associated with that field and that the stackQuestion field is metadata ! if (!empty($questionField['type']) && ($questionField['type']=='meta')) { //Check that a metadata tag has been supplied and do not write out if tag has not been supplied if (empty($questionField['metatag'])) { ! echo'No metadata tag for stackQuestion field: '.$arrayKey.'<br> As a consequence it has not been written to the XML metadata schema<br>'; } *************** *** 581,585 **** { //Array item is metadata ! if ($questionField['type']=='meta') { //check to see whether an enum type of values needs to be written out --- 585,589 ---- { //Array item is metadata ! if (!empty($questionField['type']) && $questionField['type']=='meta') { //check to see whether an enum type of values needs to be written out Index: stackQuestion.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackQuestion.php,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** stackQuestion.php 18 Jul 2005 10:53:37 -0000 1.27 --- stackQuestion.php 18 Jul 2005 14:32:13 -0000 1.28 *************** *** 257,261 **** $stackQuestion['questionDateLastEdited']['metatag']='Date'; ! //Tags to be added to SQL server //Publisher $stackQuestion['questionPublisher']['type']='meta'; --- 257,261 ---- $stackQuestion['questionDateLastEdited']['metatag']='Date'; ! //<PDK> Metadata added - database updated //Publisher $stackQuestion['questionPublisher']['type']='meta'; *************** *** 350,353 **** --- 350,355 ---- $stackQuestion['questionExcerciseType']['default']='unspecified'; + //Versioning required to check whether schema is up to date + $stackQuestion['version']=1; //////////////////////////////////// |