- */
-
-/*
-* There is an Enterprise overlay for this file
-*/
-
-package org.penguindreams.alfresco;
-
-import java.io.IOException;
-import java.io.Writer;
-import java.util.Map;
-
-import org.springframework.extensions.surf.util.I18NUtil;
-import org.springframework.extensions.surf.util.StringBuilderWriter;
-import org.springframework.extensions.webscripts.WebScriptException;
-import org.springframework.extensions.webscripts.WebScriptRequest;
-import org.springframework.extensions.webscripts.WebScriptResponse;
-import org.springframework.extensions.webscripts.json.JSONWriter;
-
-/**
- * WebScript responsible for returning a JavaScript response containing a JavaScript
- * associative array of all I18N messages name/key pairs installed on the web-tier.
- *
- * The JavaScript object is created as 'Alfresco.messages' - example usage:
- *
- * var msg = Alfresco.messages["messageid"];
- *
- *
- * @author Kevin Roast
- */
-public class TrackingImageRemovalMessagesWebScript extends org.springframework.extensions.webscripts.MessagesWebScript
-{
- /**
- * Generate the message for a given locale.
- *
- * @param locale Java locale format
- *
- * @return messages as JSON string
- *
- * @throws IOException
- */
- @Override
- protected String generateMessages(WebScriptRequest req, WebScriptResponse res, String locale) throws IOException
- {
- Writer writer = new StringBuilderWriter(8192);
- writer.write("if (typeof Alfresco == \"undefined\" || !Alfresco) {var Alfresco = {};}\r\n");
- writer.write("Alfresco.messages = Alfresco.messages || {global: null, scope: {}}\r\n");
- writer.write("Alfresco.messages.global = ");
- JSONWriter out = new JSONWriter(writer);
-
- try
- {
- out.startObject();
- Map messages = I18NUtil.getAllMessages(I18NUtil.parseLocale(locale));
- for (Map.Entry entry : messages.entrySet())
- {
- out.writeValue(entry.getKey(), entry.getValue());
- }
- out.endObject();
- }
- catch (IOException jsonErr)
- {
- throw new WebScriptException("Error building messages response.", jsonErr);
- }
- writer.write(";\r\n");
-
- // start logo
- // community logo
-
- //Sumit - PenguinDreams - Edited to remove this image as it's a phone-home for Alfresco to gather software stats.
- // It's in two places; removed below as well
-
- //final String serverPath = req.getServerPath();
- //final int schemaIndex = serverPath.indexOf(':');
- //writer.write("window.setTimeout(function(){(document.getElementById('alfresco-yuiloader')||document.createElement('div')).innerHTML = '
\'}, 100);\r\n");
- // end logo
-
- return writer.toString();
- }
-
- @Override
- protected String getMessagesPrefix(WebScriptRequest req, WebScriptResponse res, String locale) throws IOException
- {
- return "if (typeof Alfresco == \"undefined\" || !Alfresco) {var Alfresco = {};}\r\nAlfresco.messages = Alfresco.messages || {global: null, scope: {}}\r\nAlfresco.messages.global = ";
- }
-
- @Override
- protected String getMessagesSuffix(WebScriptRequest req, WebScriptResponse res, String locale) throws IOException
- {
- StringBuilder sb = new StringBuilder();
- sb.append(";\r\n");
-
- //Sumit - PenguinDreams - removed; see above
-
- // start logo
- // community logo
- //final String serverPath = req.getServerPath();
- //final int schemaIndex = serverPath.indexOf(':');
- //sb.append("window.setTimeout(function(){(document.getElementById('alfresco-yuiloader')||document.createElement('div')).innerHTML = '
\'}, 100);\r\n");
- // end logo
- return sb.toString();
- }
-}
diff --git a/amp/README.md b/amp/README.md
deleted file mode 100644
index 983a27e..0000000
--- a/amp/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-Just the same project, but built as an AMP for easy deploy.
-
-Rebuild the amp:
-
- cd amp/remove-tracking-amp
- zip -rv ../remove-tracking.amp ./*
-
-Install the amp with the [Module Management Tool](http://wiki.alfresco.com/wiki/Module_Management_Tool).
diff --git a/amp/remove-tracking-amp/config/alfresco/web-extension/custom-slingshot-application-context.xml b/amp/remove-tracking-amp/config/alfresco/web-extension/custom-slingshot-application-context.xml
deleted file mode 100644
index 84952f2..0000000
--- a/amp/remove-tracking-amp/config/alfresco/web-extension/custom-slingshot-application-context.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/amp/remove-tracking-amp/config/org/penguindreams/alfresco/TrackingImageRemovalMessagesWebScript.class b/amp/remove-tracking-amp/config/org/penguindreams/alfresco/TrackingImageRemovalMessagesWebScript.class
deleted file mode 100644
index f01cd27..0000000
Binary files a/amp/remove-tracking-amp/config/org/penguindreams/alfresco/TrackingImageRemovalMessagesWebScript.class and /dev/null differ
diff --git a/amp/remove-tracking-amp/module.properties b/amp/remove-tracking-amp/module.properties
deleted file mode 100644
index a47fdac..0000000
--- a/amp/remove-tracking-amp/module.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-module.version=1.0.0
-module.description=Remove tracking from Alfresco Inc.
-module.id=nz.net.catalyst.alfresco.removetracking
-module.title=Remove Alfresco tracking
-module.repo.version.min=4.0.0
diff --git a/amp/remove-tracking.amp b/amp/remove-tracking.amp
deleted file mode 100644
index 05db3c2..0000000
Binary files a/amp/remove-tracking.amp and /dev/null differ
diff --git a/patch.sh b/patch.sh
deleted file mode 100755
index d764494..0000000
--- a/patch.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-if [ -f "share.war" ]; then
- jar uvf share.war WEB-INF
-else
- echo "Please copy share.war to current working directory"
- exit 2
-fi
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..920d160
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,92 @@
+
+
+ 4.0.0
+ org.saidone
+ alfresco-tracking-removal
+ 1.0
+ alfresco-tracking-removal AMP project
+ amp
+ Manages the lifecycle of the alfresco-tracking-removal AMP (Alfresco Module Package)
+
+
+ org.alfresco.maven
+ alfresco-sdk-parent
+ 2.2.0
+
+
+
+
+
+
+
+
+
+
+
+ ${alfresco.share.artifactId}
+
+
+ 8081
+
+
+ http://localhost:8080/alfresco
+
+
+
+
+
+
+
+
+ ${alfresco.groupId}
+ alfresco-platform-distribution
+ ${alfresco.version}
+ pom
+ import
+
+
+
+
+
+
+
+ ${alfresco.groupId}
+ share
+ ${alfresco.version}
+ classes
+ provided
+
+
+ org.springframework.extensions.surf
+ spring-surf-api
+ provided
+
+
+
+
+
+
+
+ net.alchim31.maven
+ yuicompressor-maven-plugin
+
+
+
+
\ No newline at end of file
diff --git a/run.bat b/run.bat
new file mode 100644
index 0000000..ae97ed3
--- /dev/null
+++ b/run.bat
@@ -0,0 +1,3 @@
+@ECHO OFF
+
+mvn clean install -Pamp-to-war
\ No newline at end of file
diff --git a/run.sh b/run.sh
new file mode 100755
index 0000000..3ce06cc
--- /dev/null
+++ b/run.sh
@@ -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
\ No newline at end of file
diff --git a/src/main/amp/config/alfresco/web-extension/alfresco-tracking-removal-slingshot-application-context.xml b/src/main/amp/config/alfresco/web-extension/alfresco-tracking-removal-slingshot-application-context.xml
new file mode 100644
index 0000000..866d326
--- /dev/null
+++ b/src/main/amp/config/alfresco/web-extension/alfresco-tracking-removal-slingshot-application-context.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/amp/file-mapping.properties b/src/main/amp/file-mapping.properties
new file mode 100644
index 0000000..45cccaf
--- /dev/null
+++ b/src/main/amp/file-mapping.properties
@@ -0,0 +1,14 @@
+# Custom AMP to WAR location mappings
+
+#
+# The following property can be used to include the standard set of mappings.
+# The contents of this file will override any defaults. The default is
+# 'true', i.e. the default mappings will be augmented or modified by values in
+# this file.
+#
+include.default=true
+
+#
+# Custom mappings. If 'include.default' is false, then this is the complete set.
+#
+/web=/
diff --git a/src/main/amp/module.properties b/src/main/amp/module.properties
new file mode 100644
index 0000000..158500f
--- /dev/null
+++ b/src/main/amp/module.properties
@@ -0,0 +1,48 @@
+# 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.
+
+
+
+# SDK Sample module
+
+# ==== Beginning of Alfresco required/optional properties ====== #
+# NB: These properties are filtered at build time by Maven, single
+# sourcing from POM properties
+module.id=${project.artifactId}
+#module.aliases=myModule-123, my-module
+module.title=${project.name}
+module.description=${project.description}
+module.version=${project.version}
+
+# The following optional properties can be used to prevent the module from being added
+# to inappropriate versions of the WAR file.
+# module.repo.version.min=2.0
+# module.repo.version.max=2.1
+
+# FIXME: This dependencies should come out of mvn dependencies on amp
+
+# The following describe dependencies on other modules
+# Depends on net.sf.myproject.module.SupportModuleA version ${version} or later
+# module.depends.net.sf.myproject.module.SupportModuleA=${version}-*
+# Depends on net.sf.myproject.module.SupportModuleA version ${version} to 2.0
+# module.depends.net.sf.myproject.module.SupportModuleB=${version}-2.0
+# Depends on net.sf.myproject.module.SupportModuleC - any version
+# module.depends.net.sf.myproject.module.SupportModuleB=*
+
+
+# ==== End of Alfresco required/optional properties ======= #
+
+
+# ==== Beginning of module required properties/optional ====== #
\ No newline at end of file
diff --git a/src/main/java/org/saidone/TrackingPixelRemovalWebScript.java b/src/main/java/org/saidone/TrackingPixelRemovalWebScript.java
new file mode 100644
index 0000000..0a93952
--- /dev/null
+++ b/src/main/java/org/saidone/TrackingPixelRemovalWebScript.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2005 - 2020 Alfresco Software Limited.
+ *
+ * This file is part of the Alfresco software.
+ * If the software was purchased under a paid Alfresco license, the terms of the paid license agreement will prevail.
+ * Otherwise, the software is provided under the following open source license terms:
+ *
+ * Alfresco 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.
+ *
+ * Alfresco 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 Alfresco. If not, see .
+ */
+/*
+* There is an Enterprise overlay for this file
+*/
+
+package org.saidone;
+
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Map;
+
+import org.springframework.extensions.surf.util.I18NUtil;
+import org.springframework.extensions.surf.util.StringBuilderWriter;
+import org.springframework.extensions.webscripts.WebScriptException;
+import org.springframework.extensions.webscripts.WebScriptRequest;
+import org.springframework.extensions.webscripts.WebScriptResponse;
+import org.springframework.extensions.webscripts.json.JSONWriter;
+
+/**
+ * WebScript responsible for returning a JavaScript response containing a JavaScript
+ * associative array of all I18N messages name/key pairs installed on the web-tier.
+ *
+ * The JavaScript object is created as 'Alfresco.messages' - example usage:
+ *
+ * var msg = Alfresco.messages["messageid"];
+ *
+ *
+ * @author Kevin Roast
+ */
+public class TrackingPixelRemovalWebScript extends org.alfresco.web.scripts.MessagesWebScript
+{
+ @Override
+ protected String generateMessages(WebScriptRequest req, WebScriptResponse res, String locale) throws IOException
+ {
+ Writer writer = new StringBuilderWriter(8192);
+ writer.write("if (typeof Alfresco == \"undefined\" || !Alfresco) {var Alfresco = {};}\r\n");
+ writer.write("Alfresco.messages = Alfresco.messages || {global: null, scope: {}}\r\n");
+ writer.write("Alfresco.messages.global = ");
+ JSONWriter out = new JSONWriter(writer);
+ try
+ {
+ out.startObject();
+ Map messages = I18NUtil.getAllMessages(I18NUtil.parseLocale(locale));
+ for (Map.Entry entry : messages.entrySet())
+ {
+ out.writeValue(entry.getKey(), entry.getValue());
+ }
+ out.endObject();
+ }
+ catch (IOException jsonErr)
+ {
+ throw new WebScriptException("Error building messages response.", jsonErr);
+ }
+ writer.write(";\r\n");
+ return writer.toString();
+ }
+
+ @Override
+ protected String getMessagesSuffix(WebScriptRequest req, WebScriptResponse res, String locale) throws IOException
+ {
+ return (";\r\n");
+ }
+
+}
\ No newline at end of file
diff --git a/tomcat/context.xml b/tomcat/context.xml
new file mode 100644
index 0000000..59a0220
--- /dev/null
+++ b/tomcat/context.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+