Skip to content

Ported to the latest Alfresco Community (6.2 GA) #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/target/
.project
.classpath
.settings
*~
698 changes: 674 additions & 24 deletions LICENSE

Large diffs are not rendered by default.

69 changes: 47 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,50 @@
Alfresco Tacking Image Removal Patch
====================================

Distributed for free without any license or warranty. Use at your own risk.

Instructions
============

1. Look at the README located in the amp folder to build an Alfresco module (contributed by @Pluies)

**or manually patch the war**

1. Place an Alfresco share.war file in the current working directory.
2. Run the ./patch.sh command

This has been tested on Alfresco 4.2b/4.2c as well as 5.0/5.1 community (thanks @patricia93sousa)

Your mileage on other versions may vary.

Source (.java) and binary (.class) files are included.

Additional details:
# Alfresco Tracking Image Removal Patch
Remove that *hidden*, *hardcoded* and *annoying* tracking image from Alfresco Community

Distributed for free without any warranty. Use at your own risk.

Tested with **Alfresco Community Edition 6.2 GA**.

## Instructions
### Build
Get the sources:
```console
$ git clone https://github.com/saidone75/alfresco-tracking-removal.git -b v1.0.0
```
build the AMP:
```console
$ cd alfresco-tracking-removal
$ mvn package
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------< org.saidone:alfresco-tracking-removal >----------------
[INFO] Building alfresco-tracking-removal AMP project 1.0
[INFO] --------------------------------[ amp ]---------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-sdk-requirements) @ alfresco-tracking-removal ---
[...]
[INFO] --- alfresco-maven-plugin:2.2.0:amp (default-amp) @ alfresco-tracking-removal ---
[INFO] Building jar: alfresco-tracking-removal/target/amp/lib/alfresco-tracking-removal-1.0.jar
[INFO] Building amp: alfresco-tracking-removal/target/alfresco-tracking-removal-1.0.amp
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.688 s
[INFO] Finished at: 2020-12-26T15:15:55+01:00
[INFO] ------------------------------------------------------------------------
```
### Installation
Install the AMP against share.war using the Module Management Tool (MMT):
```
$ java -jar alfresco-mmt.jar install target/alfresco-tracking-removal-1.0.amp share.war
```
and restart Alfresco.

### Pre-built AMP
On [releases](https://github.com/saidone75/alfresco-tracking-removal/releases) page

## Credits
Credits for this patch goes to:

http://penguindreams.org/blog/removing-the-tracking-image-from-alfresco

Expand Down

This file was deleted.

Binary file not shown.

This file was deleted.

8 changes: 0 additions & 8 deletions amp/README.md

This file was deleted.

This file was deleted.

Binary file not shown.
5 changes: 0 additions & 5 deletions amp/remove-tracking-amp/module.properties

This file was deleted.

Binary file removed amp/remove-tracking.amp
Binary file not shown.
8 changes: 0 additions & 8 deletions patch.sh

This file was deleted.

92 changes: 92 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.saidone</groupId>
<artifactId>alfresco-tracking-removal</artifactId>
<version>1.0</version>
<name>alfresco-tracking-removal AMP project</name>
<packaging>amp</packaging>
<description>Manages the lifecycle of the alfresco-tracking-removal AMP (Alfresco Module Package)</description>

<parent>
<groupId>org.alfresco.maven</groupId>
<artifactId>alfresco-sdk-parent</artifactId>
<version>2.2.0</version>
</parent>

<!--
SDK properties have sensible defaults in the SDK parent,
but you can override the properties below to use another version.
For more available properties see the alfresco-sdk-parent POM.
-->
<properties>
<!-- The following are default values for data location and Alfresco version.
Uncomment if you need to change
<alfresco.version>${alfresco.community.default.version}</alfresco.version> -->

<!-- This control the root logging level for all apps uncomment and change, defaults to WARN
<app.log.root.level>WARN</app.log.root.level>
-->

<!-- Set the enviroment to use, this controls which properties will be picked in src/test/properties
for embedded run, defaults to the 'local' environment. See SDK Parent POM for more info.
<env>other environment name</env>
-->

<!-- The Maven artifact ID to use when loading the Share.WAR that the AMP should be applied to,
defaults to the alfresco.war artifact ID, so we need to override here. -->
<app.amp.client.war.artifactId>${alfresco.share.artifactId}</app.amp.client.war.artifactId>

<!-- Since Alfresco.WAR (i.e. the Repository) is already running on port 8080, we run Share.WAR on port 8081 -->
<maven.tomcat.port>8081</maven.tomcat.port>

<!-- Used in share-config-custom.xml. By default points to local installation of Alfresco Repo -->
<alfresco.repo.url>http://localhost:8080/alfresco</alfresco.repo.url>

</properties>

<!-- Here we realize the connection with the Alfresco selected platform
(e.g.version and edition) -->
<dependencyManagement>
<dependencies>
<!-- This will import the dependencyManagement for all artifacts in the selected Alfresco version/edition
(see http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Importing_Dependencies)
NOTE: You still need to define dependencies in your POM, but you can omit version as it's enforced by this dependencyManagement. NOTE: It defaults
to the latest version this SDK pom has been tested with, but alfresco version can/should be overridden in your project's pom -->
<dependency>
<groupId>${alfresco.groupId}</groupId>
<artifactId>alfresco-platform-distribution</artifactId>
<version>${alfresco.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<!-- Following dependencies are needed for compiling Java code in src/main/java; -->
<dependencies>
<dependency>
<groupId>${alfresco.groupId}</groupId>
<artifactId>share</artifactId>
<version>${alfresco.version}</version>
<classifier>classes</classifier>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.extensions.surf</groupId>
<artifactId>spring-surf-api</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<plugins>
<!-- Compress JavaScript files and store as *-min.js -->
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
3 changes: 3 additions & 0 deletions run.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@ECHO OFF

mvn clean install -Pamp-to-war
19 changes: 19 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
# Note. This script requires Alfresco.war to be running in another Tomcat on port 8080

if [[ -z ${MAVEN_OPTS} ]]; then
echo "The environment variable 'MAVEN_OPTS' is not set, setting it for you";

# Downloads the spring-loaded lib if not existing and runs the Share AMP applied to Share WAR
springloadedfile=~/.m2/repository/org/springframework/springloaded/1.2.5.RELEASE/springloaded-1.2.5.RELEASE.jar

if [ ! -f $springloadedfile ]; then
mvn validate -Psetup
fi

# Spring loaded can be used with the Share AMP project in 5.1
# (i.e. it does not have the same problem as Repo AMP and AIO)
MAVEN_OPTS="-javaagent:$springloadedfile -noverify"
fi
echo "MAVEN_OPTS is set to '$MAVEN_OPTS'";
mvn clean install -Pamp-to-war
Loading