org.histpop.ohpr.entities
Class MasterNumber

java.lang.Object
  extended by org.histpop.server.objects.ServerObject
      extended by org.histpop.server.objects.PersistentObject
          extended by org.histpop.ohpr.entities.MasterNumber
All Implemented Interfaces:
ServerObj

public class MasterNumber
extends PersistentObject

Persistent object representing a master number volume item. This object corresponds to a row from the master number database table. Its properties describe an item such as a Census or General Registrar bound volume. The properties are read in from the fields of the SQL table row.


Field Summary
protected static java.util.Hashtable cache
           
static java.lang.String FIELD_ABSTRACT
          SQL field name for the master number abstract
static java.lang.String FIELD_ALT_TITLE
          SQL field name for the alternative (short) title
static java.lang.String FIELD_COMMAND_NO
          SQL field name for the command number
static java.lang.String FIELD_COMMENTS
          SQL field name for the master number volume comments
static java.lang.String FIELD_FIRST_HIT
          SQL field name for the aggregated first hit
static java.lang.String FIELD_FIRST_PAGE_SEQ
          SQL field name for the page sequence of the first page
static java.lang.String FIELD_FULL_TITLE
          SQL field name for the full title
static java.lang.String FIELD_GEOGRAPHY
          SQL field name for the geography
static java.lang.String FIELD_GEOGRAPHY_CODE
          SQL field name for the geography codes
static java.lang.String FIELD_GROUP_END_YEAR
          SQL field name for the end of the year range
static java.lang.String FIELD_GROUP_START_YEAR
          SQL field name for the start of the year range
static java.lang.String FIELD_INCLUDING_DOC_TITLE
          SQL field name for the aggregated property 'including_doc_title'
static java.lang.String FIELD_ITEM_COUNT
          SQL field name for the items count (an aggregated property for browse tree nodes)
static java.lang.String FIELD_MASTER_NUMBER
          SQL field name for the master number
static java.lang.String FIELD_MNO_SEQUENCE
          SQL field name for the master number default sequence
static java.lang.String FIELD_NO_TOC
          SQL field name for the No ToC flag
static java.lang.String FIELD_PAGE_COUNT
          SQL field name for the pages count (an aggregated property for browse tree nodes)
static java.lang.String FIELD_PAGES_COUNT
          SQL field name for the aggregated pages count
static java.lang.String FIELD_PP_YEAR
          SQL field name for the PP year
static java.lang.String FIELD_QUALITY
          SQL field name for the master number quality comments
static java.lang.String FIELD_RELEVANCE_END_YEAR
          SQL field name for the end of the year range
static java.lang.String FIELD_RELEVANCE_START_YEAR
          SQL field name for the start of the year range
static java.lang.String FIELD_RESOURCE_CODE
          SQL field name for the resource code
static java.lang.String FIELD_RESOURCE_CODE_SORT
          SQL field name for the resource code sort order
static java.lang.String FIELD_RESOURCE_SORT
          SQL field name for the resource sort attribute
static java.lang.String FIELD_RESOURCE_TYPE
          SQL field name for the resource type
static java.lang.String FIELD_TITLES_COUNT
          SQL field name for the aggregated titles count
static java.lang.String FIELD_VOLUME
          SQL field name for the volume
static java.lang.String FIELD_YEAR_RANGE
          SQL field name for the year range.
static java.lang.String ORDER_EXPR_1
          One of the possible SQL order clauses: resource-type, date, geography
static java.lang.String ORDER_EXPR_2
          One of the possible SQL order clauses: resource-type, geography, date
static java.lang.String ORDER_EXPR_3
          One of the possible SQL order clauses: geography, resource-type, date
static java.lang.String RESOURCE_CODE_ESSAYS
          The resource code for Essays
static java.lang.String RESOURCE_CODE_LEGISLATION
          The resource code for Legislation
static java.lang.String RESOURCE_CODE_LEGISLATION_CENSUS
          The resource code for Legislation( Census )
static java.lang.String RESOURCE_CODE_LEGISLATION_REGISTRATION
          The resource code for Legislation( Registration )
static java.lang.String RESOURCE_CODE_TNA
          The resource code for The National Archives
static java.lang.String type
           
 
Fields inherited from class org.histpop.server.objects.ServerObject
ID, methods, OBJECT, properties
 
Constructor Summary
MasterNumber()
           
MasterNumber(java.lang.String id)
           
 
Method Summary
static Bag browseQuery(java.lang.String queryTemplate)
          Perform a DB query returning a collection of persistent objects needed for constructing a browse tree.
static void clearCache()
           
static MasterNumber findTitle(java.lang.Integer mno)
          Find a persistent object for a given master number.
static java.util.Hashtable getCache()
           
 java.lang.String getType()
           
static Bag searchQuery(java.lang.String[] searchExpr, java.lang.String filterExpr, java.lang.String order)
          Perform a DB query returning a collection of persistent objects needed for constructing a browse tree for the search results.
 void setType(java.lang.String type)
           
static Bag titlesQuery(java.lang.String condition, java.lang.String order)
          Perform a DB query returning a collection of persistent objects needed for displaying the master number volume titles.
static Bag titlesQuery2(java.lang.String[] searchExpr, java.lang.String filterExpr, java.lang.String order)
          Perform a DB query returning a collection of persistent objects needed for listing the search result titles.
 
Methods inherited from class org.histpop.server.objects.PersistentObject
delete, destroy, filter, getBooleanProperty, getFieldList, getID, getIntegerProperty, getPrimaryKey, getPropertyNames, getRepository, getRepository, getStatements, init, insert, list, load, save, setPrimaryKey, setRepository, Update
 
Methods inherited from class org.histpop.server.objects.ServerObject
addMethod, getMethod, getMethodList, getProperties, getProperty, init, isReadOnly, setID, setProperties, setProperty, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

type

public static java.lang.String type

cache

protected static java.util.Hashtable cache

FIELD_MASTER_NUMBER

public static final java.lang.String FIELD_MASTER_NUMBER
SQL field name for the master number

See Also:
Constant Field Values

FIELD_FULL_TITLE

public static final java.lang.String FIELD_FULL_TITLE
SQL field name for the full title

See Also:
Constant Field Values

FIELD_TITLES_COUNT

public static final java.lang.String FIELD_TITLES_COUNT
SQL field name for the aggregated titles count

See Also:
Constant Field Values

FIELD_PAGES_COUNT

public static final java.lang.String FIELD_PAGES_COUNT
SQL field name for the aggregated pages count

See Also:
Constant Field Values

FIELD_FIRST_HIT

public static final java.lang.String FIELD_FIRST_HIT
SQL field name for the aggregated first hit

See Also:
Constant Field Values

FIELD_RESOURCE_TYPE

public static final java.lang.String FIELD_RESOURCE_TYPE
SQL field name for the resource type

See Also:
Constant Field Values

FIELD_RESOURCE_CODE

public static final java.lang.String FIELD_RESOURCE_CODE
SQL field name for the resource code

See Also:
Constant Field Values

FIELD_RESOURCE_SORT

public static final java.lang.String FIELD_RESOURCE_SORT
SQL field name for the resource sort attribute

See Also:
Constant Field Values

FIELD_RESOURCE_CODE_SORT

public static final java.lang.String FIELD_RESOURCE_CODE_SORT
SQL field name for the resource code sort order

See Also:
Constant Field Values

FIELD_YEAR_RANGE

public static final java.lang.String FIELD_YEAR_RANGE
SQL field name for the year range. This field is not in the database, but is aggregated from the other two fields FIELD_GROUP_START_YEAR and FIELD_GROUP_END_YEAR

See Also:
Constant Field Values

FIELD_GROUP_START_YEAR

public static final java.lang.String FIELD_GROUP_START_YEAR
SQL field name for the start of the year range

See Also:
Constant Field Values

FIELD_GROUP_END_YEAR

public static final java.lang.String FIELD_GROUP_END_YEAR
SQL field name for the end of the year range

See Also:
Constant Field Values

FIELD_RELEVANCE_START_YEAR

public static final java.lang.String FIELD_RELEVANCE_START_YEAR
SQL field name for the start of the year range

See Also:
Constant Field Values

FIELD_RELEVANCE_END_YEAR

public static final java.lang.String FIELD_RELEVANCE_END_YEAR
SQL field name for the end of the year range

See Also:
Constant Field Values

FIELD_GEOGRAPHY

public static final java.lang.String FIELD_GEOGRAPHY
SQL field name for the geography

See Also:
Constant Field Values

FIELD_GEOGRAPHY_CODE

public static final java.lang.String FIELD_GEOGRAPHY_CODE
SQL field name for the geography codes

See Also:
Constant Field Values

FIELD_MNO_SEQUENCE

public static final java.lang.String FIELD_MNO_SEQUENCE
SQL field name for the master number default sequence

See Also:
Constant Field Values

FIELD_ABSTRACT

public static final java.lang.String FIELD_ABSTRACT
SQL field name for the master number abstract

See Also:
Constant Field Values

FIELD_ALT_TITLE

public static final java.lang.String FIELD_ALT_TITLE
SQL field name for the alternative (short) title

See Also:
Constant Field Values

FIELD_VOLUME

public static final java.lang.String FIELD_VOLUME
SQL field name for the volume

See Also:
Constant Field Values

FIELD_COMMAND_NO

public static final java.lang.String FIELD_COMMAND_NO
SQL field name for the command number

See Also:
Constant Field Values

FIELD_PP_YEAR

public static final java.lang.String FIELD_PP_YEAR
SQL field name for the PP year

See Also:
Constant Field Values

FIELD_ITEM_COUNT

public static final java.lang.String FIELD_ITEM_COUNT
SQL field name for the items count (an aggregated property for browse tree nodes)

See Also:
Constant Field Values

FIELD_PAGE_COUNT

public static final java.lang.String FIELD_PAGE_COUNT
SQL field name for the pages count (an aggregated property for browse tree nodes)

See Also:
Constant Field Values

FIELD_INCLUDING_DOC_TITLE

public static final java.lang.String FIELD_INCLUDING_DOC_TITLE
SQL field name for the aggregated property 'including_doc_title'

See Also:
Constant Field Values

FIELD_FIRST_PAGE_SEQ

public static final java.lang.String FIELD_FIRST_PAGE_SEQ
SQL field name for the page sequence of the first page

See Also:
Constant Field Values

FIELD_NO_TOC

public static final java.lang.String FIELD_NO_TOC
SQL field name for the No ToC flag

See Also:
Constant Field Values

FIELD_COMMENTS

public static final java.lang.String FIELD_COMMENTS
SQL field name for the master number volume comments

See Also:
Constant Field Values

FIELD_QUALITY

public static final java.lang.String FIELD_QUALITY
SQL field name for the master number quality comments

See Also:
Constant Field Values

ORDER_EXPR_1

public static final java.lang.String ORDER_EXPR_1
One of the possible SQL order clauses: resource-type, date, geography

See Also:
Constant Field Values

ORDER_EXPR_2

public static final java.lang.String ORDER_EXPR_2
One of the possible SQL order clauses: resource-type, geography, date

See Also:
Constant Field Values

ORDER_EXPR_3

public static final java.lang.String ORDER_EXPR_3
One of the possible SQL order clauses: geography, resource-type, date

See Also:
Constant Field Values

RESOURCE_CODE_ESSAYS

public static final java.lang.String RESOURCE_CODE_ESSAYS
The resource code for Essays

See Also:
Constant Field Values

RESOURCE_CODE_LEGISLATION

public static final java.lang.String RESOURCE_CODE_LEGISLATION
The resource code for Legislation

See Also:
Constant Field Values

RESOURCE_CODE_LEGISLATION_CENSUS

public static final java.lang.String RESOURCE_CODE_LEGISLATION_CENSUS
The resource code for Legislation( Census )

See Also:
Constant Field Values

RESOURCE_CODE_LEGISLATION_REGISTRATION

public static final java.lang.String RESOURCE_CODE_LEGISLATION_REGISTRATION
The resource code for Legislation( Registration )

See Also:
Constant Field Values

RESOURCE_CODE_TNA

public static final java.lang.String RESOURCE_CODE_TNA
The resource code for The National Archives

See Also:
Constant Field Values
Constructor Detail

MasterNumber

public MasterNumber()

MasterNumber

public MasterNumber(java.lang.String id)
Method Detail

setType

public void setType(java.lang.String type)
Overrides:
setType in class ServerObject

getType

public java.lang.String getType()
Overrides:
getType in class ServerObject

getCache

public static java.util.Hashtable getCache()

clearCache

public static void clearCache()

browseQuery

public static Bag browseQuery(java.lang.String queryTemplate)
                       throws ServerException
Perform a DB query returning a collection of persistent objects needed for constructing a browse tree. The results of the query are used to create a part of the overall navigational browse tree. Each persistent object returned represents a group of titles, and its properties only consist of the fields defining the group.

Parameters:
queryTemplate - The name of a pre-defined SQL query template.
Returns:
A collection of persistent objects.
Throws:
ServerException

titlesQuery

public static Bag titlesQuery(java.lang.String condition,
                              java.lang.String order)
                       throws ServerException
Perform a DB query returning a collection of persistent objects needed for displaying the master number volume titles.

Parameters:
condition - . The SQL condition built from filters and search terms.
order - A comma-separated list of SQL field names by which to order the results.
Returns:
A collection of persistent objects.
Throws:
ServerException

searchQuery

public static Bag searchQuery(java.lang.String[] searchExpr,
                              java.lang.String filterExpr,
                              java.lang.String order)
                       throws ServerException
Perform a DB query returning a collection of persistent objects needed for constructing a browse tree for the search results. The results of the query are used to create a part of the overall navigational browse tree. Each persistent object returned represents a group of titles, and its properties only consist of the fields defining the group.

Parameters:
searchExpr - The SQL condition built from the search terms.
filterExpr - The SQL condition built from the submitted resource types, geographies and dates.
order - A comma-separated list of SQL field names by which to order the results.
Returns:
A collection of persistent objects.
Throws:
ServerException

titlesQuery2

public static Bag titlesQuery2(java.lang.String[] searchExpr,
                               java.lang.String filterExpr,
                               java.lang.String order)
                        throws ServerException
Perform a DB query returning a collection of persistent objects needed for listing the search result titles.

Parameters:
searchExpr - The SQL condition built from the search terms.
filterExpr - The SQL condition built from the submitted resource types, geographies and dates.
order - A comma-separated list of SQL field names by which to order the results.
Returns:
A collection of persistent objects.
Throws:
ServerException

findTitle

public static MasterNumber findTitle(java.lang.Integer mno)
                              throws ServerException
Find a persistent object for a given master number.

Throws:
ServerException