com.facetmap.sql
Class ResourceIdHeading

java.lang.Object
  extended by com.facetmap.sql.ResourceIdHeading
All Implemented Interfaces:
Heading, SqlHeading

public class ResourceIdHeading
extends java.lang.Object
implements SqlHeading, Heading


Field Summary
protected  java.lang.String id
           
protected  ResourceIdFacet resourceIdFacet
           
protected  int[] resourceIds
           
protected  java.lang.String title
           
 
Constructor Summary
ResourceIdHeading(java.lang.String id, java.lang.String title, int[] resourceIds, ResourceIdFacet resourceIdFacet)
          This is the preferred method for directly creating a ResourceIdHeading with a set of Resource IDs.
 
Method Summary
 Heading getBackwardHeading()
          See Facet for the definition of a backward heading.
 Facet getFacet()
          Facet to which this Heading belongs.
 java.util.Iterator getForwardHeadings()
          See Facet for the definition of a forward heading.
 java.lang.String getId()
          Unique identifier of a predefined Heading.
 int[] getResourceIds()
           
 java.lang.String getTitle()
          The descriptive name of this Heading, for display to users.
 boolean isRoot()
          Returns true if this Heading is the root, the starting Heading, of its Facet.
 java.lang.String sqlFilterClause(java.util.Properties properties)
          Return a WHERE clause (without the "WHERE" or "AND" string) that selects resources in this heading.
 void sqlMap(java.sql.Connection connection, SqlResource resource)
          Create the SQL representation of the mapping between a Resource and this Heading.
 void sqlUnmap(java.sql.Connection connection, SqlResource resource)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resourceIds

protected int[] resourceIds

id

protected java.lang.String id

title

protected java.lang.String title

resourceIdFacet

protected ResourceIdFacet resourceIdFacet
Constructor Detail

ResourceIdHeading

public ResourceIdHeading(java.lang.String id,
                         java.lang.String title,
                         int[] resourceIds,
                         ResourceIdFacet resourceIdFacet)
This is the preferred method for directly creating a ResourceIdHeading with a set of Resource IDs. The result can then be passed into a getSelection() method; the returned Selection will contain only Resources whose IDs are listed in the ResourceIdHeading.

A ResourceIdHeading created with a null or empty resourceId array is equivalent to the facet's root heading (i.e. equivalent to resourceIdFacet.getRootHeading() ).

Method Detail

getResourceIds

public int[] getResourceIds()

sqlFilterClause

public java.lang.String sqlFilterClause(java.util.Properties properties)
Description copied from interface: SqlHeading
Return a WHERE clause (without the "WHERE" or "AND" string) that selects resources in this heading. vendor argument specifies the vendor dialect of SQL to return, and can be ignored for vanilla SQL.

Method may also return null, to indicate no filtering should be done (i.e. this heading selects all resources).

Default is to filter nothing (i.e. select everything).

Specified by:
sqlFilterClause in interface SqlHeading

sqlMap

public void sqlMap(java.sql.Connection connection,
                   SqlResource resource)
            throws java.sql.SQLException
Description copied from interface: SqlHeading
Create the SQL representation of the mapping between a Resource and this Heading. REVISIT argument list.

Specified by:
sqlMap in interface SqlHeading
Throws:
java.sql.SQLException

sqlUnmap

public void sqlUnmap(java.sql.Connection connection,
                     SqlResource resource)
              throws java.sql.SQLException
Specified by:
sqlUnmap in interface SqlHeading
Throws:
java.sql.SQLException

getBackwardHeading

public Heading getBackwardHeading()
Description copied from interface: Heading
See Facet for the definition of a backward heading. This method returns null if the Heading has no backward heading.

Specified by:
getBackwardHeading in interface Heading

getFacet

public Facet getFacet()
Description copied from interface: Heading
Facet to which this Heading belongs. A Heading must belong to a Facet.

Specified by:
getFacet in interface Heading

getForwardHeadings

public java.util.Iterator getForwardHeadings()
Description copied from interface: Heading
See Facet for the definition of a forward heading. This method returns an empty Iterator if the Heading has no forward headings.

Specified by:
getForwardHeadings in interface Heading

getId

public java.lang.String getId()
Description copied from interface: Heading
Unique identifier of a predefined Heading. This can be null if the Heading is not explicitly defined as an input to the Facetmap engine.

Specified by:
getId in interface Heading

getTitle

public java.lang.String getTitle()
Description copied from interface: Heading
The descriptive name of this Heading, for display to users.

Specified by:
getTitle in interface Heading

isRoot

public boolean isRoot()
Description copied from interface: Heading
Returns true if this Heading is the root, the starting Heading, of its Facet.

Specified by:
isRoot in interface Heading
See Also:
Facet.getRootHeading()