<commit_before><?xml version="1.0"?>

<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->

<web-app version="3.0">

    <display-name>SCIPIO - Shop</display-name>
    <description>Demo eCommerce Store</description>

    <context-param>
        <description>A unique ID used to look up the WebSite entity</description>
        <param-name>webSiteId</param-name>
        <param-value>ScipioWebStore</param-value>
    </context-param>
    <context-param>
        <description>A unique name used to identify/recognize the local dispatcher for the Service Engine</description>
        <param-name>localDispatcherName</param-name>
        <param-value>scipio-shop</param-value>
    </context-param>
    <context-param>
        <description>The Name of the Entity Delegator to use, defined in entityengine.xml</description>
        <param-name>entityDelegatorName</param-name>
        <param-value>default</param-value>
    </context-param>
    <context-param>
        <description>The location of the main-decorator screen to use for this webapp; referred to as a context variable in screen def XML files.</description>
        <param-name>mainDecoratorLocation</param-name>
        <param-value>component://shop/widget/CommonScreens.xml</param-value>
    </context-param>
    <context-param>
        <description>
            Forces the JSESSIONID cookie to be sent via http rather https, helps prevent lost sessions in web apps that
            frequently switch between http and https.
        </description>
        <param-name>forceHttpSession</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <description>
            SCIPIO: Enables or disables controller target view overrides (/control/requestname/viewname) in request handler. Default: true (enabled - stock behavior).
        </description>
        <param-name>allowOverrideViewUri</param-name>
        <param-value>true</param-value>
    </context-param>

    <!-- HTML Compression - enable this in production (disable for debugging)
    <context-param>
        <description>Remove unnecessary whitespace from HTML output.</description>
        <param-name>compressHTML</param-name>
        <param-value>true</param-value>
    </context-param>
    -->

    <!-- SCIPIO: UrlRewriteFilter - processes urlrewrite.xml
        NOTE: 2017-11-01: SimpleRedirectFilter is replaced by UrlRewriteFilter. -->
    <filter>
        <filter-name>UrlRewriteFilter</filter-name>
        <filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
        <!-- Uncomment this to make rules editable at runtime
        <init-param>
            <param-name>confReloadCheckInterval</param-name>
            <param-value>0</param-value>
        </init-param>-->
        <init-param>
            <param-name>logLevel</param-name>
            <param-value>log4j</param-value>
        </init-param>
        <init-param>
            <param-name>statusEnabled</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>
    <filter>
        <display-name>SeoCatalogUrlFilter</display-name>
        <filter-name>SeoCatalogUrlFilter</filter-name>
        <filter-class>com.ilscipio.scipio.product.seo.SeoCatalogUrlFilter</filter-class>
        <init-param><param-name>defaultLocaleString</param-name><param-value>en_US</param-value></init-param>
        <!-- SCIPIO: Set this to true to enable advanced SEO URLs; if false, delegates to the regular CatalogUrlFilter. -->
        <init-param><param-name>seoUrlEnabled</param-name><param-value>false</param-value></init-param>
    </filter>
    <filter>
        <display-name>CatalogUrlFilter</display-name>
        <filter-name>CatalogUrlFilter</filter-name>
        <filter-class>org.ofbiz.product.category.CatalogUrlFilter</filter-class>
        <init-param><param-name>defaultLocaleString</param-name><param-value>en_US</param-value></init-param>
    </filter>
    <filter>
        <display-name>ContentUrlFilter</display-name>
        <filter-name>ContentUrlFilter</filter-name>
        <filter-class>org.ofbiz.content.content.ContentUrlFilter</filter-class>
        <init-param>
            <param-name>defaultLocaleString</param-name>
            <param-value>en_US</param-value>
        </init-param>
        <init-param><param-name>viewRequest</param-name><param-value>ViewBlogArticle</param-value></init-param>
    </filter>
    <filter>
        <display-name>ContextFilter</display-name>
        <filter-name>ContextFilter</filter-name>
        <filter-class>org.ofbiz.webapp.control.ContextFilter</filter-class>
        <init-param>
            <param-name>disableContextSecurity</param-name>
            <param-value>N</param-value>
        </init-param>
        <init-param>
            <param-name>allowedPaths</param-name>
            <param-value>/error:/control:/products:/select:/index.html:/index.jsp:/robots.txt:/default.html:/default.jsp:/images</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>UrlRewriteFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
    </filter-mapping>
    <filter-mapping>
        <filter-name>SeoCatalogUrlFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
    </filter-mapping>
    <filter-mapping>
        <filter-name>CatalogUrlFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
    </filter-mapping>
    <filter-mapping>
        <filter-name>ContentUrlFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
    </filter-mapping>
    <filter-mapping>
        <filter-name>ContextFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher><!-- SCIPIO: 2017-11-01: required for previous filter forwards to work  -->
    </filter-mapping>

    <listener><listener-class>org.ofbiz.webapp.control.ControlEventListener</listener-class></listener>
    <!-- NOTE: not all app servers support mounting implementations of the HttpSessionActivationListener interface -->
    <!-- <listener><listener-class>org.ofbiz.webapp.control.ControlActivationEventListener</listener-class></listener> -->

    <!-- this listener will save any abandoned cart info -->
    <listener><listener-class>org.ofbiz.order.shoppingcart.CartEventListener</listener-class></listener>
    <!-- this listener will clean up info -->
    <listener><listener-class>org.ofbiz.webapp.control.LoginEventListener</listener-class></listener>

    <servlet>
        <display-name>ControlServlet</display-name>
        <servlet-name>ControlServlet</servlet-name>
        <description>Main Control Servlet</description>
        <servlet-class>org.ofbiz.webapp.control.ControlServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <!-- un-comment for Worldpay
    <servlet>
        <description>WorldPay Select Handler Service</description>
        <display-name>SelectHandler</display-name>
        <servlet-name>select</servlet-name>
        <servlet-class>com.worldpay.select.merchant.SelectHandler</servlet-class>
        <load-on-startup>5</load-on-startup>
    </servlet>
    -->
    <servlet>
        <description>Catalog (Category/Product) URL Servlet</description>
        <display-name>CatalogUrlServlet</display-name>
        <servlet-name>CatalogUrlServlet</servlet-name>
        <servlet-class>org.ofbiz.product.category.CatalogUrlServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>ControlServlet</servlet-name>
        <url-pattern>/control/*</url-pattern>
    </servlet-mapping>
    <!-- un-comment for Worldpay
    <servlet-mapping>
        <servlet-name>select</servlet-name>
        <url-pattern>/select/*</url-pattern>
    </servlet-mapping>
    -->
    <servlet-mapping>
        <servlet-name>CatalogUrlServlet</servlet-name>
        <url-pattern>/products/*</url-pattern>
    </servlet-mapping>

    <session-config>
        <!-- SCIPIO: Increase shop session timeout to 24 hours. If more frequent logins are desired (as in some shops - for security),
            they would need to be coded in a less brute way, because by default this method will destroy the cart, which is rarely desired.
        <session-timeout>60</session-timeout>-->
        <session-timeout>1440</session-timeout>
        <cookie-config>
          <http-only>true</http-only>
          <!-- SCIPIO: FIXME?: Currently can't enable this, it is causing secure flag even for HTTP requests and
              causing a new session to be recreated at every non-HTTPS request
          <secure>true</secure>-->
        </cookie-config>
        <tracking-mode>COOKIE</tracking-mode>
    </session-config>

    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
    </welcome-file-list>

    <error-page>
        <error-code>404</error-code>
        <location>/error/404.jsp</location>
    </error-page>
</web-app>
<commit_msg>NoRef shop: seo/alt urls: web.xml: comment out the stock CatalogUrlFilter because too hard to separate them<commit_after><?xml version="1.0"?>

<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->

<web-app version="3.0">

    <display-name>SCIPIO - Shop</display-name>
    <description>Demo eCommerce Store</description>

    <context-param>
        <description>A unique ID used to look up the WebSite entity</description>
        <param-name>webSiteId</param-name>
        <param-value>ScipioWebStore</param-value>
    </context-param>
    <context-param>
        <description>A unique name used to identify/recognize the local dispatcher for the Service Engine</description>
        <param-name>localDispatcherName</param-name>
        <param-value>scipio-shop</param-value>
    </context-param>
    <context-param>
        <description>The Name of the Entity Delegator to use, defined in entityengine.xml</description>
        <param-name>entityDelegatorName</param-name>
        <param-value>default</param-value>
    </context-param>
    <context-param>
        <description>The location of the main-decorator screen to use for this webapp; referred to as a context variable in screen def XML files.</description>
        <param-name>mainDecoratorLocation</param-name>
        <param-value>component://shop/widget/CommonScreens.xml</param-value>
    </context-param>
    <context-param>
        <description>
            Forces the JSESSIONID cookie to be sent via http rather https, helps prevent lost sessions in web apps that
            frequently switch between http and https.
        </description>
        <param-name>forceHttpSession</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <description>
            SCIPIO: Enables or disables controller target view overrides (/control/requestname/viewname) in request handler. Default: true (enabled - stock behavior).
        </description>
        <param-name>allowOverrideViewUri</param-name>
        <param-value>true</param-value>
    </context-param>

    <!-- HTML Compression - enable this in production (disable for debugging)
    <context-param>
        <description>Remove unnecessary whitespace from HTML output.</description>
        <param-name>compressHTML</param-name>
        <param-value>true</param-value>
    </context-param>
    -->

    <!-- SCIPIO: UrlRewriteFilter - processes urlrewrite.xml
        NOTE: 2017-11-01: SimpleRedirectFilter is replaced by UrlRewriteFilter. -->
    <filter>
        <filter-name>UrlRewriteFilter</filter-name>
        <filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
        <!-- Uncomment this to make rules editable at runtime
        <init-param>
            <param-name>confReloadCheckInterval</param-name>
            <param-value>0</param-value>
        </init-param>-->
        <init-param>
            <param-name>logLevel</param-name>
            <param-value>log4j</param-value>
        </init-param>
        <init-param>
            <param-name>statusEnabled</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>
    <filter>
        <display-name>SeoCatalogUrlFilter</display-name>
        <filter-name>SeoCatalogUrlFilter</filter-name>
        <filter-class>com.ilscipio.scipio.product.seo.SeoCatalogUrlFilter</filter-class>
        <init-param><param-name>defaultLocaleString</param-name><param-value>en_US</param-value></init-param>
        <!-- SCIPIO: Set this to true to enable advanced SEO URLs; if false, delegates to the regular CatalogUrlFilter. -->
        <init-param><param-name>seoUrlEnabled</param-name><param-value>false</param-value></init-param>
    </filter>
    <!-- SCIPIO: the stock CatalogUrlFilter will be contained in the SeoCatalogUrlFilter.
    <filter>
        <display-name>CatalogUrlFilter</display-name>
        <filter-name>CatalogUrlFilter</filter-name>
        <filter-class>org.ofbiz.product.category.CatalogUrlFilter</filter-class>
        <init-param><param-name>defaultLocaleString</param-name><param-value>en_US</param-value></init-param>
    </filter>-->
    <filter>
        <display-name>ContentUrlFilter</display-name>
        <filter-name>ContentUrlFilter</filter-name>
        <filter-class>org.ofbiz.content.content.ContentUrlFilter</filter-class>
        <init-param>
            <param-name>defaultLocaleString</param-name>
            <param-value>en_US</param-value>
        </init-param>
        <init-param><param-name>viewRequest</param-name><param-value>ViewBlogArticle</param-value></init-param>
    </filter>
    <filter>
        <display-name>ContextFilter</display-name>
        <filter-name>ContextFilter</filter-name>
        <filter-class>org.ofbiz.webapp.control.ContextFilter</filter-class>
        <init-param>
            <param-name>disableContextSecurity</param-name>
            <param-value>N</param-value>
        </init-param>
        <init-param>
            <param-name>allowedPaths</param-name>
            <param-value>/error:/control:/products:/select:/index.html:/index.jsp:/robots.txt:/default.html:/default.jsp:/images</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>UrlRewriteFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
    </filter-mapping>
    <filter-mapping>
        <filter-name>SeoCatalogUrlFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
    </filter-mapping>
    <filter-mapping>
        <filter-name>CatalogUrlFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
    </filter-mapping>
    <filter-mapping>
        <filter-name>ContentUrlFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
    </filter-mapping>
    <filter-mapping>
        <filter-name>ContextFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher><!-- SCIPIO: 2017-11-01: required for previous filter forwards to work  -->
    </filter-mapping>

    <listener><listener-class>org.ofbiz.webapp.control.ControlEventListener</listener-class></listener>
    <!-- NOTE: not all app servers support mounting implementations of the HttpSessionActivationListener interface -->
    <!-- <listener><listener-class>org.ofbiz.webapp.control.ControlActivationEventListener</listener-class></listener> -->

    <!-- this listener will save any abandoned cart info -->
    <listener><listener-class>org.ofbiz.order.shoppingcart.CartEventListener</listener-class></listener>
    <!-- this listener will clean up info -->
    <listener><listener-class>org.ofbiz.webapp.control.LoginEventListener</listener-class></listener>

    <servlet>
        <display-name>ControlServlet</display-name>
        <servlet-name>ControlServlet</servlet-name>
        <description>Main Control Servlet</description>
        <servlet-class>org.ofbiz.webapp.control.ControlServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <!-- un-comment for Worldpay
    <servlet>
        <description>WorldPay Select Handler Service</description>
        <display-name>SelectHandler</display-name>
        <servlet-name>select</servlet-name>
        <servlet-class>com.worldpay.select.merchant.SelectHandler</servlet-class>
        <load-on-startup>5</load-on-startup>
    </servlet>
    -->
    <servlet>
        <description>Catalog (Category/Product) URL Servlet</description>
        <display-name>CatalogUrlServlet</display-name>
        <servlet-name>CatalogUrlServlet</servlet-name>
        <servlet-class>org.ofbiz.product.category.CatalogUrlServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>ControlServlet</servlet-name>
        <url-pattern>/control/*</url-pattern>
    </servlet-mapping>
    <!-- un-comment for Worldpay
    <servlet-mapping>
        <servlet-name>select</servlet-name>
        <url-pattern>/select/*</url-pattern>
    </servlet-mapping>
    -->
    <servlet-mapping>
        <servlet-name>CatalogUrlServlet</servlet-name>
        <url-pattern>/products/*</url-pattern>
    </servlet-mapping>

    <session-config>
        <!-- SCIPIO: Increase shop session timeout to 24 hours. If more frequent logins are desired (as in some shops - for security),
            they would need to be coded in a less brute way, because by default this method will destroy the cart, which is rarely desired.
        <session-timeout>60</session-timeout>-->
        <session-timeout>1440</session-timeout>
        <cookie-config>
          <http-only>true</http-only>
          <!-- SCIPIO: FIXME?: Currently can't enable this, it is causing secure flag even for HTTP requests and
              causing a new session to be recreated at every non-HTTPS request
          <secure>true</secure>-->
        </cookie-config>
        <tracking-mode>COOKIE</tracking-mode>
    </session-config>

    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
    </welcome-file-list>

    <error-page>
        <error-code>404</error-code>
        <location>/error/404.jsp</location>
    </error-page>
</web-app>

{'fraction_non_alphanumeric': 0.13054344097613563, 'fraction_numerical': 0.004214240211692067, 'mean_word_length': 2.941290073387408, 'pattern_counts': {'":': 0, '<': 650, '<?xml version=': 2, '>': 650, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 9}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3391331', 'n_tokens_mistral': 5954, 'n_tokens_neox': 5806, 'n_words': 1145}