From: <rd...@us...> - 2008-05-12 19:06:24
|
Revision: 681 http://digir.svn.sourceforge.net/digir/?rev=681&view=rev Author: rdg Date: 2008-05-12 12:05:48 -0700 (Mon, 12 May 2008) Log Message: ----------- New script to return response structure treeview in HTML. Added Paths: ----------- tapirbuilder/trunk/www/getstructure.php Added: tapirbuilder/trunk/www/getstructure.php =================================================================== --- tapirbuilder/trunk/www/getstructure.php (rev 0) +++ tapirbuilder/trunk/www/getstructure.php 2008-05-12 19:05:48 UTC (rev 681) @@ -0,0 +1,87 @@ +<?php + +require_once('../lib/TpToolUtils.php'); +require_once('../lib/TpTool_globals.php'); +require_once('../lib/TpToolSchemaTreeBrowser.php'); + +// "loc" parameter (CNS location) is mandatory +if ( ! isset( $_REQUEST['loc'] ) ) +{ + echo("<br/>Error loading response structure: Missing response structure location parameter (loc)\n"); + exit; +} + +// "loc" parameter must be a URL +if ( ! TpToolUtils::IsURL( $_REQUEST['loc'] ) ) +{ + echo("<br/>Error loading response structure: Response structure location must be a valid URL\n"); + exit; +} + +// load response structure +$SchemaTreeObj = new TpToolSchemaTreeBrowser( $_REQUEST['loc'] ); + +// parse and return a tree view representation in HTML +$SchemaTreeObj->parseFullSchemaArray(); + +try +{ + //beware: HTTP variables use the attribute "name" of a control to get input values, not "id" + print("<br/><form id=\"FormOutputXML\" action=\"".FILE_FOR_QUERY_TEMPLATE_GENERATION_PHP."?typeMapping=outputmodel\" method=\"post\" target=\"_blank\">\n"); + print("<table>"); + print("<tr>\n"); + print("<td>\n"); + //HTTP variable for the label of an OutputModel is not handled by "TpToolSchemaTreeBrowser.php" directly + // so it must be created in this script + print("Enter name (label value) for your TAPIR output model:"); + print("</td>\n"); + print("<td>\n"); + print("<input type=\"text\" id=\"".OUTPUT_MODEL_LABEL_HTML."\" name=\"".OUTPUT_MODEL_LABEL_HTML."\" size=\"75\" />\n"); + print("</td>\n"); + print("</tr>\n"); + print("<tr>\n"); + print("<td>\n"); + //HTTP variable for the description of an OutputModel is not handled by "TpToolSchemaTreeBrowser.php" + // so it must be created in this script + print("Enter description of your TAPIR output model:\n"); + print("</td>\n"); + print("<td>\n"); + print("<textarea id=\"".OUTPUT_MODEL_DESCRIPTION_HTML."\" name=\"".OUTPUT_MODEL_DESCRIPTION_HTML."\" rows=\"5\" cols=\"75\"></textarea>\n"); + print("</td>\n"); + print("</tr>\n"); + print("<tr>\n"); + //HTTP variable for the automapping is not handled by "TpToolSchemaTreeBrowser.php" + // so it must be created in this script + print("<td>\n"); + print("Auto-mapping (when checked)/<br/>Manual mapping (when unchecked)\n"); + print("</td>\n"); + print("<td>\n"); + print(TpToolSchemaTreeBrowser::checkBoxForAutoMapping(AUTO_MAPPING_HTML, "onclick=\"switchListVisibility('DIVExplicitMapping');\"")); + print("</td>\n"); + print("</tr>\n"); + print("</table>\n"); + //this function displays the treeview + print("<div id=\"DIVExplicitMapping\" style=\"display: block\">\n"); + print("<p>"); + print("The tree structure belows displays the concept of the response structure in a hierarchical way.<br/>\n"); + print("Use the \"Submit new mapping\" and \"Delete last mapped concept button\" to define the mapping between CNS concept and Response Structure Concepts/TAPIR variables/Literals.\n"); + print("</p>"); + print("<table style=\"border-style: solid;\">\n"); + print("<tr>\n"); + print("<td>\n"); + print("Click on \"Submit new mapping\" to add a concept to the Output Model (you can concatenate mappings).<br/>\n"); + print("Click on \"Delete last mapped concept new mapping\" to remove a concept from the Output Model.<br/>\n"); + print($SchemaTreeObj->PrintHtmlTreeWithIDArray("navigation")); + print("</td>\n"); + print("</tr>\n"); + print("</table>\n"); + print("</div>"); + print("<br/><input type=\"submit\" value=\"Display XML\" />\n"); + print("<br/></form><br/>\n"); +} +catch ( Exception $e ) +{ + echo("<br/>Error loading response structure: ".$e->GetError()."\n"); +} + +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |