The DBMS_EPG
package implements the embedded PL/SQL gateway that enables a Web browser to invoke a PL/SQL stored procedure through an HTTP listener.
This chapter contains the following topics:
Overview
Security Model
Exceptions
Configuration Subprograms
Authorization Subprograms
The DBMS_EPG
package is a platform on which PL/SQL users develop and deploy PL/SQL Web applications. The embedded PL/SQL gateway is an embedded version of the gateway that runs in the XML database HTTP server in the Oracle database. It provides the core features of mod_plsql
in the database but does not require the Oracle HTTP server powered by Apache.
In order to make a PL/SQL application accessible from a browser by way of HTTP, a Database Access Descriptor (DAD) must be created and mapped to a virtual path. A DAD is a set of configuration values used for database access and the virtual path mapping makes the application accessible under a virtual path of the XML DB HTTP Server. A DAD is represented as a servlet in XML DB HTTP Server.
The DBMS_EPG
package defines a TABLE
type.
This type is used by the procedures GET_ALL_GLOBAL_ATTRIBUTES
, GET_ALL_DAD_ATTRIBUTES
, GET_ALL_DAD_MAPPINGS
, and GET_DAD_LIST
to return lists of attribute names, attribute values, virtual paths, and database access descriptors (DAD).
TYPE VARCHAR2_TABLE IS TABLE OF VARCHAR2(4000) INDEX BY BINARY_INTEGER;
The DBMS_EPG consists of two interfaces:
The Configuration subprogram group contain the subprogram interfaces to examine and modify the global and database access descriptor (DAD) specific settings of the embedded PL/SQL gateway.
Table 63-2 Configuration Subprogram Group
Subprogram | Description |
---|---|
Creates a new DAD |
|
Deletes a DAD attribute |
|
Deletes a global attribute |
|
Drops a DAD |
|
Retrieves all the attributes of a DAD. |
|
Retrieves all virtual paths to which the specified DAD is mapped. |
|
Retrieves all global attributes and values |
|
Retrieves the value of a DAD attribute |
|
Retrieves a list of all DADs for an Embedded Gateway instance. |
|
Retrieves the value of a global attribute |
|
Maps a DAD to the specified virtual path. |
|
Sets the value for a DAD |
|
Sets the value of a global attribute |
|
Unmaps a DAD from the specified virtual path |
The Authorization subprogram group contains the subprogram interfaces to authorize and deauthorize the use of a database user's privileges by the embedded PL/SQL gateway through a specific database access descriptor (DAD)
Table 63-4 DBMS_EPG Package Subprograms
Subprogram | Description |
---|---|
authorizes a DAD to invoke procedures and access document tables with a database user's privileges |
|
Creates a new DAD |
|
Deauthorizes a DAD with regard to invoking procedures and accessing document tables with a database user's privileges |
|
Deletes a DAD attribute |
|
Deletes a global attribute |
|
Drops a DAD |
|
Retrieves all the attributes of a DAD. |
|
Retrieves all virtual paths to which the specified DAD is mapped. |
|
Retrieves all global attributes and values |
|
Retrieves the value of a DAD attribute |
|
Retrieves a list of all DADs for an Embedded Gateway instance. |
|
Retrieves the value of a global attribute |
|
Maps a DAD to the specified virtual path. |
|
Sets the value for a DAD |
|
Sets the value of a global attribute |
|
Unmaps a DAD from the specified virtual path |
This procedure authorizes a DAD to invoke procedures and access document tables with a database user's privileges. The invoker can always authorize the use of her/his own privileges.
See Also:
Authorization Subprograms for other subprograms in this groupTo authorize the use of another user's privileges, the invoker must have the ALTER
USER
system privilege.
The DAD must exist but its "database-username" DAD attribute does not have to be set to user to authorize.
Multiple users can authorize the same DAD and it is up to the DAD's "database-username" setting to decide which user's privileges to use.
Raises an error if the DAD or user does not exist, or the invoker does not have the needed system privilege.
This procedure creates a new DAD.
See Also:
Configuration Subprograms for other subprograms in this groupThis procedure deauthorizes a DAD with regard to invoking procedures and accessing document tables with a database user's privileges. The invoker can always deauthorize the use of his own privileges.
See Also:
Authorization Subprograms for other subprograms in this groupTo deauthorize the use of another user's privileges, the invoker must have the ALTER
USER
system privilege.
Raises an error if the DAD or user does not exist, or the invoker does not have the needed system privilege.
This procedure deletes a DAD attribute.
See Also:
Configuration Subprograms for other subprograms in this groupThis procedure deletes a global attribute.
See Also:
Configuration Subprograms for other subprograms in this groupThis procedure drops a DAD. All the virtual-path mappings of the DAD will be dropped also
See Also:
Configuration Subprograms for other subprograms in this groupThis procedure retrieves all the attributes of a DAD. The outputs are 2 correlated index-by tables of the name/value pairs.
See Also:
Configuration Subprograms for other subprograms in this groupDBMS_EPG.GET_ALL_DAD_ATTRIBUTES ( dad_name IN VARCHAR2, attr_names OUT NOCOPY VARCHAR2_TABLE, attr_values OUT NOCOPY VARCHAR2_TABLE);
This procedure retrieves all virtual paths to which the specified DAD is mapped.
See Also:
Configuration Subprograms for other subprograms in this groupThis procedure retrieves all global attributes and values. The outputs are 2 correlated index-by tables of the name/value pairs.
See Also:
Configuration Subprograms for other subprograms in this groupDBMS_EPG.GET_ALL_GLOBAL_ATTRIBUTES ( attr_names OUT NOCOPY VARCHAR2_TABLE, attr_values OUT NOCOPY VARCHAR2_TABLE);
This procedure retrieves the value of a DAD attribute.
See Also:
Configuration Subprograms for other subprograms in this groupReturns the DAD attribute value. Returns NULL
if attribute is unknown or has not been set.
This procedure retrieves a list of all DADs for an Embedded Gateway instance.
See Also:
Configuration Subprograms for other subprograms in this groupThis function retrieves the value of a global attribute.
See Also:
Configuration Subprograms for other subprograms in this groupThis procedure maps a DAD to the specified virtual path. If the virtual path exists already, the old virtual-path mapping will be overridden.
See Also:
Configuration Subprograms for other subprograms in this groupThis procedure sets the value for a DAD.
See Also:
Configuration Subprograms for other subprograms in this groupDBMS_EPG.SET_DAD_ATTRIBUTE ( dad_name IN VARCHAR2, attr_name IN VARCHAR2, attr_value IN VARCHAR2);
Table 63-18 SET_DAD_ATTRIBUTE Procedure Parameters
Parameter | Description |
---|---|
|
The name of the DAD for which to set the attribute |
|
The name of the attribute to set |
|
The attribute value to set |
Table 63-19 Mapping Between mod_plsql and Embedded PL/SQL Gateway DAD Attributes
mod_plsql DAD Attribute | Embedded PL/SQL Gateway DAD Attribute | Allows Multiple Occurr-ences | Legal Values |
---|---|---|---|
|
|
No |
String |
|
|
No |
Enumeration of On, Off |
|
|
No |
Enumeration of Basic, SingleSignOn, GlobalOwa, CustomOwa, PerPackageOwa |
|
|
No |
String |
|
|
Yes |
Unsigned integer |
|
|
Yes |
Unsigned integer |
|
|
Yes |
String |
|
|
No |
Unsigned integer |
|
|
No |
String |
|
|
No |
String |
|
|
No |
String |
|
|
No |
String |
|
|
No |
String |
|
|
No |
Enumeration of ApacheStyle, ModplsqlStyle, DebugStyle |
|
|
Yes |
String |
|
|
No |
Unsigned integer |
|
i |
No |
Enumeration of InfoDebug |
|
|
No |
Enumeration of On, Off |
|
|
No |
Unsigned integer |
|
|
No |
String |
|
|
No |
String |
|
|
No |
String |
|
|
No |
String |
|
|
No |
String |
|
|
No |
Enumeration of StatelessWithResetPackageState, StatelessWithFastRestPackageState, StatelessWithPreservePackageState |
|
|
No |
Enumeration of Char, Raw |
|
|
No |
String |
If attr_name
attribute has been set before, then the old value will be overwritten with the new attr_value
argument.
The embedded gateway assumes default values when the attributes are not set. The default values of the DAD attributes should be sufficient for most users of the embedded gateway. mod_plsql users should note the following
The PlsqlDatabasePassword
attribute is not needed.
The PlsqlDatabaseConnectString
attribute is not needed because the embedded gateway does not support logon to external databases.
This procedure sets the value of a global attribute.
See Also:
Configuration Subprograms for other subprograms in this groupThe attribute name is case sensitive. The value may or may not be case-sensitive depending on the attribute.
If attr_name
attribute has been set before, then the old value will be overwritten with the new attr_value
argument.
This procedure unmaps a DAD from the specified virtual path. If path is NULL
, the procedure removes all virtual-path mappings for the DAD but keeps the DAD.
See Also:
Configuration Subprograms for other subprograms in this group