MINI MINI MANI MO
<?xml version="1.0"?>
<!--
NAME
kudvcr.xsl
DESCRIPTION
XSLT stylesheet for XML => DDL
conversion of ku$_dv_comm_rule_alts_t UDTs
corresponding to Database Vault Command Rules by CREATE_COMMAND_RULE
NOTES
Do NOT modify this file under any circumstance. Copy the file
if you wish to use this stylesheet with an external XML/XSL parser
MODIFIED MM/DD/YY
sjavagal 10/04/17 - Bug 26882631: handle mixed case usernames
sanbhara 06/01/15 - Bug 21158282 - splitting create_command_rule
to two files to accomodate object identifier
length restriction.
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- Import the kucommon.xsl script, otherwise this template will never get invoked. See line 43 in kucommon.xsl, where the comment is "Top level template for all objects", this is the xsl equivalent of 'main'. -->
<xsl:import href="kucommon.xsl"/>
<!-- Top-level parameters -->
<!-- Parameters for DDL generation -->
<xsl:param name="PRETTY">1</xsl:param>
<xsl:param name="SQLTERMINATOR">0</xsl:param>
<!-- Parameters required for DoParse to function correctly. -->
<xsl:param name="PRS_DDL">0</xsl:param>
<xsl:param name="PRS_DELIM">\{]`</xsl:param>
<xsl:param name="PRS_VERB">0</xsl:param>
<xsl:param name="PRS_OBJECT_TYPE">0</xsl:param>
<xsl:param name="PRS_SCHEMA">0</xsl:param>
<xsl:param name="PRS_NAME">0</xsl:param>
<xsl:param name="PRS_GRANTEE">0</xsl:param>
<xsl:param name="PRS_GRANTOR">0</xsl:param>
<xsl:param name="PRS_BASE_OBJECT_SCHEMA">0</xsl:param>
<xsl:param name="PRS_BASE_OBJECT_NAME">0</xsl:param>
<xsl:param name="PRS_BASE_OBJECT_TYPE">0</xsl:param>
<!-- Template to create a new Database Vault Command Rule -->
<xsl:template match="DVPS_COMMAND_RULE_ALTS_T">
<xsl:call-template name="DoParse">
<xsl:with-param name="Verb">DBMS_MACADM</xsl:with-param>
<xsl:with-param name="ObjectType">DVPS_COMMAND_RULE_ALTS</xsl:with-param>
</xsl:call-template>
<xsl:text>BEGIN DVSYS.DBMS_MACADM.CREATE_COMMAND_RULE(command => </xsl:text>
<xsl:call-template name="EscapeString">
<xsl:with-param name="OrigStr" select="COMMAND"/>
<xsl:with-param name="Leading">'</xsl:with-param>
<xsl:with-param name="Trailing">'</xsl:with-param>
<xsl:with-param name="NullVal">NULL</xsl:with-param>
</xsl:call-template>
<xsl:text>, rule_set_name => </xsl:text>
<xsl:call-template name="EscapeString">
<xsl:with-param name="OrigStr" select="RULE_SET_NAME"/>
<xsl:with-param name="Leading">'</xsl:with-param>
<xsl:with-param name="Trailing">'</xsl:with-param>
<xsl:with-param name="NullVal">NULL</xsl:with-param>
</xsl:call-template>
<xsl:text>, object_owner => </xsl:text>
<xsl:call-template name="TSQuoteObject">
<xsl:with-param name="Schema" select="OBJECT_OWNER"/>
</xsl:call-template>
<xsl:text>, object_name => </xsl:text>
<xsl:call-template name="TSQuoteObject">
<xsl:with-param name="Object" select="OBJECT_NAME"/>
</xsl:call-template>
<xsl:text>, enabled => </xsl:text>
<xsl:call-template name="EscapeString">
<xsl:with-param name="OrigStr" select="ENABLED"/>
<xsl:with-param name="Leading">'</xsl:with-param>
<xsl:with-param name="Trailing">'</xsl:with-param>
<xsl:with-param name="NullVal">NULL</xsl:with-param>
</xsl:call-template>
<xsl:text>, privilege_scope => </xsl:text>
<xsl:call-template name="EscapeString">
<xsl:with-param name="OrigStr" select="PRIVILEGE_SCOPE"/>
<xsl:with-param name="Leading">'</xsl:with-param>
<xsl:with-param name="Trailing">'</xsl:with-param>
<xsl:with-param name="NullVal">NULL</xsl:with-param>
</xsl:call-template>
<xsl:if test="$VERSION>=1202000000">
<xsl:text>, clause_name => </xsl:text>
<xsl:call-template name="EscapeString">
<xsl:with-param name="OrigStr" select="CLAUSE_NAME"/>
<xsl:with-param name="Leading">'</xsl:with-param>
<xsl:with-param name="Trailing">'</xsl:with-param>
<xsl:with-param name="NullVal">NULL</xsl:with-param>
</xsl:call-template>
<xsl:text>, parameter_name => </xsl:text>
<xsl:call-template name="EscapeString">
<xsl:with-param name="OrigStr" select="PARAMETER_NAME"/>
<xsl:with-param name="Leading">'</xsl:with-param>
<xsl:with-param name="Trailing">'</xsl:with-param>
<xsl:with-param name="NullVal">NULL</xsl:with-param>
</xsl:call-template>
<xsl:text>, event_name => </xsl:text>
<xsl:call-template name="EscapeString">
<xsl:with-param name="OrigStr" select="EVENT_NAME"/>
<xsl:with-param name="Leading">'</xsl:with-param>
<xsl:with-param name="Trailing">'</xsl:with-param>
<xsl:with-param name="NullVal">NULL</xsl:with-param>
</xsl:call-template>
<xsl:text>, component_name => </xsl:text>
<xsl:call-template name="EscapeString">
<xsl:with-param name="OrigStr" select="COMPONENT_NAME"/>
<xsl:with-param name="Leading">'</xsl:with-param>
<xsl:with-param name="Trailing">'</xsl:with-param>
<xsl:with-param name="NullVal">NULL</xsl:with-param>
</xsl:call-template>
<xsl:text>, action_name => </xsl:text>
<xsl:call-template name="EscapeString">
<xsl:with-param name="OrigStr" select="ACTION_NAME"/>
<xsl:with-param name="Leading">'</xsl:with-param>
<xsl:with-param name="Trailing">'</xsl:with-param>
<xsl:with-param name="NullVal">NULL</xsl:with-param>
</xsl:call-template>
<xsl:text>, scope=> </xsl:text>
<xsl:choose>
<xsl:when test="SCOPE">
<xsl:value-of select="SCOPE"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>NULL</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:text>); END;</xsl:text>
<!-- Terminate inner SQL statement -->
<xsl:call-template name="DoTerminator">
<xsl:with-param name="Text"/>
</xsl:call-template>
</xsl:template>
</xsl:stylesheet>
OHA YOOOO