Skip to content

Commit

Permalink
Merge pull request #42 from AlbertoRamirezLosilla/master
Browse files Browse the repository at this point in the history
Generate signature report
  • Loading branch information
angelborroy-ks committed Jan 22, 2018
2 parents fb07c38 + 459ed42 commit 5301f4b
Show file tree
Hide file tree
Showing 47 changed files with 1,472 additions and 71 deletions.
50 changes: 48 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,18 @@ esign.cert.signOtherDocs=false
# Sign Purpose (Default enabled=false)
esign.cert.params.signPurpose.enabled=false
# Enable or disable download signature resume on pdf files (Default false)
esign.download.signature.report.enabled=true
# Web application URL to download signed document by CSV (Default null)
esign.csv.url=
# CSV image position to print(Default null).
esign.download.signature.report.default.csv.place=
# Signature resume position to print (Default Default null).
esign.download.signature.report.default.signature.info.place=
```

If no signature position selection form is required, `signaturePosition` properties must be declared blank. PDF signature will be performed by using `esign.cert.params.pades` in this scenario.
Expand All @@ -161,6 +173,18 @@ esign.cert.signOtherDocs=false
# Sign Purpose (Default enabled=false)
esign.cert.params.signPurpose.enabled=false
# Enable or disable download signature resume on pdf files (Default false)
esign.download.signature.report.enabled=false
# Web application URL to download signed document by CSV (Default null)
esign.csv.url=https://www.google.es
# CSV image position to print(Default null).
esign.download.signature.report.default.csv.place=csv.all.pages
# Signature resume position to print (Default Default null).
esign.download.signature.report.default.signature.info.place=signature.info.first.page
```

Usage
Expand All @@ -181,6 +205,27 @@ Issuer: OU=FNMT Clase 2 CA, O=FNMT, C=ES

PDF files can be signed up to 6 times on 6 different positions. Once a PDF is signed in a certain position that position is no longer available for signing. The signatures positions are defined in **alfresco-global.properties**.

To enable download signature report action, is necessary set to true property **esign.download.signature.report.enabled** on alfresco-global.properties. Then, you can configure default position of CSV and/or signature resume watermarks with properties **esign.download.signature.report.default.csv.place** and/or **esign.download.signature.report.default.signature.info.place**.

Availables values are:

* esign.download.signature.report.default.signature.info.place
* signature.info.first.page
* signature.info.last.page
* signature.info.all.pages
* signature.info.none
* esign.download.signature.report.default.csv.place
* csv.first.page
* csv.last.page
* csv.all.pages
* csv.none

If you don't set those properties, Alfresco asks user the position of CSV and signature resume.

Download signature report action is only available for nodes with next features:
* PDF nodes.
* Documents signed on this Alfresco instance. (Documents signed only by your organization).

Todo
----------------------
Pending features to be included (aka "wishlist"):
Expand All @@ -197,7 +242,8 @@ Pending features to be included (aka "wishlist"):
* Daniel E. Fernández
* Douglas C. R. Paes
* Vasil Iliev
* Pedro González
* Alberto Ramírez Losilla
* [Pedro González](https://www.linkedin.com/in/pedro-gonz%C3%A1lez-cano-310b40120/)
* [Alberto Ramírez Losilla](https://www.linkedin.com/in/alramlo/)
* Mikel Asla
* Maria Tsiakmaki
* [Sergio Campoy](https://es.linkedin.com/in/sergio-campoy-arnau-79697568)
2 changes: 1 addition & 1 deletion esign-cert-repo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>es.keensoft.alfresco</groupId>
<artifactId>esign-cert-repo</artifactId>
<version>1.5.2</version>
<version>1.6.0</version>
<name>esign-cert-repo Repository AMP project</name>
<packaging>amp</packaging>
<description>Manages the lifecycle of the esign-cert-repo Repository AMP (Alfresco Module Package)</description>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<webscript>
<shortname>Download document signature report</shortname>
<description>It generates a report about document signature. It is a copy of document signed
To test: curl "http://localhost:8080/alfresco/service/alfatec/alfresco-global/downloadSignReportFile"
</description>
<family>alfatec</family>
<url>/alfatec/alfresco-global/downloadSignReportFile</url>
<format default="json">any</format>
<authentication>user</authentication>
<transaction>none</transaction>
</webscript>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<webscript>
<shortname>Get Alfatec custom params</shortname>
<description>Get all properties from alfresco-global.properties created by Alfatec
To test: curl "http://localhost:8080/alfresco/service/alfatec/alfresco-global/getAlfatecCustomProperties"
</description>
<family>alfatec</family>
<url>/alfatec/alfresco-global/getAlfatecCustomProperties</url>
<format default="json">any</format>
<authentication>user</authentication>
<transaction>none</transaction>
</webscript>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<webscript>
<shortname>Check if document has been signed on Alfresco</shortname>
<description>Check if document has been signed on Alfresco
To test: curl "http://localhost:8080/alfresco/service/alfatec/alfresco-global/hasBeenDocumentSignedOnAlfresco?nodeRef={nodeRef}"
</description>
<family>alfatec</family>
<url>/alfatec/alfresco-global/hasBeenDocumentSignedOnAlfresco</url>
<format default="json">any</format>
<authentication>user</authentication>
<transaction>none</transaction>
</webscript>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<webscript>
<shortname>Get document signature report information</shortname>
<description>It generates a report about document signature. It is a copy of document signed
To test: curl "http://localhost:8080/alfresco/service/alfatec/alfresco-global/signatureReportInfo"
</description>
<family>alfatec</family>
<url>/alfatec/alfresco-global/signatureReportInfo</url>
<format default="json">any</format>
<authentication>user</authentication>
<transaction>none</transaction>
</webscript>
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,16 @@ esign.cert.params.sixthSignaturePosition=signaturePage={page}\tsignaturePosition
esign.cert.signOtherDocs=true

# Sign Purpose (Default enabled=false)
esign.cert.params.signPurpose.enabled=true
esign.cert.params.signPurpose.enabled=true

# Enable or disable download signature resume on pdf files (Default false)
esign.download.signature.report.enabled=false

# Web application URL to download signed document by CSV (Default null)
esign.csv.url=

# CSV image position to print(Default null).
esign.download.signature.report.default.csv.place=

# Signature resume position to print (Default Default null).
esign.download.signature.report.default.signature.info.place=
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
<property name="resourceBundles">
<list>
<value>alfresco.module.${project.artifactId}.messages.sign-webscripts</value>
<value>alfresco.module.${project.artifactId}.messages.csv</value>
<value>alfresco.module.${project.artifactId}.messages.sign</value>
</list>
</property>
</bean>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@
limitations under the License.
-->
<beans>

<!-- Return property signOtherDocs from alfresco-global.properties -->
<bean id="webscript.es.alfatec.signOtherDocsProperty.get"
class="es.alfatec.alfresco.webscripts.SignOtherDocsProperty" parent="webscript">
<property name="signOtherDocs" value="${esign.cert.signOtherDocs}" />
</bean>

<bean id="signCustomBehavior" class="es.keensoft.alfresco.behaviour.CustomBehaviour" init-method="init" depends-on="esign-cert-repo.dictionaryBootstrap">
<property name="policyComponent" ref="policyComponent" />
Expand All @@ -45,4 +39,14 @@
<property name="threadPriority" value="5" />
</bean>

</beans>
<bean id="AlfatecSignUtils" class="es.alfatec.alfresco.AlfatecSignUtils">
<property name="nodeService" ref="NodeService" />
<property name="contentService" ref="ContentService" />
<property name="versionService" ref="VersionService" />
</bean>

<bean id="WaterMarkUtils" class="es.alfatec.alfresco.WaterMarkUtils">
<property name="messageService" ref="messageService" />
<property name="url" value="${esign.cert.csv.url}"/>
</bean>
</beans>
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,30 @@
<bean id="webscript.es.keensoft.sign.webscripts.signature-metadata.get"
class="es.keensoft.alfresco.sign.webscript.SignatureMetadata" parent="webscript">
<property name="nodeService" ref="NodeService" />
</bean>
</bean>

<!-- Return properties from alfresco-global.properties -->
<bean id="webscript.es.alfatec.getAlfatecCustomProperties.get"
class="es.alfatec.alfresco.webscripts.GetAlfatecCustomProperties" parent="webscript">
<property name="signOtherDocs" value="${esign.cert.signOtherDocs}" />
<property name="defaultCSVPlace" value="${esign.download.signature.report.default.csv.place}" />
<property name="defaultSignatureInfoPlace" value="${esign.download.signature.report.default.signature.info.place}" />
<property name="csvWebApplicationURL" value="${esign.csv.url}" />
<property name="downloadSignatureReport" value="${esign.download.signature.report.enabled}" />
</bean>

<bean id="webscript.es.alfatec.hasBeenDocumentSignedOnAlfresco.get" class="es.alfatec.alfresco.webscripts.HasBeenDocumentSignedOnAlfresco" parent="webscript">
<property name="nodeService" ref="NodeService" />
<property name="alfatecSignUtils" ref="AlfatecSignUtils" />
</bean>

<bean id="webscript.es.alfatec.signatureReportInfo.post" class="es.alfatec.alfresco.webscripts.SignatureReportInfo" parent="webscript">
<property name="nodeService" ref="NodeService" />
<property name="alfatecSignUtils" ref="AlfatecSignUtils" />
</bean>
<bean id="webscript.es.alfatec.downloadSignatureReportFile.get" class="es.alfatec.alfresco.webscripts.DownloadSignatureReportFile" parent="webscript">
<property name="nodeService" ref="NodeService" />
<property name="alfatecSignUtils" ref="AlfatecSignUtils" />
<property name="waterMarkUtils" ref="WaterMarkUtils" />
</bean>
</beans>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
csv.text1=Documento firmado electr\u00f3nicamente
csv.text2=C\u00f3digo seguro de verificaci\u00f3n:
csv.text3=Para descargar el documento acceda a:
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
csv.text1=Documento firmado electr\u00f3nicamente
csv.text2=C\u00f3digo seguro de verificaci\u00f3n:
csv.text3=Para descargar el documento acceda a:
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sign.signed=Firmado por:
sign.date=Fecha:
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sign.signed=Firmado por:
sign.date=Fecha:
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
<property name="sign:type">
<type>d:text</type>
</property>
<property name="sign:signaturePage">
<type>d:text</type>
</property>
<property name="sign:csv">
<type>d:text</type>
</property>
</properties>
<associations>
<association name="sign:signatureAssoc">
Expand Down Expand Up @@ -73,6 +79,12 @@
</associations>
</aspect>

<aspect name="sign:firstSignature"></aspect>
<aspect name="sign:secondSignature"></aspect>
<aspect name="sign:thirdSignature"></aspect>
<aspect name="sign:fourthSignature"></aspect>
<aspect name="sign:fifthSignature"></aspect>
<aspect name="sign:sixthSignature"></aspect>
</aspects>

</model>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package es.alfatec.alfresco;

public class AlfatecException extends Exception{

private static final long serialVersionUID = 1L;
private String exceptionMessage;
private int resultCode;

public AlfatecException(String exceptionMessage, int resultCode){
this.exceptionMessage = exceptionMessage;
this.resultCode = resultCode;
}

public String getExceptionMessage() {
return exceptionMessage;
}

public int getResultCode() {
return resultCode;
}
}
Loading

0 comments on commit 5301f4b

Please sign in to comment.