[Swift-commit] r2719 - SwiftApps/pc3

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Sat Mar 21 07:47:11 CDT 2009


Author: lgadelha
Date: 2009-03-21 07:47:10 -0500 (Sat, 21 Mar 2009)
New Revision: 2719

Added:
   SwiftApps/pc3/CSVRootPathInput.xml
   SwiftApps/pc3/CompactDatabase.sh
   SwiftApps/pc3/CountEntries.sh
   SwiftApps/pc3/CreateEmptyLoadDB.sh
   SwiftApps/pc3/ExtractEntry.sh
   SwiftApps/pc3/JobIDInput.xml
   SwiftApps/pc3/PSLoadExecutable.sh
   SwiftApps/pc3/PSLoadExecutableDB.sh
   SwiftApps/pc3/ParseXMLBooleanValue.sh
   SwiftApps/pc3/Stop.sh
   SwiftApps/pc3/pc3.swift
   SwiftApps/pc3/tc.data.append
Log:


Added: SwiftApps/pc3/CSVRootPathInput.xml
===================================================================
--- SwiftApps/pc3/CSVRootPathInput.xml	                        (rev 0)
+++ SwiftApps/pc3/CSVRootPathInput.xml	2009-03-21 12:47:10 UTC (rev 2719)
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?> 
+<java version="1.6.0_03" class="java.beans.XMLDecoder"> 
+ <string>/home/lgadelha/PC3/SampleData/J062941</string> 
+</java> 


Property changes on: SwiftApps/pc3/CSVRootPathInput.xml
___________________________________________________________________
Name: svn:executable
   + *

Added: SwiftApps/pc3/CompactDatabase.sh
===================================================================
--- SwiftApps/pc3/CompactDatabase.sh	                        (rev 0)
+++ SwiftApps/pc3/CompactDatabase.sh	2009-03-21 12:47:10 UTC (rev 2719)
@@ -0,0 +1,6 @@
+#!/bin/bash
+INPUT=$1
+
+$JAVA_HOME/bin/java -cp "$PC3LIB/Java/bin/info.ipaw.pc3.PSLoadExecutable.jar:$PC3LIB/Java/bin/info.ipaw.pc3.PSLoadWorkflow.jar:$PC3LIB/Java/lib/derby.jar:$PC3LIB/Java/lib/derbyclient.jar:$PC3LIB/Java/lib/derbynet.jar:$PC3LIB/Java/lib/derbyrun.jar:$PC3LIB/Java/lib/derbytools.jar" info.ipaw.pc3.PSLoadExecutable.Execute CompactDatabase -f $INPUT
+
+


Property changes on: SwiftApps/pc3/CompactDatabase.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: SwiftApps/pc3/CountEntries.sh
===================================================================
--- SwiftApps/pc3/CountEntries.sh	                        (rev 0)
+++ SwiftApps/pc3/CountEntries.sh	2009-03-21 12:47:10 UTC (rev 2719)
@@ -0,0 +1,5 @@
+#!/bin/bash
+INPUT=$1
+OUTPUT=$2
+
+xpath -q -e "count(/java/object/void/object)" $INPUT > $OUTPUT


Property changes on: SwiftApps/pc3/CountEntries.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: SwiftApps/pc3/CreateEmptyLoadDB.sh
===================================================================
--- SwiftApps/pc3/CreateEmptyLoadDB.sh	                        (rev 0)
+++ SwiftApps/pc3/CreateEmptyLoadDB.sh	2009-03-21 12:47:10 UTC (rev 2719)
@@ -0,0 +1,6 @@
+#!/bin/bash
+INPUT=$1
+OUTPUT=$2
+
+$JAVA_HOME/bin/java -cp "$PC3LIB/Java/bin/info.ipaw.pc3.PSLoadExecutable.jar:$PC3LIB/Java/bin/info.ipaw.pc3.PSLoadWorkflow.jar:$PC3LIB/Java/lib/derby.jar:$PC3LIB/Java/lib/derbyclient.jar:$PC3LIB/Java/lib/derbynet.jar:$PC3LIB/Java/lib/derbyrun.jar:$PC3LIB/Java/lib/derbytools.jar" info.ipaw.pc3.PSLoadExecutable.Execute CreateEmptyLoadDB -o $OUTPUT -f $INPUT
+


Property changes on: SwiftApps/pc3/CreateEmptyLoadDB.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: SwiftApps/pc3/ExtractEntry.sh
===================================================================
--- SwiftApps/pc3/ExtractEntry.sh	                        (rev 0)
+++ SwiftApps/pc3/ExtractEntry.sh	2009-03-21 12:47:10 UTC (rev 2719)
@@ -0,0 +1,10 @@
+#!/bin/bash
+INPUT=$1
+INTEGER=$2
+OUTPUT=$3
+echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > $OUTPUT 
+echo "<java version=\"1.6.0_12\" class=\"java.beans.XMLDecoder\">" >> $OUTPUT 
+ 
+xpath -q -e "/java/object/void[$INTEGER]/object" $INPUT >> $OUTPUT
+
+echo "</java>" >> $OUTPUT
\ No newline at end of file


Property changes on: SwiftApps/pc3/ExtractEntry.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: SwiftApps/pc3/JobIDInput.xml
===================================================================
--- SwiftApps/pc3/JobIDInput.xml	                        (rev 0)
+++ SwiftApps/pc3/JobIDInput.xml	2009-03-21 12:47:10 UTC (rev 2719)
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?> 
+<java version="1.6.0_03" class="java.beans.XMLDecoder"> 
+ <string>J062941</string> 
+</java>


Property changes on: SwiftApps/pc3/JobIDInput.xml
___________________________________________________________________
Name: svn:executable
   + *

Added: SwiftApps/pc3/PSLoadExecutable.sh
===================================================================
--- SwiftApps/pc3/PSLoadExecutable.sh	                        (rev 0)
+++ SwiftApps/pc3/PSLoadExecutable.sh	2009-03-21 12:47:10 UTC (rev 2719)
@@ -0,0 +1,7 @@
+#!/bin/bash
+INPUT1=$1
+INPUT2=$2
+OUTPUT=$3
+
+$JAVA_HOME/bin/java -cp "$PC3LIB/Java/bin/info.ipaw.pc3.PSLoadExecutable.jar:$PC3LIB/Java/bin/info.ipaw.pc3.PSLoadWorkflow.jar:$PC3LIB/Java/lib/derby.jar:$PC3LIB/Java/lib/derbyclient.jar:$PC3LIB/Java/lib/derbynet.jar:$PC3LIB/Java/lib/derbyrun.jar:$PC3LIB/Java/lib/derbytools.jar" info.ipaw.pc3.PSLoadExecutable.Execute $INPUT2 -o $OUTPUT -f $INPUT1
+


Property changes on: SwiftApps/pc3/PSLoadExecutable.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: SwiftApps/pc3/PSLoadExecutableDB.sh
===================================================================
--- SwiftApps/pc3/PSLoadExecutableDB.sh	                        (rev 0)
+++ SwiftApps/pc3/PSLoadExecutableDB.sh	2009-03-21 12:47:10 UTC (rev 2719)
@@ -0,0 +1,7 @@
+#!/bin/bash
+DB=$1
+INPUT=$2
+SINPUT=$3
+OUTPUT=$4
+
+$JAVA_HOME/bin/java -cp "$PC3LIB/Java/bin/info.ipaw.pc3.PSLoadExecutable.jar:$PC3LIB/Java/bin/info.ipaw.pc3.PSLoadWorkflow.jar:$PC3LIB/Java/lib/derby.jar:$PC3LIB/Java/lib/derbyclient.jar:$PC3LIB/Java/lib/derbynet.jar:$PC3LIB/Java/lib/derbyrun.jar:$PC3LIB/Java/lib/derbytools.jar" info.ipaw.pc3.PSLoadExecutable.Execute $SINPUT -o $OUTPUT -f $DB -f $INPUT 


Property changes on: SwiftApps/pc3/PSLoadExecutableDB.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: SwiftApps/pc3/ParseXMLBooleanValue.sh
===================================================================
--- SwiftApps/pc3/ParseXMLBooleanValue.sh	                        (rev 0)
+++ SwiftApps/pc3/ParseXMLBooleanValue.sh	2009-03-21 12:47:10 UTC (rev 2719)
@@ -0,0 +1,4 @@
+#!/bin/bash
+INPUT=$1
+OUTPUT=$2
+xpath -q -e '/java/boolean/text()' $INPUT > $OUTPUT


Property changes on: SwiftApps/pc3/ParseXMLBooleanValue.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: SwiftApps/pc3/Stop.sh
===================================================================
--- SwiftApps/pc3/Stop.sh	                        (rev 0)
+++ SwiftApps/pc3/Stop.sh	2009-03-21 12:47:10 UTC (rev 2719)
@@ -0,0 +1,2 @@
+#!/bin/bash
+exit 1


Property changes on: SwiftApps/pc3/Stop.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: SwiftApps/pc3/pc3.swift
===================================================================
--- SwiftApps/pc3/pc3.swift	                        (rev 0)
+++ SwiftApps/pc3/pc3.swift	2009-03-21 12:47:10 UTC (rev 2719)
@@ -0,0 +1,191 @@
+type xmlfile;
+type textfile;
+
+(xmlfile output) ps_load_executable(xmlfile input, string s) {
+  app {
+    ps_load_executable_app @input s @output;
+  }
+}
+
+(xmlfile output) ps_load_executable(xmlfile input, string s) {
+  app {
+    ps_load_executable_app @input s @output;
+  }
+}
+
+(textfile output) parse_xml_boolean_value(xmlfile input) {
+  app {
+    parse_xml_boolean_value_app @input @output;
+  }
+}
+
+(boolean output) extract_boolean(xmlfile input) {
+  textfile text_out = parse_xml_boolean_value(input);
+  output = readData(text_out);
+}
+
+(boolean output) ps_load_executable_boolean(xmlfile input, string s) {
+  xmlfile xml_out;
+  xml_out = ps_load_executable(input, s);
+  output = extract_boolean(xml_out);
+}
+
+(boolean output) is_csv_ready_file_exists(xmlfile input) {
+  output = ps_load_executable_boolean(input, "IsCSVReadyFileExists");
+}
+
+(xmlfile output) read_csv_ready_file(xmlfile input) {
+  output = ps_load_executable(input, "ReadCSVReadyFile");
+}
+
+(boolean output) is_match_csv_file_tables(xmlfile input) {
+  output = ps_load_executable_boolean(input, "IsMatchCSVFileTables");
+}
+
+(xmlfile output) create_empty_load_db(xmlfile input) {
+  output = ps_load_executable(input, "CreateEmptyLoadDB");
+}
+
+(textfile output) count_entries(xmlfile input) {
+  app {
+    count_entries_app @input @output;
+  }
+}
+
+(xmlfile output) extract_entry(xmlfile input, int i) {
+  app {
+    extract_entry_app @input i @output;
+  }
+}
+
+(boolean output) is_exists_csv_file(xmlfile input) {
+  output = ps_load_executable_boolean(input, "IsExistsCSVFile");  
+}
+
+(xmlfile output) read_csv_file_column_names(xmlfile input) {
+  output = ps_load_executable(input, "ReadCSVFileColumnNames");
+}
+
+(boolean output) is_match_csv_file_column_names(xmlfile input) {
+  output =  ps_load_executable_boolean(input, "IsMatchCSVFileColumnNames");
+}
+
+(xmlfile output) ps_load_executable_db (xmlfile db, xmlfile input, string s) {
+  app {
+    ps_load_executable_db_app @db @input s @output;
+  }
+}
+
+(boolean output) ps_load_executable_db_boolean(xmlfile db, xmlfile input, string s) {
+  xmlfile xml_out = ps_load_executable_db(db, input, s);
+  output = extract_boolean(xml_out);
+}
+
+(boolean output) load_csv_file_into_table(xmlfile db, xmlfile input) {
+  output = ps_load_executable_db_boolean(db, input, "LoadCSVFileIntoTable");
+}
+
+(boolean output) update_computed_columns(xmlfile db, xmlfile input) {
+  output = ps_load_executable_db_boolean(db, input, "UpdateComputedColumns");
+}
+
+(boolean output) is_match_table_row_count(xmlfile db, xmlfile input) {
+  output = ps_load_executable_db_boolean(db, input, "IsMatchTableRowCount");
+}
+
+(boolean output) is_match_table_column_ranges(xmlfile db, xmlfile input) {
+  output = ps_load_executable_db_boolean(db, input, "IsMatchTableColumnRanges");
+}
+
+compact_database (xmlfile input) {
+  app {
+    compact_database_app @input;
+  }
+}
+
+stop() {
+  app {
+    stop_app;
+  }
+}
+
+xmlfile  csv_root_path_input <"CSVRootPathInput.xml">;
+boolean  is_csv_ready_file_exists_output;
+xmlfile  read_csv_ready_file_output;
+boolean is_match_csv_file_tables_output;
+xmlfile job_id <"JobIDInput.xml">;
+xmlfile create_empty_load_db_output;
+textfile count_entries_output;
+int entries;
+xmlfile split_list_output[];
+
+is_csv_ready_file_exists_output = is_csv_ready_file_exists(csv_root_path_input);
+
+if(is_csv_ready_file_exists_output) {
+  read_csv_ready_file_output = read_csv_ready_file(csv_root_path_input);
+  is_match_csv_file_tables_output = is_match_csv_file_tables(read_csv_ready_file_output);
+  if(is_match_csv_file_tables_output) {
+    create_empty_load_db_output = create_empty_load_db(job_id);
+    count_entries_output = count_entries(read_csv_ready_file_output);
+    entries = readData(count_entries_output);
+    int entries_seq[] = [1:entries];
+    
+    foreach i in entries_seq {
+      split_list_output[i] = extract_entry(read_csv_ready_file_output, i);
+    }    
+    
+    foreach i in entries_seq {
+      
+      boolean is_exists_csv_file_output;
+      xmlfile read_csv_file_column_names_output;
+      boolean is_match_csv_file_column_names_output;
+      boolean load_csv_file_into_table_output;
+      boolean update_computed_columns_output;
+      boolean is_match_table_row_count_output;
+      boolean is_match_table_column_ranges_output;
+     
+      is_exists_csv_file_output = is_exists_csv_file(split_list_output[i]);
+      if(is_exists_csv_file_output) {
+	read_csv_file_column_names_output = read_csv_file_column_names(split_list_output[i]);
+	is_match_csv_file_column_names_output = is_match_csv_file_column_names(read_csv_file_column_names_output);
+	if(is_match_csv_file_column_names_output) {
+	  load_csv_file_into_table_output = load_csv_file_into_table(create_empty_load_db_output, read_csv_file_column_names_output);
+	  if(load_csv_file_into_table_output) {
+	    update_computed_columns_output = update_computed_columns(create_empty_load_db_output, read_csv_file_column_names_output);
+	    if(update_computed_columns_output) {
+	      is_match_table_row_count_output = is_match_table_row_count(create_empty_load_db_output, read_csv_file_column_names_output);
+	      if(is_match_table_row_count_output) {
+		is_match_table_column_ranges_output = is_match_table_column_ranges(create_empty_load_db_output, read_csv_file_column_names_output);
+		if(!is_match_table_column_ranges_output) {
+		  stop();
+		}
+	      }
+	      else {
+		stop();
+	      }
+	    }
+	    else {
+	      stop();
+	    }
+	  }
+	  else {
+	    stop();
+	  }
+	}
+	else {
+	  stop();
+	}
+      }
+      else {
+	stop();
+      }
+    }
+    compact_database(create_empty_load_db_output);
+  }
+  else {
+    stop();
+  }
+}
+else {
+   stop();
+}

Added: SwiftApps/pc3/tc.data.append
===================================================================
--- SwiftApps/pc3/tc.data.append	                        (rev 0)
+++ SwiftApps/pc3/tc.data.append	2009-03-21 12:47:10 UTC (rev 2719)
@@ -0,0 +1,7 @@
+localhost	ps_load_executable_app	PSLoadExecutable.sh	INSTALLED	INTEL32::LINUX
+localhost	ps_load_executable_db_app	PSLoadExecutableDB.sh	INSTALLED	INTEL32::LINUX
+localhost	compact_database_app	CompactDatabase.sh	INSTALLED	INTEL32::LINUX
+localhost	parse_xml_boolean_value_app	ParseXMLBooleanValue.sh	INSTALLED	INTEL32::LINUX
+localhost	count_entries_app	CountEntries.sh	INSTALLED	INTEL32::LINUX
+localhost	extract_entry_app	ExtractEntry.sh	INSTALLED	INTEL32::LINUX
+localhost	stop_app	Stop.sh	INSTALLED	INTEL32::LINUX




More information about the Swift-commit mailing list