In addition to the PL/SQL APIs in the SDO_WFS_PROCESS and SDO_WFS_LOCK packages, you can use a Java API to publish and drop feature types, and to grant and revoke access to feature types and WFS metadata tables.
This section provides basic reference information about the methods in the oracle.spatial.wfs.WFSAdmin
class. The methods are presented in alphabetical order.
The createXMLTableIndex
method creates an index of XDB.XMLINDEX on document-based feature type instances. This method has the following format:
public static void createXMLTableIndex( OracleConnection conn, String ftNSUrl, String ftName) throws SQLException;
conn
is an Oracle Database connection for a user that has been granted the DBA role.
ftNSUrl
is the URL of the namespace of the feature type.
ftName
is the name of the feature type.
The dropFeatureType
method deletes a feature type from the WFS repository. This method has the following format:
public static void dropFeatureType( OracleConnection conn, String ftNSUrl, String ftName) throws SQLException;
conn
is an Oracle Database connection for a user that has been granted the DBA role.
ftNSUrl
is the URL of the namespace of the feature type.
ftName
is the name of the feature type.
The dropXMLTableIndex
method drops an index of type XDB.XMLINDEX that was created on document-based feature type instances. This method has the following format:
public static void dropXMLTableIndex( OracleConnection conn, String ftNSUrl, String ftName) throws SQLException;
conn
is an Oracle Database connection for a user that has been granted the DBA role.
ftNSUrl
is the URL of the namespace of the feature type.
ftName
is the name of the feature type.
The getIsXMLTableIndexCreated
method returns a Boolean TRUE
if an index of type XDB.XMLINDEX has been created on a document-based feature type, or a Boolean FALSE
if such an index has not been created. This method has the following format:
public static boolean getIsXMLTableIndexCreated( OracleConnection conn, String ftNSUrl, String ftName) throws SQLException;
conn
is an Oracle Database connection for a user that has been granted the DBA role.
ftNSUrl
is the URL of the namespace of the feature type.
ftName
is the name of the feature type.
The grantFeatureTypeToUser
method grants access to a feature type to a database user. This method has the following format:
public static void grantFeatureTypeToUser( OracleConnection conn, String typeNS, String typeName, String usrName) throws SQLException;
conn
is an Oracle Database connection for a user that has been granted the DBA role.
typeNS
is the URL of the namespace of the feature type.
typeName
is the name of the feature type.
usrName
is the name of the database user.
The grantMDAccessToUser
method grants access to the WFS metadata to a database user. This method has the following format:
public static void grantMDAccessToUser( OracleConnection conn, String usrName) throws SQLException;
conn
is an Oracle Database connection for a user that has been granted the DBA role.
usrName
is the name of the database user.
The publishFeatureType
method publishes a document-based feature type; that is, it registers metadata related to the feature type. This method has the following formats:
public static void publishFeatureType(OracleConnection conn, XMLType featureTypeMD) throws SQLException , WFSException; public static void publishFeatureType(OracleConnection conn, XMLType schemaDocXt, XMLType featureDescXt, ArrayList<String> docIdPaths, String primarySpatialPath, String featureMemberNS, String featureMemberName, String ftNSUrl, String ftName, ArrayList<PathInfo> spatialPaths, ArrayList<PathInfo> mandatoryPaths, ArrayList<PathInfo> tsPaths, ArrayList<GeomMetaInfo> sdoMetaInfo, String srsNS, String srsNSAlias) throws SQLException; public static void publishFeatureType(OracleConnection conn, XMLType schemaDocXt, XMLType featureDescXt, ArrayList<String> docIdPaths, String primarySpatialPath, String featureMemberNS, String featureMemberName, String ftNSUrl, String ftName, ArrayList<PathInfo> spatialPaths, ArrayList<PathInfo> mandatoryPaths, ArrayList<PathInfo> tsPaths, ArrayList<GeomMetaInfo> sdoMetaInfo, String srsNS, String srsNSAlias, String ftXSDRefId) throws SQLException; public static void publishFeatureType(OracleConnection conn, XMLType schemaDocXt, XMLType featureDescXt, ArrayList<String> docIdPaths, String primarySpatialPath, String featureMemberNS, String featureMemberName, String ftNSUrl, String ftName, ArrayList<PathInfo> spatialPaths, ArrayList<PathInfo> mandatoryPaths, ArrayList<PathInfo> tsPaths, ArrayList<GeomMetaInfo> sdoMetaInfo, String srsNS, String srsNSAlias, String ftXSDRefId, boolean genSpatialIndex, boolean lockEnable) throws SQLException; public static void publishFeatureType(OracleConnection conn, XMLType schemaDocXt, XMLType featureDescXt, ArrayList<String> docIdPaths, String primarySpatialPath, String featureMemberNS, String featureMemberName, String ftNSUrl, String ftName, ArrayList<PathInfo> spatialPaths, ArrayList<PathInfo> mandatoryPaths, ArrayList<PathInfo> tsPaths, ArrayList<GeomMetaInfo> sdoMetaInfo, String srsNS, String srsNSAlias, String ftXSDRefId, boolean genSpatialIndex, boolean lockEnable, ArrayList<PathInfo> numPaths, ArrayList<PathInfo> idxPaths, ArrayList<String[]> idxPathTypes, boolean genXMLIndex) throws SQLException; public static void publishFeatureType(OracleConnection conn, XMLType schemaDocXt, XMLType featureDescXt, ArrayList<String> docIdPaths, String primarySpatialPath, String featureMemberNS, String featureMemberName, String ftNSUrl, String ftName, ArrayList<PathInfo> spatialPaths, ArrayList<PathInfo> mandatoryPaths, ArrayList<PathInfo> tsPaths, ArrayList<GeomMetaInfo> sdoMetaInfo, String srsNS, String srsNSAlias, String ftXSDRefId, boolean genSpatialIndex, boolean lockEnable, ArrayList<PathInfo> numPaths, ArrayList<PathInfo> idxPaths, ArrayList<String[]> idxPathTypes, boolean genXMLIndex, String featureCollectionNS, String featureCollectionName, boolean isGML3) throws SQLException; public static void publishFeatureType(OracleConnection conn, XMLType schemaDocXt, XMLType featureDescXt, ArrayList<String> docIdPaths, String primarySpatialPath, String featureMemberNS, String featureMemberName, String ftNSUrl, String ftName, ArrayList<PathInfo> spatialPaths, ArrayList<PathInfo> mandatoryPaths, ArrayList<PathInfo> tsPaths, ArrayList<GeomMetaInfo> sdoMetaInfo, String srsNS, String srsNSAlias, String ftXSDRefId, boolean genSpatialIndex, boolean lockEnable, ArrayList<PathInfo> numPaths, ArrayList<PathInfo> idxPaths, ArrayList<String[]> idxPathTypes, boolean genXMLIndex, String featureCollectionNS, String featureCollectionName, boolean isGML3, CollectionPathInfo collPathInfo) throws SQLException; public static void publishFeatureType(OracleConnection conn, XMLType schemaDocXt, XMLType featureDescXt, ArrayList<String> docIdPaths, String primarySpatialPath, String featureMemberNS, String featureMemberName, String ftNSUrl, String ftName, ArrayList<PathInfo> spatialPaths, ArrayList<PathInfo> mandatoryPaths, ArrayList<PathInfo> tsPaths, ArrayList<GeomMetaInfo> sdoMetaInfo, String srsNS, String srsNSAlias, String ftXSDRefId, boolean genSpatialIndex, boolean lockEnable, ArrayList<PathInfo> numPaths, ArrayList<PathInfo> idxPaths, ArrayList<String[]> idxPathTypes, boolean genXMLIndex, String featureCollectionNS, String featureCollectionName, boolean isGML3, CollectionPathInfo collPathInfo, boolean hasMultipleSRSNS) throws SQLException;
conn
is an Oracle Database connection for a user that has been granted the DBA role.
featureTypeMD
is the feature type path registration metadata. This metadata must conform to the featureTypeMd
element definition as specified in the wstype_md.xsd
file. An example of feature type path registration metadata XML is provided in ft_metadata.xml
. These files are included in the ws_client.jar
demo file (described in Demo Files for Sample Java Client) under the src/data/
path. For information about using the example to publish a feature type, see the Readme.txt
file, which is included in ws_client.jar
under the src/
path.
schemaDocXt
is the XML schema definition (XSD) of the feature type.
featureDescXt
is the XML schema definition (XSD) of the feature type description, to be included in the Capabilities
document.
docIdPaths
is a list of document ID path elements where each element is a String.
primarySpatialPath
is the primary spatial path that will be used to compute the bounding box in the result.
featureMemberNS
is the namespace of the feature member.
featureMemberName
is the name of the feature member.
ftNSUrl
is the URL of the namespace of the feature type.
ftName
is the name of the feature type.
spatialPaths
is a list of spatial paths in the feature type. It is an ArrayList
of class oracle.spatial.ws.PathInfo
, which is described in Related Classes for publishFeatureType.
mandatoryPaths
is a list of mandatory paths in the feature type. It is an ArrayList
of class oracle.spatial.ws.PathInfo
, which is described in Related Classes for publishFeatureType.
tsPaths
is a list of time-related paths in the feature type (for example, date
, dateTime
, gYear
, gMonth
, gDay
, gMonthDay
, and gYearMonth
). It is an ArrayList
of class oracle.spatial.ws.PathInfo
, which is described in Related Classes for publishFeatureType.
sdoMetaInfo
is the spatial metadata information for spatial paths. It is an ArrayList
of class oracle.spatial.ws.GeomMetaInfo
, which is described in Related Classes for publishFeatureType.
srsNS
is the user-defined namespace of the spatial reference system (coordinate system) associated with the data in the spatial paths. This namespace (if specified) is also used to generate the srsName
attribute in the <boundedBy>
element of the FeatureCollection result generated for the GetFeature request.
srsNSAlias
is the namespace alias of the spatial reference system (coordinate system) associated with the data in the spatial paths.
ftXSDRefId
is the group feature type XML schema definition file name (as a string), for cases where multiple feature types are defined in a single XSD file. This parameter is used to store the group XSD definition once in the WFS metadata, and then refer to it from multiple feature types whose schema definitions are present in the group feature type XSD file.
genSpatialIndex
is a Boolean value: TRUE
causes a spatial index to be created on the feature type at type creation time; FALSE
does not cause a spatial index to be created.
lockEnable
is a Boolean value: TRUE
causes the feature type table (the underlying system-generated table where instances of this feature type are stored) to be lock-enabled at type creation time; FALSE
does not cause the feature type table to be lock-enabled. If lockEnable
is TRUE
, this will WFS-transaction lock enable the WFS data table for the feature type. (This data table is automatically generated when the feature type is published.)
numPaths
is a list of numeric (NUMBER, INTEGER, and so on) related paths in the feature type. It is an ArrayList
of class oracle.spatial.ws.PathInfo
, which is described in Related Classes for publishFeatureType.
idxPaths
is the index path list. It is list of paths on which to create an index of type XDB.XMLINDEX when that index is created. It is an ArrayList
of class oracle.spatial.ws.PathInfo
, which is described in Related Classes for publishFeatureType.
idxPathTypes
specifies information about each index path, where each element of string[3] contains the following: string[0] is the type name, string[1] is the type format (such as the type length), and string[2] specifies whether a Btree or unique index, or no index, should be created (WFSAdmin.BTREE
, WFSAdmin.UNIQUE
, or null).
genXMLIndex
is a Boolean value: TRUE
causes an index of type XDB.XMLINDEX to be created on the document-based feature type; FALSE
does not cause an index of type XDB.XMLINDEX to be created on the document-based feature type. If you choose not to create the index now, you can create it later using the createXMLTableIndex
method (described in createXMLTableIndex method).
featureCollectionNS
is the namespace of the feature collection.
featureCollectionName
is the name of the feature collection.
isGML3
is a Boolean value: TRUE
means that the geometries inside instances of this feature type are GML3.1.1 compliant; FALSE
means that the geometries inside instances of this feature type are GML 2.1.2 compliant.
collPathInfo
is spatial collection path information.
hasMultipleSRSNS
is a Boolean value: TRUE
means that this feature type refers to multiple user-defined spatial reference system namespaces; FALSE
means that this feature type does not refer to multiple user-defined spatial reference system namespaces.
This section describes some classes used in the definition of parameters of the publishFeatureType method.
oracle.spatial.ws.PathElement
is a Java class that contains a pair of String objects: the PathElement
namespace am the PathElement
name. This class includes the getValue()
method, which returns a string format of the PathElement
object. This class has the following format:
public class PathElement { // Set namespace and name information for a PathElement. public void set(String ns, String name); //Get a string value for the PathElement object. public String getValue() ; }
oracle.spatial.ws.Path
is a Java class that contains an ordered list of PathElement
objects that constitute the path. For example, if an XPath is myns:A/myns:B
, then myns:A
and myns:B
are PathElement
objects. This class includes the getValue()
method, which returns a string format of the Path
object. This class has the following format:
public class Path { //Add a PathElement. public void add(PathElement p) ; //Get a string Value for the Path object. public String getValue() ; }
oracle.spatial.ws.PathInfo
is a container class that contains information about a path or list of paths, including their association and metadata information. This class has the following format:
public class PathInfo { // Set number of occurrences for the Path. Default value is 1. Number of // occurrences > 1 in case of arrays. public void setNumOfOccurrences(int i) ; // Get number of occurrences for the Path. public int getNumOfOccurrences(); // Add a path, in case PathInfo has multiple paths associated via a // choice association public void addPath(Path p) ; // Add path type information. This is relevant for time-related Paths // (for example, date, dateTime, gDay, gMonth, gYear, gMonthDay, // gYearMonth, duration, or time). public void addPathType(String t) ; // Add a PathInfo type. This can be PathInfo.CHOICE or // PathInfo.DEFAULT or PathInfo.COLLECTION. // PathInfo.CHOICE - means that the list of paths in this PathInfo are // related to each other via choice association. For example, we may have // a list of Spatial Paths, which are associated with one another via choice. // So, only one of these path can occur in a feature instance/document. // PathInfo.COLLECTION - means the list of paths in this PathInfo are part // of a collection (currently spatial collections are // supported) which will be indexed. // Default value is PathInfo.DEFAULT for one Path or a finite array Paths. // @param t PathInfo type information. PathInfo.CHOICE or // PathInfo.DEFAULT or PathInfo.COLLECTION public void addPathInfoType(int t) ; // Returns a string representation for PathInfo content. public String getPathContent() ; // Returns Path type information (for example, date, dateTime, gDay, gMonth, // gYear, gMonthDay, gYearMonth, duration, or time). public String getPathType() ; // Returns a string representation for PathInfo path content. // param i The index of the path in the PathInfo whose path content needs to // be returned // @return a string representation for PathInfo path content public String getCollectionPathContent(int i); // Returns number of paths in the PathInfo. // @return number of paths in the PathInfo which is of type PathInfo.COLLECTION // if PathInfo is not of type PathInfo.COLLECTION returns -1 public int getCollectionPathContentSize(); }
oracle.spatial.ws.CollectionPathInfo
is a container class that contains information about a collection of PathInfo objects. Each PathInfo object in this collection, represents a group of spatial paths that will be indexed and searched on. This class will be used to register paths referring to spatial collection-based content in feature and record types. This class has the following format:
public class CollectionPathInfo { /** * Add a PathInfo. * @param p PathInfo to be added * @param g geometry related metadata for PathInfo to be added */ public void addPathInfo(PathInfo p, GeomMetaInfo g) ; /** * Get a PathInfo. * @param i index of the PathInfo to be retrieved */ public PathInfo getPathInfo(int i) ; /** * Get geometry related metadata for a certain PathInfo. * @param i index of the PathInfo whose geomMetaInfo is to be retrieved */ public GeomMetaInfo getGeomMetaInfo(int i) ; /** * Get all PathInfo objects in this CollectionPathInfo. */ public ArrayList<PathInfo> getPathInfos() ; }
oracle.spatial.ws.GeomMetaInfo
is a class that contains dimension-related information corresponding to a spatial path in a feature type. This information includes the dimension name, the lower and upper bounds, the tolerance, and the coordinate system (SRID). This class has the following format:
public class GeomMetaInfo { // Default constructor. Creates a GeomMetaInfo object with number of // dimensions equal to 2. public GeomMetaInfo() ; // Creates a GeomMetaInfo object of a specified number of dimensions. // Parameter numOfDimensions is the number of dimensions represented // in the GeomMetaInfo object. // Note: max number of dimensions supported is 4. public GeomMetaInfo(int numOfDimensions) throws ArrayIndexOutOfBoundsException ; //Set Dimension Name. // Parameter index represents the dimension index which needs to be set. // Parameter val is dimension name value. public void setDimName(int index, String val) throws ArrayIndexOutOfBoundsException ; // Set Dimension Lower Bound. // Parameter index represents the dimension index which needs to be set. // Parameter val is dimension lower bound value. public void setLB(int index, double val) throws ArrayIndexOutOfBoundsException ; // Set Dimension Upper Bound // Parameter index represents the dimension index which needs to be set. // Parameter val is dimension upper bound value public void setUB(int index, double val) throws ArrayIndexOutOfBoundsException ; // Set Dimension tolerance value. // Parameter index represents the dimension index which needs to be set. // Parameter val is dimension tolerance value. public void setTolerance(int index, double val) throws ArrayIndexOutOfBoundsException ; // Set Coordinate Reference System Identifier public void setSRID (int val) ; // Get dimension Name. // Parameter index represents the dimension index whose name needs to be // returned. This method returns the dimension name for the given index. public String getDimName(int index) throws ArrayIndexOutOfBoundsException ; // Get dimension lower bound. // Parameter index represents the dimension index whose lower bound needs // to be returned. // This method returns the lower bound for the given index. public double getLB(int index) throws ArrayIndexOutOfBoundsException ; // Get dimension upper bound. // Parameter index represents the dimension index whose upper bound needs // to be returned. // This method returns the upper bound for the given index. public double getUB(int index) throws ArrayIndexOutOfBoundsException ; // Get dimension tolerance. // Parameter index represents the dimension index whose tolerance needs // to be returned. // This method returns the tolerance value for the given index. public double getTolerance(int index) throws ArrayIndexOutOfBoundsException ; // Get coordinate system (spatial reference system) identifier. public int getSRID () ; // Get number of dimensions represented by this GeomMetaInfo object. public int getNumOfDimensions() ; // Sets the spatial index dimension parameter. By default it is 2. // return Coordinate Reference System Identifier value public int setSpatialIndexDimension(int d) ; // Get the spatial index dimension parameter. // return number of dimensions public int getSpatialIndexDimension() ; // Sets the user spatial srs namespace refered by this GeomMetaInfo object. // Needs to be specified if multiple srs namespace are refered within the same //feature or record type. public void setSRSNS(String s) ; // Gets the user defined spatial srs namespace refered by this // GeomMetaInfo object. public String getSRSNS() ; // Sets the user defined spatial srs namespace alias refered by this // GeomMetaInfo object. public void setSRSNSAlias (String s) ; // Gets the user defined spatial srs namespace alias refered by this // GeomMetaInfo object. public String getSRSNSAlias () ; }
The revokeFeatureTypeFromUser
method revokes access to a feature type from a database user. This method has the following format:
public static void revokeFeatureTypeFromUser( OracleConnection conn, String typeNS, String typeName, String usrName) throws SQLException;
conn
is an Oracle Database connection for a user that has been granted the DBA role.
typeNS
is the URL of the namespace of the feature type.
typeName
is the name of the feature type.
usrName
is the name of the database user.
The revokeMDAccessFromUser
method revokes access to the WFS metadata from a database user. This method has the following format:
public static void revokeMDAccessFromUser( OracleConnection conn, String usrName) throws SQLException;
conn
is an Oracle Database connection for a user that has been granted the DBA role.
usrName
is the name of the database user.
The setXMLTableIndexInfo
method updates the XMLTableIndex index information for a document-based feature type, with the option of creating the index. This method has the following format:
Note:
If the XMLTableIndex index already exists, you must drop it (using the dropXMLTableIndex method) before you call the setXMLTableIndexInfo
method.
public static void setXMLTableIndexInfo(OracleConnection conn, String ftNSUrl, String ftName, ArrayList<PathInfo> idxPaths, ArrayList<String[]> idxPathTypes, boolean genXMLIndex) throws SQLException , WFSException;
conn
is an Oracle Database connection for a user that has been granted the DBA role.
ftNSUrl
is the URL of the namespace of the feature type.
ftName
is the name of the feature type.
idxPaths
is the index path list. It is list of paths on which to create an index of type XDB.XMLINDEX when that index is created. It is an ArrayList
of class oracle.spatial.ws.PathInfo
, which is described in Related Classes for publishFeatureType.
idxPathTypes
specifies information about each index path, where each element of string[3] contains the following: string[0] is the type name, string[1] is the type format (such as the type length), and string[2] specifies whether a Btree or unique index, or no index, should be created (WFSAdmin.BTREE
, WFSAdmin.UNIQUE
, or null).
genXMLIndex
is a Boolean value: TRUE
causes an index of type XDB.XMLINDEX to be created on the document-based feature type; FALSE
does not cause an index of type XDB.XMLINDEX to be created on the document-based feature type. If you choose not to create the index now, you can create it later using the createXMLTableIndex
method (described in createXMLTableIndex method).