admin
Class DBInsert

java.lang.Object
  extended by admin.DBInsert

public class DBInsert
extends java.lang.Object

Class helping the insertion of new workflow data into biowep database Author: Chiara Rasi. chiara.rasi(at)istge.it 04-10-2007


Constructor Summary
DBInsert()
           
 
Method Summary
 boolean checkInDB(java.lang.String query, java.lang.String field)
          Connects to biowep DB, checks if a record is already existing.
 int getId(java.lang.String query, java.lang.String param)
          Connects to biowep DB and returns the id of a record inside its table.
 java.lang.String[] getInputs(java.lang.String toBeSeparated, java.lang.String name, java.lang.String version, java.lang.String req)
          If this workflow's input is in data_input table, just inserts its join in "input" table, otherwise a new input is inserted into "input" table.
 java.lang.String[] insert(java.lang.String query, java.lang.String res1)
          Connects to biowep DB, performs an update on it with the syntax specified in "query".
 java.lang.String[] insertProx(java.lang.String proc, java.lang.String version)
          Inserts new processors into "processors" table.
 java.lang.String replaceSpecials(java.lang.String before)
          replaces all "'" with " ".
 void setDB(java.lang.String params)
          sets up the params required for the DB connection.
 java.lang.String[] updateInputs(java.lang.String toBeSeparated, java.lang.String inid, java.lang.String required, java.lang.String vers)
          If input is in database it is inserted de novo in "data_input", otherwise just "input" table is modified.
 java.lang.String[] updateVersion(java.lang.String filename, java.lang.String newVers, java.lang.String newChange, java.lang.String newAuth)
          Updates a workflow version, setting up new values for version, changes, author.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBInsert

public DBInsert()
Method Detail

setDB

public void setDB(java.lang.String params)
sets up the params required for the DB connection.


insert

public java.lang.String[] insert(java.lang.String query,
                                 java.lang.String res1)
Connects to biowep DB, performs an update on it with the syntax specified in "query". Returns a result, wich is a server path to an icon (res[0]) and a String result (res[1]) of the operation.


checkInDB

public boolean checkInDB(java.lang.String query,
                         java.lang.String field)
Connects to biowep DB, checks if a record is already existing. if "ok" is false record may be added to db.


getId

public int getId(java.lang.String query,
                 java.lang.String param)
Connects to biowep DB and returns the id of a record inside its table.


getInputs

public java.lang.String[] getInputs(java.lang.String toBeSeparated,
                                    java.lang.String name,
                                    java.lang.String version,
                                    java.lang.String req)
If this workflow's input is in data_input table, just inserts its join in "input" table, otherwise a new input is inserted into "input" table.


insertProx

public java.lang.String[] insertProx(java.lang.String proc,
                                     java.lang.String version)
Inserts new processors into "processors" table.


updateVersion

public java.lang.String[] updateVersion(java.lang.String filename,
                                        java.lang.String newVers,
                                        java.lang.String newChange,
                                        java.lang.String newAuth)
Updates a workflow version, setting up new values for version, changes, author.


updateInputs

public java.lang.String[] updateInputs(java.lang.String toBeSeparated,
                                       java.lang.String inid,
                                       java.lang.String required,
                                       java.lang.String vers)
If input is in database it is inserted de novo in "data_input", otherwise just "input" table is modified.


replaceSpecials

public java.lang.String replaceSpecials(java.lang.String before)
replaces all "'" with " ".