mysql
Class ProposalSql

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by mysql.AbstractSql
                  extended by mysql.ProposalSql
All Implemented Interfaces:
Cloneable, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying

public class ProposalSql
extends AbstractSql

A class that allows access to a database containing the propsals to stella observations as handed over by the user. It links observing programs to users.

   CREATE TABLE "proposal" (
   propid   | character varying(255) | not null
   pi       | character varying(255) |
   title    | character varying(255) |
   abstract | text                   |
   expire   | interval               |
   
In this setup, the columns have the following meanings:


Nested Class Summary
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private static String DEFABSTRACTFIELD
          The key to the object name in the database.
private static String DEFEXPIREFIELD
          The key to the object name in the database.
private static String DEFPIFIELD
          The key to the object name in the database.
private static String DEFPROPIDFIELD
          The key to the object name in the database.
private static int DEFPROPRIETY
          The key to the default propriety period if none given.
private static String DEFTABLE
          The default table name.
private static String DEFTIMEUNIT
          The key to the propriety period time unit .
private static String DEFTITLEFIELD
          The key to the object name in the database.
static String KEY_ABSTRACTFIELD
          The key to the object name in the database.
static String KEY_EXPIREFIELD
          The key to the object name in the database.
static String KEY_PIFIELD
          The key to the object name in the database.
static String KEY_PROPIDFIELD
          The key to the object name in the database.
static String KEY_PROPRIETY
          The key to the default propriety period if none given.
static String KEY_TIMEUNIT
          The key to the propriety period time unit .
static String KEY_TITLEFIELD
          The key to the object name in the database.
 
Fields inherited from class mysql.AbstractSql
KEY_TABLE
 
Fields inherited from class util.PropertyBundles
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES
 
Fields inherited from class util.PropertyResources
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR
 
Fields inherited from interface util.ResourceSupplying
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Fields inherited from interface util.PropertySupplying
CONFIG, KEY_CLASS
 
Constructor Summary
ProposalSql(Map<String,String> prop)
          Constructs a new proposal sql.
 
Method Summary
 boolean addProposal(String id, String user, String title, String abstr)
          Adds a new proposal with a unique ID to the db.
 boolean addProposal(String id, String user, String title, String abstr, int period)
          Adds a new proposal with a unique ID to the db.
 Map<String,Object> getProposal(String propid)
          Returns the mapping of field names to db entries for the given proposal or null if no such entry exists.
 
Methods inherited from class mysql.AbstractSql
getPassword, getTable, getUserName, init, isEntry
 
Methods inherited from class util.PropertyBundles
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource
 
Methods inherited from class util.PropertyResources
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, keyCreate, keyCreate, reload, setApplet
 
Methods inherited from class util.PropertyContainer
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface util.ResourceSupplying
getResource, getResourceAsStream, getResources
 
Methods inherited from interface util.PropertySupplying
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties
 

Field Detail

KEY_PROPIDFIELD

public static final String KEY_PROPIDFIELD
The key to the object name in the database.

See Also:
Constant Field Values

KEY_PIFIELD

public static final String KEY_PIFIELD
The key to the object name in the database.

See Also:
Constant Field Values

KEY_TITLEFIELD

public static final String KEY_TITLEFIELD
The key to the object name in the database.

See Also:
Constant Field Values

KEY_ABSTRACTFIELD

public static final String KEY_ABSTRACTFIELD
The key to the object name in the database.

See Also:
Constant Field Values

KEY_EXPIREFIELD

public static final String KEY_EXPIREFIELD
The key to the object name in the database.

See Also:
Constant Field Values

KEY_PROPRIETY

public static final String KEY_PROPRIETY
The key to the default propriety period if none given.

See Also:
Constant Field Values

KEY_TIMEUNIT

public static final String KEY_TIMEUNIT
The key to the propriety period time unit .

See Also:
Constant Field Values

DEFTABLE

private static final String DEFTABLE
The default table name.

See Also:
Constant Field Values

DEFPROPIDFIELD

private static final String DEFPROPIDFIELD
The key to the object name in the database.

See Also:
Constant Field Values

DEFPIFIELD

private static final String DEFPIFIELD
The key to the object name in the database.

See Also:
Constant Field Values

DEFTITLEFIELD

private static final String DEFTITLEFIELD
The key to the object name in the database.

See Also:
Constant Field Values

DEFABSTRACTFIELD

private static final String DEFABSTRACTFIELD
The key to the object name in the database.

See Also:
Constant Field Values

DEFEXPIREFIELD

private static final String DEFEXPIREFIELD
The key to the object name in the database.

See Also:
Constant Field Values

DEFPROPRIETY

private static final int DEFPROPRIETY
The key to the default propriety period if none given.

See Also:
Constant Field Values

DEFTIMEUNIT

private static final String DEFTIMEUNIT
The key to the propriety period time unit .

See Also:
Constant Field Values
Constructor Detail

ProposalSql

public ProposalSql(Map<String,String> prop)
Constructs a new proposal sql.

Method Detail

getProposal

public Map<String,Object> getProposal(String propid)
Returns the mapping of field names to db entries for the given proposal or null if no such entry exists.


addProposal

public boolean addProposal(String id,
                           String user,
                           String title,
                           String abstr)
Adds a new proposal with a unique ID to the db.


addProposal

public boolean addProposal(String id,
                           String user,
                           String title,
                           String abstr,
                           int period)
Adds a new proposal with a unique ID to the db. Propriety period is in #KEY_TIMEUNITS, normally years.