Skip to content

Commit

Permalink
Use of "web fragments"
Browse files Browse the repository at this point in the history
web.xml Share file is no more overridden by the module.
https://blogs.oracle.com/swchan/servlet-30-web-fragmentxml

Ordering: web-fragment filters are executed *after* webapp filters so,
due to UrlRewriteFilter, we need to catch forwarded requests.

#14

Issue #42193

Change-Id: Id4780de7846a9f45d1598e26ed10e7d1b32656c1
  • Loading branch information
bforest committed Apr 13, 2018
1 parent e15da50 commit 948b83f
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 254 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Supported DBMS:


## [Unreleased]
### Changed
- Use of "web fragments" (web.xml is no more overridden by the module) (https://github.com/atolcd/alfresco-audit-share/issues/14)


## [1.5.6] - 2018-03-29
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG_FR.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ SGBD support


## [Unreleased]
### Changed
- Utilisation de "web fragments" (le fichier web.xml n'est plus écrasé par le module) (https://github.com/atolcd/alfresco-audit-share/issues/14)


## [1.5.6] - 2018-03-29
Expand Down
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"AuditShare" for Alfresco
================================

**AuditShare** is an extension totally integrated into the Share UI accessible by **administrators** and **sites managers**.
**AuditShare** is an extension totally integrated into the Share UI accessible by **administrators** and **site managers**.
This app displays sites and repository usage info: number of created/read/updated/deleted documents displayed by day/week/month/year.
In sites, others informations are "audited" concerning wiki, blog and discussions components but also users connected and sites volumetry.

Expand Down Expand Up @@ -42,11 +42,6 @@ This extension is a standard Alfresco Module, so experienced users can skip thes
4. Start Alfresco


Overrides
---------------------
**Caution:** Share **web.xml** file is overridden by the module (to declare new filters).


Using the module
---------------------

Expand Down Expand Up @@ -84,7 +79,7 @@ Contributors
Created by: [Alexandre NICOLAS](https://github.com/alexandre-nicolas) and [Bertrand FOREST](https://github.com/bforest)

Contributors:
- Anicet PRAO
- [Anicet PRAO](https://github.com/anicet-prao)
- Benjamin BRUDO
- [Stéphane PROUVEZ](https://github.com/sprouvez)
- [Laurent MEUNIER](https://github.com/lmeunier)
Expand Down
6 changes: 0 additions & 6 deletions module_share/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@
<value>auditshare-module-share, com.atolcd.alfresco.auditshare-share, com.atolcd.alfresco.auditshare-42X-share, com.atolcd.alfresco.auditshare-50X-share, com.atolcd.alfresco.auditshare-51X-share</value>
</property>
</moduleProperties>
<filemappingProperties>
<property>
<name>/WEB-INF</name>
<value>/WEB-INF</value>
</property>
</filemappingProperties>
<rootDirectory>${project.basedir}/src/main/webapp</rootDirectory>
</configuration>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public class ProxyAuditFilter extends AuditFilterConstants implements Filter {
// XXX: externalize configuration?
public static final String SHARE_WEBAPP_NAME = "share";
public static final String ALFRESCO_ENDPOINT_ID = "alfresco";
public static final String SHORT_PROXY_URL = "/" + SHARE_WEBAPP_NAME + "/proxy/" + ALFRESCO_ENDPOINT_ID + "/";
public static final String SHORT_PROXY_URL = "/" + SHARE_WEBAPP_NAME + "/page/proxy/" + ALFRESCO_ENDPOINT_ID + "/";

public static final String KEY_SITE = "site";
public static final String KEY_MODULE = "module";
Expand Down
54 changes: 54 additions & 0 deletions module_share/src/main/web-fragment.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<!--
* Copyright (C) 2018 Atol Conseils et Développements.
* http://www.atolcd.com/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<web-fragment xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee/web-fragment_3_0.xsd"
version="3.0">

<name>AuditShareFragment</name>
<ordering><before><others/></before></ordering>

<filter>
<description>AuditShare Filter</description>
<filter-name>AuditShareFilter</filter-name>
<filter-class>com.atolcd.alfresco.AuditFilter</filter-class>
</filter>
<filter>
<description>AuditShare Proxy Filter</description>
<filter-name>ProxyAuditShareFilter</filter-name>
<filter-class>com.atolcd.alfresco.ProxyAuditFilter</filter-class>
</filter>


<filter-mapping>
<filter-name>AuditShareFilter</filter-name>
<url-pattern>/page/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>AuditShareFilter</filter-name>
<url-pattern>/p/*</url-pattern>
</filter-mapping>

<filter-mapping>
<filter-name>ProxyAuditShareFilter</filter-name>
<url-pattern>/page/proxy/*</url-pattern>
<!-- Due to UrlRewriteFilter -->
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
</web-fragment>
234 changes: 0 additions & 234 deletions module_share/src/main/webapp/WEB-INF/web.xml

This file was deleted.

12 changes: 6 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@
<alfresco.version>5.2.f</alfresco.version>
<!-- Example for Enterprise version -->
<!--<alfresco.version>5.2.3</alfresco.version>-->
<alfresco-maven.version>1.1.6</alfresco-maven.version>
<alfresco-maven.version>1.1.8</alfresco-maven.version>
<java.version>1.8</java.version>
<sonar.projectName>AtolCD - AuditShare [5.2.X]</sonar.projectName>
</properties>

<!-- For internal use only (atolcd) -->
<distributionManagement>
<repository>
<id>nexus-releases</id>
<url>http://nexus.lan.priv.atolcd.com/content/repositories/releases/</url>
<id>maven-registry</id>
<url>https://maven-registry.priv.atolcd.com</url>
<name>Releases</name>
</repository>
<snapshotRepository>
<id>nexus-snapshots</id>
<url>http://nexus.lan.priv.atolcd.com/content/repositories/snapshots/</url>
<name>Snapshots</name>
<id>maven-snapshot-registry</id>
<url>https://maven-snapshot-registry.priv.atolcd.com</url>
<name>Snapshot</name>
</snapshotRepository>
</distributionManagement>

Expand Down

0 comments on commit 948b83f

Please sign in to comment.