org.vfny.geoserver.zserver
Class GeoSummary

java.lang.Object
  extended byorg.vfny.geoserver.zserver.GeoSummary

public class GeoSummary
extends java.lang.Object

Helper class that represents a summary response. It can return itself as text, html or xml. To use it simply set the values of the fields with the accessor methods. A convenience constructor is also provided, which takes a lucene document and the attribute map used to generate it and fills in the fields that it can.


Constructor Summary
GeoSummary()
          No argument constructor.
GeoSummary(org.apache.lucene.document.Document doc, java.util.Properties attrMap)
          Convenience constructor.
 
Method Summary
 java.lang.String addHtmlField(java.lang.String fieldName, java.lang.String fieldVal)
          Creates a html field for the return summary.
 java.lang.String addTextField(java.lang.String fieldName, java.lang.String fieldVal)
          Creates a text field for the return summary.
 java.lang.String getHtmlSummary()
          Creates a string representation of a geo summary in html format.
 java.lang.String getTextSummary()
          Creates a string representation of a geo summary in a text format.
 org.w3c.dom.Document getXmlSummary()
          Creates an xml summary.
 void setAttributeLabel(java.lang.String attrLabel)
          Sets the attribute label of the summary.
 void setBeginningDate(java.lang.String begDate)
          Sets the beginning date of the summary.
 void setBounds(java.lang.String westbc, java.lang.String eastbc, java.lang.String northbc, java.lang.String southbc)
          Sets the bounding coordinates of the summary.
 void setBrowseGraphic(java.lang.String fileName, java.lang.String fileDesc, java.lang.String fileType)
          Sets the three fields needed for a browse graphic.
 void setDSGPolygon(java.lang.String dsgpoly)
          Sets the Data Set G-polygon of the summary.
 void setEdition(java.lang.String edition)
          Sets the edition field of the summary.
 void setEndingDate(java.lang.String endDate)
          Sets the end date of the summary.
 void setEntityTypeLabel(java.lang.String entTypeLabel)
          Sets the entity type label of the summary.
 void setExtent(java.lang.String extent)
          Sets the extent field of the summary.
 void setGeoform(java.lang.String geoform)
          Sets the geoform field of the summary.
 void setIndspref(java.lang.String indspref)
          Sets the indspref field of the summary.
 void setOnlineLinkage(java.lang.String onlink)
          Sets the online linkage field of the summary.
 void setPublicationDate(java.lang.String pubDate)
          Sets the publication date of the summary.
 void setTitle(java.lang.String title)
          Sets the title of the summary.
 void setUpdate(java.lang.String update)
          Sets the update field of the summary.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeoSummary

public GeoSummary(org.apache.lucene.document.Document doc,
                  java.util.Properties attrMap)
Convenience constructor. Takes a lucene document and a mapping of the use attributes. The method relies on the GeoProfile class to access the attribute numbers of the fields, using the passed in attrMap to map to the fields of the lucene document.

Parameters:
doc - The lucene document used to fill the summary fields.
attrMap - The mapping of use attribute numbers to their lucene field names

GeoSummary

public GeoSummary()
No argument constructor. Fields must be filled with setter functions before this class can do anything meaningful.

Method Detail

setBrowseGraphic

public void setBrowseGraphic(java.lang.String fileName,
                             java.lang.String fileDesc,
                             java.lang.String fileType)
Sets the three fields needed for a browse graphic.

Parameters:
fileName - the name of the browse graphic file.
fileDesc - the file's description
fileType - the type of the browse file.

setTitle

public void setTitle(java.lang.String title)
Sets the title of the summary.

Parameters:
title - the title to be set.

setOnlineLinkage

public void setOnlineLinkage(java.lang.String onlink)
Sets the online linkage field of the summary.

Parameters:
onlink - the string representation of the online linkage field.

setBounds

public void setBounds(java.lang.String westbc,
                      java.lang.String eastbc,
                      java.lang.String northbc,
                      java.lang.String southbc)
Sets the bounding coordinates of the summary.

Parameters:
westbc - the west bounding coordinate.
eastbc - the east bounding coordinate.
northbc - the north bounding coordinate.
southbc - the south bounding coordinate.

setExtent

public void setExtent(java.lang.String extent)
Sets the extent field of the summary.

Parameters:
extent - the area covered by the bounding coords.

setPublicationDate

public void setPublicationDate(java.lang.String pubDate)
Sets the publication date of the summary.

Parameters:
pubDate - the publication date to be set.

setBeginningDate

public void setBeginningDate(java.lang.String begDate)
Sets the beginning date of the summary.

Parameters:
begDate - the beginning date to be set.

setEndingDate

public void setEndingDate(java.lang.String endDate)
Sets the end date of the summary.

Parameters:
endDate - the ending date to be set.

setEntityTypeLabel

public void setEntityTypeLabel(java.lang.String entTypeLabel)
Sets the entity type label of the summary.

Parameters:
entTypeLabel - the type label of the entity.

setAttributeLabel

public void setAttributeLabel(java.lang.String attrLabel)
Sets the attribute label of the summary.

Parameters:
attrLabel - the attribute label to be set.

setDSGPolygon

public void setDSGPolygon(java.lang.String dsgpoly)
Sets the Data Set G-polygon of the summary.

Parameters:
dsgpoly - the string representation of the g-polygon.

setEdition

public void setEdition(java.lang.String edition)
Sets the edition field of the summary.

Parameters:
edition - the string representation of the g-polygon.

setGeoform

public void setGeoform(java.lang.String geoform)
Sets the geoform field of the summary.

Parameters:
geoform - the string representation of the g-polygon.

setUpdate

public void setUpdate(java.lang.String update)
Sets the update field of the summary.

Parameters:
update - the string representation of the g-polygon.

setIndspref

public void setIndspref(java.lang.String indspref)
Sets the indspref field of the summary.

Parameters:
indspref - the string representation of the g-polygon.

addTextField

public java.lang.String addTextField(java.lang.String fieldName,
                                     java.lang.String fieldVal)
Creates a text field for the return summary.

Parameters:
fieldName - the name of the field.
fieldVal - what the field equals.
Returns:
a string of the fieldname, an equals sign, the fieldVal, and a newline char.

addHtmlField

public java.lang.String addHtmlField(java.lang.String fieldName,
                                     java.lang.String fieldVal)
Creates a html field for the return summary.

Parameters:
fieldName - the name of the field.
fieldVal - what the field equals.
Returns:
a string of a P tag, the fieldname, an equals sign, the fieldVal, and a closing P tag, and a newline char.

getHtmlSummary

public java.lang.String getHtmlSummary()
Creates a string representation of a geo summary in html format. Currently uses the same return values as the Isite reference implementation, since this is for the fgdc. The Geo Profile specifies different values, but this is easily modified to use those.

Returns:
a string of the relevant fields, with various html tags.

getTextSummary

public java.lang.String getTextSummary()
Creates a string representation of a geo summary in a text format. Currently uses the same return values as the Isite reference implementation, since this is for the fgdc. The Geo Profile specifies different values, but this is easily modified to use those.

Returns:
a string of the relevant fields.

getXmlSummary

public org.w3c.dom.Document getXmlSummary()
Creates an xml summary. Currently uses the same return values as the Isite reference implementation, since this is for the fgdc. The Geo Profile specifies different values, but changing this to use those won't be trivial.

Returns:
A summary in xml.