<?xml version="1.0"?>
<ruleset xmlns="http://windup.jboss.org/schema/jboss-ruleset" id="xml-jrun"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://windup.jboss.org/schema/jboss-ruleset http://windup.jboss.org/schema/jboss-ruleset/windup-jboss-ruleset.xsd">
    <metadata>
        <description>
            This ruleset provides analysis of JRun proprietary xml files that may require individual
            attention when migrating to JBoss EAP 6+.
        </description>
        <dependencies>
            <addon id="org.jboss.windup.rules,windup-rules-xml,2.3.0.Final" />
        </dependencies>
        <sourceTechnology id="jrun" />
        <targetTechnology id="eap" versionRange="[6,)" />
        <tag>web-app</tag>
        <tag>jrun</tag>
        <tag>configuration</tag>
    </metadata>
    <rules>
        <rule id="xml-jrun-01000">
            <when>
                <or>
                   <xmlfile matches="/jrun-web-app"/>
                   <xmlfile public-id="Macromedia, Inc.//DTD jrun-web 1.."/>
                   <xmlfile public-id="Adobe, Inc.//DTD jrun-web 1.."/>
                </or>
            </when>
            <perform>
                <iteration>
                    <classification issue-display-mode="all" title="JRun Web App descriptor" effort="3" category-id="mandatory">
                        <description> JRun web descriptor is a file that is by convention named jrun-web. It is JRun specific configuration file used to configure JRun server. This file is not supported in JBoss EAP 6 and needs to be migrated to web.xml or JBoss-specific jboss-web.xml</description>
                        <link href="https://access.redhat.com/documentation/en-us/JBoss_Enterprise_Application_Platform/6.4/html/Security_Guide/jboss-webxml_Configuration_Reference.html" title="JBoss EAP web descriptor"/>
                        <tag>configuration</tag>
                        <tag>jrun</tag>
                    </classification>
                </iteration>
            </perform>
        </rule>
        <rule id="xml-jrun-02000">
            <when>
                <or>
                    <xmlfile as="default" matches="/*[local-name()='jrun-ejb-jar']"/>
                    <xmlfile as="default" public-id="Macromedia, Inc.//DTD jrun-ejb-jar ..."/>
                </or>
            </when>
            <perform>
                <iteration>
                    <classification issue-display-mode="all" title="JRun ejb-jar configuration" effort="3" category-id="mandatory">
                        <description> JRun ejb configuration file used to configure EJBs, map them to jndi names etc.</description>
                        <link
                            href="https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/6.4/html-single/development_guide/#jboss-ejb3xml_Deployment_Descriptor_Reference"
                            title="JBoss EAP 6 - jboss-ejb3.xml Deployment Descriptor Reference"/>
                        <link
                            href="https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.1/html-single/developing_ejb_applications/#jboss_ejb3_xml_deployment_descriptor_reference"
                            title="JBoss EAP 7 - jboss-ejb3.xml Deployment Descriptor Reference"/>
                        <tag>configuration</tag>
                        <tag>jrun</tag>
                     </classification>
                </iteration>
            </perform>
        </rule>
    </rules>
</ruleset>
