public class AddDocumentActionExecuter extends AbstractActionExecuter
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
COVER_PAGE_ATTRIBUTE_DATE_FORMAT
The date format for cover page attributes that are dates.
|
protected static java.lang.String |
PARAM_BARCODE_ATTRIBUTE
The attribute to use for generating the barcode for the generated cover page.
|
protected static java.lang.String |
PARAM_CLOUD_LINK_AUTH_TOKEN
The authorization token for the cloud service that will be used to download the cloud content of a document to create.
|
protected static java.lang.String |
PARAM_CLOUD_LINK_BYTE_ARRAY
This will exist for box documents or cloud content that has been shared via share link.
|
protected static java.lang.String |
PARAM_CLOUD_LINK_MIME_TYPE
The passed in mime type for a cloud link document that is to be created (I think this is actually a file extension and the author of
this misnamed it as "mimeType").
|
protected static java.lang.String |
PARAM_COVER_PAGE_ATTRIBUTES
The attributes to list on the generated cover page.
|
protected static java.lang.String |
PARAM_COVER_PAGE_TITLE
The title to put on the top of the generated PDF cover page.
|
protected static java.lang.String |
PARAM_CREATE_EMAIL
Whether or not we're actually creating the email object.
|
protected static java.lang.String |
PARAM_CREATE_PDF_RENDITION
Whether to create a PDF rendition for uploaded MSG files or to let the repository create a rendition.
|
protected static java.lang.String |
PARAM_EMAIL_ATTACHMENT_PROPERTIES
The properties to set on the email attachment objects we create.
|
protected static java.lang.String |
PARAM_EMAIL_RELATION_TYPE
The relation type to use when relating the email attachments to the email.
|
protected static java.lang.String |
PARAM_EXISTING_REPO_ID
This is the parameter passed in if we are creating an object from a template (the template content is in the repository already)
|
protected static java.lang.String |
PARAM_GMAIL_AUTH_TOKEN
This is a parameter passed in if we are creating an object from a gmail message or attachment
|
protected static java.lang.String |
PARAM_GMAIL_ID
This is a parameter passed in if we are creating an object from a gmail message
|
protected static java.lang.String |
PARAM_GMAIL_USER
This parameter is the user's gmail user id
|
protected static java.lang.String |
PARAM_HIDE_FILE_EXTENSION
A bulk upload HPI configuration of whether or not to hide the file extensions in the object names of newly created objects.
|
protected static java.lang.String |
PARAM_OBJECT_ID
The parent folder ID for the folder to upload this document to.
|
protected static java.lang.String |
PARAM_OBJECT_TYPE
The object type to use for this new document.
|
protected static java.lang.String |
PARAM_PARTS
The parameter representing the file that is being uploaded.
|
protected static java.lang.String |
PARAM_PROCESS_REQUIRED_DOCS
This is a parameter passed in that determines whether required documents should be required or not
|
protected static java.lang.String |
PARAM_PROPERTIES
The properties to set on this new document.
|
protected static java.lang.String |
PARAM_SELECTED_DOCUMENT
This is a parameter passed in if we are creating a new version of an existing doc, not a new object
|
protected static java.lang.String |
UNDEFINED_COVER_PAGE_ATTRIBUTE
The value to display for cover page attributes that are null in the object's properties map.
|
group, groupedConditionEvaluatorList, indexImage, nonRequiredConditionEvaluatorList, requiredConditionEvaluatorList
Constructor and Description |
---|
AddDocumentActionExecuter() |
Modifier and Type | Method and Description |
---|---|
protected void |
addMandatoryParameters(java.util.List<java.lang.String> mandatoryProperties)
A hook method for actions to add mandatory parameters to the provided list.
|
protected static org.apache.commons.collections.map.LinkedMap |
createEmailAttachments(java.lang.String ticket,
java.lang.String newObjectId,
boolean createEmail,
byte[] emailBytes,
java.lang.String tempEmailObjectId,
java.lang.String parentFolderId,
boolean showFileExtensions,
java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> emailAttachmentProperties,
java.util.Map<java.lang.String,java.lang.Object> actionParams)
Parses an MSG file to create any attachments as objects in the repository.
|
protected void |
doUpload(java.lang.String ticket,
Action action,
java.lang.String parentFolderId)
Actually execute the upload of the content and set its various properties.
|
static com.itextpdf.text.Image |
encodeToQrCode(java.lang.String data,
int width,
int height) |
void |
executeImpl(java.lang.String ticket,
Action action)
The implementation of the action.
|
protected static java.io.InputStream |
generateCloudDocumentContent(java.lang.String ticket,
java.lang.String newObjectId,
java.lang.String downloadUrl,
java.util.Map<java.lang.String,java.lang.Object> actionParams)
Generates the input stream for the content of the cloud document we're creating.
|
protected static byte[] |
generateCoverPageContent(java.lang.String ticket,
java.lang.String newObjectId,
java.lang.String barcodeAttribute,
java.util.Map<java.lang.String,java.lang.Object> actionParams)
Generates the content for the cover page we're creating.
|
evaluateAndExecute, execute, getActionDefinition, getDescription, getGroupedConditionEvaluatorList, getIndexImage, getNonRequiredConditionEvaluatorList, getRequiredConditionEvaluatorList, getShouldPoolAction, isGroup, setActionExecutionThreadManager, setDescription, setGroup, setGroupedConditionEvaluatorList, setIndexImage, setNonRequiredConditionEvaluatorList, setRequiredConditionEvaluatorList, setShouldPoolAction
checkParameters
protected static final java.lang.String PARAM_OBJECT_ID
protected static final java.lang.String PARAM_PARTS
protected static final java.lang.String PARAM_OBJECT_TYPE
protected static final java.lang.String PARAM_PROPERTIES
protected static final java.lang.String PARAM_HIDE_FILE_EXTENSION
protected static final java.lang.String PARAM_BARCODE_ATTRIBUTE
protected static final java.lang.String PARAM_COVER_PAGE_TITLE
protected static final java.lang.String PARAM_COVER_PAGE_ATTRIBUTES
protected static final java.lang.String UNDEFINED_COVER_PAGE_ATTRIBUTE
protected static final java.lang.String COVER_PAGE_ATTRIBUTE_DATE_FORMAT
protected static final java.lang.String PARAM_CREATE_EMAIL
protected static final java.lang.String PARAM_CREATE_PDF_RENDITION
protected static final java.lang.String PARAM_EMAIL_RELATION_TYPE
protected static final java.lang.String PARAM_EMAIL_ATTACHMENT_PROPERTIES
protected static final java.lang.String PARAM_CLOUD_LINK_MIME_TYPE
protected static final java.lang.String PARAM_CLOUD_LINK_BYTE_ARRAY
protected static final java.lang.String PARAM_CLOUD_LINK_AUTH_TOKEN
protected static final java.lang.String PARAM_EXISTING_REPO_ID
protected static final java.lang.String PARAM_GMAIL_ID
protected static final java.lang.String PARAM_GMAIL_AUTH_TOKEN
protected static final java.lang.String PARAM_GMAIL_USER
protected static final java.lang.String PARAM_SELECTED_DOCUMENT
protected static final java.lang.String PARAM_PROCESS_REQUIRED_DOCS
protected void addMandatoryParameters(java.util.List<java.lang.String> mandatoryProperties)
AbstractActionExecuter
addMandatoryParameters
in class AbstractActionExecuter
mandatoryProperties
- a list of mandatory parameters that must be provided to the action executer when executed.AbstractActionExecuter.addMandatoryParameters(List)
public void executeImpl(java.lang.String ticket, Action action)
ActionExecuter
executeImpl
in interface ActionExecuter
executeImpl
in class AbstractActionExecuter
ticket
- a valid OC ticket.action
- the action object containing the parameters sent to the action for execution.AbstractActionExecuter.executeImpl(String, Action)
protected void doUpload(java.lang.String ticket, Action action, java.lang.String parentFolderId)
ticket
- a valid OC ticket.action
- the action object containing the parameters passed in.parentFolderId
- the id of the parent folder that you would like to add this item to.protected static byte[] generateCoverPageContent(java.lang.String ticket, java.lang.String newObjectId, java.lang.String barcodeAttribute, java.util.Map<java.lang.String,java.lang.Object> actionParams) throws com.itextpdf.text.DocumentException
ticket
- A valid OC ticket.newObjectId
- The objectId of the document we've created that we now want to update the content with the cover page content.barcodeAttribute
- The attribute whose value we should use to generate the barcode for the cover page.actionParams
- The passed in action parameters to this action executer.InputStream
containing the stream of data for the generated cover page content.com.itextpdf.text.DocumentException
- If an error occurs attempting to use iText to generate our cover page content.public static com.itextpdf.text.Image encodeToQrCode(java.lang.String data, int width, int height) throws com.itextpdf.text.BadElementException
com.itextpdf.text.BadElementException
protected static org.apache.commons.collections.map.LinkedMap createEmailAttachments(java.lang.String ticket, java.lang.String newObjectId, boolean createEmail, byte[] emailBytes, java.lang.String tempEmailObjectId, java.lang.String parentFolderId, boolean showFileExtensions, java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> emailAttachmentProperties, java.util.Map<java.lang.String,java.lang.Object> actionParams)
ticket
- A valid OC ticket.newObjectId
- The objectId of the new email object we created in the repository.createEmail
- True if we're actually creating the email object, false otherwise. This could be false if the user only wanted to create
the attachment objects and not the email MSG file itself.emailBytes
- The bytes of the MSG file we can use to parse the email for attachments.tempEmailObjectId
- If we had a temporary email object that we used to get the content, this is the objectId of that temporary repository
email object.parentFolderId
- The objectId of the folder we're creating the MSG and attachments in.showFileExtensions
- True if we're showing file extensions on the objects we're creating, false otherwise.emailAttachmentProperties
- A map of properties for the email attachments we're going to parse and create, keyed by the name of the attachment.actionParams
- The passed in action parameters to this action executer.protected static java.io.InputStream generateCloudDocumentContent(java.lang.String ticket, java.lang.String newObjectId, java.lang.String downloadUrl, java.util.Map<java.lang.String,java.lang.Object> actionParams) throws java.io.UnsupportedEncodingException
ticket
- A valid OC ticket.newObjectId
- The objectId of the new object we've created that we're now updating the content for.downloadUrl
- The URL of where the cloud content can be downloaded from.actionParams
- The passed in action parameters to this action executer.InputStream
containing the stream of data for the cloud document content.java.io.UnsupportedEncodingException
- If an error occurs processing the passed in byte string in ISO-8859-1 encoding.