Commit 2d15b067 authored by cdanger's avatar cdanger

- Added new representation type "application/xacml+json" for JSON

profile of XACML on pdp resource (Request and Response)
parent 8bdc65fe
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:wadl="http://wadl.dev.java.net/2009/02">
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:wadl="http://wadl.dev.java.net/2009/02" xmlns:xacml="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17">
<!-- <xsl:output method="xml" encoding="UTF-8" indent="yes" saxon:indent-spaces="4" /> xmlns:saxon="http://saxon.sf.net/" -->
<xsl:output method="xml" encoding="UTF-8" indent="yes" />
<xsl:param name="enable_xacml_json_profile" select="false"/>
<xsl:template match="wadl:representation[@mediaType='application/xml']">
<xsl:variable name="xmlElement" select="@element" />
<!-- <xsl:variable name="xmlElement" select="@element" /> -->
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
......@@ -11,6 +12,9 @@
<!-- If we specify an element again for 'application/json', CXF wadl2java plugin ignores the fact that it is the same and maps to generic java type 'javax.xml.transform.Source' -->
<!-- <xsl:attribute name="element"><xsl:value-of select="$xmlElement" /></xsl:attribute> -->
</wadl:representation>
<xsl:if test="$enable_xacml_json_profile = 'true' and (@element = 'xacml:Request' or @element = 'xacml:Response')">
<wadl:representation mediaType="application/xacml+json" />
</xsl:if>
</xsl:template>
<!-- standard copy template -->
<xsl:template match="@*|node()">
......
......@@ -142,7 +142,7 @@
</configuration>
</execution>
<execution>
<id>generate-wadl-with-json</id>
<id>generate-wadl-with-mapped-json</id>
<phase>generate-sources</phase>
<goals>
<goal>transform</goal>
......@@ -166,7 +166,7 @@
</configuration>
</execution>
<execution>
<id>generate-wadl-with-fastinfoset-and-json</id>
<id>generate-wadl-with-mapped-json-and-json-profile-of-xacml</id>
<phase>generate-sources</phase>
<goals>
<goal>transform</goal>
......@@ -176,12 +176,42 @@
<transformationSet>
<dir>${project.build.outputDirectory}</dir>
<includes>
<include>authz-api+json.wadl</include>
<include>authz-api.wadl</include>
</includes>
<outputDir>${project.build.outputDirectory}</outputDir>
<fileMappers>
<fileMapper implementation="org.codehaus.plexus.components.io.filemappers.MergeFileMapper">
<targetName>authz-api+xacml+json.wadl</targetName>
</fileMapper>
</fileMappers>
<stylesheet>add-json-to-wadl.xsl</stylesheet>
<parameters>
<parameter>
<name>enable_xacml_json_profile</name>
<value>true</value>
</parameter>
</parameters>
</transformationSet>
</transformationSets>
</configuration>
</execution>
<execution>
<id>generate-wadl-with-all</id>
<phase>generate-sources</phase>
<goals>
<goal>transform</goal>
</goals>
<configuration>
<transformationSets>
<transformationSet>
<dir>${project.build.outputDirectory}</dir>
<includes>
<include>authz-api+xacml+json.wadl</include>
</includes>
<outputDir>${project.build.outputDirectory}</outputDir>
<fileMappers>
<fileMapper implementation="org.codehaus.plexus.components.io.filemappers.MergeFileMapper">
<targetName>authz-api+fi+json.wadl</targetName>
<targetName>authz-api+all.wadl</targetName>
</fileMapper>
</fileMappers>
<stylesheet>add-fastinfoset-to-wadl.xsl</stylesheet>
......@@ -253,7 +283,7 @@
<configuration>
<wadlOptions>
<wadlOption>
<wadl>${project.build.outputDirectory}/authz-api+fi+json.wadl</wadl>
<wadl>${project.build.outputDirectory}/authz-api+all.wadl</wadl>
<packagename>org.ow2.authzforce.rest.api.jaxrs</packagename>
<extraargs>
<extraarg>-catalog</extraarg>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment