diff --git a/alfviral-share/pom.xml b/alfviral-share/pom.xml
index 15e972d..bcd2280 100644
--- a/alfviral-share/pom.xml
+++ b/alfviral-share/pom.xml
@@ -4,39 +4,46 @@
4.0.0
com.fegor.alfresco
alfviral-share
- 1.3.4-SNAPSHOT
- Alfviral-share AMP project
+ 1.4.0-SNAPSHOT
+ FegorSoft / Alfresco Virus Alert (Share)
amp
Manages the lifecycle of the alfviral-share AMP (Alfresco Module Package)
org.alfresco.maven
alfresco-sdk-parent
- 1.1.1
+ 2.2.0
-
- org.alfresco
-
- 4.2.e
- WARN
- alf_data_dev
-
- alfresco
-
- org.alfresco
-
- 4.2.e
-
- local
+
+
+
+
+
+
+
+ ${alfresco.share.artifactId}
+
+
+ 8081
+
+
+ http://localhost:8080/alfresco
+
+
+ net.alchim31.maven
+ yuicompressor-maven-plugin
+
+
+
diff --git a/alfviral-share/src/main/amp/config/alfresco/web-extension/slingshot-application-context.xml b/alfviral-share/src/main/amp/config/alfresco/web-extension/alfviral-share-slingshot-application-context.xml
similarity index 97%
rename from alfviral-share/src/main/amp/config/alfresco/web-extension/slingshot-application-context.xml
rename to alfviral-share/src/main/amp/config/alfresco/web-extension/alfviral-share-slingshot-application-context.xml
index 9f6121a..e4680e5 100644
--- a/alfviral-share/src/main/amp/config/alfresco/web-extension/slingshot-application-context.xml
+++ b/alfviral-share/src/main/amp/config/alfresco/web-extension/alfviral-share-slingshot-application-context.xml
@@ -10,6 +10,8 @@
+
+
diff --git a/alfviral-share/src/main/amp/config/alfresco/web-extension/share-config-custom.xml b/alfviral-share/src/main/resources/META-INF/share-config-custom.xml
similarity index 100%
rename from alfviral-share/src/main/amp/config/alfresco/web-extension/share-config-custom.xml
rename to alfviral-share/src/main/resources/META-INF/share-config-custom.xml
diff --git a/alfviral-share/target/alfviral-share.amp b/alfviral-share/target/alfviral-share.amp
deleted file mode 100644
index 58a0413..0000000
Binary files a/alfviral-share/target/alfviral-share.amp and /dev/null differ
diff --git a/alfviral-share/target/alfviral-share/config/alfresco/web-extension/messages/alfviral-messages.properties b/alfviral-share/target/alfviral-share/config/alfresco/web-extension/messages/alfviral-messages.properties
deleted file mode 100644
index 9c9ae8e..0000000
--- a/alfviral-share/target/alfviral-share/config/alfresco/web-extension/messages/alfviral-messages.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-aspect.ava_infected=Documento infectado
-aspect.ava_scanned_from_instream=Escaneado por stream
-aspect.ava_scanned_from_command=Escaneado por comando
-aspect.ava_scanned_from_virustotal=Escaneado por VirusTotal
-aspect.ava_scanned_from_icap=Escaneado por ICAP
-
-prop.ava.date=Fecha de detecci�n
-prop.ava.clean=�Desinfectado?
-
-prop.ava.response.code=C�digo de respuesta
-prop.ava.verbose.msg=Mensaje
-prop.ava.resource=Recurso
-prop.ava.scan.id=ID Scan
-prop.ava.permalink=Link
-prop.ava.sha256=SHA256
-prop.ava.positives=Positivos
-
-prop.ava.scan.id
-search.form.label.ava.infected.cm_content=B�squeda de infectados
-search.form.desc.ava.infected.cm_content=B�squeda de infectados
-
-message.scanfile.success=Documento escaneado
-message.scanfile.failure=El documento no ha podido ser escaneado
-
-actions.document.scanfile=Escanear fichero
-
\ No newline at end of file
diff --git a/alfviral-share/target/alfviral-share/config/alfresco/web-extension/messages/alfviral-messages_es.properties b/alfviral-share/target/alfviral-share/config/alfresco/web-extension/messages/alfviral-messages_es.properties
deleted file mode 100644
index 5180811..0000000
--- a/alfviral-share/target/alfviral-share/config/alfresco/web-extension/messages/alfviral-messages_es.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-aspect.ava_infected=Documento infectado
-aspect.ava_scanned_from_instream=Escaneado por stream
-aspect.ava_scanned_from_command=Escaneado por comando
-aspect.ava_scanned_from_virustotal=Escaneado por VirusTotal
-aspect.ava_scanned_from_icap=Escaneado por ICAP
-
-prop.ava.date=Fecha de detecci�n
-prop.ava.clean=�Desinfectado?
-
-prop.ava.response.code=C�digo de respuesta
-prop.ava.verbose.msg=Mensaje
-prop.ava.resource=Recurso
-prop.ava.scan.id=ID Scan
-prop.ava.permalink=Link
-prop.ava.sha256=SHA256
-prop.ava.positives=Positivos
-
-search.form.label.ava.infected.cm_content=B�squeda de infectados
-search.form.desc.ava.infected.cm_content=B�squeda de infectados
-
-message.scanfile.success=Documento escaneado
-message.scanfile.failure=El documento no ha podido ser escaneado
-
-actions.document.scanfile=Escanear fichero
-
\ No newline at end of file
diff --git a/alfviral-share/target/alfviral-share/config/alfresco/web-extension/share-config-custom.xml b/alfviral-share/target/alfviral-share/config/alfresco/web-extension/share-config-custom.xml
deleted file mode 100644
index 7adb642..0000000
--- a/alfviral-share/target/alfviral-share/config/alfresco/web-extension/share-config-custom.xml
+++ /dev/null
@@ -1,134 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- onActionScanFile
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/alfviral-share/target/alfviral-share/config/alfresco/web-extension/site-webscripts/org/alfresco/components/document-details/document-actions.get.config.xml b/alfviral-share/target/alfviral-share/config/alfresco/web-extension/site-webscripts/org/alfresco/components/document-details/document-actions.get.config.xml
deleted file mode 100644
index 245acc5..0000000
--- a/alfviral-share/target/alfviral-share/config/alfresco/web-extension/site-webscripts/org/alfresco/components/document-details/document-actions.get.config.xml
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/alfviral-share/target/alfviral-share/config/alfresco/web-extension/site-webscripts/org/alfresco/components/documentlibrary/actions-common.get.head.ftl b/alfviral-share/target/alfviral-share/config/alfresco/web-extension/site-webscripts/org/alfresco/components/documentlibrary/actions-common.get.head.ftl
deleted file mode 100644
index 242fab1..0000000
--- a/alfviral-share/target/alfviral-share/config/alfresco/web-extension/site-webscripts/org/alfresco/components/documentlibrary/actions-common.get.head.ftl
+++ /dev/null
@@ -1,22 +0,0 @@
-<#include "../component.head.inc">
-<#-- Document Library Actions: Supports concatenated JavaScript files via build scripts -->
-<#if DEBUG>
-
-
-
-
-
-
-
-<#else>
-
-#if>
-<#-- Global Folder Picker (req'd by Copy/Move To) -->
-<@link rel="stylesheet" type="text/css" href="${page.url.context}/res/modules/documentlibrary/global-folder.css" />
-<#-- People Finder Assets (req'd by Assign Workflow) -->
-<@link rel="stylesheet" type="text/css" href="${page.url.context}/res/components/people-finder/people-finder.css" />
-<#-- Manage Permissions -->
-<@link rel="stylesheet" type="text/css" href="${page.url.context}/res/modules/documentlibrary/permissions.css" />
-<#-- Manage Aspects -->
-<@link rel="stylesheet" type="text/css" href="${page.url.context}/res/modules/documentlibrary/aspects.css" />
-
diff --git a/alfviral-share/target/alfviral-share/config/alfresco/web-extension/site-webscripts/org/alfresco/components/documentlibrary/documentlist.get.config.xml b/alfviral-share/target/alfviral-share/config/alfresco/web-extension/site-webscripts/org/alfresco/components/documentlibrary/documentlist.get.config.xml
deleted file mode 100644
index a838be1..0000000
--- a/alfviral-share/target/alfviral-share/config/alfresco/web-extension/site-webscripts/org/alfresco/components/documentlibrary/documentlist.get.config.xml
+++ /dev/null
@@ -1,104 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/alfviral-share/target/alfviral-share/config/alfresco/web-extension/slingshot-application-context.xml b/alfviral-share/target/alfviral-share/config/alfresco/web-extension/slingshot-application-context.xml
deleted file mode 100644
index 9f6121a..0000000
--- a/alfviral-share/target/alfviral-share/config/alfresco/web-extension/slingshot-application-context.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
- alfresco.web-extension.messages.alfviral-messages
-
-
-
-
-
-
-
-
- classpath:alfresco/web-extension/share-config-custom.xml
-
-
-
-
-
diff --git a/alfviral-share/target/alfviral-share/lib/alfviral-share.jar b/alfviral-share/target/alfviral-share/lib/alfviral-share.jar
deleted file mode 100644
index 3f5d881..0000000
Binary files a/alfviral-share/target/alfviral-share/lib/alfviral-share.jar and /dev/null differ
diff --git a/alfviral-share/target/alfviral-share/log4j.properties b/alfviral-share/target/alfviral-share/log4j.properties
deleted file mode 100644
index 183137c..0000000
--- a/alfviral-share/target/alfviral-share/log4j.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-# Define here logging properties for your AMP specific classes
-# This will end up in alfresco.war/WEB-INF/classes/alfresco/module/log4j.properties
-# and loaded as per http://wiki.alfresco.com/wiki/Developing_an_Alfresco_Module#log4j.properties
-log4j.logger.org.alfresco.demoamp=DEBUG
\ No newline at end of file
diff --git a/alfviral-share/target/alfviral-share/module.properties b/alfviral-share/target/alfviral-share/module.properties
deleted file mode 100644
index d8bfb3c..0000000
--- a/alfviral-share/target/alfviral-share/module.properties
+++ /dev/null
@@ -1,48 +0,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.
-
-
-
-# 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=alfviral-share
-#module.aliases=myModule-123, my-module
-module.title=Alfviral-share AMP project
-module.description=Manages the lifecycle of the alfviral-share AMP (Alfresco Module Package)
-module.version=1.3.4.1702031434
-
-# 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 1.3.4-SNAPSHOT or later
-# module.depends.net.sf.myproject.module.SupportModuleA=1.3.4-SNAPSHOT-*
-# Depends on net.sf.myproject.module.SupportModuleA version 1.3.4-SNAPSHOT to 2.0
-# module.depends.net.sf.myproject.module.SupportModuleB=1.3.4-SNAPSHOT-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/alfviral-share/target/alfviral-share/web/css/demoamp.css b/alfviral-share/target/alfviral-share/web/css/demoamp.css
deleted file mode 100644
index c24bc1b..0000000
--- a/alfviral-share/target/alfviral-share/web/css/demoamp.css
+++ /dev/null
@@ -1,16 +0,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.
- */
\ No newline at end of file
diff --git a/alfviral-share/target/alfviral-share/web/jsp/demoamp.jsp b/alfviral-share/target/alfviral-share/web/jsp/demoamp.jsp
deleted file mode 100644
index 2fe9c38..0000000
--- a/alfviral-share/target/alfviral-share/web/jsp/demoamp.jsp
+++ /dev/null
@@ -1,19 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-
\ No newline at end of file
diff --git a/alfviral-share/target/alfviral-share/web/licenses/README-licenses.txt b/alfviral-share/target/alfviral-share/web/licenses/README-licenses.txt
deleted file mode 100644
index 3ff33ba..0000000
--- a/alfviral-share/target/alfviral-share/web/licenses/README-licenses.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-This folder (root in the AMP) gets mapped automagically in WEB-INF/licenses
-by the MMT or the alfresco-maven-plugin
\ No newline at end of file
diff --git a/alfviral-share/target/alfviral-share/web/scripts/demoamp.js b/alfviral-share/target/alfviral-share/web/scripts/demoamp.js
deleted file mode 100644
index c24bc1b..0000000
--- a/alfviral-share/target/alfviral-share/web/scripts/demoamp.js
+++ /dev/null
@@ -1,16 +0,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.
- */
\ No newline at end of file
diff --git a/alfviral-share/target/maven-archiver/pom.properties b/alfviral-share/target/maven-archiver/pom.properties
index 2321605..81d6099 100644
--- a/alfviral-share/target/maven-archiver/pom.properties
+++ b/alfviral-share/target/maven-archiver/pom.properties
@@ -1,5 +1,5 @@
-#Generated by Maven
-#Fri Feb 03 14:34:24 CET 2017
-version=1.3.4-SNAPSHOT
+#Generated by Apache Maven
+#Thu Feb 16 13:25:48 CET 2017
+version=1.4.0-SNAPSHOT
groupId=com.fegor.alfresco
artifactId=alfviral-share
diff --git a/alfviral/pom.xml b/alfviral/pom.xml
index c3e8034..b8e27d4 100644
--- a/alfviral/pom.xml
+++ b/alfviral/pom.xml
@@ -4,49 +4,47 @@
4.0.0
com.fegor.alfresco
alfviral
- 1.3.4-SNAPSHOT
- Alfviral AMP project
+ 1.4.0-SNAPSHOT
+ FegorSoft / Alfresco Virus Alert
amp
Manages the lifecycle of the alfviral AMP (Alfresco Module Package)
org.alfresco.maven
alfresco-sdk-parent
- 1.1.1
+ 2.2.0
-
- org.alfresco
-
- 4.2.e
- WARN
- alf_data_dev
-
- alfresco
-
- org.alfresco
-
- 4.2.e
-
+
+
+
+
+
-
+
${alfresco.groupId}
alfresco-platform-distribution
@@ -56,6 +54,7 @@
+
@@ -68,18 +67,26 @@
org.alfresco
alfresco-web-client
- 4.2.e
+ 4.2.f
+
+
junit
junit
- 4.8.1
test
+
+
+
+ org.apache.commons
+ commons-lang3
+ 3.0
+
+
+ enterprise
+
+
+ ${alfresco.groupId}
+ alfresco-enterprise-repository
+ ${alfresco.version}
+ provided
+
+
+
+
diff --git a/alfviral/src/main/amp/config/alfresco/extension/templates/webscripts/namedentities.get.desc.xml b/alfviral/src/main/amp/config/alfresco/extension/templates/webscripts/namedentities.get.desc.xml
new file mode 100644
index 0000000..cbbb4c1
--- /dev/null
+++ b/alfviral/src/main/amp/config/alfresco/extension/templates/webscripts/namedentities.get.desc.xml
@@ -0,0 +1,6 @@
+
+ Extract Named Entities
+ This Web Script is used to call the Named Entities Service to extract named entities from a text
+ /tutorial/extractentities?nodeId={nodeId}
+ user
+
\ No newline at end of file
diff --git a/alfviral/src/main/amp/config/alfresco/extension/templates/webscripts/namedentities.get.html.ftl b/alfviral/src/main/amp/config/alfresco/extension/templates/webscripts/namedentities.get.html.ftl
new file mode 100644
index 0000000..83c84aa
--- /dev/null
+++ b/alfviral/src/main/amp/config/alfresco/extension/templates/webscripts/namedentities.get.html.ftl
@@ -0,0 +1,7 @@
+
+
+ Extracted Named Entities:
+ Node:${nodeId}
+ Message:${message}
+
+
\ No newline at end of file
diff --git a/alfviral/src/main/amp/config/alfresco/module/alfviral/context/alfviral-context.xml b/alfviral/src/main/amp/config/alfresco/module/alfviral/context/alfviral-context.xml
deleted file mode 100644
index a227105..0000000
--- a/alfviral/src/main/amp/config/alfresco/module/alfviral/context/alfviral-context.xml
+++ /dev/null
@@ -1,290 +0,0 @@
-
-
-
-
-
- true
-
-
-
- classpath:alfresco/extension/alfviral.properties
-
-
-
-
-
-
-
-
-
- alfresco.extension.webclient
-
-
-
-
-
-
-
- classpath:alfresco/module/${project.artifactId}/ui/web-client-config-custom.xml
-
-
-
-
-
-
-
-
-
- alfresco/module/${project.artifactId}/model/alfviralModel.xml
-
-
-
-
-
-
-
-
-
-
-
- ${alfviral.host}
-
-
- ${alfviral.port}
-
-
- ${alfviral.timeout}
-
-
- ${alfviral.chunkSize}
-
-
-
-
-
-
-
-
- ${alfviral.command}
-
-
-
-
-
-
-
-
- ${vt.key}
-
-
- ${vt.url}
-
-
-
-
-
-
-
-
- ${alfviral.icap.host}
-
-
- ${alfviral.icap.port}
-
-
- ${alfviral.icap.service}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ${alfviral.on_update}
-
-
- ${alfviral.on_read}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- script
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- UNTIL_FIRST_FAILURE
-
-
- IGNORE
-
-
-
-
-
-
-
-
- lucene
-
-
-
- workspace://SpacesStore
-
-
-
- PATH:"${alfviral.scheduled.pathQuery}"
-
-
- ${alfviral.scheduled.cronExpression}
-
-
- jobScanFolder
-
-
- jobGroupScanFolder
-
-
- triggerScanFolder
-
-
- triggerGroupScanFolder
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- System
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ${alfviral.mode}
-
-
- ${dir.contentstore}
-
-
- ${alfviral.file.exceptions}
-
-
- ${alfviral.notify.admin}
-
-
- ${alfviral.notify.user}
-
-
-
diff --git a/alfviral/src/main/amp/config/alfresco/module/alfviral/context/alfviral-context.xml.bak2 b/alfviral/src/main/amp/config/alfresco/module/alfviral/context/alfviral-context.xml.bak2
new file mode 100644
index 0000000..12d2cdf
--- /dev/null
+++ b/alfviral/src/main/amp/config/alfresco/module/alfviral/context/alfviral-context.xml.bak2
@@ -0,0 +1,45 @@
+
+
+
+
+
+ true
+
+
+
+ classpath:alfresco/extension/alfviral.properties
+
+
+
+
+
+
+
+
+
+ alfresco.extension.webclient
+
+
+
+
+
+
+
+ classpath:alfresco/module/${project.artifactId}/ui/web-client-config-custom.xml
+
+
+
+
+
+
+
+
+
+ alfresco/module/${project.artifactId}/model/alfviralModel.xml
+
+
+
+
diff --git a/alfviral/src/main/amp/config/alfresco/module/alfviral/context/service-context.xml b/alfviral/src/main/amp/config/alfresco/module/alfviral/context/service-context.xml
new file mode 100644
index 0000000..a730271
--- /dev/null
+++ b/alfviral/src/main/amp/config/alfresco/module/alfviral/context/service-context.xml
@@ -0,0 +1,151 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ alfresco.extension.webclient
+
+
+
+
+
+
+
+ classpath:alfresco/module/${project.artifactId}/ui/web-client-config-custom.xml
+
+
+
+
+
+
+
+
+
+ alfresco/module/${project.artifactId}/model/alfviralModel.xml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Security
+
+
+ alfviral
+
+
+
+ alfviral
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+ antivirusService
+
+
+
+ com.fegor.alfresco.services.AntivirusService
+
+
+
+
+
+
+
diff --git a/alfviral/src/main/amp/config/alfresco/module/alfviral/context/service-context.xml.bak b/alfviral/src/main/amp/config/alfresco/module/alfviral/context/service-context.xml.bak
new file mode 100644
index 0000000..6059b05
--- /dev/null
+++ b/alfviral/src/main/amp/config/alfresco/module/alfviral/context/service-context.xml.bak
@@ -0,0 +1,86 @@
+
+
+
+
+
+
+
+ Semantic
+
+
+ namedEntities
+
+
+
+ namedEntities
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+ namedEntitiesService
+
+
+
+ org.alfresco.tutorial.semantic.namedentities.NamedEntitiesService
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/alfviral/src/main/amp/config/alfresco/module/alfviral/module-context.xml b/alfviral/src/main/amp/config/alfresco/module/alfviral/module-context.xml
index 7a9d05b..40f3ef1 100644
--- a/alfviral/src/main/amp/config/alfresco/module/alfviral/module-context.xml
+++ b/alfviral/src/main/amp/config/alfresco/module/alfviral/module-context.xml
@@ -1,9 +1,6 @@
-
-
-
+
+
diff --git a/alfviral/src/main/amp/config/alfresco/subsystems/Security/alfviral/alfviral-context.xml b/alfviral/src/main/amp/config/alfresco/subsystems/Security/alfviral/alfviral-context.xml
new file mode 100644
index 0000000..c9453fb
--- /dev/null
+++ b/alfviral/src/main/amp/config/alfresco/subsystems/Security/alfviral/alfviral-context.xml
@@ -0,0 +1,282 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ${alfviral.icap.host}
+
+
+ ${alfviral.icap.port}
+
+
+ ${alfviral.icap.service}
+
+
+
+
+
+ ${alfviral.command.exec}
+
+
+
+
+
+ ${alfviral.instream.host}
+
+
+ ${alfviral.instream.port}
+
+
+ ${alfviral.instream.timeout}
+
+
+ ${alfviral.instream.chunkSize}
+
+
+
+
+
+ ${alfviral.vt.key}
+
+
+ ${alfviral.vt.url}
+
+
+ ${alfviral.mode}
+
+
+ ${dir.contentstore}
+
+
+ ${alfviral.notify.admin}
+
+
+ ${alfviral.notify.admin.template}
+
+
+ ${alfviral.notify.user}
+
+
+ ${alfviral.notify.user.template}
+
+
+ ${alfviral.on_update}
+
+
+ ${alfviral.on_read}
+
+
+ ${alfviral.file.exceptions}
+
+
+ ${alfviral.file.only}
+
+
+ ${alfviral.file.only_or_exceptions}
+
+
+
+
+
+ PATH:"${alfviral.scheduled.pathQuery}"
+
+
+ ${alfviral.scheduled.cronExpression}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ script
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ UNTIL_FIRST_FAILURE
+
+
+ IGNORE
+
+
+
+
+
+
+
+
+ lucene
+
+
+
+ workspace://SpacesStore
+
+
+
+ PATH:"${alfviral.scheduled.pathQuery}"
+
+
+ ${alfviral.scheduled.cronExpression}
+
+
+ jobScanFolder
+
+
+ jobGroupScanFolder
+
+
+ triggerScanFolder
+
+
+ triggerGroupScanFolder
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ System
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ${alfviral.on_update}
+
+
+ ${alfviral.on_read}
+
+
+
+
+
+
+
+
+
+
+ ${alfviral.instream.host}
+
+
+ ${alfviral.instream.port}
+
+
+ ${alfviral.instream.timeout}
+
+
+ ${alfviral.instream.chunkSize}
+
+
+
+
+
+
+
+
+ ${alfviral.command.exec}
+
+
+
+
+
+
+
+
+ ${alfviral.vt.key}
+
+
+ ${alfviral.vt.url}
+
+
+
+
+
+
+
+
+ ${alfviral.icap.host}
+
+
+ ${alfviral.icap.port}
+
+
+ ${alfviral.icap.service}
+
+
+
+
diff --git a/alfviral/src/main/amp/config/alfresco/module/alfviral/extension/alfviral.properties b/alfviral/src/main/amp/config/alfresco/subsystems/Security/alfviral/alfviral.properties
similarity index 54%
rename from alfviral/src/main/amp/config/alfresco/module/alfviral/extension/alfviral.properties
rename to alfviral/src/main/amp/config/alfresco/subsystems/Security/alfviral/alfviral.properties
index 5fe8886..1859df4 100644
--- a/alfviral/src/main/amp/config/alfresco/module/alfviral/extension/alfviral.properties
+++ b/alfviral/src/main/amp/config/alfresco/subsystems/Security/alfviral/alfviral.properties
@@ -1,41 +1,41 @@
-# Command to exec, i.e. clamscan, alfviral.sh, etc. (COMMAND)
-alfviral.command=C\:\\Users\\fegor\\Documents\\alfviral.bat
-
-# Config for ClamAV in stream data (INSTREAM)
-alfviral.timeout=30000
-alfviral.host=192.168.56.101
-alfviral.port=3310
-alfviral.chunkSize=1024
-
-# Config for VIRUSTOTAL
-vt.key=
-vt.url=https://www.virustotal.com/vtapi/v2/file/scan
-
-# Config for ICAP protocol
-alfviral.icap.host=192.168.56.101
-alfviral.icap.port=1344
-alfviral.icap.service=srv_clamav
-
-# Modes: COMMAND, INSTREAM, VIRUSTOTAL, ICAP
-alfviral.mode=ICAP
-
-# Events
-alfviral.on_update=TRUE
-alfviral.on_read=FALSE
-
-# Scheduled action
-alfviral.scheduled.pathQuery=/app:company_home/st:sites
-alfviral.scheduled.cronExpression=* * * * * ? 2099
-
-# List of file exceptions
-alfviral.file.exceptions=text/html|text/xml|application/pdf|image/jpeg|image/png|image/giftext/plain
-
-# Notification of infected
-# Options: Notify to user to upload file and notify to admin. Use email config in profile (people)
-alfviral.notify.user=true
-alfviral.notify.admin=true
-alfviral.notify.user.template=notify_user_es.html
-#b17dd91e-8af9-4951-b54e-d3f417cce36c
-alfviral.notify.admin.template=notify_admin_es.html
-#e7ce528f-18da-437b-abd1-208b8c02ae2a
-
+# Command to exec, i.e. clamscan, alfviral.sh, etc. (COMMAND)
+alfviral.command.exec=C\:\\Users\\fegor\\Documents\\alfviral.bat
+
+# Config for ClamAV in stream data (INSTREAM)
+alfviral.instream.timeout=30000
+alfviral.instream.host=192.168.56.101
+alfviral.instream.port=3310
+alfviral.instream.chunkSize=1024
+
+# Config for VIRUSTOTAL
+alfviral.vt.key=
+alfviral.vt.url=https://www.virustotal.com/vtapi/v2/file/scan
+
+# Config for ICAP protocol
+alfviral.icap.host=192.168.56.101
+alfviral.icap.port=1344
+alfviral.icap.service=srv_clamav
+
+# Modes: COMMAND, INSTREAM, VIRUSTOTAL, ICAP
+alfviral.mode=ICAP
+
+# Events
+alfviral.on_update=TRUE
+alfviral.on_read=FALSE
+
+# Scheduled action
+alfviral.scheduled.pathQuery=/app:company_home/st:sites
+alfviral.scheduled.cronExpression=* * * * * ? 2099
+
+# List of file only or exceptions
+alfviral.file.exceptions=text/html|text/xml|application/pdf|image/jpeg|image/png|image/giftext/plain
+alfviral.file.only=application/octet-stream|application/x-dosexec|application/bat|application/x-bat|application/x-msdos-program|application/textedit|application/cmd|application/x-ms-dos-executable
+alfviral.file.only_or_exceptions=exceptions
+
+# Notification of infected
+# Options: Notify to user to upload file and notify to admin. Use email config in profile (people)
+alfviral.notify.user=true
+alfviral.notify.admin=true
+alfviral.notify.user.template=notify_user_es.html.ftl
+alfviral.notify.admin.template=notify_admin_es.html.ftl
+
diff --git a/alfviral/src/main/java/com/fegor/alfresco/action/VirusScanAction.java b/alfviral/src/main/java/com/fegor/alfresco/action/VirusScanAction.java
index c85cec3..7fc8d99 100644
--- a/alfviral/src/main/java/com/fegor/alfresco/action/VirusScanAction.java
+++ b/alfviral/src/main/java/com/fegor/alfresco/action/VirusScanAction.java
@@ -18,11 +18,8 @@
import java.util.List;
-import javax.transaction.Status;
-import javax.transaction.UserTransaction;
-
import org.alfresco.repo.action.executer.ActionExecuterAbstractBase;
-import org.alfresco.service.ServiceRegistry;
+import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.service.cmr.action.Action;
import org.alfresco.service.cmr.action.ParameterDefinition;
import org.alfresco.service.cmr.repository.InvalidNodeRefException;
@@ -55,15 +52,35 @@ public class VirusScanAction extends ActionExecuterAbstractBase {
* org.alfresco.service.cmr.repository.NodeRef)
*/
@Override
- protected void executeImpl(Action action, NodeRef actionedUponNodeRef) {
+ protected void executeImpl(Action action, final NodeRef actionedUponNodeRef) {
- if (actionedUponNodeRef != null) {
+ if (AuthenticationUtil.getRunAsUser() != null) {
+ run(actionedUponNodeRef);
+ }
+ else {
if (logger.isDebugEnabled()) {
- logger.debug(getClass().getName() + " scanFile for "
- + actionedUponNodeRef.getId());
+ logger.debug("Run action as system user for node '" + actionedUponNodeRef + "'");
}
+
+ AuthenticationUtil.runAsSystem(new AuthenticationUtil.RunAsWork() {
+ @Override
+ public Void doWork() throws Exception {
+ try {
+ run(actionedUponNodeRef);
+ }
+
+ catch (Exception e) {
+ logger.error(e);
+ }
+ return null;
+ }
+ });
+ }
+ }
+ protected void run(NodeRef actionedUponNodeRef) {
+ if (actionedUponNodeRef != null) {
try {
antivirusService.scanFile(actionedUponNodeRef);
}
@@ -73,10 +90,13 @@ protected void executeImpl(Action action, NodeRef actionedUponNodeRef) {
// TODO In Share (version 4.2), update of document produce the
// Node not found error
- logger.warn(this.getClass().getName() + ": NodeRef: "
- + actionedUponNodeRef.getId()
+ logger.warn(this.getClass().getName() + ": NodeRef: " + actionedUponNodeRef.getId()
+ " not found. This node has changed in transaction.");
}
+
+ catch (net.sf.acegisecurity.AuthenticationCredentialsNotFoundException acnfe) {
+ logger.error("Not credentials.");
+ }
}
}
diff --git a/alfviral/src/main/java/com/fegor/alfresco/behavior/OnUpdateReadScan.java b/alfviral/src/main/java/com/fegor/alfresco/behavior/OnUpdateReadScan.java
index 878938d..fdbb4bd 100644
--- a/alfviral/src/main/java/com/fegor/alfresco/behavior/OnUpdateReadScan.java
+++ b/alfviral/src/main/java/com/fegor/alfresco/behavior/OnUpdateReadScan.java
@@ -81,7 +81,6 @@ public void init() {
this.policyComponent.bindClassBehaviour(QName.createQName(
NamespaceService.ALFRESCO_URI, "onContentUpdate"),
ContentModel.TYPE_CMOBJECT, this.onContentUpdate);
-
}
// create behavior and binding for read
@@ -93,7 +92,6 @@ public void init() {
NamespaceService.ALFRESCO_URI, "onContentRead"),
ContentModel.TYPE_CMOBJECT, this.onContentRead);
}
-
}
/*
diff --git a/alfviral/src/main/java/com/fegor/alfresco/services/AntivirusService.java b/alfviral/src/main/java/com/fegor/alfresco/services/AntivirusService.java
index c2a914b..a335735 100644
--- a/alfviral/src/main/java/com/fegor/alfresco/services/AntivirusService.java
+++ b/alfviral/src/main/java/com/fegor/alfresco/services/AntivirusService.java
@@ -1,424 +1,12 @@
-/*
- * Copyright 2015 Fernando González (fegor@fegor.com)
- *
- * Licensed 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.
- *
- */
-package com.fegor.alfresco.services;
-
-import java.io.Serializable;
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.GregorianCalendar;
-import java.util.HashMap;
-import org.alfresco.model.ContentModel;
-import org.alfresco.repo.action.executer.MailActionExecuter;
-import org.alfresco.service.cmr.action.Action;
-import org.alfresco.service.cmr.action.ActionService;
-import org.alfresco.service.cmr.repository.ContentIOException;
-import org.alfresco.service.cmr.repository.ContentReader;
-import org.alfresco.service.cmr.repository.ContentService;
-import org.alfresco.service.cmr.repository.InvalidNodeRefException;
-import org.alfresco.service.cmr.repository.NodeRef;
-import org.alfresco.service.cmr.repository.NodeService;
-import org.alfresco.service.cmr.security.AuthenticationService;
-import org.alfresco.service.cmr.security.PersonService;
-import org.alfresco.service.namespace.QName;
-import org.apache.log4j.Logger;
-import com.fegor.alfresco.model.AlfviralModel;
-import com.fegor.alfresco.security.antivirus.CommandScan;
-import com.fegor.alfresco.security.antivirus.ICAPScan;
-import com.fegor.alfresco.security.antivirus.InStreamScan;
-import com.fegor.alfresco.security.antivirus.VirusScanMode;
-import com.fegor.alfresco.security.antivirus.VirusTotalScan;
-
-/**
- * @author Fernando.Gonzalez
- *
- */
-public class AntivirusService {
- private final Logger logger = Logger.getLogger(AntivirusService.class);
-
- /*
- * Services
- */
- private ContentService contentService;
- private NodeService nodeService;
- private ContentReader contentReader;
- private ActionService actionService;
- private PersonService personService;
- private AuthenticationService authenticationService;
-
- /*
- * Refs to beans
- */
- private ICAPScan icapScan;
- private CommandScan commandScan;
- private InStreamScan inStreamScan;
- private VirusTotalScan virusTotalScan;
-
- /*
- * Config
- */
- private String mode;
- private boolean notifyAdmin;
- private boolean notifyUser;
- private String notifyAdminTemplate;
- private String notifyUserTemplate;
-
- /*
- * for mode COMMAND
- */
- private String store;
-
- /*
- * Generic
- */
- private String file_exceptions;
-
- /**
- * Scan file for nodeRef
- *
- * @param nodeRef
- */
- public void scanFile(NodeRef nodeRef) throws InvalidNodeRefException {
- int res = 0;
-
- contentReader = this.contentService.getReader(nodeRef,
- ContentModel.PROP_CONTENT);
-
- // TODO Include for files_for_scan, in option to file_exception
-
- if ((contentReader != null)
- && (this.file_exceptions.indexOf(contentReader.getMimetype()) == -1)) {
- String contentUrl = contentReader.getContentUrl();
- String contentPath = contentUrl.replaceFirst("store:/", this.store);
-
- if (logger.isDebugEnabled()) {
- logger.debug(this.getClass().getName() + ": [NodeRef: "
- + nodeRef.getId() + "]");
- logger.debug(this.getClass().getName() + ": [File: "
- + contentPath + "]");
- logger.debug(this.getClass().getName() + ": [Type: "
- + contentReader.getMimetype() + "]");
- logger.debug(this.getClass().getName() + ": [Mode: "
- + mode.toUpperCase() + "]");
- }
-
- else if(contentReader != null) {
- if (logger.isDebugEnabled()) {
- logger.debug("File/Document is excluded for virus scan.");
- }
- }
-
- /*
- * if mode is COMMAND
- */
- if (mode.toUpperCase().equals(VirusScanMode.ScanModeCommand)) {
-
- commandScan.setFileToScan(contentPath);
- res = commandScan.scan(nodeRef);
- }
- /*
- * if mode is INSTREAM
- */
- else if (mode.toUpperCase().equals(VirusScanMode.ScanModeInStream)) {
-
- try {
-
- inStreamScan.setData(contentReader.getContentString()
- .getBytes());
- res = inStreamScan.scan(nodeRef);
-
- } catch (ContentIOException e) {
-
- logger.info("Not found content for nodeRef: "
- + nodeRef.getId() + " of "
- + contentReader.getContentUrl() + ". ¿Is closed?: "
- + contentReader.isClosed());
- }
- }
- /*
- * if mode is VIRUSTOTAL
- */
- else if (mode.toUpperCase().equals(VirusScanMode.ScanModeVirusTotal)) {
-
- try {
-
- virusTotalScan.setFileToScan(contentPath);
- res = virusTotalScan.scan(nodeRef);
-
- } catch (ContentIOException e) {
-
- logger.info("Not found content for nodeRef: "
- + nodeRef.getId() + " of "
- + contentReader.getContentUrl() + ". ¿Is closed?: "
- + contentReader.isClosed());
- }
- }
- /*
- * if mode is ICAP
- */
- else if (mode.toUpperCase().equals(VirusScanMode.ScanModeICap)) {
-
- try {
-
- icapScan.setData(contentReader.getContentString()
- .getBytes());
- res = icapScan.scan(nodeRef);
-
- } catch (ContentIOException e) {
- logger.info("Not found content for nodeRef: "
- + nodeRef.getId() + " of "
- + contentReader.getContentUrl() + ". ¿Is closed?: "
- + contentReader.isClosed());
- }
- }
- /*
- * if none
- */
- else {
-
- logger.info(this.getClass().getName()
- + ": [No config action: {COMMAND|INSTREAM|VIRUSTOTAL}]");
- }
-
- /*
- * if res not zero then infected!!
- */
- if (res != 0) {
-
- if (logger.isInfoEnabled() || logger.isDebugEnabled()) {
- logger.info(this.getClass().getName() + ": [ALERT File: "
- + contentReader.getContentUrl() + " is infected!]");
- }
- this.addAspect(nodeRef);
-
- } else {
- if (logger.isDebugEnabled())
- logger.debug("[File: " + contentReader.getContentUrl()
- + " is clean");
- }
- }
- }
-
- /**
- * Add aspect Infected is not assigned
- *
- * @param nodeRef
- */
- private void addAspect(NodeRef nodeRef) {
- Calendar cal = GregorianCalendar.getInstance();
- Date dt = cal.getTime();
- String df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").format(dt);
-
- HashMap properties = new HashMap(
- 1, 1.0f);
- properties.put(AlfviralModel.PROP_INFECTED_DATE, df.substring(0, 22)
- + ":" + df.substring(22));
- properties.put(AlfviralModel.PROP_INFECTED_CLEAN, false);
-
- if (!nodeService.hasAspect(nodeRef, AlfviralModel.ASPECT_INFECTED)) {
-
- nodeService.addAspect(nodeRef, AlfviralModel.ASPECT_INFECTED,
- properties);
-
- // If notify is true
- if (notifyUser == true || notifyAdmin == true) {
- notifyForInfected(nodeRef);
- }
-
- // TODO Add deleted file possibility if is infected
-
- } else {
-
- if (logger.isDebugEnabled())
- logger.debug("Este fichero se detectó como infectado anteriormente, se actualiza el aspecto.");
- nodeService.addProperties(nodeRef, properties);
- }
- }
-
- /**
- * Notify
- */
- private void notifyForInfected(NodeRef nodeRef) {
-
- // TODO Add other admin and templates of use new class Notify()...
-
- Action mailAction = actionService.createAction(MailActionExecuter.NAME);
-
- // Map model = new HashMap();
- // model.put("dateEpoch", new Date(0));
-
- NodeRef nrCurrentUser = personService.getPerson(authenticationService
- .getCurrentUserName());
-
- String currentUser = (String) nodeService.getProperty(nrCurrentUser,
- ContentModel.PROP_EMAIL);
-
- if (notifyUser == true) {
- mailAction.setParameterValue(MailActionExecuter.PARAM_TO,
- currentUser);
- mailAction.setParameterValue(MailActionExecuter.PARAM_SUBJECT,
- "Document infected!");
- mailAction.setParameterValue(MailActionExecuter.PARAM_TEXT,
- "File infected as NodeRef: " + nodeRef
- + ". Contacting with your administrator ASAP!");
- // mailAction.setParameterValue(MailActionExecuter.PARAM_TEMPLATE,
- // "alfresco/extension/mail" + notifyUserTemplate);
- // mailAction.setParameterValue(
- // MailActionExecuter.PARAM_TEMPLATE_MODEL,
- // (Serializable) model);
- logger.info(this.getClass().getName()
- + ": [Sending notify mail notify of infected to "
- + currentUser + "]");
- actionService.executeAction(mailAction, null);
- }
-
- if (notifyAdmin == true) {
- NodeRef nrAdmin = personService.getPerson("admin");
- String userAdmin = (String) nodeService.getProperty(nrAdmin,
- ContentModel.PROP_EMAIL);
- mailAction
- .setParameterValue(MailActionExecuter.PARAM_TO, userAdmin);
- mailAction.setParameterValue(MailActionExecuter.PARAM_SUBJECT,
- "File infected!");
- mailAction.setParameterValue(MailActionExecuter.PARAM_TEXT,
- "File infected as NodeRef: " + nodeRef
- + " upload to user: " + currentUser);
- // mailAction.setParameterValue(MailActionExecuter.PARAM_TEMPLATE,
- // "alfresco/extension/mail" + notifyAdminTemplate);
- // mailAction.setParameterValue(
- // MailActionExecuter.PARAM_TEMPLATE_MODEL,
- // (Serializable) model);
- logger.info(this.getClass().getName()
- + ": [Sending mail notify of infected to admin]");
- actionService.executeAction(mailAction, null);
- }
- }
-
- /**
- * @param icapScan
- */
- public void setIcapScan(ICAPScan icapScan) {
- this.icapScan = icapScan;
- }
-
- /**
- * @param contentService
- */
- public void setContentService(ContentService contentService) {
- this.contentService = contentService;
- }
-
- /**
- * @param nodeService
- */
- public void setNodeService(NodeService nodeService) {
- this.nodeService = nodeService;
- }
-
- /**
- * @param commandScan
- */
- public void setCommandScan(CommandScan commandScan) {
- this.commandScan = commandScan;
- }
-
- /**
- * @param inStreamScan
- */
- public void setInStreamScan(InStreamScan inStreamScan) {
- this.inStreamScan = inStreamScan;
- }
-
- /**
- * @param virusTotalScan
- */
- public void setVirusTotalScan(VirusTotalScan virusTotalScan) {
- this.virusTotalScan = virusTotalScan;
- }
-
- /**
- * @param mode
- */
- public void setMode(String mode) {
- this.mode = mode;
- }
-
- /**
- * @param file_exceptions
- */
- public void setFileExceptions(String file_exceptions) {
- this.file_exceptions = file_exceptions;
- }
-
- /**
- * @param store
- */
- public void setStore(String store) {
- this.store = store;
- }
-
- /**
- * @param actionService
- */
- public void setActionService(ActionService actionService) {
- this.actionService = actionService;
- }
-
- /**
- * @param personService
- */
- public void setPersonService(PersonService personService) {
- this.personService = personService;
- }
-
- /**
- * @param notifyAdmin
- */
- public void setNotifyAdmin(boolean notifyAdmin) {
- this.notifyAdmin = notifyAdmin;
- }
-
- /**
- * @param notifyUser
- */
- public void setNotifyUser(boolean notifyUser) {
- this.notifyUser = notifyUser;
- }
-
- /**
- * @param authenticationService
- */
- public void setAuthenticationService(
- AuthenticationService authenticationService) {
- this.authenticationService = authenticationService;
- }
-
- /**
- * @param notifyAdminTemplate
- */
- public void setNotifyAdminTemplate(String notifyAdminTemplate) {
- this.notifyAdminTemplate = notifyAdminTemplate;
- }
-
- /**
- * @param notifyUserTemplate
- */
- public void setNotifyUserTemplate(String notifyUserTemplate) {
- this.notifyUserTemplate = notifyUserTemplate;
- }
-
-}
+package com.fegor.alfresco.services;
+
+import org.alfresco.service.cmr.repository.InvalidNodeRefException;
+import org.alfresco.service.cmr.repository.NodeRef;
+
+/**
+ * @author fegor
+ *
+ */
+public interface AntivirusService {
+ void scanFile(NodeRef nodeRef) throws InvalidNodeRefException;
+}
diff --git a/alfviral/src/main/java/com/fegor/alfresco/services/AntivirusServiceDescriptorRegistry.java b/alfviral/src/main/java/com/fegor/alfresco/services/AntivirusServiceDescriptorRegistry.java
index f25b7ee..3c455dd 100644
--- a/alfviral/src/main/java/com/fegor/alfresco/services/AntivirusServiceDescriptorRegistry.java
+++ b/alfviral/src/main/java/com/fegor/alfresco/services/AntivirusServiceDescriptorRegistry.java
@@ -21,7 +21,7 @@
public class AntivirusServiceDescriptorRegistry extends ServiceDescriptorRegistry implements AntivirusServiceRegistry {
@Override
- public AntivirusService getAntivirusService() {
- return (AntivirusService)getService(ANTIVIRUS_SERVICE);
+ public AntivirusServiceImpl getAntivirusService() {
+ return (AntivirusServiceImpl)getService(ANTIVIRUS_SERVICE);
}
}
diff --git a/alfviral/src/main/java/com/fegor/alfresco/services/AntivirusServiceImpl.java b/alfviral/src/main/java/com/fegor/alfresco/services/AntivirusServiceImpl.java
new file mode 100644
index 0000000..3981b01
--- /dev/null
+++ b/alfviral/src/main/java/com/fegor/alfresco/services/AntivirusServiceImpl.java
@@ -0,0 +1,594 @@
+/*
+ * Copyright 2015 Fernando González (fegor@fegor.com)
+ *
+ * Licensed 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.
+ *
+ */
+package com.fegor.alfresco.services;
+
+import java.io.Serializable;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.alfresco.model.ContentModel;
+import org.alfresco.repo.action.executer.MailActionExecuter;
+import org.alfresco.repo.action.scheduled.CronScheduledQueryBasedTemplateActionDefinition;
+import org.alfresco.service.ServiceRegistry;
+import org.alfresco.service.cmr.action.Action;
+import org.alfresco.service.cmr.action.ActionService;
+import org.alfresco.service.cmr.repository.ContentIOException;
+import org.alfresco.service.cmr.repository.ContentReader;
+import org.alfresco.service.cmr.repository.ContentService;
+import org.alfresco.service.cmr.repository.InvalidNodeRefException;
+import org.alfresco.service.cmr.repository.NodeRef;
+import org.alfresco.service.cmr.repository.NodeService;
+import org.alfresco.service.cmr.repository.StoreRef;
+import org.alfresco.service.cmr.search.ResultSet;
+import org.alfresco.service.cmr.search.SearchService;
+import org.alfresco.service.cmr.security.AuthenticationService;
+import org.alfresco.service.cmr.security.PersonService;
+import org.alfresco.service.namespace.QName;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import com.fegor.alfresco.behavior.OnUpdateReadScan;
+import com.fegor.alfresco.model.AlfviralModel;
+import com.fegor.alfresco.security.antivirus.CommandScan;
+import com.fegor.alfresco.security.antivirus.ICAPScan;
+import com.fegor.alfresco.security.antivirus.InStreamScan;
+import com.fegor.alfresco.security.antivirus.VirusScanMode;
+import com.fegor.alfresco.security.antivirus.VirusTotalScan;
+
+/**
+ * @author Fernando.Gonzalez
+ *
+ */
+public class AntivirusServiceImpl implements AntivirusService {
+ private static final Log logger = LogFactory.getLog(AntivirusServiceImpl.class);
+ private static final String FILE_ONLY = "only";
+ private static final String FILE_EXCEPTIONS = "exceptions";
+ private static final String EMAIL_TEMPLATES_PATH = "PATH:\"/app:company_home/app:dictionary/app:email_templates/cm:Alfviral";
+
+ /*
+ * Services
+ */
+ private ContentService contentService;
+ private NodeService nodeService;
+ private ContentReader contentReader;
+ private ActionService actionService;
+ private PersonService personService;
+ private AuthenticationService authenticationService;
+
+ private ServiceRegistry serviceRegistry;
+
+ private OnUpdateReadScan onUpdateReadScan;
+
+ /*
+ * Refs to beans
+ */
+ private ICAPScan icapScan;
+ private CommandScan commandScan;
+ private InStreamScan inStreamScan;
+ private VirusTotalScan virusTotalScan;
+
+ /*
+ * Config
+ */
+ private String mode;
+ private boolean notifyAdmin;
+ private boolean notifyUser;
+ private String notifyAdminTemplate;
+ private String notifyUserTemplate;
+
+ private int icapPort;
+ private String icapHost;
+ private String icapService;
+
+ private int inStreamChunkSize = 4096;
+ private int inStreamPort;
+ private String inStreamHost;
+ private int inStreamTimeout;
+
+ private List commandExec;
+
+ private String vtKey = "";
+ private String vtUrl = "https://www.virustotal.com/vtapi/v2/file/scan";
+
+ // private boolean onUpdate;
+ // private boolean onRead;
+
+ private CronScheduledQueryBasedTemplateActionDefinition runScriptScanFolder;
+
+ /*
+ * for mode COMMAND
+ */
+ private String store;
+
+ /*
+ * Generic
+ */
+ private String fileExceptions;
+ private String fileOnly;
+ private String fileOnlyOrExceptions;
+
+ /**
+ * Scan file for nodeRef
+ *
+ * @param nodeRef
+ */
+ public void scanFile(NodeRef nodeRef) throws InvalidNodeRefException {
+ int res = 0;
+
+ nodeService = serviceRegistry.getNodeService();
+ contentService = serviceRegistry.getContentService();
+ actionService = serviceRegistry.getActionService();
+ personService = serviceRegistry.getPersonService();
+ authenticationService = serviceRegistry.getAuthenticationService();
+
+ if (nodeService.exists(nodeRef)) {
+ contentReader = contentService.getReader(nodeRef, ContentModel.PROP_CONTENT);
+
+ if ((contentReader != null)
+ && (fileExceptions.indexOf(contentReader.getMimetype()) == -1
+ && (fileOnlyOrExceptions.toLowerCase()).equals(FILE_EXCEPTIONS))
+ || (fileOnly.indexOf(contentReader.getMimetype()) != -1
+ && (fileOnlyOrExceptions.toLowerCase()).equals(FILE_ONLY))) {
+ String contentUrl = contentReader.getContentUrl();
+ String contentPath = contentUrl.replaceFirst("store:/", this.store);
+
+ if (logger.isDebugEnabled()) {
+ logger.debug(this.getClass().getName() + ": [NodeRef: " + nodeRef.getId() + "]");
+ logger.debug(this.getClass().getName() + ": [File: " + contentPath + "]");
+ logger.debug(this.getClass().getName() + ": [Type: " + contentReader.getMimetype() + "]");
+ logger.debug(this.getClass().getName() + ": [Mode: " + mode.toUpperCase() + "]");
+ }
+
+ else if (contentReader != null) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("File/Document is excluded for virus scan.");
+ }
+ }
+
+ /*
+ * if mode is COMMAND
+ */
+ if (mode.toUpperCase().equals(VirusScanMode.ScanModeCommand)) {
+ commandScan.setCommand(commandExec);
+ commandScan.setFileToScan(contentPath);
+ res = commandScan.scan(nodeRef);
+ }
+ /*
+ * if mode is INSTREAM
+ */
+ else if (mode.toUpperCase().equals(VirusScanMode.ScanModeInStream)) {
+
+ try {
+ inStreamScan.setChunkSize(inStreamChunkSize);
+ inStreamScan.setHost(inStreamHost);
+ inStreamScan.setPort(inStreamPort);
+ inStreamScan.setTimeout(inStreamTimeout);
+ inStreamScan.setData(contentReader.getContentString().getBytes());
+ res = inStreamScan.scan(nodeRef);
+ }
+
+ catch (ContentIOException e) {
+ logger.info("Not found content for nodeRef: " + nodeRef.getId() + " of "
+ + contentReader.getContentUrl() + ". ¿Is closed?: " + contentReader.isClosed());
+ }
+ }
+ /*
+ * if mode is VIRUSTOTAL
+ */
+ else if (mode.toUpperCase().equals(VirusScanMode.ScanModeVirusTotal)) {
+
+ try {
+ virusTotalScan.setKey(vtKey);
+ virusTotalScan.setUrlScan(vtUrl);
+ virusTotalScan.setFileToScan(contentPath);
+ res = virusTotalScan.scan(nodeRef);
+ }
+
+ catch (ContentIOException e) {
+ logger.info("Not found content for nodeRef: " + nodeRef.getId() + " of "
+ + contentReader.getContentUrl() + ". ¿Is closed?: " + contentReader.isClosed());
+ }
+ }
+ /*
+ * if mode is ICAP
+ */
+ else if (mode.toUpperCase().equals(VirusScanMode.ScanModeICap)) {
+ try {
+ icapScan.setHost(icapHost);
+ icapScan.setPort(icapPort);
+ icapScan.setService(icapService);
+ icapScan.setData(contentReader.getContentString().getBytes());
+ res = icapScan.scan(nodeRef);
+ }
+
+ catch (ContentIOException e) {
+ logger.info("Not found content for nodeRef: " + nodeRef.getId() + " of "
+ + contentReader.getContentUrl() + ". ¿Is closed?: " + contentReader.isClosed());
+ }
+ }
+ /*
+ * if none
+ */
+ else {
+ logger.info(this.getClass().getName() + ": [No config action: {COMMAND|INSTREAM|ICAP|VIRUSTOTAL}]");
+ }
+
+ /*
+ * if res not zero then infected!!
+ */
+ if (res != 0) {
+
+ if (logger.isInfoEnabled() || logger.isDebugEnabled()) {
+ logger.info(this.getClass().getName() + ": [ALERT File: " + contentReader.getContentUrl()
+ + " is infected!]");
+ }
+ this.addAspect(nodeRef);
+
+ } else {
+ if (logger.isDebugEnabled())
+ logger.debug("[File: " + contentReader.getContentUrl() + " is clean");
+ }
+ }
+
+ else if ((!(fileOnlyOrExceptions.toLowerCase()).equals(fileOnly))
+ || (!(fileOnlyOrExceptions.toLowerCase()).equals(fileExceptions))) {
+ logger.error("Property alfviral.file.only_or_exceptions not is '" + FILE_ONLY + "' or '"
+ + FILE_EXCEPTIONS + "'");
+ }
+ }
+ }
+
+ /**
+ * Add aspect Infected is not assigned
+ *
+ * @param nodeRef
+ */
+ private void addAspect(NodeRef nodeRef) {
+ Calendar cal = GregorianCalendar.getInstance();
+ Date dt = cal.getTime();
+ String df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").format(dt);
+
+ HashMap properties = new HashMap(1, 1.0f);
+ properties.put(AlfviralModel.PROP_INFECTED_DATE, df.substring(0, 22) + ":" + df.substring(22));
+ properties.put(AlfviralModel.PROP_INFECTED_CLEAN, false);
+
+ if (!nodeService.hasAspect(nodeRef, AlfviralModel.ASPECT_INFECTED)) {
+
+ nodeService.addAspect(nodeRef, AlfviralModel.ASPECT_INFECTED, properties);
+
+ // If notify is true
+ if (notifyUser == true || notifyAdmin == true) {
+ notifyForInfected(nodeRef);
+ }
+
+ // TODO Add deleted file possibility if is infected
+
+ } else {
+
+ if (logger.isDebugEnabled())
+ logger.debug("Este fichero se detectó como infectado anteriormente, se actualiza el aspecto.");
+ nodeService.addProperties(nodeRef, properties);
+ }
+ }
+
+ /**
+ * Notify
+ */
+ private void notifyForInfected(NodeRef nodeRef) {
+ Action mailAction = actionService.createAction(MailActionExecuter.NAME);
+
+ Map model = new HashMap();
+ model.put("dateEpoch", new Date(0));
+
+ NodeRef nrCurrentUser = personService.getPerson(authenticationService.getCurrentUserName());
+
+ String currentUser = (String) nodeService.getProperty(nrCurrentUser, ContentModel.PROP_EMAIL);
+ String templatePATH = EMAIL_TEMPLATES_PATH + "/cm:";
+ ResultSet resultSet = null;
+
+ if (notifyUser == true) {
+ mailAction.setParameterValue(MailActionExecuter.PARAM_TO, currentUser);
+ mailAction.setParameterValue(MailActionExecuter.PARAM_SUBJECT, "Document infected!");
+
+ if (notifyUserTemplate == "") {
+ mailAction.setParameterValue(MailActionExecuter.PARAM_TEXT,
+ "File infected as NodeRef: " + nodeRef + ". Contacting with your administrator ASAP!");
+ }
+
+ else {
+ templatePATH += notifyUserTemplate + "\"";
+ resultSet = serviceRegistry.getSearchService().query(
+ new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore"), SearchService.LANGUAGE_LUCENE,
+ templatePATH);
+
+ if (resultSet.length() == 0) {
+ logger.error("Template " + templatePATH + " not found.");
+ return;
+ }
+
+ mailAction.setParameterValue(MailActionExecuter.PARAM_TEMPLATE, resultSet.getNodeRef(0));
+ mailAction.setParameterValue(MailActionExecuter.PARAM_TEMPLATE_MODEL, (Serializable) model);
+ }
+
+ logger.info(
+ this.getClass().getName() + ": [Sending notify mail notify of infected to " + currentUser + "]");
+ actionService.executeAction(mailAction, nodeRef);
+ }
+
+ templatePATH = EMAIL_TEMPLATES_PATH + "/cm:";
+
+ if (notifyAdmin == true) {
+ NodeRef nrAdmin = personService.getPerson("admin");
+ String userAdmin = (String) nodeService.getProperty(nrAdmin, ContentModel.PROP_EMAIL);
+ mailAction.setParameterValue(MailActionExecuter.PARAM_TO, userAdmin);
+ mailAction.setParameterValue(MailActionExecuter.PARAM_SUBJECT, "File infected!");
+
+ if (notifyAdminTemplate != "") {
+ mailAction.setParameterValue(MailActionExecuter.PARAM_TEXT,
+ "File infected as NodeRef: " + nodeRef + " upload to user: " + currentUser);
+ }
+
+ else {
+ templatePATH += notifyAdminTemplate + "\"";
+ resultSet = serviceRegistry.getSearchService().query(
+ new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore"), SearchService.LANGUAGE_LUCENE,
+ templatePATH);
+
+ if (resultSet.length() == 0) {
+ logger.error("Template " + templatePATH + " not found.");
+ return;
+ }
+
+ mailAction.setParameterValue(MailActionExecuter.PARAM_TEMPLATE, resultSet.getNodeRef(0));
+ mailAction.setParameterValue(MailActionExecuter.PARAM_TEMPLATE_MODEL, (Serializable) model);
+ }
+
+ logger.info(this.getClass().getName() + ": [Sending mail notify of infected to admin]");
+ actionService.executeAction(mailAction, nodeRef);
+ }
+ }
+
+ /**
+ * @param icapScan
+ */
+ public void setIcapScan(ICAPScan icapScan) {
+ this.icapScan = icapScan;
+ }
+
+ /**
+ * @param commandScan
+ */
+ public void setCommandScan(CommandScan commandScan) {
+ this.commandScan = commandScan;
+ }
+
+ /**
+ * @param inStreamScan
+ */
+ public void setInStreamScan(InStreamScan inStreamScan) {
+ this.inStreamScan = inStreamScan;
+ }
+
+ /**
+ * @param virusTotalScan
+ */
+ public void setVirusTotalScan(VirusTotalScan virusTotalScan) {
+ this.virusTotalScan = virusTotalScan;
+ }
+
+ /**
+ * @param mode
+ */
+ public void setMode(String mode) {
+ this.mode = mode;
+ }
+
+ /**
+ * @param store
+ */
+ public void setStore(String store) {
+ this.store = store;
+ }
+
+ /**
+ * @param notifyAdmin
+ */
+ public void setNotifyAdmin(boolean notifyAdmin) {
+ this.notifyAdmin = notifyAdmin;
+ }
+
+ /**
+ * @param notifyUser
+ */
+ public void setNotifyUser(boolean notifyUser) {
+ this.notifyUser = notifyUser;
+ }
+
+ /**
+ * @param notifyAdminTemplate
+ */
+ public void setNotifyAdminTemplate(String notifyAdminTemplate) {
+ this.notifyAdminTemplate = notifyAdminTemplate;
+ }
+
+ /**
+ * @param notifyUserTemplate
+ */
+ public void setNotifyUserTemplate(String notifyUserTemplate) {
+ this.notifyUserTemplate = notifyUserTemplate;
+ }
+
+ /**
+ * @param serviceRegistry
+ */
+ public void setServiceRegistry(ServiceRegistry serviceRegistry) {
+ this.serviceRegistry = serviceRegistry;
+ }
+
+ /**
+ * @return
+ */
+ public ICAPScan getIcapScan() {
+ return icapScan;
+ }
+
+ /**
+ * @return
+ */
+ public InStreamScan getInStreamScan() {
+ return inStreamScan;
+ }
+
+ /**
+ * @param icapPort
+ */
+ public void setIcapPort(int icapPort) {
+ this.icapPort = icapPort;
+ }
+
+ /**
+ * @param icapHost
+ */
+ public void setIcapHost(String icapHost) {
+ this.icapHost = icapHost;
+ }
+
+ /**
+ * @param icapService
+ */
+ public void setIcapService(String icapService) {
+ this.icapService = icapService;
+ }
+
+ /**
+ * @param inStreamChunkSize
+ */
+ public void setInStreamChunkSize(int inStreamChunkSize) {
+ this.inStreamChunkSize = inStreamChunkSize;
+ }
+
+ /**
+ * @param inStreamPort
+ */
+ public void setInStreamPort(int inStreamPort) {
+ this.inStreamPort = inStreamPort;
+ }
+
+ /**
+ * @param inStreamHost
+ */
+ public void setInStreamHost(String inStreamHost) {
+ this.inStreamHost = inStreamHost;
+ }
+
+ /**
+ * @param inStreamTimeout
+ */
+ public void setInStreamTimeout(int inStreamTimeout) {
+ this.inStreamTimeout = inStreamTimeout;
+ }
+
+ /**
+ * @param commandExec
+ */
+ public void setCommandExec(List commandExec) {
+ this.commandExec = commandExec;
+ }
+
+ /**
+ * @param vtKey
+ */
+ public void setVtKey(String vtKey) {
+ this.vtKey = vtKey;
+ }
+
+ /**
+ * @param vtUrl
+ */
+ public void setVtUrl(String vtUrl) {
+ this.vtUrl = vtUrl;
+ }
+
+ /**
+ * @param onUpdateReadScan
+ */
+ public void setOnUpdateReadScan(OnUpdateReadScan onUpdateReadScan) {
+ this.onUpdateReadScan = onUpdateReadScan;
+ }
+
+ /**
+ * @param onUpdate
+ */
+ public void setOnUpdate(boolean onUpdate) {
+ this.onUpdateReadScan.setOnUpdate(onUpdate);
+ // this.onUpdateReadScan.init();
+ }
+
+ /**
+ * @param onRead
+ */
+ public void setOnRead(boolean onRead) {
+ this.onUpdateReadScan.setOnRead(onRead);
+ // this.onUpdateReadScan.init();
+ }
+
+ /**
+ * @param fileExceptions
+ */
+ public void setFileExceptions(String fileExceptions) {
+ this.fileExceptions = fileExceptions;
+ }
+
+ /**
+ * @param fileOnly
+ */
+ public void setFileOnly(String fileOnly) {
+ this.fileOnly = fileOnly;
+ }
+
+ /**
+ * @param fileOnlyOrExceptions
+ */
+ public void setFileOnlyOrExceptions(String fileOnlyOrExceptions) {
+ this.fileOnlyOrExceptions = fileOnlyOrExceptions;
+ }
+
+ /**
+ * @param runScriptScanFolder
+ */
+ public void setRunScriptScanFolder(CronScheduledQueryBasedTemplateActionDefinition runScriptScanFolder) {
+ this.runScriptScanFolder = runScriptScanFolder;
+ }
+
+ /**
+ * @param queryTemplate
+ */
+ public void setQueryTemplate(String queryTemplate) {
+ this.runScriptScanFolder.setQueryTemplate(queryTemplate);
+ }
+
+ /**
+ * @param cronExpression
+ */
+ public void setCronExpression(String cronExpression) {
+ this.runScriptScanFolder.setCronExpression(cronExpression);
+ }
+}
diff --git a/alfviral/src/main/java/com/fegor/alfresco/services/AntivirusServiceRegistry.java b/alfviral/src/main/java/com/fegor/alfresco/services/AntivirusServiceRegistry.java
index e2ed225..22e5d7c 100644
--- a/alfviral/src/main/java/com/fegor/alfresco/services/AntivirusServiceRegistry.java
+++ b/alfviral/src/main/java/com/fegor/alfresco/services/AntivirusServiceRegistry.java
@@ -25,5 +25,5 @@ public interface AntivirusServiceRegistry {
static final QName ANTIVIRUS_SERVICE = QName.createQName(NamespaceService.ALFRESCO_URI, "AntivirusService");
@NotAuditable
- AntivirusService getAntivirusService();
+ AntivirusServiceImpl getAntivirusService();
}
diff --git a/alfviral/target/alfviral.amp b/alfviral/target/alfviral.amp
deleted file mode 100644
index 6b29fa7..0000000
Binary files a/alfviral/target/alfviral.amp and /dev/null differ
diff --git a/alfviral/target/alfviral/config/alfresco/extension/templates/mail/notify_admin_en.html b/alfviral/target/alfviral/config/alfresco/extension/templates/mail/notify_admin_en.html
deleted file mode 100644
index be2c04e..0000000
--- a/alfviral/target/alfviral/config/alfresco/extension/templates/mail/notify_admin_en.html
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- |
-
-
- ${person.properties.firstName} <#if person.properties.lastName?exists> ${person.properties.lastName}#if> has added a new content item, ${document.name}, in the ${document.siteShortName!""} site and is this INFECTED!
-
-
- ${date?datetime?string.full}
-
- |
-
-
-
- Hi,
-
- ${person.properties.firstName}
- <#if person.properties.lastName?exists> ${person.properties.lastName}#if>
- has added a new content item, ${document.name}, in the ${document.siteShortName!""} site was detected as infected.
-
- Sincerely,
- Alfviral
-
- |
-
-
- |
-
-
-
-
- |
-
-
-
-
- |
-
-
- |
-
-
- |
-
-
-
-
\ No newline at end of file
diff --git a/alfviral/target/alfviral/config/alfresco/extension/templates/mail/notify_admin_es.html b/alfviral/target/alfviral/config/alfresco/extension/templates/mail/notify_admin_es.html
deleted file mode 100644
index 531dc4a..0000000
--- a/alfviral/target/alfviral/config/alfresco/extension/templates/mail/notify_admin_es.html
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- |
-
-
- ${person.properties.firstName} <#if person.properties.lastName?exists> ${person.properties.lastName}#if> ha añadido un nuevo elemento de contenido, ${document.name}, en el sitio ${document.siteShortName!""} y se ha detectado como INFECTADO
-
-
- ${date?datetime?string.full}
-
- |
-
-
-
- Hola:
-
- ${person.properties.firstName}
- <#if person.properties.lastName?exists> ${person.properties.lastName}#if>
- ha añadido un nuevo elemento (o modificado) de contenido, ${document.name}, en el sitio ${document.siteShortName!""} que se ha detectado como infectado.
-
- Atentamente,
- Alfviral
-
- |
-
-
- |
-
-
-
-
- |
-
-
-
-
- |
-
-
- |
-
-
- |
-
-
-
-
diff --git a/alfviral/target/alfviral/config/alfresco/extension/templates/mail/notify_user_en.html b/alfviral/target/alfviral/config/alfresco/extension/templates/mail/notify_user_en.html
deleted file mode 100644
index 8babdd7..0000000
--- a/alfviral/target/alfviral/config/alfresco/extension/templates/mail/notify_user_en.html
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- |
-
-
- ${person.properties.firstName} <#if person.properties.lastName?exists> ${person.properties.lastName}#if> has added a new content item, ${document.name}, in the ${document.siteShortName!""} site and is this INFECTED!
-
-
- ${date?datetime?string.full}
-
- |
-
-
-
- Hi,
-
- ${person.properties.firstName}
- <#if person.properties.lastName?exists> ${person.properties.lastName}#if>
- has added a new content item, ${document.name}, in the ${document.siteShortName!""} site was detected as infected.
-
- Please contact the Administrator
-
- Sincerely,
- Alfviral
-
- |
-
-
- |
-
-
-
-
- |
-
-
-
-
- |
-
-
- |
-
-
- |
-
-
-
-
\ No newline at end of file
diff --git a/alfviral/target/alfviral/config/alfresco/extension/templates/mail/notify_user_es.html b/alfviral/target/alfviral/config/alfresco/extension/templates/mail/notify_user_es.html
deleted file mode 100644
index e966d3f..0000000
--- a/alfviral/target/alfviral/config/alfresco/extension/templates/mail/notify_user_es.html
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- |
-
-
- ${person.properties.firstName} <#if person.properties.lastName?exists> ${person.properties.lastName}#if> ha añadido un nuevo elemento de contenido, ${document.name}, en el sitio ${document.siteShortName!""} y se ha detectado como INFECTADO
-
-
- ${date?datetime?string.full}
-
- |
-
-
-
- Hola:
-
- ${person.properties.firstName}
- <#if person.properties.lastName?exists> ${person.properties.lastName}#if>
- ha añadido un nuevo elemento (o modificado) de contenido, ${document.name}, en el sitio ${document.siteShortName!""} que se ha detectado como infectado.
-
- Por favor, póngase en contacto con el Administrador
-
- Atentamente,
- Alfviral
-
- |
-
-
- |
-
-
-
-
- |
-
-
-
-
- |
-
-
- |
-
-
- |
-
-
-
-
diff --git a/alfviral/target/alfviral/config/alfresco/extension/templates/webscripts/com/fegor/alfviral/scanfolder.get.desc.xml b/alfviral/target/alfviral/config/alfresco/extension/templates/webscripts/com/fegor/alfviral/scanfolder.get.desc.xml
deleted file mode 100644
index 97998e0..0000000
--- a/alfviral/target/alfviral/config/alfresco/extension/templates/webscripts/com/fegor/alfviral/scanfolder.get.desc.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
- Alfviral Folder Scan
- Alfresco Virus Alert folder scan.
- /alfviral/scanfolder?f={f};p={p}
- extension
- user
- required
-
diff --git a/alfviral/target/alfviral/config/alfresco/extension/templates/webscripts/com/fegor/alfviral/scanfolder.get.html.400.ftl b/alfviral/target/alfviral/config/alfresco/extension/templates/webscripts/com/fegor/alfviral/scanfolder.get.html.400.ftl
deleted file mode 100644
index e00985f..0000000
--- a/alfviral/target/alfviral/config/alfresco/extension/templates/webscripts/com/fegor/alfviral/scanfolder.get.html.400.ftl
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-${status.message}
-
-
diff --git a/alfviral/target/alfviral/config/alfresco/extension/templates/webscripts/com/fegor/alfviral/scanfolder.get.js b/alfviral/target/alfviral/config/alfresco/extension/templates/webscripts/com/fegor/alfviral/scanfolder.get.js
deleted file mode 100644
index 4425ac7..0000000
--- a/alfviral/target/alfviral/config/alfresco/extension/templates/webscripts/com/fegor/alfviral/scanfolder.get.js
+++ /dev/null
@@ -1,2 +0,0 @@
-
-var scanfolder = ScanFolder(args.f, args.p);
\ No newline at end of file
diff --git a/alfviral/target/alfviral/config/alfresco/extension/templates/webscripts/com/fegor/alfviral/scanfolder.get.json.ftl b/alfviral/target/alfviral/config/alfresco/extension/templates/webscripts/com/fegor/alfviral/scanfolder.get.json.ftl
deleted file mode 100644
index ed93c1c..0000000
--- a/alfviral/target/alfviral/config/alfresco/extension/templates/webscripts/com/fegor/alfviral/scanfolder.get.json.ftl
+++ /dev/null
@@ -1,2 +0,0 @@
-{"success":"${folder_scan}"}
-
diff --git a/alfviral/target/alfviral/config/alfresco/extension/templates/webscripts/com/fegor/alfviral/scanfolder.get.text.ftl b/alfviral/target/alfviral/config/alfresco/extension/templates/webscripts/com/fegor/alfviral/scanfolder.get.text.ftl
deleted file mode 100644
index 9766475..0000000
--- a/alfviral/target/alfviral/config/alfresco/extension/templates/webscripts/com/fegor/alfviral/scanfolder.get.text.ftl
+++ /dev/null
@@ -1 +0,0 @@
-ok
diff --git a/alfviral/target/alfviral/config/alfresco/extension/templates/webscripts/org/alfresco/slingshot/documentlibrary/action/scanfile.post.desc.xml b/alfviral/target/alfviral/config/alfresco/extension/templates/webscripts/org/alfresco/slingshot/documentlibrary/action/scanfile.post.desc.xml
deleted file mode 100644
index c295fc5..0000000
--- a/alfviral/target/alfviral/config/alfresco/extension/templates/webscripts/org/alfresco/slingshot/documentlibrary/action/scanfile.post.desc.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
- ScanFile
- Document List Action - ScanFile document(s)
- /slingshot/doclib/action/scanfile/site/{site}/{container}
- argument
- user
- required
-
diff --git a/alfviral/target/alfviral/config/alfresco/extension/templates/webscripts/org/alfresco/slingshot/documentlibrary/action/scanfile.post.json.ftl b/alfviral/target/alfviral/config/alfresco/extension/templates/webscripts/org/alfresco/slingshot/documentlibrary/action/scanfile.post.json.ftl
deleted file mode 100644
index 8976ae0..0000000
--- a/alfviral/target/alfviral/config/alfresco/extension/templates/webscripts/org/alfresco/slingshot/documentlibrary/action/scanfile.post.json.ftl
+++ /dev/null
@@ -1,2 +0,0 @@
-<#import "action.lib.ftl" as actionLib />
-<@actionLib.resultsJSON results=results />
diff --git a/alfviral/target/alfviral/config/alfresco/extension/templates/webscripts/org/alfresco/slingshot/documentlibrary/action/scanfile.post.json.js b/alfviral/target/alfviral/config/alfresco/extension/templates/webscripts/org/alfresco/slingshot/documentlibrary/action/scanfile.post.json.js
deleted file mode 100644
index 80fc09f..0000000
--- a/alfviral/target/alfviral/config/alfresco/extension/templates/webscripts/org/alfresco/slingshot/documentlibrary/action/scanfile.post.json.js
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-/**
- * ScanFile multiple files action
- * @method POST
- */
-
-/**
- * Entrypoint required by action.lib.js
- *
- * @method runAction
- * @param p_params {object} Object literal containing files array
- * @return {object|null} object representation of action results
- */
-function runAction(p_params)
-{
- var results = [];
- var files = p_params.files;
- var file, fileNode, result, nodeRef;
-
- if (!files || files.length == 0)
- {
- status.setCode(status.STATUS_BAD_REQUEST, "¿files?");
- return;
- }
-
- for (file in files)
- {
- nodeRef = files[file];
- result =
- {
- nodeRef: nodeRef,
- action: "scanfile",
- success: false
- }
-
- try
- {
- fileNode = search.findNode(nodeRef);
- if (fileNode === null)
- {
- result.id = file;
- result.nodeRef = nodeRef;
- result.success = false;
- }
- else
- {
- result.id = fileNode.name;
- result.type = fileNode.isContainer ? "folder" : "document";
-// TODO poner try...catch
- actions.create("alfviral.virusscan.action").execute(fileNode);
- if (fileNode.hasAspect("infected"))
- {
- result.infected = true;
- }
- result.success = true;
- }
- }
- catch (e)
- {
- result.id = file;
- result.nodeRef = nodeRef;
- result.success = false;
- }
-
- results.push(result);
- }
-
- return results;
-}
-
-/* Bootstrap action script */
-main();
diff --git a/alfviral/target/alfviral/config/alfresco/extension/webclient.properties b/alfviral/target/alfviral/config/alfresco/extension/webclient.properties
deleted file mode 100644
index ebf1189..0000000
--- a/alfviral/target/alfviral/config/alfresco/extension/webclient.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-alfviral.virusscan.action.title=Scanning for viruses
-alfviral.virusscan.action.description=Scanning for viruses using ClamAV
-
-alfviral.label.infected=Infected
-alfviral.label.date=Date of detection
-alfviral.label.clean=Desinfected?
-
-alfviral.label.scanned.from.clamav=Scanned from ClamAV
-alfviral.label.scanned.from.command=Scanned from Command
-alfviral.label.scanned.from.virustotal=Scanned from VirusTotal
-alfviral.label.scanned.from.icap=Scanned from ICAP
-
-prop.ava.response.code=Response code
-prop.ava.verbose.msg=Message
-prop.ava.resource=Resource
-prop.ava.permalink=Link
-prop.ava.sha256=SHA256
-prop.ava.positives=Positives
-
-alfviral.label.action.virusscan=Virus Scan
diff --git a/alfviral/target/alfviral/config/alfresco/extension/webclient_en_US.properties b/alfviral/target/alfviral/config/alfresco/extension/webclient_en_US.properties
deleted file mode 100644
index ebf1189..0000000
--- a/alfviral/target/alfviral/config/alfresco/extension/webclient_en_US.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-alfviral.virusscan.action.title=Scanning for viruses
-alfviral.virusscan.action.description=Scanning for viruses using ClamAV
-
-alfviral.label.infected=Infected
-alfviral.label.date=Date of detection
-alfviral.label.clean=Desinfected?
-
-alfviral.label.scanned.from.clamav=Scanned from ClamAV
-alfviral.label.scanned.from.command=Scanned from Command
-alfviral.label.scanned.from.virustotal=Scanned from VirusTotal
-alfviral.label.scanned.from.icap=Scanned from ICAP
-
-prop.ava.response.code=Response code
-prop.ava.verbose.msg=Message
-prop.ava.resource=Resource
-prop.ava.permalink=Link
-prop.ava.sha256=SHA256
-prop.ava.positives=Positives
-
-alfviral.label.action.virusscan=Virus Scan
diff --git a/alfviral/target/alfviral/config/alfresco/extension/webclient_es_ES.properties b/alfviral/target/alfviral/config/alfresco/extension/webclient_es_ES.properties
deleted file mode 100644
index d64950d..0000000
--- a/alfviral/target/alfviral/config/alfresco/extension/webclient_es_ES.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-alfviral.virusscan.action.title=Escanear para virus
-alfviral.virusscan.action.description=Escaneo de virus usando ClamAV
-
-alfviral.label.infected=Infectado
-alfviral.label.date=Fecha de detecci�n
-alfviral.label.clean=�Desinfectado?
-
-alfviral.label.scanned.from.clamav=Escaneado por ClamAV
-alfviral.label.scanned.from.command=Escaneado por Command
-alfviral.label.scanned.from.virustotal=Escaneado por VirusTotal
-alfviral.label.scanned.from.icap=Scanned from ICAP
-
-prop.ava.response.code=C�digo de respuesta
-prop.ava.verbose.msg=Mensaje
-prop.ava.resource=Recurso
-prop.ava.permalink=Link
-prop.ava.sha256=SHA256
-prop.ava.positives=Positivos
-
-alfviral.label.action.virusscan=Escanear virus
diff --git a/alfviral/target/alfviral/config/alfresco/module/alfviral/bootstrap/alfviral-email-templates.acp b/alfviral/target/alfviral/config/alfresco/module/alfviral/bootstrap/alfviral-email-templates.acp
deleted file mode 100644
index f1defa4..0000000
Binary files a/alfviral/target/alfviral/config/alfresco/module/alfviral/bootstrap/alfviral-email-templates.acp and /dev/null differ
diff --git a/alfviral/target/alfviral/config/alfresco/module/alfviral/bootstrap/alfviral-scripts.acp b/alfviral/target/alfviral/config/alfresco/module/alfviral/bootstrap/alfviral-scripts.acp
deleted file mode 100644
index 16e5f8f..0000000
Binary files a/alfviral/target/alfviral/config/alfresco/module/alfviral/bootstrap/alfviral-scripts.acp and /dev/null differ
diff --git a/alfviral/target/alfviral/config/alfresco/module/alfviral/bootstrap/bootstrap-context.xml b/alfviral/target/alfviral/config/alfresco/module/alfviral/bootstrap/bootstrap-context.xml
deleted file mode 100644
index b938a76..0000000
--- a/alfviral/target/alfviral/config/alfresco/module/alfviral/bootstrap/bootstrap-context.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- UPDATE_EXISTING
- /${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.scripts.childname}
- alfresco/module/alfviral/bootstrap/alfviral-scripts.acp
-
-
- UPDATE_EXISTING
- /${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.templates.email.childname}
- alfresco/module/alfviral/bootstrap/alfviral-email-templates.acp
-
-
-
-
-
\ No newline at end of file
diff --git a/alfviral/target/alfviral/config/alfresco/module/alfviral/context/alfviral-context.xml b/alfviral/target/alfviral/config/alfresco/module/alfviral/context/alfviral-context.xml
deleted file mode 100644
index 5f87d13..0000000
--- a/alfviral/target/alfviral/config/alfresco/module/alfviral/context/alfviral-context.xml
+++ /dev/null
@@ -1,290 +0,0 @@
-
-
-
-
-
- true
-
-
-
- classpath:alfresco/extension/alfviral.properties
-
-
-
-
-
-
-
-
-
- alfresco.extension.webclient
-
-
-
-
-
-
-
- classpath:alfresco/module/alfviral/ui/web-client-config-custom.xml
-
-
-
-
-
-
-
-
-
- alfresco/module/alfviral/model/alfviralModel.xml
-
-
-
-
-
-
-
-
-
-
-
- ${alfviral.host}
-
-
- ${alfviral.port}
-
-
- ${alfviral.timeout}
-
-
- ${alfviral.chunkSize}
-
-
-
-
-
-
-
-
- ${alfviral.command}
-
-
-
-
-
-
-
-
- ${vt.key}
-
-
- ${vt.url}
-
-
-
-
-
-
-
-
- ${alfviral.icap.host}
-
-
- ${alfviral.icap.port}
-
-
- ${alfviral.icap.service}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ${alfviral.on_update}
-
-
- ${alfviral.on_read}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- script
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- UNTIL_FIRST_FAILURE
-
-
- IGNORE
-
-
-
-
-
-
-
-
- lucene
-
-
-
- workspace://SpacesStore
-
-
-
- PATH:"${alfviral.scheduled.pathQuery}"
-
-
- ${alfviral.scheduled.cronExpression}
-
-
- jobScanFolder
-
-
- jobGroupScanFolder
-
-
- triggerScanFolder
-
-
- triggerGroupScanFolder
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- System
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ${alfviral.mode}
-
-
- ${dir.contentstore}
-
-
- ${alfviral.file.exceptions}
-
-
- ${alfviral.notify.admin}
-
-
- ${alfviral.notify.user}
-
-
-
diff --git a/alfviral/target/alfviral/config/alfresco/module/alfviral/log4j.properties b/alfviral/target/alfviral/config/alfresco/module/alfviral/log4j.properties
deleted file mode 100644
index 22f8cb1..0000000
--- a/alfviral/target/alfviral/config/alfresco/module/alfviral/log4j.properties
+++ /dev/null
@@ -1,28 +0,0 @@
-#-----------------------------------------------------------------------
-# webscript module log4j.properties
-#
-# NOTE
-# ----
-# Log4j uses the following logging levels:
-# debug,info,warn,error,fatal
-#
-# To set the logging level of {fullClassName} to {loglevel},
-# add a line to this file of the following form:
-#
-# log4j.logger.{fullClassName}={loglevel}
-#
-# For example, to make 'com.example.MyExample' produce 'debug'
-# logs, add a line like this:
-#
-# log4j.logger.com.example.MyExample=debug
-#
-#
-# WARNING
-# -------
-# Log properties in this log4j.properties file override/augment
-# those in the webapp's main log4j.properties.
-#
-#-----------------------------------------------------------------------
-
-log4j.logger.com.fegor.alfresco=debug
-
\ No newline at end of file
diff --git a/alfviral/target/alfviral/config/alfresco/module/alfviral/model/alfviralModel.xml b/alfviral/target/alfviral/config/alfresco/module/alfviral/model/alfviralModel.xml
deleted file mode 100644
index ec9fb1c..0000000
--- a/alfviral/target/alfviral/config/alfresco/module/alfviral/model/alfviralModel.xml
+++ /dev/null
@@ -1,117 +0,0 @@
-
-
-
- Alfresco Virus Alarm Model
- Fernando González Ruano (twitter://fegorama)
- 1.0
-
-
-
-
-
-
-
-
-
- Infected
-
-
- d:date
- false
-
- false
- false
- false
-
-
-
- d:boolean
- false
-
- false
- false
- false
-
-
-
-
-
- Scannned from Command
-
-
- Scannned from ClamAV
-
-
- Scannned from ICAP
-
-
- Scannned from VirusTotal
-
-
- d:text
- true
-
- true
- false
- false
-
-
-
- d:text
- true
-
- true
- false
- false
-
-
-
- d:text
- true
-
- true
- false
- false
-
-
-
- d:text
- true
-
- false
- false
- false
-
-
-
- d:text
- true
-
- true
- false
- false
-
-
-
- d:text
- true
-
- true
- false
- false
-
-
-
- d:int
-
- true
- false
- false
-
-
-
-
-
-
\ No newline at end of file
diff --git a/alfviral/target/alfviral/config/alfresco/module/alfviral/module-context.xml b/alfviral/target/alfviral/config/alfresco/module/alfviral/module-context.xml
deleted file mode 100644
index 2d6a03e..0000000
--- a/alfviral/target/alfviral/config/alfresco/module/alfviral/module-context.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
diff --git a/alfviral/target/alfviral/config/alfresco/module/alfviral/templates/scripts/ScanDocument.js b/alfviral/target/alfviral/config/alfresco/module/alfviral/templates/scripts/ScanDocument.js
deleted file mode 100644
index d92d658..0000000
--- a/alfviral/target/alfviral/config/alfresco/module/alfviral/templates/scripts/ScanDocument.js
+++ /dev/null
@@ -1,2 +0,0 @@
-logger.log("Scanning document: " + document.displayPath + "/" + document.name);
-actions.create("alfviral.virusscan.action").execute(document);
\ No newline at end of file
diff --git a/alfviral/target/alfviral/config/alfresco/module/alfviral/templates/scripts/ScanFolder.js b/alfviral/target/alfviral/config/alfresco/module/alfviral/templates/scripts/ScanFolder.js
deleted file mode 100644
index ab5aa34..0000000
--- a/alfviral/target/alfviral/config/alfresco/module/alfviral/templates/scripts/ScanFolder.js
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * alfviral 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.
- *
- * alfviral 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 .
- */
-
-/*
- * scanFolder
- * Lanza la función recursiva de escaneo.
- *
- * @param folder_scan
- * @param p
- */
-function ScanFolder(folder_scan, p)
-{
- logger.log("============");
- logger.log(" ScanFolder ")
- logger.log("============");
-
- logger.log("Scanning from: " + folder_scan.replace(companyhome.name + "/", ""));
- logger.log("¿Recursive? " + (p.equals("r") ? "Si" : "No"));
-
- scanFolderRun(folder_scan, p);
-}
-
-/*
- * scanFolderRun
- * Función de escaneo que usa un folder inicial y
- * el parámetro p que si es "r" la hará recursiva.
- *
- * @param folder_scan
- * @param p
- */
-function scanFolderRun(folder_scan, p)
-{
- var success = false;
- var files_scan = companyhome.children;
-
- /*
- * Comprueba si es la raÃz Company Home, si no
- * hay que eliminar la cadena de Company Home (Espacio de empresa)
- * para que localice correctament el nodeRef.
- */
- if (folder_scan.replace(companyhome.name, "").length > 0)
- {
- files_scan = companyhome.childByNamePath(folder_scan.replace(companyhome.name + "/", "")).children;
- }
-
- /*
- * Si se encuentra la carpeta...
- */
- if (files_scan)
- {
- /*
- * Recorrido...
- */
- for ( var file_scan in files_scan)
- {
- /*
- * Si es un documento se llama a la acción de escaneo.
- */
- if (files_scan[file_scan].isDocument)
- {
- logger.log("Escaneando: " + files_scan[file_scan].displayPath + "/" + files_scan[file_scan].name);
- actions.create("alfviral.virusscan.action").execute(files_scan[file_scan]);
- }
- /*
- * Si es una carpeta y está activada la recursividad se llama a sà misma.
- */
- else
- if (files_scan[file_scan].isContainer && p == "r")
- {
- logger.log("Entrando en: " + files_scan[file_scan].displayPath + "/" + files_scan[file_scan].name);
- scanFolderRun(files_scan[file_scan].displayPath + "/" + files_scan[file_scan].name, "r");
- }
- }
- success = true;
- }
- else
- {
- logger.log("No se ha encontrado la carpeta para escanear.");
- }
-
- return success;
-}
diff --git a/alfviral/target/alfviral/config/alfresco/module/alfviral/templates/scripts/ScriptScanFolder.js b/alfviral/target/alfviral/config/alfresco/module/alfviral/templates/scripts/ScriptScanFolder.js
deleted file mode 100644
index dd22195..0000000
--- a/alfviral/target/alfviral/config/alfresco/module/alfviral/templates/scripts/ScriptScanFolder.js
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-logger.log("llamada... ScriptScanFolder");
diff --git a/alfviral/target/alfviral/config/alfresco/module/alfviral/ui/web-client-config-custom.xml b/alfviral/target/alfviral/config/alfresco/module/alfviral/ui/web-client-config-custom.xml
deleted file mode 100644
index 30c925e..0000000
--- a/alfviral/target/alfviral/config/alfresco/module/alfviral/ui/web-client-config-custom.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- com.fegor.alfresco.evaluator.VirusScanEvaluator
-
- alfviral.label.action.virusscan
- /images/alfviral/icons/action-scan-file-16.png
-
-
- #{actionContext.nodeRef}
- #{actionContext.id}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/alfviral/target/alfviral/lib/alfviral.jar b/alfviral/target/alfviral/lib/alfviral.jar
deleted file mode 100644
index e201e4e..0000000
Binary files a/alfviral/target/alfviral/lib/alfviral.jar and /dev/null differ
diff --git a/alfviral/target/alfviral/log4j.properties b/alfviral/target/alfviral/log4j.properties
deleted file mode 100644
index 183137c..0000000
--- a/alfviral/target/alfviral/log4j.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-# Define here logging properties for your AMP specific classes
-# This will end up in alfresco.war/WEB-INF/classes/alfresco/module/log4j.properties
-# and loaded as per http://wiki.alfresco.com/wiki/Developing_an_Alfresco_Module#log4j.properties
-log4j.logger.org.alfresco.demoamp=DEBUG
\ No newline at end of file
diff --git a/alfviral/target/alfviral/module.properties b/alfviral/target/alfviral/module.properties
deleted file mode 100644
index aecf70d..0000000
--- a/alfviral/target/alfviral/module.properties
+++ /dev/null
@@ -1,48 +0,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.
-
-
-
-# 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=alfviral
-#module.aliases=myModule-123, my-module
-module.title=Alfviral AMP project
-module.description=Manages the lifecycle of the alfviral AMP (Alfresco Module Package)
-module.version=1.3.4.1702031410
-
-# 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 1.3.4-SNAPSHOT or later
-# module.depends.net.sf.myproject.module.SupportModuleA=1.3.4-SNAPSHOT-*
-# Depends on net.sf.myproject.module.SupportModuleA version 1.3.4-SNAPSHOT to 2.0
-# module.depends.net.sf.myproject.module.SupportModuleB=1.3.4-SNAPSHOT-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/alfviral/target/alfviral/web/images/alfviral/icons/action-scan-file-16.png b/alfviral/target/alfviral/web/images/alfviral/icons/action-scan-file-16.png
deleted file mode 100644
index 6394728..0000000
Binary files a/alfviral/target/alfviral/web/images/alfviral/icons/action-scan-file-16.png and /dev/null differ
diff --git a/alfviral/target/alfviral/web/licenses/README-licenses.txt b/alfviral/target/alfviral/web/licenses/README-licenses.txt
deleted file mode 100644
index 2a848d0..0000000
--- a/alfviral/target/alfviral/web/licenses/README-licenses.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-This folder (root in the AMP) gets mapped automagically in WEB-INF/licenses
-in the war build
\ No newline at end of file
diff --git a/alfviral/target/classes/com/fegor/alfresco/action/VirusScanAction.class b/alfviral/target/classes/com/fegor/alfresco/action/VirusScanAction.class
index 5a16b7c..471d6a7 100644
Binary files a/alfviral/target/classes/com/fegor/alfresco/action/VirusScanAction.class and b/alfviral/target/classes/com/fegor/alfresco/action/VirusScanAction.class differ
diff --git a/alfviral/target/classes/com/fegor/alfresco/behavior/OnUpdateReadScan.class b/alfviral/target/classes/com/fegor/alfresco/behavior/OnUpdateReadScan.class
index 41acfc5..4c35a0f 100644
Binary files a/alfviral/target/classes/com/fegor/alfresco/behavior/OnUpdateReadScan.class and b/alfviral/target/classes/com/fegor/alfresco/behavior/OnUpdateReadScan.class differ
diff --git a/alfviral/target/classes/com/fegor/alfresco/services/AntivirusService.class b/alfviral/target/classes/com/fegor/alfresco/services/AntivirusService.class
index c3a8395..2b7c1f5 100644
Binary files a/alfviral/target/classes/com/fegor/alfresco/services/AntivirusService.class and b/alfviral/target/classes/com/fegor/alfresco/services/AntivirusService.class differ
diff --git a/alfviral/target/classes/com/fegor/alfresco/services/AntivirusServiceDescriptorRegistry.class b/alfviral/target/classes/com/fegor/alfresco/services/AntivirusServiceDescriptorRegistry.class
index c2feee7..19d9362 100644
Binary files a/alfviral/target/classes/com/fegor/alfresco/services/AntivirusServiceDescriptorRegistry.class and b/alfviral/target/classes/com/fegor/alfresco/services/AntivirusServiceDescriptorRegistry.class differ
diff --git a/alfviral/target/classes/com/fegor/alfresco/services/AntivirusServiceRegistry.class b/alfviral/target/classes/com/fegor/alfresco/services/AntivirusServiceRegistry.class
index 1332f3c..7a5fa42 100644
Binary files a/alfviral/target/classes/com/fegor/alfresco/services/AntivirusServiceRegistry.class and b/alfviral/target/classes/com/fegor/alfresco/services/AntivirusServiceRegistry.class differ
diff --git a/alfviral/target/maven-archiver/pom.properties b/alfviral/target/maven-archiver/pom.properties
index 7a3f660..4dc9be7 100644
--- a/alfviral/target/maven-archiver/pom.properties
+++ b/alfviral/target/maven-archiver/pom.properties
@@ -1,5 +1,5 @@
-#Generated by Maven
-#Fri Feb 03 14:10:52 CET 2017
-version=1.3.4-SNAPSHOT
+#Generated by Apache Maven
+#Tue Feb 21 13:25:33 CET 2017
+version=1.4.0-SNAPSHOT
groupId=com.fegor.alfresco
artifactId=alfviral
diff --git a/alfviral/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/alfviral/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
index 9c43e71..462fc34 100644
--- a/alfviral/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
+++ b/alfviral/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
@@ -1,5 +1,6 @@
com\fegor\alfresco\behavior\OnUpdateReadScan.class
com\fegor\alfresco\protocols\icap\ICAP.class
+com\fegor\alfresco\services\AntivirusServiceImpl.class
com\fegor\alfresco\model\AlfviralModel.class
com\fegor\alfresco\security\antivirus\VirusScanMode.class
com\fegor\alfresco\services\AntivirusService.class
@@ -11,5 +12,6 @@ com\fegor\alfresco\security\antivirus\VirusTotalScan.class
com\fegor\alfresco\action\VirusScanAction.class
com\fegor\alfresco\evaluator\VirusScanEvaluator.class
com\fegor\alfresco\security\antivirus\CommandScan.class
+com\fegor\alfresco\action\VirusScanAction$1.class
com\fegor\alfresco\services\AntivirusServiceRegistry.class
com\fegor\alfresco\security\util\md5.class
diff --git a/alfviral/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/alfviral/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
index 9ecea50..49c58a1 100644
--- a/alfviral/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
+++ b/alfviral/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
@@ -13,3 +13,4 @@ D:\Users\fegor\workspace\alfviral\alfviral\src\main\java\com\fegor\alfresco\serv
D:\Users\fegor\workspace\alfviral\alfviral\src\main\java\com\fegor\alfresco\behavior\OnUpdateReadScan.java
D:\Users\fegor\workspace\alfviral\alfviral\src\main\java\com\fegor\alfresco\action\VirusScanAction.java
D:\Users\fegor\workspace\alfviral\alfviral\src\main\java\com\fegor\alfresco\security\antivirus\VirusTotalScan.java
+D:\Users\fegor\workspace\alfviral\alfviral\src\main\java\com\fegor\alfresco\services\AntivirusServiceImpl.java
diff --git a/alfviral/target/test-classes/alfresco/module/alfviral/context/alfviral-context.xml b/alfviral/target/test-classes/alfresco/module/alfviral/context/alfviral-context.xml
deleted file mode 100644
index 5f87d13..0000000
--- a/alfviral/target/test-classes/alfresco/module/alfviral/context/alfviral-context.xml
+++ /dev/null
@@ -1,290 +0,0 @@
-
-
-
-
-
- true
-
-
-
- classpath:alfresco/extension/alfviral.properties
-
-
-
-
-
-
-
-
-
- alfresco.extension.webclient
-
-
-
-
-
-
-
- classpath:alfresco/module/alfviral/ui/web-client-config-custom.xml
-
-
-
-
-
-
-
-
-
- alfresco/module/alfviral/model/alfviralModel.xml
-
-
-
-
-
-
-
-
-
-
-
- ${alfviral.host}
-
-
- ${alfviral.port}
-
-
- ${alfviral.timeout}
-
-
- ${alfviral.chunkSize}
-
-
-
-
-
-
-
-
- ${alfviral.command}
-
-
-
-
-
-
-
-
- ${vt.key}
-
-
- ${vt.url}
-
-
-
-
-
-
-
-
- ${alfviral.icap.host}
-
-
- ${alfviral.icap.port}
-
-
- ${alfviral.icap.service}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ${alfviral.on_update}
-
-
- ${alfviral.on_read}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- script
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- UNTIL_FIRST_FAILURE
-
-
- IGNORE
-
-
-
-
-
-
-
-
- lucene
-
-
-
- workspace://SpacesStore
-
-
-
- PATH:"${alfviral.scheduled.pathQuery}"
-
-
- ${alfviral.scheduled.cronExpression}
-
-
- jobScanFolder
-
-
- jobGroupScanFolder
-
-
- triggerScanFolder
-
-
- triggerGroupScanFolder
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- System
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ${alfviral.mode}
-
-
- ${dir.contentstore}
-
-
- ${alfviral.file.exceptions}
-
-
- ${alfviral.notify.admin}
-
-
- ${alfviral.notify.user}
-
-
-
diff --git a/alfviral/target/test-classes/alfresco/module/alfviral/module-context.xml b/alfviral/target/test-classes/alfresco/module/alfviral/module-context.xml
index 2d6a03e..a370ee0 100644
--- a/alfviral/target/test-classes/alfresco/module/alfviral/module-context.xml
+++ b/alfviral/target/test-classes/alfresco/module/alfviral/module-context.xml
@@ -1,9 +1,6 @@
-
-
-
+
+