public class CatalogUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ATTR_ACTION
Attribute name for the xml attribute "action "
|
static java.lang.String |
ATTR_BASE
Attribute name for the xml attribute "base "
|
static java.lang.String |
ATTR_CATALOGURL
Xml attribute name for the url where the doc came from
|
static java.lang.String |
ATTR_DATASETGROUP
Xml attribute name for the data set group
|
static java.lang.String |
ATTR_DATASETID
Xml attribute name for the data set id
|
static java.lang.String |
ATTR_DATATYPE
Attribute name for the xml attribute "dataType "
|
static java.lang.String |
ATTR_ID
Attribute name for the xml attribute "ID "
|
static java.lang.String |
ATTR_INHERITED
Attribute name for the xml attribute "inherited "
|
static java.lang.String |
ATTR_METADATATYPE |
static java.lang.String |
ATTR_NAME
Attribute name for the xml attribute "name "
|
static java.lang.String |
ATTR_SERVERID
Attribute name for the xml attribute "serverID "
|
static java.lang.String |
ATTR_SERVICENAME
Attribute name for the xml attribute "serviceName "
|
static java.lang.String |
ATTR_SERVICETYPE
Attribute name for the xml attribute "serviceType "
|
static java.lang.String |
ATTR_SUFFIX
Attribute name for the xml attribute "suffix "
|
static java.lang.String |
ATTR_TYPE
Attribute name for the xml attribute "type "
|
static java.lang.String |
ATTR_UNITS
Attribute name for the xml node "units"
|
static java.lang.String |
ATTR_URL
Attribute name for the xml attribute "url "
|
static java.lang.String |
ATTR_URLPATH
Attribute name for the xml attribute "urlPath "
|
static java.lang.String |
ATTR_VALUE
Attribute name for the xml attribute "value "
|
static java.lang.String |
ATTR_VERSION
Attribute name for the xml attribute "version "
|
static java.lang.String |
ATTR_XLINK_HREF
Attribute name for the xml attribute "xlink:href "
|
static java.lang.String |
ATTR_XLINK_TITLE
Attribute name for the xml attribute "xlink:title "
|
static java.lang.String |
NULL_STRING
More clear than then doing (String)null
|
static java.lang.String |
PROP_ANNOTATIONSERVER
Property name for the annotations server url
|
static java.lang.String |
PROP_CATALOGURL
Property name for the url of the catalog
|
static java.lang.String |
PROP_DATASETGROUP
Property name for the data set group
|
static java.lang.String |
PROP_DATASETID
Property name for the data set id
|
static java.lang.String |
PROP_SERVICE_HTTP
This needs to be the same as unidata.data.DataSource
|
static java.lang.String |
PROP_TITLE
This needs to be the same as unidata.data.DataSource.PROP_TITLE
|
static java.lang.String |
SERVICE_ADDE
Service type value for the adde service
|
static java.lang.String |
SERVICE_COMPOUND
Service type value for the compound service
|
static java.lang.String |
SERVICE_DODS
Service type value for the dods service
|
static java.lang.String |
SERVICE_FILE
Service type value for the compound service
|
static java.lang.String |
SERVICE_HTTP
Service type value for the wcs service
|
static java.lang.String |
SERVICE_OPENDAP
Service type value for the OPeNDAP service
|
static java.lang.String |
SERVICE_RESOLVER
Service name of the special resolver service.
|
static java.lang.String |
TAG_ACCESS
Tag name for the xml node "access"
|
static java.lang.String |
TAG_CATALOG
Tag name for the xml node "catalog"
|
static java.lang.String |
TAG_CATALOGREF
Tag name for the xml node "catalogRef"
|
static java.lang.String |
TAG_COLLECTION
Tag name for the xml node "collection"
|
static java.lang.String |
TAG_CONTACT
contact
|
static java.lang.String |
TAG_DATASET
Tag name for the xml node "dataset"
|
static java.lang.String |
TAG_DATASIZE
_more_
|
static java.lang.String |
TAG_DATATYPE
Tag name for the xml node "dataType"
|
static java.lang.String |
TAG_DATE
_more_
|
static java.lang.String |
TAG_DOCPARENT
Tag name for the xml node "docparent"
|
static java.lang.String |
TAG_DOCUMENTATION
Tag name for the xml node "documentation"
|
static java.lang.String |
TAG_EAST
xml tag name
|
static java.lang.String |
TAG_END
_more_
|
static java.lang.String |
TAG_GEOSPATIALCOVERAGE
_more_
|
static java.lang.String |
TAG_LATLONBOX
xml tag name
|
static java.lang.String |
TAG_METADATA
Tag name for the xml node "metadata"
|
static java.lang.String |
TAG_NAME
name
|
static java.lang.String |
TAG_NORTH
xml tag name
|
static java.lang.String |
TAG_PROPERTY
Tag name for the xml node "property"
|
static java.lang.String |
TAG_QUERYCAPABILITY
Tag name for the xml node "queryCapability"
|
static java.lang.String |
TAG_SERVER
Tag name for the xml node "server "
|
static java.lang.String |
TAG_SERVICE
Tag name for the xml node "service "
|
static java.lang.String |
TAG_SERVICENAME
Tag name for the xml node "serviceName"
|
static java.lang.String |
TAG_SOUTH
xml tag name
|
static java.lang.String |
TAG_START
_more_
|
static java.lang.String |
TAG_TIMECOVERAGE
_more_
|
static java.lang.String |
TAG_WEST
xml tag name
|
static double |
THREDDS_VERSION_0_4
Value for the thredds catalog v0.4
|
static double |
THREDDS_VERSION_0_5
Value for the thredds catalog v0.5
|
static double |
THREDDS_VERSION_0_6
Value for the thredds catalog v0.6
|
static double |
THREDDS_VERSION_1_0
Value for the thredds catalog v1.0
|
static java.lang.String |
VALUE_ANNOTATIONSERVER
Xml attribute name for the data set id
|
static java.lang.String |
VALUE_RIGHTS
Xml attribute value for the rights documentation
|
static java.lang.String |
VALUE_SUMMARY
Xml attribute value for the summary documentation
|
Constructor and Description |
---|
CatalogUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
addServiceProperties(org.w3c.dom.Element datasetNode,
java.util.Hashtable properties,
java.lang.String urlPath)
Add any service urls to the properties
|
static void |
errorMessage(java.lang.String msg)
Log the error
|
static java.lang.String |
findBaseForDataset(org.w3c.dom.Element datasetNode,
org.w3c.dom.Element root)
Find the base url attribute from the service that the given datasetNode is
associated with.
|
static java.lang.String |
findDataTypeForDataset(org.w3c.dom.Element datasetNode,
org.w3c.dom.Element root,
double version,
boolean firstCall)
Recurse up the DOM tree, looking for a dataset that contains a
dataType attribute.
|
static org.w3c.dom.Element |
findServiceNodeForDataset(org.w3c.dom.Element datasetNode,
boolean showErrors,
java.lang.String type)
Find the service xml element for the given dataset node.
|
static int |
generateHtml(org.w3c.dom.Element root,
org.w3c.dom.Element datasetNode,
int cnt,
java.lang.String bundleTemplate,
java.lang.String jnlpTemplate)
Generate an html representation of the catalog
|
static java.lang.String |
getAbsoluteUrl(org.w3c.dom.Element serviceNode,
java.lang.String urlPath)
Find the base url for the given service node.
|
static java.lang.Object[] |
getResolverData(java.lang.String resolverUrl,
java.util.Hashtable properties)
This reads the xml pointed to by the given resolverUrl.
|
static java.lang.String |
getServiceType(org.w3c.dom.Element serviceNode)
Find the service type attribute for the given service node.
|
static java.lang.String |
getTitleFromDataset(org.w3c.dom.Element datasetNode)
Assemble the String title for the given dataset.
|
static java.lang.String |
getUrlPath(org.w3c.dom.Element datasetNode)
Lookup and return the urlPath defined for the given datasetNode.
|
static double |
getVersion(org.w3c.dom.Element node)
A utility to get the version from the catalog root.
|
static boolean |
haveChildCatalogs(org.w3c.dom.Element node) |
static boolean |
haveChildDatasets(org.w3c.dom.Element node) |
static java.lang.String |
resolveUrl(java.lang.String resolverUrl,
java.util.Hashtable properties)
The given resolverUrl should return a catalog that holds one dataset.
|
public static final java.lang.String PROP_TITLE
public static final java.lang.String PROP_SERVICE_HTTP
public static final java.lang.String PROP_CATALOGURL
public static final java.lang.String PROP_DATASETID
public static final java.lang.String PROP_DATASETGROUP
public static final java.lang.String PROP_ANNOTATIONSERVER
public static final java.lang.String ATTR_CATALOGURL
public static final java.lang.String ATTR_DATASETGROUP
public static final java.lang.String ATTR_DATASETID
public static final java.lang.String ATTR_METADATATYPE
public static final java.lang.String VALUE_ANNOTATIONSERVER
public static final java.lang.String VALUE_SUMMARY
public static final java.lang.String VALUE_RIGHTS
public static final java.lang.String NULL_STRING
public static final java.lang.String SERVICE_RESOLVER
public static final java.lang.String SERVICE_COMPOUND
public static final java.lang.String SERVICE_FILE
public static final java.lang.String SERVICE_HTTP
public static final java.lang.String SERVICE_DODS
public static final java.lang.String SERVICE_ADDE
public static final java.lang.String SERVICE_OPENDAP
public static final double THREDDS_VERSION_0_4
public static final double THREDDS_VERSION_0_5
public static final double THREDDS_VERSION_0_6
public static final double THREDDS_VERSION_1_0
public static final java.lang.String TAG_LATLONBOX
public static final java.lang.String TAG_NORTH
public static final java.lang.String TAG_SOUTH
public static final java.lang.String TAG_EAST
public static final java.lang.String TAG_WEST
public static final java.lang.String TAG_NAME
public static final java.lang.String TAG_CONTACT
public static final java.lang.String TAG_GEOSPATIALCOVERAGE
public static final java.lang.String TAG_TIMECOVERAGE
public static final java.lang.String TAG_START
public static final java.lang.String TAG_END
public static final java.lang.String TAG_DATASIZE
public static final java.lang.String TAG_DATE
public static final java.lang.String TAG_ACCESS
public static final java.lang.String TAG_DOCUMENTATION
public static final java.lang.String TAG_DOCPARENT
public static final java.lang.String TAG_CATALOG
public static final java.lang.String TAG_CATALOGREF
public static final java.lang.String TAG_COLLECTION
public static final java.lang.String TAG_DATASET
public static final java.lang.String TAG_DATATYPE
public static final java.lang.String TAG_METADATA
public static final java.lang.String TAG_QUERYCAPABILITY
public static final java.lang.String TAG_SERVER
public static final java.lang.String TAG_SERVICE
public static final java.lang.String TAG_SERVICENAME
public static final java.lang.String ATTR_UNITS
public static final java.lang.String TAG_PROPERTY
public static final java.lang.String ATTR_ACTION
public static final java.lang.String ATTR_DATATYPE
public static final java.lang.String ATTR_BASE
public static final java.lang.String ATTR_ID
public static final java.lang.String ATTR_INHERITED
public static final java.lang.String ATTR_NAME
public static final java.lang.String ATTR_VALUE
public static final java.lang.String ATTR_SERVERID
public static final java.lang.String ATTR_SERVICENAME
public static final java.lang.String ATTR_SERVICETYPE
public static final java.lang.String ATTR_SUFFIX
public static final java.lang.String ATTR_TYPE
public static final java.lang.String ATTR_URL
public static final java.lang.String ATTR_URLPATH
public static final java.lang.String ATTR_VERSION
public static final java.lang.String ATTR_XLINK_HREF
public static final java.lang.String ATTR_XLINK_TITLE
public static double getVersion(org.w3c.dom.Element node)
node
- The xml nodepublic static boolean haveChildDatasets(org.w3c.dom.Element node)
public static boolean haveChildCatalogs(org.w3c.dom.Element node)
public static java.lang.String getServiceType(org.w3c.dom.Element serviceNode)
serviceNode
- The service node to look for the service type.public static java.lang.String getTitleFromDataset(org.w3c.dom.Element datasetNode)
datasetNode
- The dataset node we are looking at.public static void errorMessage(java.lang.String msg)
msg
- the error messagepublic static org.w3c.dom.Element findServiceNodeForDataset(org.w3c.dom.Element datasetNode, boolean showErrors, java.lang.String type)
datasetNode
- The dataset node to look for a service node for.showErrors
- Do we tell the user if there was an errortype
- service typepublic static java.lang.String findBaseForDataset(org.w3c.dom.Element datasetNode, org.w3c.dom.Element root)
datasetNode
- The dataset node we are looking for a base url for.root
- public static java.lang.String findDataTypeForDataset(org.w3c.dom.Element datasetNode, org.w3c.dom.Element root, double version, boolean firstCall)
datasetNode
- The dataset node we are looking at.root
- The root of the xml treeversion
- The catalog version<firstCall
- Is this the leaf nodepublic static java.lang.String getAbsoluteUrl(org.w3c.dom.Element serviceNode, java.lang.String urlPath)
serviceNode
- The service node for the given urlPath.urlPath
- The tail end of the absolute url.public static java.lang.String getUrlPath(org.w3c.dom.Element datasetNode)
datasetNode
- The dataset node we are looking at.public static java.lang.Object[] getResolverData(java.lang.String resolverUrl, java.util.Hashtable properties)
Object[] {newXmlRoot, datasetNode, serviceNode, url}
resolverUrl
- The url pointing to the resolver catalog.properties
- The propertiespublic static java.lang.String resolveUrl(java.lang.String resolverUrl, java.util.Hashtable properties)
resolverUrl
- The url pointing to the resolved catalog.properties
- To put the title into.public static void addServiceProperties(org.w3c.dom.Element datasetNode, java.util.Hashtable properties, java.lang.String urlPath)
datasetNode
- data set nodeproperties
- propertiesurlPath
- base urlpublic static int generateHtml(org.w3c.dom.Element root, org.w3c.dom.Element datasetNode, int cnt, java.lang.String bundleTemplate, java.lang.String jnlpTemplate)
root
- Root of the catalogdatasetNode
- The data set node we are looking atcnt
- The current count of the data set nodes we have processedbundleTemplate
- The bundle template we generate the bundle fromjnlpTemplate
- The jnlp template