com.silanis.esl.sdk.Document Maven / Gradle / Ivy
package com.silanis.esl.sdk;
import com.google.common.collect.Sets;
import java.io.Serializable;
import java.util.*;
/**
* The document class contains data describing pages, signatures and their associated data and layout.>
*
Allowed file types for uploaded documents are Adobe PDF (.pdf), a Microsoft Word (.doc or.docx), an IBM Symphony (.odt),
* or an Open Document (.odt) file.
* Any document that is not having the .pdf extension will be automatically converted to Adobe pdf based on its extension.
* This conversion is achieved during the package creation.
*/
public class Document implements Serializable {
private static final long serialVersionUID = 1L;
private String name;
private final Collection signatures = new ArrayList();
private byte[] content;
private String fileName;
private int index;
private int numberOfPages;
private boolean extract;
private Boolean tagged;
private Set extractionTypes = Sets.newHashSet();
private DocumentId id;
private List injectedFields = new ArrayList();
private List qrCodes = new ArrayList();
private String description;
private External external;
private Map data;
private Boolean externalSigned;
private String base64Content;
/**
* Accessor method used to retrieve the file name
*
* @return the file name
*/
public String getFileName() {
return fileName;
}
/**
*
* Accessor method used to set the file name
*
* @param fileName the file name
*/
public void setFileName( String fileName ) {
this.fileName = fileName;
}
/**
*
* Accessor method used to retrieve the content of a document
*
* @return the document content
*/
public byte[] getContent() {
return content;
}
/**
* Accessor method used to set the content of a document
*
* @param content the document content
*/
public void setContent( byte[] content ) {
this.content = content;
}
/**
* Accessor method to set the name of a document
*
* @param name the document name
*/
public void setName( String name ) {
this.name = name;
}
/**
* Accessor method used to retrieve the name of a document
*
* @return the document name
*/
public String getName() {
return name;
}
/**
* Accessor method used to retrieve the document signatures
*
* @return the document signatures
*/
public Collection getSignatures() {
return signatures;
}
/**
* Accessor method used to specify the order that document must be signed in.
* So, a document with an index set to 1 will be signed before a document with an index set to 2, and so on.
*
* @param position the document signing order
*/
public void setIndex(int position) {
this.index = position;
}
/**
* Accessor method used to retrieve the document signing order
*
* @return the document signing order
*/
public int getIndex() {
return index;
}
/**
* Accessor method used to retrieve the number of pages of the document
*
* @return the number of pages
*/
public int getNumberOfPages() {
return numberOfPages;
}
/**
* Accessor method used to specify the number of pages of the document.
*
* @param numberOfPages the document signing order
*/
public void setNumberOfPages(int numberOfPages) {
this.numberOfPages = numberOfPages;
}
/**
*
*
* @param extract
*/
public void setExtraction( boolean extract ) {
this.extract = extract;
}
public boolean isExtract() {
return extract;
}
public Boolean isTagged() {
return tagged;
}
public void setTagged(boolean tagged) {
this.tagged = tagged;
}
public Set getExtractionTypes() {
return extractionTypes;
}
public void setExtractionTypes(Set extractionTypes) {
this.extractionTypes = extractionTypes;
}
/**
*
* Accessor method used to set the document ID
*
* @param id the ID of the document
*/
public void setId( DocumentId id ) {
this.id = id;
}
/**
* Accessor method used to get the ID of the document
*
* @return the ID of the document
*/
public DocumentId getId() {
return id;
}
/**
* Accessor method used to get the information from the external provider
*
* @return the external provider
*/
public External getExternal(){return external;}
/**
* Accessor method used to set the document external provider
*
* @param external the external provider of the document null if none
*/
public void setExternal(External external){this.external = external;}
public void addSignatures(List signatures) {
this.signatures.addAll(signatures);
}
public void addInjectedFields( List fields ) {
this.injectedFields.addAll( fields );
}
public List getInjectedFields() {
return injectedFields;
}
public void addQRCodes(List fields) {
this.qrCodes.addAll(fields);
}
public List getQrCodes() {
return qrCodes;
}
public void setDescription( String description ) {
this.description = description;
}
public String getDescription() {
return description;
}
public Map getData() {
return data;
}
public void setData(Map data) {
this.data = data;
}
public Boolean isExternalSigned() { return externalSigned; }
public void setExternalSigned(Boolean externalSigned) { this.externalSigned = externalSigned; }
public String getBase64Content() {return base64Content;}
public void setBase64Content(String base64Content) { this.base64Content = base64Content; }
}