-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4d9cd9d
commit 69da127
Showing
12 changed files
with
377 additions
and
5,456 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
6 changes: 3 additions & 3 deletions
6
rules-catalogue/src/main/java/com/microsoft/appcat/rulescatalogue/Catalogue.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
package com.microsoft.appcat.rulescatalogue; | ||
|
||
import java.util.List; | ||
import javax.xml.transform.stream.StreamSource; | ||
|
||
public record Catalogue(String name, String directoryPath, StreamSource xsltTemplate) { | ||
|
||
public record Catalogue(String name, List<String> directories, String templateId) { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 0 additions & 48 deletions
48
rules-catalogue/src/main/java/com/microsoft/appcat/rulescatalogue/XMLMerger.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns="http://windup.jboss.org/schema/jboss-ruleset"> | ||
<xsl:output method="text" indent="no"/> | ||
<xsl:strip-space elements="*"/> | ||
|
||
<xsl:param name="catalogueName" select="'AppCAT'"/> | ||
<xsl:param name="filename" select="'unknown.xml'"/> | ||
<xsl:param name="includeHeader" select="'true'"/> | ||
|
||
<!-- Template for the part to be invoked once --> | ||
<xsl:template name="header"> | ||
<xsl:text> </xsl:text> | ||
<xsl:text># </xsl:text> | ||
<xsl:value-of select="$catalogueName"/> | ||
<xsl:text> Rules </xsl:text> | ||
<xsl:text>| ID | Title | Category | Effort | Azure App Service | Azure Container Apps | Azure Kubernetes Service | Azure Spring Apps | Source file | </xsl:text> | ||
<xsl:text>| --- | --- | --- | --- | --- | --- | --- | --- | --- | </xsl:text> | ||
</xsl:template> | ||
|
||
<!-- Template for the part to be invoked multiple times --> | ||
<xsl:template name="body"> | ||
<xsl:for-each select="//ns:rule"> | ||
<xsl:text>| </xsl:text> | ||
<xsl:value-of select="@id"/> | ||
<xsl:text> | </xsl:text> | ||
<xsl:value-of select=".//ns:hint/@title"/> | ||
<xsl:text> | </xsl:text> | ||
<xsl:value-of select=".//ns:hint/@category-id"/> | ||
<xsl:text> | </xsl:text> | ||
<xsl:value-of select=".//ns:hint/@effort"/> | ||
<xsl:text> | </xsl:text> | ||
<xsl:choose> | ||
<xsl:when test="boolean(ancestor::ns:ruleset/ns:metadata/ns:targetTechnology[@id='azure-appservice'])">X</xsl:when> | ||
<xsl:otherwise></xsl:otherwise> | ||
</xsl:choose> | ||
<xsl:text> | </xsl:text> | ||
<xsl:choose> | ||
<xsl:when test="boolean(ancestor::ns:ruleset/ns:metadata/ns:targetTechnology[@id='azure-container-apps'])">X</xsl:when> | ||
<xsl:otherwise></xsl:otherwise> | ||
</xsl:choose> | ||
<xsl:text> | </xsl:text> | ||
<xsl:choose> | ||
<xsl:when test="boolean(ancestor::ns:ruleset/ns:metadata/ns:targetTechnology[@id='azure-aks'])">X</xsl:when> | ||
<xsl:otherwise></xsl:otherwise> | ||
</xsl:choose> | ||
<xsl:text> | </xsl:text> | ||
<xsl:choose> | ||
<xsl:when test="boolean(ancestor::ns:ruleset/ns:metadata/ns:targetTechnology[@id='azure-spring-apps'])">X</xsl:when> | ||
<xsl:otherwise></xsl:otherwise> | ||
</xsl:choose> | ||
<xsl:text> | </xsl:text> | ||
<xsl:value-of select="$filename"/> | ||
<xsl:text> | </xsl:text> | ||
</xsl:for-each> | ||
</xsl:template> | ||
|
||
<!-- Main template to orchestrate the transformations --> | ||
<xsl:template match="/"> | ||
<!-- Call the header template once --> | ||
<xsl:if test="$includeHeader = 'true'"> | ||
<xsl:call-template name="header"/> | ||
</xsl:if> | ||
|
||
<!-- Apply the rule template to each rule element --> | ||
<xsl:call-template name="body" /> | ||
</xsl:template> | ||
</xsl:stylesheet> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns="http://windup.jboss.org/schema/jboss-ruleset"> | ||
<xsl:output method="text" indent="no"/> | ||
<xsl:strip-space elements="*"/> | ||
|
||
<xsl:param name="catalogueName" select="'AppCAT'"/> | ||
<xsl:param name="filename" select="'unknown.xml'"/> | ||
<xsl:param name="includeHeader" select="'true'"/> | ||
|
||
<!-- Template for the part to be invoked once --> | ||
<xsl:template name="header"> | ||
<xsl:text> </xsl:text> | ||
<xsl:text># </xsl:text> | ||
<xsl:value-of select="$catalogueName"/> | ||
<xsl:text> Rules </xsl:text> | ||
<xsl:text>| ID | Title | Category | Effort | Source file | </xsl:text> | ||
<xsl:text>| --- | --- | --- | --- | --- | </xsl:text> | ||
</xsl:template> | ||
|
||
<!-- Template for the part to be invoked multiple times --> | ||
<xsl:template name="body"> | ||
<xsl:for-each select="//ns:rule"> | ||
<xsl:text>| </xsl:text> | ||
<xsl:value-of select="@id" /> | ||
<xsl:text> | </xsl:text> | ||
<!-- Check for hint or classification --> | ||
<xsl:choose> | ||
<!-- If hint exists --> | ||
<xsl:when test=".//ns:hint"> | ||
<xsl:value-of select=".//ns:hint/@title"/> | ||
<xsl:text> | </xsl:text> | ||
<xsl:value-of select=".//ns:hint/@category-id"/> | ||
<xsl:text> | </xsl:text> | ||
<xsl:value-of select=".//ns:hint/@effort"/> | ||
</xsl:when> | ||
<!-- If classification exists --> | ||
<xsl:when test=".//ns:classification"> | ||
<xsl:value-of select=".//ns:classification/@title"/> | ||
<xsl:text> | </xsl:text> | ||
<xsl:value-of select=".//ns:classification/@category-id"/> | ||
<xsl:text> | </xsl:text> | ||
<xsl:value-of select=".//ns:classification/@effort"/> | ||
</xsl:when> | ||
<!-- Default case if neither exists --> | ||
<xsl:otherwise> | ||
<xsl:text>Not Available | Not Available | Not Available</xsl:text> | ||
</xsl:otherwise> | ||
</xsl:choose> | ||
<xsl:text> | </xsl:text> | ||
<xsl:value-of select="$filename"/> | ||
<xsl:text> | </xsl:text> | ||
</xsl:for-each> | ||
</xsl:template> | ||
|
||
<!-- Main template to orchestrate the transformations --> | ||
<xsl:template match="/"> | ||
<!-- Call the header template once --> | ||
<xsl:if test="$includeHeader = 'true'"> | ||
<xsl:call-template name="header"/> | ||
</xsl:if> | ||
|
||
<!-- Apply the rule template to each rule element --> | ||
<xsl:call-template name="body" /> | ||
</xsl:template> | ||
</xsl:stylesheet> |
Oops, something went wrong.