[MOBY-guts] biomoby commit

michael ng mng at pub.open-bio.org
Fri Aug 5 20:32:44 UTC 2005


mng
Fri Aug  5 16:32:43 EDT 2005
Update of /home/repository/moby/moby-live/Accessories
In directory pub.open-bio.org:/tmp/cvs-serv12830

Modified Files:
	code-generator0.6.cgi 
Log Message:
code-generator0.6 with data confirmation page

moby-live/Accessories code-generator0.6.cgi,1.1,1.2
===================================================================
RCS file: /home/repository/moby/moby-live/Accessories/code-generator0.6.cgi,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Accessories/code-generator0.6.cgi	2005/07/29 20:06:37	1.1
+++ /home/repository/moby/moby-live/Accessories/code-generator0.6.cgi	2005/08/05 20:32:43	1.2
@@ -7,7 +7,6 @@
 #
 #********************************************************************************
 
-
 use strict;
 use LWP::UserAgent;
 use LWP::Simple;
@@ -27,12 +26,8 @@
 my @InParam;
 
 #Different forms that will be displayed
-if ( $query->param("Webservice Properties"))
-{
-    print $query->header();
-    webservice_properties();
-}
-elsif ( $query->param("Submit") )
+
+if ( $query->param("Submit") )
 {
     print $query->header();
     validate_form();
@@ -77,40 +72,15 @@
     print $query->header();
     deregister_service();
 }
-elsif ( $query->param("MapHTMLinput") )
-{
-    print $query->header();
-    MapHTMLinput();
-}
-elsif ( $query->param("MapHTMLinput2") )
-{
-    print $query->header();
-    MapHTMLinput2();
-}
-elsif ( $query->param("mapSQLinput") )
-{
-    print $query->header();
-    mapSQLinput();
-}
-elsif ( $query->param("mapSQLfields") )
-{
-    print $query->header();
-    mapSQLfields();
-}
-elsif ( $query->param("MapCOMinput") )
-{
-    print $query->header();
-    MapCOMinput();
-}
-elsif ( $query->param("MapCOMoutput") )
+elsif ( $query->param("Confirm Page") )
 {
     print $query->header();
-    MapCOMoutput();
+    Confirm_Page();
 }
 else
 {
     print $query->header();
-    welcome_form();
+    webservice_properties();
 }
 
 #********************************************************************************
@@ -150,34 +120,6 @@
 JAVA_SCRIPT
 }
 
-#***********************************************************************
-#
-#          This is just a Welcome page where users will learn about the program and how to interact with it
-#
-#***********************************************************************
-sub welcome_form
-{
-print <<HTML_FORM;
-    <html>
-	<head>
-	<title>MOBY-S Web Service Auto-Generator</title>
-	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-	</head>
-
-	<body>
-	<div align="center">
-	<p><font size="+3"><strong>MOBY-S Web Service Auto-Generator Form</strong></font></p>
-	<p>&nbsp;</p>
-	This service (wizard) is provided by BIOMOBY and the purpose of this service is to help you generate webservices with only a few steps and as least programming as possible!. :)<br>
-Click on the next button to continue
-<form method="get" action="/cgi-bin/code-generator0.6.cgi">
-<input type="submit" name="Webservice Properties" value="Next">
-</form>
-HTML_FORM
-
-
-}
-
 #**********************************************************************
 #
 #           DISPLAYS THE FORM WHERE USER ENTERS INFORMATION ON THE SERVICE
@@ -188,7 +130,7 @@
           my $Central = MOBY::Client::Central->new(Registries => {mobycentral => {
                                  URL => 'http://mobycentral.icapture.ubc.ca/cgi-bin/MOBY05/mobycentral.pl',
                                  URI => 'http://mobycentral.icapture.ubc.ca/MOBY/Central/'}}
-						   );
+					   );
 
           #We grab retrieve parameters passed into it if there is an error.
 	  my $error_msg = shift;
@@ -262,7 +204,6 @@
 	      $objectConsumed_html .= ">$objectConsumed_options</option>";
 	  }
 	  
-	  
 	  #Build drop down list for object produced
 	  my $objectProduced_html = "";
 	  
@@ -466,51 +407,27 @@
 
     my $form = $query->param("properties");
 
+    my $serviceType = $query->param("serviceType");
+    my $objectConsumed = $query->param("objectConsumed");
+    my $objectProduced = $query->param("objectProduced");
+    my $nameSpace = $query->param("nameSpace");
+    my $outnameSpace = $query->param("outnameSpace");	
+    my $serviceName = $query->param("serviceName");
+    my $authURI = $query->param("authURI");
+    my $sqlORalgor_rad = $query->param("sqlORalgor_rad");
+    my $contactEmail = $query->param("contactEmail");
+    my $description = $query->param("description");
+    my $directory = $query->param("directory");
+    my $genORcom = $query->param("genORcom");
+    my $simORcollInput = $query->param("simORcollInput");
+    my $simORcollOutput = $query->param("simORcollOutput");
+    my $parse_html = "";
+
+
     #CHECK WEBSERVICE PROPERTIES
     if ( $form eq "Webservice Properties")
     {
-	my $serviceType = $query->param("serviceType");
-	my $objectConsumed = $query->param("objectConsumed");
-	my $objectProduced = $query->param("objectProduced");
-	my $nameSpace = $query->param("nameSpace");
-	my $outnameSpace = $query->param("outnameSpace");	
-	my $serviceName = $query->param("serviceName");
-	my $authURI = $query->param("authURI");
-	my $sqlORalgor_rad = $query->param("sqlORalgor_rad");
-	my $contactEmail = $query->param("contactEmail");
-	my $description = $query->param("description");
-	my $directory = $query->param("directory");
-	my $genORcom = $query->param("genORcom");
-	my $simORcollInput = $query->param("simORcollInput");
-	my $simORcollOutput = $query->param("simORcollOutput");
-
-    #HTML HIDDEN INPUTS WHEN CHECKING WEBSERVICE PROPERTIES
-	print <<HTML;
-	<html>
-	    <body>
-	    <form method="post" action="/cgi-bin/code-generator0.6.cgi">
-
-	    <input type="hidden" name="serviceType" value="$serviceType">
-	    <input type="hidden" name="objectConsumed" value="$objectConsumed">
-	    <input type="hidden" name="objectProduced" value="$objectProduced">
-	    <input type="hidden" name="nameSpace" value="$nameSpace">
-	    <input type="hidden" name="outnameSpace" value="$outnameSpace">
-	    <input type="hidden" name="serviceName" value="$serviceName">
-	    <input type="hidden" name="authURI" value="$authURI">
-	    <input type="hidden" name="sqlORalgor_rad" value="$sqlORalgor_rad">
-	    <input type="hidden" name="contactEmail" value="$contactEmail">
-	    <input type="hidden" name="description" value="$description">
-	    <input type="hidden" name="directory" value="$directory">
-	    <input type="hidden" name="genORcom" value="$genORcom">
-	    <input type="hidden" name="simORcollInput" value="$simORcollInput">
-	    <input type="hidden" name="simORcollOutput" value="$simORcollOutput">
-
-	    </form>
-	    </body>
-	    </html>
-HTML
-
-my $error_msg = "";
+	my $error_msg = "";
 	$error_msg .= "Please select a service type<br>" if ($serviceType eq 'Please select a Service Type');
 	$error_msg .= "Please select an object consumed<br>" if ($objectConsumed eq 'Please select an Object');
 	$error_msg .= "Please select Generic or Complex<br>" if (!$genORcom);
@@ -539,6 +456,7 @@
 	}
 
     }
+
     #CHECK DBCCESS PROPERTIES
     elsif ( $form eq "DBAccess Properties")
     {    
@@ -550,47 +468,10 @@
 	my $password1 = $query->param("password1");
 	my $password2 = $query->param("password2");
 	my $prefixed = $query->param("prefixed");
-
-	my $sqlStatement = $query->param("sqlStatement");
-
-	#WE ALSO NEED TO CONTINUE PASSING THE OTHER VARIABLES
-	my $serviceType = $query->param("serviceType");
-	my $objectConsumed = $query->param("objectConsumed");
-	my $objectProduced = $query->param("objectProduced");
-	my $nameSpace = $query->param("nameSpace");
-	my $outnameSpace = $query->param("outnameSpace");
-	my $serviceName = $query->param("serviceName");
-	my $authURI = $query->param("authURI");
-	my $sqlORalgor_rad = $query->param("sqlORalgor_rad");
-	my $contactEmail = $query->param("contactEmail");
-	my $description = $query->param("description");
-	my $directory = $query->param("directory");
-	my $genORcom = $query->param("genORcom");
-	my $simORcollInput = $query->param("simORcollInput");
-	my $simORcollOutput = $query->param("simORcollOutput");
 	my $InputParam = $query->param("InputParam");
+	my $sqlStatement = $query->param("sqlStatement");
 
-    #HTML HIDDEN INPUTS WHEN CHECKING DBACCESS PROPERTIES
-    print <<HTML;
-	<html>
-	    <body>
-	    <form method="get" action="/cgi-bin/code-generator0.6.cgi">
-	    <input type="hidden" name="serviceType" value="$serviceType">
-	    <input type="hidden" name="objectConsumed" value="$objectConsumed">
-	    <input type="hidden" name="objectProduced" value="$objectProduced">
-	    <input type="hidden" name="nameSpace" value="$nameSpace">
-	    <input type="hidden" name="outnameSpace" value="$outnameSpace">
-	    <input type="hidden" name="serviceName" value="$serviceName">
-	    <input type="hidden" name="authURI" value="$authURI">
-	    <input type="hidden" name="sqlORalgor_rad" value="$sqlORalgor_rad">
-	    <input type="hidden" name="contactEmail" value="$contactEmail">
-	    <input type="hidden" name="description" value="$description">
-	    <input type="hidden" name="directory" value="$directory">
-	    <input type="hidden" name="genORcom" value="$genORcom">
-	    <input type="hidden" name="simORcollInput" value="$simORcollInput">
-	    <input type="hidden" name="simORcollOutput" value="$simORcollOutput">
-
-	    <input type="hidden" name="dbType" value="$dbType">
+	$parse_html .= qq{<input type="hidden" name="dbType" value="$dbType">
 	    <input type="hidden" name="dbInstance" value="$dbInstance">
 	    <input type="hidden" name="host_port" value="$host_port">
 	    <input type="hidden" name="username" value="$username">
@@ -598,14 +479,9 @@
 	    <input type="hidden" name="password2" value="$password2">
 	    <input type="hidden" name="prefixed" value="$prefixed">
 	    <input type="hidden" name="sqlStatment" value="$sqlStatement">
-	    <input type="hidden" name="InputParam" value="$InputParam">
-	    </form>
-	    </body>
-	    </html>
-HTML
-
-my $error_msg_sql = "";
+	    <input type="hidden" name="InputParam" value="$InputParam">};
 
+	my $error_msg_sql = "";
 	$error_msg_sql .= "Please provide a database type<br>" if (!$dbType && ($sqlORalgor_rad eq 'sql'));
 	$error_msg_sql .= "Please provide a database instance<br>" if (!$dbInstance && ($sqlORalgor_rad eq 'sql'));
 	$error_msg_sql .= "Please provide a host and port number<br>" if (!$host_port && ($sqlORalgor_rad eq 'sql'));
@@ -633,51 +509,10 @@
     #CHECK Algorithm PROPERTIES
     elsif ( $form eq "Algorithm Properties")
     {
-	my $serviceType = $query->param("serviceType");
-	my $objectConsumed = $query->param("objectConsumed");
-	my $objectProduced = $query->param("objectProduced");
-	my $nameSpace = $query->param("nameSpace");
-	my $serviceName = $query->param("serviceName");
-	my $authURI = $query->param("authURI");
-	my $sqlORalgor_rad = $query->param("sqlORalgor_rad");
-	my $contactEmail = $query->param("contactEmail");
-	my $description = $query->param("description");
-	my $directory = $query->param("directory");
-	my $genORcom = $query->param("genORcom");
-	my $simORcollInput = $query->param("simORcollInput");
-	my $simORcollOutput = $query->param("simORcollOutput");
         my $htmlORcom = $query->param("htmlORcom");
-	my $outnameSpace = $query->param("outnameSpace");
-
-
-    #HTML HIDDEN INPUTS WHEN CHECKING WEBSERVICE PROPERTIES
-	print <<HTML;
-	<html>
-	    <body>
-	    <form method="post" action="/cgi-bin/code-generator0.6.cgi">
-
-	    <input type="hidden" name="serviceType" value="$serviceType">
-	    <input type="hidden" name="objectConsumed" value="$objectConsumed">
-	    <input type="hidden" name="objectProduced" value="$objectProduced">
-	    <input type="hidden" name="nameSpace" value="$nameSpace">
-	    <input type="hidden" name="serviceName" value="$serviceName">
-	    <input type="hidden" name="authURI" value="$authURI">
-	    <input type="hidden" name="sqlORalgor_rad" value="$sqlORalgor_rad">
-	    <input type="hidden" name="contactEmail" value="$contactEmail">
-	    <input type="hidden" name="description" value="$description">
-	    <input type="hidden" name="directory" value="$directory">
-	    <input type="hidden" name="genORcom" value="$genORcom">
-	    <input type="hidden" name="simORcollInput" value="$simORcollInput">
-	    <input type="hidden" name="simORcollOutput" value="$simORcollOutput">
-	    <input type="hidden" name="htmlORcom" value="$htmlORcom">
-	    <input type="hidden" name="outnameSpace" value="$outnameSpace">
-	    </form>
-	    </body>
-	    </html>
-HTML
-
-my $error_msg = "";
+	$parse_html .= qq{<input type="hidden" name="htmlORcom" value="$htmlORcom">};
 
+	my $error_msg = "";
 	$error_msg .= "Please select using a Command Line Algorithm or a HTML Wrapper algorithm<br>" if (!$htmlORcom);
 
 	if ( $error_msg )
@@ -685,69 +520,33 @@
 	    #Returns users to original form
 	    algorithm_properties($error_msg);
 	}
-	elsif ($htmlORcom eq "htmlWrapper")
-	{
-	    HTMLWrapper_properties();
-	}
 	else
 	{
-	    CommandLine_properties();
+	    HTMLWrapper_properties();
 	}
 
     }
 
-
+    #CHECK HTML Wrapper PROPERTIES
     elsif ( $form eq "HTML Wrapper Properties")
     {
-	my $serviceType = $query->param("serviceType");
-	my $objectConsumed = $query->param("objectConsumed");
-	my $objectProduced = $query->param("objectProduced");
-	my $nameSpace = $query->param("nameSpace");
-	my $serviceName = $query->param("serviceName");
-	my $authURI = $query->param("authURI");
-	my $sqlORalgor_rad = $query->param("sqlORalgor_rad");
-	my $contactEmail = $query->param("contactEmail");
-	my $description = $query->param("description");
-	my $directory = $query->param("directory");
-	my $genORcom = $query->param("genORcom");
-	my $simORcollInput = $query->param("simORcollInput");
-	my $simORcollOutput = $query->param("simORcollOutput");
-        my $htmlORcom = $query->param("htmlORcom");
+	my $htmlORcom = $query->param("htmlORcom");
         my $ServiceURL = $query->param("ServiceURL");
         my $InputParam = $query->param("InputParam");
-	my $outnameSpace = $query->param("outnameSpace");
-
-    #HTML HIDDEN INPUTS WHEN CHECKING WEBSERVICE PROPERTIES
-	print <<HTML;
-	<html>
-	    <body>
-	    <form method="post" action="/cgi-bin/code-generator0.6.cgi">
 
-	    <input type="hidden" name="serviceType" value="$serviceType">
-	    <input type="hidden" name="objectConsumed" value="$objectConsumed">
-	    <input type="hidden" name="objectProduced" value="$objectProduced">
-	    <input type="hidden" name="nameSpace" value="$nameSpace">
-	    <input type="hidden" name="serviceName" value="$serviceName">
-	    <input type="hidden" name="authURI" value="$authURI">
-	    <input type="hidden" name="sqlORalgor_rad" value="$sqlORalgor_rad">
-	    <input type="hidden" name="contactEmail" value="$contactEmail">
-	    <input type="hidden" name="description" value="$description">
-	    <input type="hidden" name="directory" value="$directory">
-	    <input type="hidden" name="genORcom" value="$genORcom">
-	    <input type="hidden" name="simORcollInput" value="$simORcollInput">
-	    <input type="hidden" name="simORcollOutput" value="$simORcollOutput">
-	    <input type="hidden" name="htmlORcom" value="$htmlORcom">
+	$parse_html .= qq{<input type="hidden" name="htmlORcom" value="$htmlORcom">
 	    <input type="hidden" name="ServiceURL" value="$ServiceURL">
-	    <input type="hidden" name="InputParam" value="$InputParam">
-	    <input type="hidden" name="outnameSpace" value="$outnameSpace">
-	    </form>
-	    </body>
-	    </html>
-HTML
+	    <input type="hidden" name="InputParam" value="$InputParam">};
 
-my $error_msg = "";
+	my $error_msg = "";
+	
+	if($htmlORcom eq "htmlWrapper"){
+	    $error_msg .= "Please provide the Service URL<br>" if (!$ServiceURL);
+	}
+	else{
+	    $error_msg .= "Please provide the Command Line<br>" if (!$ServiceURL);
+	}
 
-	$error_msg .= "Please provide the Service URL<br>" if (!$ServiceURL);
 	$error_msg .= "Please Specify the number of Input parameters<br>" if (!$InputParam);
 
 	if ( $error_msg )
@@ -761,32 +560,19 @@
 	}
 
     }
+
+    #CHECK Algorithm Input Mapping  PROPERTIES
     elsif ( $form eq "MapHTMLinput")
     {
-	my $serviceType = $query->param("serviceType");
-	my $objectConsumed = $query->param("objectConsumed");
-	my $objectProduced = $query->param("objectProduced");
-	my $nameSpace = $query->param("nameSpace");
-	my $serviceName = $query->param("serviceName");
-	my $authURI = $query->param("authURI");
-	my $sqlORalgor_rad = $query->param("sqlORalgor_rad");
-	my $contactEmail = $query->param("contactEmail");
-	my $description = $query->param("description");
-	my $directory = $query->param("directory");
-	my $genORcom = $query->param("genORcom");
-	my $simORcollInput = $query->param("simORcollInput");
-	my $simORcollOutput = $query->param("simORcollOutput");
         my $htmlORcom = $query->param("htmlORcom");
         my $ServiceURL = $query->param("ServiceURL");
         my $InputParam = $query->param("InputParam");
-	my $outnameSpace = $query->param("outnameSpace");
+	my $comline = $query->param("comline");
 
 	my $error_msg = "";
        	my $temp="";
 	my $temp2="";
 
-	my $parse_html="";
-
 	for(my $s=0; $s<$InputParam;$s++){
 	$temp = $query->param("InputParam$s");
 	$temp2 = $query->param("inputobject_articles$s");
@@ -797,37 +583,10 @@
 	$error_msg .= "Please provide the name for Parameter $s <br>" if (!$temp);
     }
 
-
-
-    #HTML HIDDEN INPUTS WHEN CHECKING WEBSERVICE PROPERTIES
-	print <<HTML;
-	<html>
-	    <body>
-	    <form method="post" action="/cgi-bin/code-generator0.6.cgi">
-
-	    <input type="hidden" name="serviceType" value="$serviceType">
-	    <input type="hidden" name="objectConsumed" value="$objectConsumed">
-	    <input type="hidden" name="objectProduced" value="$objectProduced">
-	    <input type="hidden" name="nameSpace" value="$nameSpace">
-	    <input type="hidden" name="serviceName" value="$serviceName">
-	    <input type="hidden" name="authURI" value="$authURI">
-	    <input type="hidden" name="sqlORalgor_rad" value="$sqlORalgor_rad">
-	    <input type="hidden" name="contactEmail" value="$contactEmail">
-	    <input type="hidden" name="description" value="$description">
-	    <input type="hidden" name="directory" value="$directory">
-	    <input type="hidden" name="genORcom" value="$genORcom">
-	    <input type="hidden" name="simORcollInput" value="$simORcollInput">
-	    <input type="hidden" name="simORcollOutput" value="$simORcollOutput">
-	    <input type="hidden" name="htmlORcom" value="$htmlORcom">
+	$parse_html .= qq{<input type="hidden" name="htmlORcom" value="$htmlORcom">
 	    <input type="hidden" name="ServiceURL" value="$ServiceURL">
 	    <input type="hidden" name="InputParam" value="$InputParam">
-	    <input type="hidden" name="outnameSpace" value="$outnameSpace">
-	    $parse_html
-	    </form>
-	    </body>
-	    </html>
-HTML
-
+	    <input type="hidden" name="comline" value="$comline">	};
 
 	if ( $error_msg )
 	{
@@ -837,44 +596,37 @@
 
 	else
 	{
-	    MapHTMLinput2();
+	    if ($htmlORcom eq "htmlWrapper"){
+		MapHTMLinput2();
+	    }
+	    else{
+		MapHTMLoutput();
+	    }
 	}
 
     }
 
     elsif ( $form eq "MapHTMLinput2")
     {
-	my $serviceType = $query->param("serviceType");
-	my $objectConsumed = $query->param("objectConsumed");
-	my $objectProduced = $query->param("objectProduced");
-	my $nameSpace = $query->param("nameSpace");
-	my $serviceName = $query->param("serviceName");
-	my $authURI = $query->param("authURI");
-	my $sqlORalgor_rad = $query->param("sqlORalgor_rad");
-	my $contactEmail = $query->param("contactEmail");
-	my $description = $query->param("description");
-	my $directory = $query->param("directory");
-	my $genORcom = $query->param("genORcom");
-	my $simORcollInput = $query->param("simORcollInput");
-	my $simORcollOutput = $query->param("simORcollOutput");
-        my $htmlORcom = $query->param("htmlORcom");
+	my $htmlORcom = $query->param("htmlORcom");
         my $ServiceURL = $query->param("ServiceURL");
         my $InputParam = $query->param("InputParam");
-	my $outnameSpace = $query->param("outnameSpace");
 	my $DV_count = $query->param("DV_count"); 
 	my $error_msg = "";
-	
 	my $temp="";
 	my $temp2="";
 	my @DValue=();
-	my $parse_html="";
-
+	
+	$parse_html .= qq{<input type="hidden" name="htmlORcom" value="$htmlORcom">
+	    <input type="hidden" name="ServiceURL" value="$ServiceURL">
+	    <input type="hidden" name="InputParam" value="$InputParam">
+	    <input type="hidden" name="DV_count" value="$DV_count">	    };
+	
 	for(my $s=0; $s<$InputParam;$s++){
 	$temp = $query->param("InputParam$s");
 	$temp2 = $query->param("inputobject_articles$s");
 	$parse_html .= "<input type=\"hidden\" name=\"InputParam$s\" value=\"$temp\">";
 	$parse_html .= "<input type=\"hidden\" name=\"inputobject_articles$s\" value=\"$temp2\">";
-	
     }
 
 	for(my $i=1;$i <= $DV_count;$i++){
@@ -883,124 +635,90 @@
 	    $parse_html .= "<input type=\"hidden\" name=\"DValue$i\" value=\"$temp\">";
 	    $error_msg .= "Please provide the name for Parameter" if (!$temp);
 	}
+	
+	if ( $error_msg )
+	{
+	    #Returns users to original form
+	    MapHTMLinput2(@DValue);
+	}
 
+	else
+	{
+	    MapHTMLoutput();
+	}
 
-    #HTML HIDDEN INPUTS WHEN CHECKING WEBSERVICE PROPERTIES
-	print <<HTML;
-	<html>
-	    <body>
-	    <form method="post" action="/cgi-bin/code-generator0.6.cgi">
-
-	    <input type="hidden" name="serviceType" value="$serviceType">
-	    <input type="hidden" name="objectConsumed" value="$objectConsumed">
-	    <input type="hidden" name="objectProduced" value="$objectProduced">
-	    <input type="hidden" name="nameSpace" value="$nameSpace">
-	    <input type="hidden" name="serviceName" value="$serviceName">
-	    <input type="hidden" name="authURI" value="$authURI">
-	    <input type="hidden" name="sqlORalgor_rad" value="$sqlORalgor_rad">
-	    <input type="hidden" name="contactEmail" value="$contactEmail">
-	    <input type="hidden" name="description" value="$description">
-	    <input type="hidden" name="directory" value="$directory">
-	    <input type="hidden" name="genORcom" value="$genORcom">
-	    <input type="hidden" name="simORcollInput" value="$simORcollInput">
-	    <input type="hidden" name="simORcollOutput" value="$simORcollOutput">
-	    <input type="hidden" name="htmlORcom" value="$htmlORcom">
-	    <input type="hidden" name="ServiceURL" value="$ServiceURL">
-	    <input type="hidden" name="InputParam" value="$InputParam">
-	    <input type="hidden" name="outnameSpace" value="$outnameSpace">
-	    <input type="hidden" name="DV_count" value="$DV_count">
-	    </form>
-	    </body>
-	    </html>
-HTML
-
+    }
 
+    #CHECK SQL Input Mapping  PROPERTIES
+    elsif ( $form eq "mapSQLinput")
+    {
+	my $dbType = $query->param("dbType");
+	my $dbInstance = $query->param("dbInstance");
+	my $host_port = $query->param("host_port");
+	my $username = $query->param("username");
+	my $password1 = $query->param("password1");
+	my $password2 = $query->param("password2");
+	my $prefixed = $query->param("prefixed");
+	my $serviceCode = $query->param("serviceCode");
+	my $InputParam = $query->param("InputParam");
+	
+	my $temp="";
+	my $temp2="";
+	my $error_msg = "";
+	
+	for(my $s=0; $s<$InputParam;$s++){
+	    $temp = $query->param("InputParam$s");
+	    $temp2 = $query->param("inputobject_articles$s");
+	    push(@InParam,$temp);
+	    $parse_html .= "<input type=\"hidden\" name=\"InputParam$s\" value=\"$temp\">";
+	    $parse_html .= "<input type=\"hidden\" name=\"inputobject_articles$s\" value=\"$temp2\">";
+	    
+	    $error_msg .= "Please provide the name for variable $s<br> " if (!$temp);
+	}
+	
+	$parse_html .= q{<input type="hidden" name="serviceCode" value="$serviceCode">
+			     <input type="hidden" name="dbType" value="$dbType">
+			     <input type="hidden" name="dbInstance" value="$dbInstance">
+			     <input type="hidden" name="host_port" value="$host_port">
+			     <input type="hidden" name="username" value="$username">
+			     <input type="hidden" name="password1" value="$password1">
+			     <input type="hidden" name="password2" value="$password2">
+			     <input type="hidden" name="prefixed" value="$prefixed">
+			     <input type="hidden" name="InputParam" value="$InputParam">};
+	
 	if ( $error_msg )
 	{
 	    #Returns users to original form
-	    MapHTMLinput2(@DValue);
+	    mapSQLinput($error_msg, at InParam);
 	}
-
 	else
 	{
-	    MapCOMoutput();
+	    mapSQLfields();
 	}
-
+	
     }
 
-    elsif ( $form eq "mapSQLinput")
-    {
-    my $serviceType = $query->param("serviceType");
-    my $objectConsumed = $query->param("objectConsumed");
-    my $objectProduced = $query->param("objectProduced");
-    my $nameSpace = $query->param("nameSpace");
-    my $serviceName = $query->param("serviceName");
-    my $authURI = $query->param("authURI");
-    my $sqlORalgor_rad = $query->param("sqlORalgor_rad");
-    my $contactEmail = $query->param("contactEmail");
-    my $description = $query->param("description");
-    my $directory = $query->param("directory");
-    my $outnameSpace = $query->param("outnameSpace");
-    my $dbType = $query->param("dbType");
-    my $dbInstance = $query->param("dbInstance");
-    my $host_port = $query->param("host_port");
-    my $username = $query->param("username");
-    my $password1 = $query->param("password1");
-    my $password2 = $query->param("password2");
-    my $prefixed = $query->param("prefixed");
-
-    #ADD IN HIDDEN INPUT TYPE IF THIS VARIABLE IS NEEDED
-    #my $perlModules = $query->param("perlModules");
-
-    my $genORcom = $query->param("genORcom");
-    my $simORcollInput = $query->param("simORcollInput");
-    my $simORcollOutput = $query->param("simORcollOutput");
-
+    #CHECK OTHER PROPERTIES
     my $serviceCode = $query->param("serviceCode");
-    my $InputParam = $query->param("InputParam");
-
-    my $temp="";
-    my $temp2="";
-    my $parse_html="";
-    my $error_msg = "";
-
-    for(my $s=0; $s<$InputParam;$s++){
-	$temp = $query->param("InputParam$s");
-	$temp2 = $query->param("inputobject_articles$s");
-	push(@InParam,$temp);
-	$parse_html .= "<input type=\"hidden\" name=\"InputParam$s\" value=\"$temp\">";
-	$parse_html .= "<input type=\"hidden\" name=\"inputobject_articles$s\" value=\"$temp2\">";
-
-	$error_msg .= "Please provide the name for variable $s<br> " if (!$temp);
-	}
-
-
+    my $perlModules = $query->param("perlModules");
 
     #HTML HIDDEN INPUTS WHEN CHECKING WEBSERVICE PROPERTIES
 	print <<HTML;
 	<html>
 	    <body>
 	    <form method="post" action="/cgi-bin/code-generator0.6.cgi">
+
 	    <input type="hidden" name="serviceType" value="$serviceType">
 	    <input type="hidden" name="objectConsumed" value="$objectConsumed">
 	    <input type="hidden" name="objectProduced" value="$objectProduced">
 	    <input type="hidden" name="nameSpace" value="$nameSpace">
+	    <input type="hidden" name="outnameSpace" value="$outnameSpace">
 	    <input type="hidden" name="serviceName" value="$serviceName">
 	    <input type="hidden" name="authURI" value="$authURI">
 	    <input type="hidden" name="sqlORalgor_rad" value="$sqlORalgor_rad">
-	    <input type="hidden" name="serviceCode" value="$serviceCode">
 	    <input type="hidden" name="contactEmail" value="$contactEmail">
 	    <input type="hidden" name="description" value="$description">
 	    <input type="hidden" name="directory" value="$directory">
-	    <input type="hidden" name="dbType" value="$dbType">
-	    <input type="hidden" name="dbInstance" value="$dbInstance">
-	    <input type="hidden" name="host_port" value="$host_port">
-	    <input type="hidden" name="username" value="$username">
-	    <input type="hidden" name="password1" value="$password1">
-	    <input type="hidden" name="password2" value="$password2">
-	    <input type="hidden" name="prefixed" value="$prefixed">
-	    <input type="hidden" name="InputParam" value="$InputParam">
-	    <input type="hidden" name="outnameSpace" value="$outnameSpace">
 	    <input type="hidden" name="genORcom" value="$genORcom">
 	    <input type="hidden" name="simORcollInput" value="$simORcollInput">
 	    <input type="hidden" name="simORcollOutput" value="$simORcollOutput">
@@ -1011,26 +729,6 @@
 HTML
 
 
-	if ( $error_msg )
-	{
-	    #Returns users to original form
-	    mapSQLinput($error_msg, at InParam);
-	}
-
-	else
-	{
-	    mapSQLfields();
-	}
-
-    }
-
-
-    #CHECK OTHER PROPERTIES
-    my $serviceCode = $query->param("serviceCode");
-    my $perlModules = $query->param("perlModules");
-
-
-
 
 }
 
@@ -1071,8 +769,9 @@
     my $simORcollOutput = $query->param("simORcollOutput");
 
     #Build drop down list box for Database types
-    my $dbType_html;
+    my $dbType_html = "";
     my @dbTypes_opts = ("mysql", "oracle", "mssql", "odbc", "sybase", "informix");
+
     foreach my $dbTypes_option (sort(@dbTypes_opts))
     {
 	$dbType_html .= "<option value =\"$dbTypes_option\"";
@@ -1197,7 +896,6 @@
     my $contactEmail = $query->param("contactEmail");
     my $description = $query->param("description");
     my $directory = $query->param("directory");
-
     my $dbType = $query->param("dbType");
     my $dbInstance = $query->param("dbInstance");
     my $host_port = $query->param("host_port");
@@ -1205,10 +903,6 @@
     my $password1 = $query->param("password1");
     my $password2 = $query->param("password2");
     my $prefixed = $query->param("prefixed");
-
-    #ADD IN HIDDEN INPUT TYPE IF THIS VARIABLE IS NEEDED
-    #my $perlModules = $query->param("perlModules");
-
     my $genORcom = $query->param("genORcom");
     my $simORcollInput = $query->param("simORcollInput");
     my $simORcollOutput = $query->param("simORcollOutput");
@@ -1216,9 +910,8 @@
     my $serviceCode = $query->param("serviceCode");
 
     my $parse_html = "";
-
-    my $temp;
-    my $temp2;
+    my $temp="";
+    my $temp2="";
     
     for(my $s=0; $s<$InputParam;$s++){
 	$temp = $query->param("InputParam$s");
@@ -1229,12 +922,7 @@
     }
 
     #We need to get all the columns from the SQL code, and put them in an array.
-    $@ = '';
-#    my @column_opts = eval { parseSQL($serviceCode); }; 
-#    if ($@) { die dbAccess_properties("The SQL Statement you entered was incorrect, please make sure it is correct", $dbType, $dbInstance, $host_port, $username, $password1, $password2, $serviceCode); }
-    
     my @column_opts=outMap($serviceCode);
-    
     my $column_length = @column_opts;
 
     #We need to get the articles from MOBY object, and put them in an array.
@@ -1318,7 +1006,7 @@
 	    </table>
 	    <br>
 	    <hr>
-	    <input type="Submit" name="Generate Dispatcher" value="Next">
+	    <input type="Submit" name="Confirm Page" value="Next">
 	    </form>
 	    </body>
 	    </html>
@@ -1459,11 +1147,11 @@
 
 
     #Used to display html
-    my $SQLmapping_html;
+    my $SQLmapping_html = "";
     my $parse_html = "";
 
-    my $temp;
-    my $temp2;
+    my $temp="";
+    my $temp2="";
     
     for(my $s=0; $s<$InputParam;$s++){
 	$temp = $query->param("InputParam$s");
@@ -1475,28 +1163,10 @@
 
     if($sqlORalgor_rad eq "sql")
     {
-
-	#*****************************************************************************
-	#*
-	#*   This part is used only when the webservice is defined as an SQL service
-	#*
-	#******************************************************************************
-	
-	#Here is the trick on getting the mapping.
-	#We need to get the values of parameters object_articlesX
-	#Since X varies it is not possible to do a multiple query search on it.  So we have to put the parameter values into an array
-	#In order to get the values, we have to use a query->param to get it and put it into the @SQLmapping array
-
-	#Retrieving the parameters and putting it into an array.
-	#This is one way of passing the mapping around
-
 	for(my $s=0; $s<$column_length;$s++){
 		$temp2 = $query->param("outputobject_articles$s");
-	        $SQLmapping_html .= $temp2;
 		$parse_html .= "<input type=\"hidden\" name=\"outputobject_articles$s\" value=\"$temp2\">";
-	    
 	    }
-	#***************************************************************************************
     }
     
     else{
@@ -1508,7 +1178,6 @@
 	}
 	$temp2 = $query->param("outputobject_articles0");
 	$parse_html .= "<input type=\"hidden\" name=\"outputobject_articles0\" value=\"$temp2\">";
-	$error_msg = $temp2;
     }
 
     print <<HTML;
@@ -1561,14 +1230,11 @@
 	    <input type="hidden" name="password1" value="$password1">
 	    <input type="hidden" name="password2" value="$password2">
 	    <input type="hidden" name="prefixed" value="$prefixed">
-
 	    <input type="hidden" name="genORcom" value="$genORcom">
 	    <input type="hidden" name="simORcollInput" value="$simORcollInput">	    
 	    <input type="hidden" name="simORcollOutput" value="$simORcollOutput">
 	    <input type="hidden" name="column_length" value="$column_length">
-	    $SQLmapping_html
 	    $parse_html
-
 	    <input type="hidden" name="htmlORcom" value="$htmlORcom">
 	    <input type="hidden" name="ServiceURL" value="$ServiceURL">
 	    <input type="hidden" name="InputParam" value="$InputParam">
@@ -1628,7 +1294,6 @@
     print $dispatcherCode;
 }
 
-
 #**************************************************************************
 #
 #         THIS FUNCTION DISPLAYS THE CODE GENERATED, ALSO THE MAIN CODE GENERATOR
@@ -1638,7 +1303,6 @@
 #           the rest of the code is kept in an xml called codebook.xml
 #
 #**************************************************************************
-
 sub generate_code
 {
 
@@ -1665,11 +1329,9 @@
 
     #Perl Modules still needs to be implemented.
     my $perlModules = $query->param("perlModules");
-
     my $genORcom = $query->param("genORcom");
     my $simORcollInput = $query->param("simORcollInput");
     my $simORcollOutput = $query->param("simORcollOutput");
-
     my $htmlORcom = $query->param("htmlORcom");
     my $URL = $query->param("URL");
 
@@ -1684,13 +1346,11 @@
     }
 
     #Html Wrapper Properties
-
     my $ServiceURL = $query->param("ServiceURL");
     my $InputParam = $query->param("InputParam");
     my $DV_count = $query->param("DV_count"); 
 
     #Command Line Properties
-
     my $comline = $query->param("comline");
 
 
@@ -1837,7 +1497,6 @@
 		}
 
 	    }
-
 	    
 	    $packages_modules .= $code->get("useSQL");
 	    $dbAccess_prepare = $code->get("dbAccess_prepare", (serviceCode=>$serviceCode));
@@ -1928,10 +1587,8 @@
 		$HTMLWrapper_main = $code->get("HTMLWrapper_main",(MobyObject=>$MobyObject,namespace=>$outnameSpace));
 	    
 	    }
-       
 	
 	    else{
-
 		for(my $s=0; $s<$InputParam;$s++){
 		    $temp = $InParam[$s];
 		    $temp2 = $mapArticles[$s];
@@ -1946,7 +1603,6 @@
 			$DefaultValue .= $code->get("getNodeContent",(InputParam=>"\$$temp",Tag=>$Tag,Article=>$temp2));
 			$comline =~ s/$temp/\$$temp/g;
 		    }
-		    
 		}
 
 		$CommandLine_main = $code->get("CommandLine_main",(comline=>$comline,reader=>'<Reader>',MobyObject=>$MobyObject,namespace=>$outnameSpace ));
@@ -1967,27 +1623,6 @@
 	<input type="hidden" name="URL" value="$URL">
 	<input type="hidden" name="contactEmail" value="$contactEmail">
 	<input type="hidden" name="description" value="$description">
-	
-	<b>FOR DEBUGGIN PURPOSES: <br>
-	Here are the values you have entered:</b> <br>
-	Input count:  $InputParam <br>
-	Service Type: $serviceType <br>
-	Object Consumed: $objectConsumed <br>
-	Generic Or Complex: $genORcom <br>
-	(Input) Simple or Collection: $simORcollInput <br>
-	Object Produced: $objectProduced <br>
-	(Output) Simple or Collection: $simORcollOutput <br>
-      Prefixed: $prefixed <br>
-      Namespace: $outnameSpace <br>
-      Service Name: $serviceName <br>
-      Authority URI: $authURI<br>
-      Dispatcher URL: $URL<br>
-      Contact Email: $contactEmail<br>
-    Description: $description<br>
-    SQL or Algorithm: $htmlORcom<p>
-    <p>
-  Code: $MobyObject
-  <p>
   
   <h1>THE FOLLOWING IS THE PERL MODULE FOR YOUR SERVICE</h1>
   Confirm that the values above and the code below are correct, click on the 'Save Code As' button and save the perl module onto your server. Save the service as XXX.pm (where XXX is your service name).  Place the file in the same folder as the dispatcher.cgi.  Then click on the 'Register' button to register the service.
@@ -2070,9 +1705,6 @@
 
 }
 
-
-
-
 #********************************************************************************
 #
 #                name: getXMLObject
@@ -2178,11 +1810,9 @@
 		}
 	    }
 	}
-
 			    
 	#Returns the whole XML back
 	return ($theNode->toString);
-
 }
 
 #This function saves the webservice code
@@ -2487,8 +2117,7 @@
     my $simORcollInput = $query->param("simORcollInput");
     my $simORcollOutput = $query->param("simORcollOutput");
 
-    my $serviceCode = $query->param("serviceCode");
-
+javascript_functions();
     #Print the HTML form out
     print <<HTML_FORM;
     <html>
@@ -2506,10 +2135,8 @@
 	Once you have finished filling in the form click on the 'Next' button to continue.
 	<p><font color="FF000"> <b>$error_msg</b></font></p>
 	<p align="left">Please fill in the required fields</p>
-
 	<form method="get" action="/cgi-bin/code-generator0.6.cgi">
 	<input type="hidden" name="properties" value="Algorithm Properties">
-
 	<input type="hidden" name="serviceType" value="$serviceType">
 	<input type="hidden" name="objectConsumed" value="$objectConsumed">
 	<input type="hidden" name="objectProduced" value="$objectProduced">
@@ -2539,10 +2166,8 @@
 
 HTML_FORM
 
-
 }
 
-
 #***************************************************************************
 #
 #              THIS FUNCTION DISPLAYS THE ALGORITHM PROPERTIES
@@ -2575,17 +2200,30 @@
     my $outnameSpace = $query->param("outnameSpace");
     my $serviceCode = $query->param("serviceCode");
 
+    my $service_html ="";
+    my $service_html2 ="";
+ 
+   #For the HTML Wrapper, the program will ask user to provide the location of their Service URL
+   #For the Command Line, the program will ask user to provide the command with the variable names in order to execute the program
+   if ($htmlORcom eq "htmlWrapper"){
+	$service_html = "Service URL :";
+    }
+    else{
+	$service_html = "Command Line:";
+	$service_html2 = "<br><font color=\"FF000\">Note: Please provide a name (eg. var1) for each of the mapping variable in the Command</font>";
+    }
+    
     #Print the HTML form out
     print <<HTML_FORM;
     <html>
 	<head>
-	<title>MOBY-S Web Service Auto-Generator - HTML Wrapper Properties</title>
+	<title>MOBY-S Web Service Auto-Generator - Command Line / HTML Wrapper Properties</title>
 	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 	</head>
 
 	<body>
 	<div align="center">
-	<p><font size="+3"><strong>HTML Wrapper Properties</strong></font></p>
+	<p><font size="+3"><strong>Command Line / HTML Wrapper Properties</strong></font></p>
 	<p>&nbsp;</p>
 	
 	Since you have selected an HTML Wrapper Algorithm. Please provide the following information:.<br>
@@ -2595,7 +2233,6 @@
 
 	<form method="get" action="/cgi-bin/code-generator0.6.cgi">
 	<input type="hidden" name="properties" value="HTML Wrapper Properties">
-
 	<input type="hidden" name="serviceType" value="$serviceType">
 	<input type="hidden" name="objectConsumed" value="$objectConsumed">
 	<input type="hidden" name="objectProduced" value="$objectProduced">
@@ -2611,10 +2248,9 @@
 	<input type="hidden" name="simORcollInput" value="$simORcollInput">
 	<input type="hidden" name="simORcollOutput" value="$simORcollOutput">
         <input type="hidden" name="htmlORcom" value="$htmlORcom">
-
 	<table width="75%" border="1">
 	<tr>
-	<td width="40%" height="28">Service URL: </td>
+	<td width="40%" height="28">$service_html </td>
 	<td width="60%">http://<input type="text" name="ServiceURL" id="ServiceURL" value="$ServiceURL"><A HREF="javascript:openHelp('simple')">[?]</A></td></tr>
 	<tr>
         <td width="40%" height="28">Number of Input Parameters: </td>
@@ -2626,15 +2262,14 @@
 	<td><div align="center"><input type="submit" name="Submit" value="Next"></div></td>
 	</tr>
 	</table>
+	$service_html2
 	</form>
 	</body>
 	</html>
 
 HTML_FORM
 
-
 }
-
 #***********************************************************************************************************
 #
 #             HTML WRAPPER INPUT MAPPING FUNCTION 
@@ -2649,8 +2284,7 @@
 {
     my $error_msg = shift;
     my @InParam = shift;
- 
- 
+  
     #WE ALSO NEED TO CONTINUE PASSING THE OTHER VARIABLES
     my $serviceType = $query->param("serviceType");
     my $objectConsumed = $query->param("objectConsumed");
@@ -2670,14 +2304,10 @@
     my $InputParam = $query->param("InputParam");
     my $outnameSpace = $query->param("outnameSpace");
     my $serviceCode = $query->param("serviceCode");
+    my $comline = $ServiceURL;
 
-    # check the Service URL prefix, if it isn't prefixed With (http://) , then prefix it for the purposes of the html call
-    unless ($ServiceURL =~/^http:\/\//){  
-        $ServiceURL = "http://$ServiceURL"; 
-    } 
     
     #Displaying the different input text boxes for user to type the names of parameters
-    #Displaying the different input text boxes for user to type the names of parameters
 
     my @object_articles_opts = mygetArticles($objectConsumed);
     my $articles_length = @object_articles_opts;
@@ -2703,18 +2333,33 @@
                 <td><select name=\"inputobject_articles$i\" id=\"inputobject_articles$i\">". $object_articles_html . "</select></td>
 </tr>";
    }
- 
+   
+    my $service_html ="";
+    if ($htmlORcom eq "htmlWrapper"){
+	# check the Service URL prefix, if it isn't prefixed With (http://) , then prefix it for the purposes of the html call
+	unless ($ServiceURL =~/^http:\/\//){  
+	    $ServiceURL = "http://$ServiceURL"; 
+	} 
+	
+	$service_html = qq{<p>Service URL: $ServiceURL</p>};
+    }
+    
+    else{
+	$service_html = qq{<p>Command Line: $comline</p>};
+    }
+    
+    
     #Print the HTML form out
     print <<HTML_FORM;
     <html>
 	<head>
-	<title>MOBY-S Web Service Auto-Generator - HTML Input Mapping</title>
+	<title>MOBY-S Web Service Auto-Generator - HTML/Command Line Input Mapping</title>
 	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 	</head>
 
 	<body>
 	<div align="center">
-	<p><font size="+3"><strong>HTML Input Mapping</strong></font></p>
+	<p><font size="+3"><strong>HTML/Command Line Input Mapping</strong></font></p>
 	<p>&nbsp;</p>
 	Please specify the names of the input Parameters:.<br>
 	Once you have finished filling in the form click on the 'Next' button to continue.
@@ -2738,8 +2383,9 @@
         <input type="hidden" name="ServiceURL" value="$ServiceURL">
 	<input type="hidden" name="InputParam" value="$InputParam">
 	<input type="hidden" name="outnameSpace" value="$outnameSpace">
+	<input type="hidden" name="comline" value="$comline">
 	<br>You have entered:
-	<p>Service URL: $ServiceURL</p>
+	$service_html
 	<p align="left">Please fill in the required fields</p>
 	<table width="75%" border="1">
 	<tr>
@@ -2764,8 +2410,6 @@
 
 }
 
-
-
 #***********************************************************************************************************
 #
 #             HTML WRAPPER INPUT INITIALIZATION 
@@ -2801,10 +2445,9 @@
     my $temp="";
     my $temp2="";
     my $DV_count = 0;
-
     my $parse_html="";
 
-#Display the mapping values from the previous function and Ask for the Default value of the "other" type paramaters from user
+    #Display the mapping values from the previous function and Ask for the Default value of the "other" type paramaters from user
     for(my $s=0; $s<$InputParam;$s++){
 	$temp = $query->param("InputParam$s");
 	$temp2 = $query->param("inputobject_articles$s");
@@ -2958,8 +2601,6 @@
 		}
 	    }
 	}
-	
-      
 }
 #***********************************************************************************************************
 #
@@ -2971,7 +2612,6 @@
 #                 The user will have to associate "X" with "Term" and "Y" with "Definition"
 #
 #************************************************************************************************************
-
 sub mapSQLinput{
 
     my $error_msg = shift;
@@ -2995,14 +2635,9 @@
     my $password1 = $query->param("password1");
     my $password2 = $query->param("password2");
     my $prefixed = $query->param("prefixed");
-
-    #ADD IN HIDDEN INPUT TYPE IF THIS VARIABLE IS NEEDED
-    #my $perlModules = $query->param("perlModules");
-
     my $genORcom = $query->param("genORcom");
     my $simORcollInput = $query->param("simORcollInput");
     my $simORcollOutput = $query->param("simORcollOutput");
-
     my $serviceCode = $query->param("sqlStatement");
     my $InputParam = $query->param("InputParam");
 
@@ -3026,7 +2661,7 @@
     $object_articles_html .= "<option value =\"id\">id</option>";
     $articles_length += 1;
 
-    my $InputParam_html = $objectConsumed;
+    my $InputParam_html = "";
     for(my $i=0; $i<$InputParam;$i++){
 	$InputParam_html .= " <tr><td>Parameters $i:</td>
 		<td><input type=\"text\" name=\"InputParam$i\" id=\"InputParam$i\" value=\"$InParam[$i]\"></A></td>
@@ -3095,7 +2730,6 @@
 	    </html>
 MAP
 
-
 }
 
 #******************************************************************************
@@ -3117,245 +2751,56 @@
     return @list;
 }
 
-sub CommandLine_properties
-{
-
-    my $error_msg = shift;
-    my $comline = shift;
-    my $InputParam = shift;
+#***********************************************************************************************************
+#
+#             HTML WRAPPER OUTPUT MAPPING FUNCTION 
+#              -  description:  THIS FUNCTION asks users to map the output to an Object Articles
+#                 eg. MobyObject: GO_Term, GO has String called Term AND has string called Definition
+#                 The user can map the output to one of the "Term", "Definition", or "id"
+#
+#************************************************************************************************************
+sub MapHTMLoutput{
 
-    #WE ALSO NEED TO CONTINUE PASSING THE OTHER VARIABLES
     my $serviceType = $query->param("serviceType");
     my $objectConsumed = $query->param("objectConsumed");
     my $objectProduced = $query->param("objectProduced");
     my $nameSpace = $query->param("nameSpace");
+    my $outnameSpace = $query->param("outnameSpace");
     my $serviceName = $query->param("serviceName");
     my $authURI = $query->param("authURI");
     my $sqlORalgor_rad = $query->param("sqlORalgor_rad");
     my $contactEmail = $query->param("contactEmail");
     my $description = $query->param("description");
     my $directory = $query->param("directory");
+
+    #ADD IN HIDDEN INPUT TYPE IF THIS VARIABLE IS NEEDED
+    #my $perlModules = $query->param("perlModules");
+
     my $genORcom = $query->param("genORcom");
     my $simORcollInput = $query->param("simORcollInput");
     my $simORcollOutput = $query->param("simORcollOutput");
+    my $InputParam = $query->param("InputParam");
     my $htmlORcom = $query->param("htmlORcom");
-    my $outnameSpace = $query->param("outnameSpace");
-    my $serviceCode = $query->param("serviceCode");
+    my $comline = $query->param("comline");
 
-    #Print the HTML form out
-    print <<HTML_FORM;
-    <html>
-	<head>
-	<title>MOBY-S Web Service Auto-Generator - Command Line Properties</title>
-	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-	</head>
+    my $parse_html = "";
+    my $temp;
+    my $temp2;
+    
+    #keep on passing the inout parameters to then next page
+    for(my $s=0; $s<$InputParam;$s++){
+	$temp = $query->param("InputParam$s");
+	$temp2 = $query->param("inputobject_articles$s");
+	$parse_html .= "<input type=\"hidden\" name=\"InputParam$s\" value=\"$temp\">";
+	$parse_html .= "<input type=\"hidden\" name=\"inputobject_articles$s\" value=\"$temp2\">";
+	    
+    }
 
-	<body>
-	<div align="center">
-	<p><font size="+3"><strong>Command Line Properties</strong></font></p>
-	<p>&nbsp;</p>
-	
-	Since you have selected a Command Line Algorithm. Please provide the following information:.<br>
-	Once you have finished filling in the form click on the 'Next' button to continue.
-	<p><font color="FF000"> <b>$error_msg</b></font></p>
-	<p align="left">Please fill in the required fields</p>
+    #addition data passing (Default Values) for the html wrapper
+    if($htmlORcom eq "htmlWrapper"){
 
-	<form method="get" action="/cgi-bin/code-generator0.6.cgi">
-	<input type="hidden" name="properties" value="Command Line Properties">
-
-	<input type="hidden" name="serviceType" value="$serviceType">
-	<input type="hidden" name="objectConsumed" value="$objectConsumed">
-	<input type="hidden" name="objectProduced" value="$objectProduced">
-	<input type="hidden" name="nameSpace" value="$nameSpace">
-	<input type="hidden" name="outnameSpace" value="$outnameSpace">
-	<input type="hidden" name="serviceName" value="$serviceName">
-	<input type="hidden" name="authURI" value="$authURI">
-	<input type="hidden" name="sqlORalgor_rad" value="$sqlORalgor_rad">
-	<input type="hidden" name="contactEmail" value="$contactEmail">
-	<input type="hidden" name="description" value="$description">
-	<input type="hidden" name="directory" value="$directory">
-	<input type="hidden" name="genORcom" value="$genORcom">
-	<input type="hidden" name="simORcollInput" value="$simORcollInput">
-	<input type="hidden" name="simORcollOutput" value="$simORcollOutput">
-        <input type="hidden" name="htmlORcom" value="$htmlORcom">
-
-	<table width="75%" border="1">
-	<tr>
-	<td width="40%" height="28">Command Line: </td>
-	<td width="60%"><input type="text" name="comline" id="comline" value="$comline"><A HREF="javascript:openHelp('simple')">[?]</A></td></tr>
-	<tr>
-        <td width="40%" height="28">Number of Input Parameters: </td>
-        <td width="60%"><input type="text" name="InputParam" id="InputParam" value="$InputParam"><A HREF="javascript:openHelp('simple')">[?]</A></td></tr>
-	<hr>
-	<table width="50%" align="center">
-	<tr>
-	<td><div align="center"><input type="submit" name="MapCOMinput" value="Next"></div></td>
-	<td><div align="center"><input type="reset" name="Reset" value="Start Over"></div></td>
-	</tr>
-	</table>
-	<br><font color="FF000">Note: Please provide a name (eg. var1) for each of the mapping variable in the Command</font>
-	<br>
-	</form>
-	</body>
-	</html>
-
-HTML_FORM
-
-
-}
-
-sub MapCOMinput
-{
-    my $error_msg = shift;
-    my @InParam = shift;
-  
-    #WE ALSO NEED TO CONTINUE PASSING THE OTHER VARIABLES
-    my $serviceType = $query->param("serviceType");
-    my $objectConsumed = $query->param("objectConsumed");
-    my $objectProduced = $query->param("objectProduced");
-    my $nameSpace = $query->param("nameSpace");
-    my $serviceName = $query->param("serviceName");
-    my $authURI = $query->param("authURI");
-    my $sqlORalgor_rad = $query->param("sqlORalgor_rad");
-    my $contactEmail = $query->param("contactEmail");
-    my $description = $query->param("description");
-    my $directory = $query->param("directory");
-    my $genORcom = $query->param("genORcom");
-    my $simORcollInput = $query->param("simORcollInput");
-    my $simORcollOutput = $query->param("simORcollOutput");
-    my $htmlORcom = $query->param("htmlORcom");
-    my $InputParam = $query->param("InputParam");
-    my $outnameSpace = $query->param("outnameSpace");
-    my $comline = $query->param("comline");
-
-    #Displaying the different input text boxes for user to type the names of parameters
-
-    my @object_articles_opts = mygetArticles($objectConsumed);
-    my $articles_length = @object_articles_opts;
-
-    #Displaying the All the field, id and article names, in a selection box in the right column of the table for mapping purpose
-    my $object_articles_html;
-    foreach my $object_article_option (@object_articles_opts)
-    {
-	$object_articles_html .= "<option value =\"$object_article_option\"";
-	$object_articles_html .= ">$object_article_option</option>";
-    }
-   
-    $object_articles_html .= "<option value =\"id\">id</option>";
-    #   If some of the Parameters need Initial/Default Values, eg: number of result per page, select the "other" value
-
-    $object_articles_html .= "<option value =\"other\">other</option>";
-    $articles_length += 2;  
-
-    my $InputParam_html = "";
-    for(my $i=0; $i<$InputParam;$i++){
-	$InputParam_html .= " <tr><td>Parameters $i:</td>
-		<td><input type=\"text\" name=\"InputParam$i\" id=\"InputParam$i\" value=\"$InParam[$i]\"></A></td>
-                <td><select name=\"inputobject_articles$i\" id=\"inputobject_articles$i\">". $object_articles_html . "</select></td>
-</tr>";
-   }
- 
-    #Print the HTML form out
-    print <<HTML_FORM;
-    <html>
-	<head>
-	<title>MOBY-S Web Service Auto-Generator - Command Line Input Mapping</title>
-	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-	</head>
-
-	<body>
-	<div align="center">
-	<p><font size="+3"><strong>Command Line Input Mapping</strong></font></p>
-	<p>&nbsp;</p>
-	Please specify the names of the input Parameters:.<br>
-	Once you have finished filling in the form click on the 'Next' button to continue.
-	<p><font color="FF000"> <b>$error_msg</b></font></p>
-	<form method="get" action="/cgi-bin/code-generator0.6.cgi">
-	<input type="hidden" name="properties" value="MapCOMinput">
-	<input type="hidden" name="serviceType" value="$serviceType">
-	<input type="hidden" name="objectConsumed" value="$objectConsumed">
-	<input type="hidden" name="objectProduced" value="$objectProduced">
-	<input type="hidden" name="nameSpace" value="$nameSpace">
-	<input type="hidden" name="serviceName" value="$serviceName">
-	<input type="hidden" name="authURI" value="$authURI">
-	<input type="hidden" name="sqlORalgor_rad" value="$sqlORalgor_rad">
-	<input type="hidden" name="contactEmail" value="$contactEmail">
-	<input type="hidden" name="description" value="$description">
-	<input type="hidden" name="directory" value="$directory">
-	<input type="hidden" name="genORcom" value="$genORcom">
-	<input type="hidden" name="simORcollInput" value="$simORcollInput">
-	<input type="hidden" name="simORcollOutput" value="$simORcollOutput">
-        <input type="hidden" name="htmlORcom" value="$htmlORcom">
-	<input type="hidden" name="InputParam" value="$InputParam">
-	<input type="hidden" name="comline" value="$comline">
-	<input type="hidden" name="outnameSpace" value="$outnameSpace">
-	<br>You have entered:
-	<p>Command Line: $comline</p>
-	<p align="left">Please fill in the required fields</p>
-	<table width="75%" border="1">
-	<tr>
-	<td></td>
-	<td><div align="center"><b>Input Variable Name</b></div></td>
-	<td><div align="center"><b>Moby Object Article</b></div></td>
-	</tr>
-	$InputParam_html
-	<hr>
-
-	<table width="50%" align="center">
-	<tr>
-	<td><div align="center"><input type="submit" name="MapCOMoutput" value="Next"></div></td>
-	<td><div align="center"><input type="reset" name="Reset" value="Start Over"></div></td>
-	</tr>
-	</table>
-	</form>
-	</body>
-	</html>
-
-HTML_FORM
-
-}
-
-sub MapCOMoutput{
-
-    my $serviceType = $query->param("serviceType");
-    my $objectConsumed = $query->param("objectConsumed");
-    my $objectProduced = $query->param("objectProduced");
-    my $nameSpace = $query->param("nameSpace");
-    my $outnameSpace = $query->param("outnameSpace");
-    my $serviceName = $query->param("serviceName");
-    my $authURI = $query->param("authURI");
-    my $sqlORalgor_rad = $query->param("sqlORalgor_rad");
-    my $contactEmail = $query->param("contactEmail");
-    my $description = $query->param("description");
-    my $directory = $query->param("directory");
-
-    #ADD IN HIDDEN INPUT TYPE IF THIS VARIABLE IS NEEDED
-    #my $perlModules = $query->param("perlModules");
-
-    my $genORcom = $query->param("genORcom");
-    my $simORcollInput = $query->param("simORcollInput");
-    my $simORcollOutput = $query->param("simORcollOutput");
-    my $InputParam = $query->param("InputParam");
-    my $htmlORcom = $query->param("htmlORcom");
-    my $comline = $query->param("comline");
-
-    my $parse_html = "";
-
-    my $temp;
-    my $temp2;
-    
-    for(my $s=0; $s<$InputParam;$s++){
-	$temp = $query->param("InputParam$s");
-	$temp2 = $query->param("inputobject_articles$s");
-	$parse_html .= "<input type=\"hidden\" name=\"InputParam$s\" value=\"$temp\">";
-	$parse_html .= "<input type=\"hidden\" name=\"inputobject_articles$s\" value=\"$temp2\">";
-	    
-    }
-
-    if($htmlORcom eq "htmlWrapper"){
-
-	my $ServiceURL = $query->param("ServiceURL");
-	my $DV_count = $query->param("DV_count"); 
+	my $ServiceURL = $query->param("ServiceURL");
+	my $DV_count = $query->param("DV_count"); 
 
 	$parse_html .= qq{ <input type="hidden" name="ServiceURL" value="$ServiceURL">};
 	$parse_html .= qq{<input type="hidden" name="DV_count" value="$DV_count">};
@@ -3433,10 +2878,230 @@
 	    </table>
 	    <br>
 	    <hr>
-	    <input type="Submit" name="Generate Dispatcher" value="Next">
+	    <input type="Submit" name="Confirm Page" value="Next">
 	    </form>
 	    </body>
 	    </html>
 MAP
 
 }
+
+#***********************************************************************************************************
+#
+#             Confirm Page: List all the data entered by users 
+#              -  description:  THIS FUNCTION allows users to have a look on the data they have entered before 
+#                               the code generation
+#************************************************************************************************************
+sub Confirm_Page{
+
+    #Get the parameters to validate the form
+    my $serviceType = $query->param("serviceType");
+    my $objectConsumed = $query->param("objectConsumed");
+    my $objectProduced = $query->param("objectProduced");
+    my $nameSpace = $query->param("nameSpace");
+    my $serviceName = $query->param("serviceName");
+    my $authURI = $query->param("authURI");
+    my $sqlORalgor_rad = $query->param("sqlORalgor_rad");
+    my $serviceCode = $query->param("serviceCode");
+    my $URL = $query->param("URL");
+    my $contactEmail = $query->param("contactEmail");
+    my $description = $query->param("description");
+    my $directory = $query->param("directory");
+    my $outnameSpace = $query->param("outnameSpace");
+    
+    #DataBase Properties
+    my $dbType = $query->param("dbType");
+    my $dbInstance = $query->param("dbInstance");
+    my $host_port = $query->param("host_port");
+    my $username = $query->param("username");
+    my $password1 = $query->param("password1");
+    my $password2 = $query->param("password2");
+    my $prefixed = $query->param("prefixed");
+    my $perlModules = $query->param("perlModules");
+    my $genORcom = $query->param("genORcom");
+    my $simORcollInput = $query->param("simORcollInput");
+    my $simORcollOutput = $query->param("simORcollOutput");
+    my $column_length = $query->param("column_length");
+
+    #Html Wrapper Properties
+    my $htmlORcom = $query->param("htmlORcom");
+    my $ServiceURL = $query->param("ServiceURL");
+    my $InputParam = $query->param("InputParam");
+    my $DV_count = $query->param("DV_count"); 
+
+    #Command Ling Properties
+    my $comline = $query->param("comline");
+
+    #Used to display html
+    my $Outmapping_html = "<p>This option is not availabe for your service.</p>";
+    my $DV_html =  " <p>This option is not availabe for your service.</p>";
+    my $parse_html = "";
+    my $service_html ="";
+
+    my $temp="";
+    my $temp2="";
+    my @DV_list=();
+    
+    #Print out all the Input Parameters with the associated MOBY Articles
+    my $input_html= "<table width=\"50%\" border=\"1\"><tr><td width=\"40%\" height=\"28\">Number of Input Parameters :</td>
+		<td width=\"60%\">$InputParam</td></tr>";
+
+    for(my $s=0; $s<$InputParam;$s++){
+	$temp = $query->param("InputParam$s");
+	$temp2 = $query->param("inputobject_articles$s");
+	$parse_html .= "<input type=\"hidden\" name=\"InputParam$s\" value=\"$temp\">";
+	$parse_html .= "<input type=\"hidden\" name=\"inputobject_articles$s\" value=\"$temp2\">";
+	
+	if ($temp2 eq "other"){
+	push(@DV_list,$temp);
+    }
+	$input_html .= "<tr><td width=\"40%\" height=\"28\">Input Parameters $temp:</td>
+		<td width=\"60%\">$temp2</td></tr>";
+	
+    }
+    
+    #print out the SQL properties
+    if($sqlORalgor_rad eq "sql")
+    {
+	
+	$service_html = qq{<table width="50%" border="1"><tr><td width="40%" height="28">DataBase Type:</td><td width="60%">$dbType</td></tr>
+			       <tr><td width="40%" height="28">DataBase Instance:</td><td width="60%">$dbInstance</td></tr> 
+			       <tr><td width="40%" height="28">Host Port:</td><td width="60%">$host_port</td></tr>
+			       <tr><td width="40%" height="28">UserName:</td><td width="60%">$username</td></tr>
+			       <tr><td width="40%" height="28">Password 1:</td><td width="60%">$password1</td></tr>
+			       <tr><td width="40%" height="28">Passowrd 2:</td><td width="60%">$password2</td></tr>
+			       <tr><td width="40%" height="28">Namespace Prefixed:</td><td width="60%">$prefixed</td></tr>
+			       <tr><td width="40%" height="28">SQL Query:</td><td width="60%">$serviceCode</td></tr>
+			       </table>};
+
+    #Print out all the Output Columns with the associated MOBY Articles	
+	$Outmapping_html = "<table width=\"50%\" border=\"1\"><tr><td width=\"40%\" height=\"28\">Number of output Column :</td>
+		<td width=\"60%\">$column_length</td></tr>";
+	
+	for(my $s=0; $s<$column_length;$s++){
+	    $temp2 = $query->param("outputobject_articles$s");
+	    $Outmapping_html .= "<tr><td width=\"40%\" height=\"28\">Output Column :</td>
+		<td width=\"60%\">$temp2</td></tr>";
+	    $parse_html .= "<input type=\"hidden\" name=\"outputobject_articles$s\" value=\"$temp2\">";
+	    
+	}
+    }
+    
+    #Print out the Algorithm properties
+    else{
+	
+	#print out the HTMLWrapper Properties
+        if($htmlORcom eq "htmlWrapper"){
+	    
+	    $service_html = qq{<table width="50%" border="1"><tr><td width="40%" height="28">Service URL:</td><td width="60%">$ServiceURL</td></tr></table>};
+	    $DV_html = "<table width=\"50%\" border=\"1\"><tr><td width=\"40%\" height=\"28\">Number of Default Input :</td>
+		<td width=\"60%\">$DV_count</td></tr>";
+	    
+	    #print out the Default Values 
+	    for(my $i=1;$i <= $DV_count;$i++){
+		
+		my $s =$i-1;
+		$temp2 = $query->param("DValue$i");
+		$parse_html .= "<input type=\"hidden\" name=\"DValue$i\" value=\"$temp2\">";
+		
+		$temp = $DV_list[$s];
+	        $DV_html .= "<tr><td width=\"40%\" height=\"28\"> $temp :</td>
+		<td width=\"60%\">$temp2</td></tr>";
+	    }
+	}
+
+	else{
+	    $service_html = qq{<table width="50%" border="1"><tr><td width="40%" height="28">Command Line:</td><td width="60%">$comline</td></tr></table>};
+	}
+	$temp2 = $query->param("outputobject_articles0");
+	$parse_html .= "<input type=\"hidden\" name=\"outputobject_articles0\" value=\"$temp2\">";
+	$Outmapping_html =  "<table width=\"50%\" border=\"1\"><tr><td width=\"40%\" height=\"28\">Output Article :</td>
+		<td width=\"60%\">$temp2</td></tr>";
+    }
+    
+    print <<MAP;
+    <html>
+	<head>
+	<title>MOBY-S Web Service Auto-Generator - Data Confirmation</title>
+	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+	</head>
+	<body>
+	<div align="center">
+	<p><font size="+3"><strong>Data Confirmation
+	<div align="center">
+	</strong></font></p>
+	<p>&nbsp;</p>
+	The following are the values you have entered from the previous steps. If the data is correct, please click "next".<br>
+	If the data is incorrect, please go back the make the change<br>
+	<form method="get" action="/cgi-bin/code-generator0.6.cgi">
+	<input type="hidden" name="properties" value="Confirm Page">
+	<input type="hidden" name="serviceType" value="$serviceType">
+	<input type="hidden" name="objectConsumed" value="$objectConsumed">
+	<input type="hidden" name="objectProduced" value="$objectProduced">
+	<input type="hidden" name="nameSpace" value="$nameSpace">
+	<input type="hidden" name="serviceName" value="$serviceName">
+	<input type="hidden" name="authURI" value="$authURI">
+	<input type="hidden" name="sqlORalgor_rad" value="$sqlORalgor_rad">
+	<input type="hidden" name="outnameSpace" value="$outnameSpace">
+	<input type="hidden" name="serviceCode" value="$serviceCode">
+	<input type="hidden" name="contactEmail" value="$contactEmail">
+	<input type="hidden" name="description" value="$description">
+	<input type="hidden" name="directory" value="$directory">
+	<input type="hidden" name="dbType" value="$dbType">
+	<input type="hidden" name="dbInstance" value="$dbInstance">
+	<input type="hidden" name="host_port" value="$host_port">
+	<input type="hidden" name="username" value="$username">
+	<input type="hidden" name="password1" value="$password1">
+	<input type="hidden" name="password2" value="$password2">
+	<input type="hidden" name="prefixed" value="$prefixed">
+	<input type="hidden" name="genORcom" value="$genORcom">
+	<input type="hidden" name="simORcollInput" value="$simORcollInput">	    
+	<input type="hidden" name="simORcollOutput" value="$simORcollOutput">
+	<input type="hidden" name="column_length" value="$column_length">
+	$parse_html
+	<input type="hidden" name="htmlORcom" value="$htmlORcom">
+	<input type="hidden" name="ServiceURL" value="$ServiceURL">
+	<input type="hidden" name="InputParam" value="$InputParam">
+	<input type="hidden" name="DV_count" value="$DV_count">
+	<input type="hidden" name="comline" value="$comline">
+	<input type="hidden" name="perlModules" value="$perlModules">
+	
+	<div align="left">
+	<h2>General Web Services Data</h2>
+	<p>
+	<table width="50%" border="1"><tr><td width="40%" height="28">Service Name:</td><td width="60%">$serviceName</td></tr>
+	<tr><td width="40%" height="28">Service Type:</td><td width="60%">$serviceType</td></tr>
+	<tr><td width="40%" height="28">Object Consumed:</td><td width="60%">$objectConsumed</td></tr> 
+	<tr><td width="40%" height="28">Input Namespace:</td><td width="60%">$nameSpace</td></tr>
+	<tr><td width="40%" height="28">Simple or Collection (Input):</td><td width="60%">$simORcollInput</td></tr> 
+	<tr><td width="40%" height="28">Object Produced:</td><td width="60%">$objectConsumed</td></tr>
+	<tr><td width="40%" height="28">Output Namespace:</td><td width="60%">$outnameSpace</td></tr>
+	<tr><td width="40%" height="28">Simple or Collection (Output):</td><td width="60%">$simORcollOutput</td></tr> 
+	<tr><td width="40%" height="28">Authority URI:</td><td width="60%">$authURI</td></tr> 
+	<tr><td width="40%" height="28">Contact Email:</td><td width="60%">$contactEmail</td></tr>
+	<tr><td width="40%" height="28">Service Description:</td><td width="60%">$description</td></tr>
+	<tr><td width="40%" height="28">SQL or Algorithm:</td><td width="60%">$htmlORcom</td></tr>
+	</table>
+	<p>
+	
+	<h2>Algorithm / SQL Properties</h2>
+	$service_html
+	<p>
+	
+	<h2>Input Parameter</h2>
+	$input_html</table>
+	<p>
+	
+	<h2>Output Mapping</h2>
+	$Outmapping_html</table>
+	
+	<h2>HTML Wrapper Default Value</h2>
+	$DV_html</table>
+	<p>
+	<input type="Submit" name="Generate Dispatcher" value="Next">
+	</form>
+	</body>
+	</html>
+MAP
+	
+}




More information about the MOBY-guts mailing list