it.sistematica.isharedoc.service
Class InstanceServiceImpl

java.lang.Object
  extended by it.sistematica.isharedoc.service.InstanceServiceImpl
All Implemented Interfaces:
InstanceService

public class InstanceServiceImpl
extends java.lang.Object
implements InstanceService


Field Summary
(package private)  AddressBookService addressBookService
           
(package private)  CloudManager cloudManager
           
(package private)  ReplicaService cloudReplicaService
           
(package private)  DocumentManager documentManager
           
(package private)  it.neverworks.data.EntityManager entities
           
(package private)  InstanceSecurityService instanceSecurityService
           
(package private)  MessageboxService messageboxService
           
(package private)  OrganizationService organizationService
           
(package private)  WorkProcessManager processManager
           
(package private)  WorkTaskManager taskManager
           
(package private)  it.neverworks.application.service.TemporaryFileService temporaryFileService
           
(package private)  it.neverworks.application.service.UserInfo userInfo
           
 
Constructor Summary
InstanceServiceImpl()
           
 
Method Summary
 void addFile(ItemInstance instance, java.lang.String fileSetName, File file)
          Adds the file.
 void addFiles(ItemInstance instance, java.lang.String fileSetName, java.util.Collection<? extends File> files)
          Adds the files.
 void addFiles(ItemInstance instance, java.lang.String fileSetName, File... files)
          Adds the files.
 ContactInstance addInstanceContact(ItemInstance instance, ContactInstance.DestinationType destinationType, Contact contact)
          Adds the instance contact.
 ContactInstance addInstanceContact(ItemInstance instance, ContactInstance.DestinationType destinationType, LocationAttribute location)
          Adds the instance contact.
 ContactInstance addInstanceContact(ItemInstance instance, ContactInstance.DestinationType destinationType, Organization organization, ContactInstance parent)
          Adds the instance contact.
 ContactInstance addInstanceContact(ItemInstance instance, ContactInstance.DestinationType destinationType, java.lang.String contactDescription)
          Adds the instance contact.
 ContactInstance addInstanceContact(ItemInstance instance, ContactInstance.DestinationType destinationType, it.neverworks.security.User user, ContactInstance parent)
          Adds the instance contact.
 ContactInstance addInstanceContact(ItemInstance instance, ContactInstance contactInstance)
          Adds the instance contact.
 ContactInstance addInstanceContactOrganization(ItemInstance instance, ContactInstance.DestinationType destinationType, java.lang.String organizationId, ContactInstance parent)
          Adds the instance contact organization.
 ContactInstance addInstanceContactOrganization(java.lang.String instanceId, ContactInstance.DestinationType destinationType, java.lang.String organizationId, ContactInstance parent)
          Adds the instance contact organization.
 ContactInstance addInstanceContactUserOrganization(java.lang.String instanceId, ContactInstance.DestinationType destinationType, java.lang.String userOrganizationId, ContactInstance parent)
          Adds the instance contact user organization.
 void cleanTrash()
          Clean trash.
 void cleanTrash(MessageBox mbox)
          Clean trash.
 void clearFiles(ItemInstance instance, java.lang.String fileSetName, boolean deleteFromDms)
          Clear files.
 ItemInstance cloneItemInstance(ItemInstance instance, boolean cloneFrom, boolean cloneTo, boolean cloneCc, boolean cloneBcc, boolean cloneAttachments)
          Clone item instance.
 java.util.List<ItemInstance> cloneMultipleItemInstance(ItemInstance instance, boolean spamBccIntoTo, boolean cloneOnlyExternal)
          Clone multiple item instance.
 File createFromAttachment(ItemInstance instance, AttachmentItem ar, ConfidentialityLevel confidentialityLevel)
          Creates the from attachment.
 File createFromAttachment(ItemInstance instance, InstanceBaseAction.AttachmentInfo attachment, ConfidentialityLevel confidentialityLevel)
          Creates the from attachment.
 ItemInstance createItemInstance(Storyboard storyboard, MessageBox mbox, MessageInstance.MessageType msgType, java.util.List<AttachmentItem> attachments, java.util.HashMap<java.lang.String,java.lang.Object> variables)
          Creates the item instance.
 ItemInstance createItemInstance(Storyboard storyboard, MessageBox mbox, MessageInstance.MessageType msgType, java.util.List<AttachmentItem> attachments, java.util.HashMap<java.lang.String,java.lang.Object> variables, boolean startProcess)
          Creates the item instance.
 ItemInstance createItemInstance(Storyboard storyboard, MessageBox mbox, MessageInstance.MessageType msgType, java.util.List<AttachmentItem> attachments, java.util.HashMap<java.lang.String,java.lang.Object> variables, View processLayout)
          Creates the item instance.
 ItemInstance createItemInstance(Storyboard storyboard, MessageBox mbox, MessageInstance.MessageType msgType, java.util.List<AttachmentItem> attachments, java.util.HashMap<java.lang.String,java.lang.Object> variables, View processLayout, boolean startProcess)
          Creates the item instance.
 ItemInstance createItemInstance(java.lang.String storyboardCode, MessageBox mbox, MessageInstance.MessageType msgType, java.util.List<AttachmentItem> attachments, java.util.HashMap<java.lang.String,java.lang.Object> variables)
          Creates the item instance.
 ItemInstance createItemInstance(java.lang.String storyboardCode, MessageBox mbox, MessageInstance.MessageType msgType, java.util.List<AttachmentItem> attachments, java.util.HashMap<java.lang.String,java.lang.Object> variables, boolean startProcess)
          Creates the item instance.
 ItemInstance createItemInstance(java.lang.String storyboardCode, MessageBox mbox, MessageInstance.MessageType msgType, java.util.List<AttachmentItem> attachments, java.util.HashMap<java.lang.String,java.lang.Object> variables, View processLayout)
          Creates the item instance.
 ItemInstance createItemInstance(java.lang.String storyboardCode, MessageBox mbox, MessageInstance.MessageType msgType, java.util.List<AttachmentItem> attachments, java.util.HashMap<java.lang.String,java.lang.Object> variables, View processLayout, boolean startProcess)
          Creates the item instance.
 File createItemLink(ItemInstance itemInstance, File destination, java.lang.String newName)
          Creates the item link.
 File createItemLink(ItemInstance itemInstance, File destination, java.lang.String newName, java.lang.String note)
          Creates the item link.
 Document createLocalAttachment(ItemInstance instance, java.lang.String name, java.lang.String contentType, ObjectTemplate objectTemplate, ConfidentialityLevel confidentialityLevel, java.io.InputStream stream, long size)
          Creates the local attachment.
 RemoteDocument createRemoteAttachment(ItemInstance instance, java.lang.String name, CloudFile remoteFile)
          Creates the remote attachment.
 void deleteProcessInstance(ItemInstance instance)
          Delete process instance.
 void exportInstancesXml(java.util.Date fromDate, java.util.Date toDate, java.io.File exportFile)
          Export instances xml.
 void exportInstancesXml(InstancesSet instances, java.io.File exportFile)
          Export instances xml.
 java.util.List<ItemInstance> findByVariableMapValueEquals(java.util.Map<java.lang.String,java.lang.Object> values)
          Find by variable map value equals.
 java.util.List<ItemInstance> findByVariableValueEquals(java.lang.String varName, java.lang.Object varValue)
          Find by variable value equals.
 ContactInstance findContactInstanceById(java.lang.Long id)
          Find contact instance by id.
 MessageInstance findFirstMessageInstanceByAppIdentifierAndYear(java.lang.String appIdentifier, int year)
          Come sopra ma in presenza di duplicati ritorna il primo che trova.
 ItemInstance findInstanceById(java.lang.Long id)
          Find instance by id.
 ItemInstance findInstanceRelated(CloudFile file)
          Find instance related.
 ItemInstance findInstanceRelated(File file)
          Find instance related.
 java.util.Set<ItemInstance> findInstances(CloudFile file)
          Find instances.
 java.util.Set<ItemInstance> findInstances(File file)
          Find instances.
 ItemInstance findItemInstanceByAppIdentifierAndSbCode(java.lang.String appIdentifier, java.lang.String sbCode)
          Find item instance by app identifier and sb code.
 Document findMailEML(MessageInstance messageInstance)
          Find mail eml.
 MessageInstance findMessageInstanceByAppIdentifier(java.lang.String appIdentifier, java.util.Date appIdentifierDate)
          Find message instance by app identifier.
 MessageInstance findMessageInstanceByAppIdentifierAndYear(java.lang.String appIdentifier, int year)
          Find message instance by app identifier and year.
 MessageInstance findMessageInstanceById(java.lang.Long id)
          Find message instance by id.
 MessageServiceInstance findMessageServiceInstanceByAppIdentifier(java.lang.String appIdentifier, java.util.Date appIdentifierDate, javax.mail.internet.InternetAddress recipient, MessageServiceInstance.XmlAutomationType xmlAutomationType)
          Find message service instance by app identifier.
 MessageServiceInstance findMessageServiceInstanceByAppIdentifier(java.lang.String appIdentifier, java.util.Date appIdentifierDate, MessageServiceInstance.XmlAutomationType xmlAutomationType)
          Find message service instance by app identifier.
 java.util.Set<ItemLink> getActiveItemLinks(ItemInstance instance)
          Gets the active item links.
 Document getDocumentByName(ItemInstance instance, java.lang.String attachmentName)
          Gets the document by name.
 File getFile(ItemInstance instance, java.lang.String fileSetName, java.lang.String fileName)
          Gets the file.
 java.util.Set<File> getFiles(ItemInstance instance, java.lang.String fileSetName)
          Gets the files.
 java.util.Set<File> getFilesAll(ItemInstance instance)
          Gets the files all.
 FileSet getFileSet(ItemInstance instance, java.lang.String fileSetName)
          Gets the file set.
 File getInstanceAttachmentFolder(ItemInstance instance)
          Gets the instance attachment folder.
 File getInstanceAttachmentStoryboardFolder(ItemInstance instance, File rootSbFolder)
          Gets the instance attachment storyboard folder.
 it.neverworks.mail.helper.MessageHelper getMessageHelper(MessageInstance messageInstance)
          Gets the message helper.
 FileSet getOrCreateFileSet(ItemInstance instance, java.lang.String fileSetName)
          Gets the or create file set.
 it.neverworks.mail.helper.MessageHelper getOriginalMessagePEC(MessageServiceInstance instance)
          Gets the original message pec.
 java.util.Set<File> getUserFilesAll(ItemInstance instance)
          Gets the user files all.
 boolean itemLinkExists(ItemInstance itemInstance, File destination)
          Item link exists.
 void moveToTrash(ItemInstance instance)
          Move to trash.
 ContactInstance prepareInstanceContactByEmail(javax.mail.internet.InternetAddress email)
          Prepare instance contact by email.
 void recoveryFromTrash(ItemInstance instance)
          Recovery from trash.
 void removeFile(ItemInstance instance, java.lang.String fileSetName, boolean deleteFromDms, File file)
          Removes the file.
 void removeFiles(ItemInstance instance, java.lang.String fileSetName, boolean deleteFromDms, java.util.Collection<? extends File> files)
          Removes the files.
 void removeFiles(ItemInstance instance, java.lang.String fileSetName, boolean deleteFromDms, File... files)
          Removes the files.
 void removeInstanceContact(ContactInstance contactInstance)
          Removes the instance contact.
 void removeInstanceContactOrganization(java.lang.String instanceId, ContactInstance.DestinationType destinationType, java.lang.String organizationId)
          Removes the instance contact organization.
 void removeItemLink(ItemInstance itemInstance, ItemLink link)
          Removes the item link.
 void replaceFiles(ItemInstance instance, java.lang.String fileSetName, boolean deleteFromDms, java.util.Collection<? extends File> files)
          Replace files.
 void replaceFiles(ItemInstance instance, java.lang.String fileSetName, boolean deleteFromDms, File... files)
          Replace files.
 void replicaAttachments(java.lang.String replicaServerId, ItemInstance instance, java.lang.String fileRegEx)
          Replica attachments.
 void restartAssignment(MessageInstance messageInstance, java.util.List<InstanceAssignmentEntry> instanceAssignmentEntries)
          Restart assignment.
 void restartAssignment(MessageInstance messageInstance, java.util.List<InstanceAssignmentEntry> instanceAssignmentEntries, java.util.Map<java.lang.String,java.lang.Object> customVariables)
          Restart assignment.
 void restartAssignmentFromSheet(java.lang.String filePath, ContactInstance parentCi)
          Restart assignment from sheet.
 void restartInstance(ItemInstance instance, boolean preserveVariables)
          void exportMessageInstance(Collection instances, OutputStream output, TaskLink link) throws Exception; void importMessageInstance(String appIdentifier, Date appIdentifierDate, String sender, Collection to, Collection cc, Map variables, MessageType messageType, String sConfidentialityLevel, Collection attachments, String orgVersion, boolean isPec, boolean skipCreated) throws Exception; void importMessageInstanceFromSheet(String filePath) throws Exception;
 void restartInstance(ItemInstance instance, boolean preserveVariables, Storyboard storyboard)
          Restart instance.
 void resumeProcessInstance(ItemInstance instance)
          Resume process instance.
 void saveItemInstance(ItemInstance instance)
          Save item instance.
 void suspendProcessInstance(ItemInstance instance)
          Suspend process instance.
 void updateItemHistoryVariables(ItemInstance instance, java.util.Map<java.lang.String,java.lang.Object> variables)
          Update item history variables.
 void updateItemHistoryVariables(java.lang.String id, java.util.Map<java.lang.String,java.lang.Object> variables)
          Update item history variables.
 void updateStatusById(java.lang.String itemInstanceId, ItemInstance.WorkStatus status, java.lang.String statusDescription)
          Update status by id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

userInfo

it.neverworks.application.service.UserInfo userInfo

entities

it.neverworks.data.EntityManager entities

processManager

WorkProcessManager processManager

taskManager

WorkTaskManager taskManager

documentManager

DocumentManager documentManager

organizationService

OrganizationService organizationService

messageboxService

MessageboxService messageboxService

instanceSecurityService

InstanceSecurityService instanceSecurityService

addressBookService

AddressBookService addressBookService

temporaryFileService

it.neverworks.application.service.TemporaryFileService temporaryFileService

cloudManager

CloudManager cloudManager

cloudReplicaService

ReplicaService cloudReplicaService
Constructor Detail

InstanceServiceImpl

public InstanceServiceImpl()
Method Detail

getInstanceAttachmentFolder

@Transactional
public File getInstanceAttachmentFolder(ItemInstance instance)
Description copied from interface: InstanceService
Gets the instance attachment folder.

Specified by:
getInstanceAttachmentFolder in interface InstanceService
Parameters:
instance - the instance
Returns:
the instance attachment folder

getInstanceAttachmentStoryboardFolder

@Transactional
public File getInstanceAttachmentStoryboardFolder(ItemInstance instance,
                                                                File rootSbFolder)
Description copied from interface: InstanceService
Gets the instance attachment storyboard folder.

Specified by:
getInstanceAttachmentStoryboardFolder in interface InstanceService
Parameters:
instance - the instance
rootSbFolder - the root sb folder
Returns:
the instance attachment storyboard folder

updateStatusById

@Transactional
public void updateStatusById(java.lang.String itemInstanceId,
                                           ItemInstance.WorkStatus status,
                                           java.lang.String statusDescription)
                      throws java.lang.Exception
Description copied from interface: InstanceService
Update status by id.

Specified by:
updateStatusById in interface InstanceService
Parameters:
itemInstanceId - the item instance id
status - the status
statusDescription - the status description
Throws:
java.lang.Exception - the exception

findByVariableValueEquals

@Transactional
public java.util.List<ItemInstance> findByVariableValueEquals(java.lang.String varName,
                                                                            java.lang.Object varValue)
Description copied from interface: InstanceService
Find by variable value equals.

Specified by:
findByVariableValueEquals in interface InstanceService
Parameters:
varName - the var name
varValue - the var value
Returns:
the list

findByVariableMapValueEquals

@Transactional
public java.util.List<ItemInstance> findByVariableMapValueEquals(java.util.Map<java.lang.String,java.lang.Object> values)
Description copied from interface: InstanceService
Find by variable map value equals.

Specified by:
findByVariableMapValueEquals in interface InstanceService
Parameters:
values - the values
Returns:
the list

findMessageInstanceById

@Transactional
public MessageInstance findMessageInstanceById(java.lang.Long id)
Description copied from interface: InstanceService
Find message instance by id.

Specified by:
findMessageInstanceById in interface InstanceService
Parameters:
id - the id
Returns:
the message instance

findInstanceById

@Transactional
public ItemInstance findInstanceById(java.lang.Long id)
Description copied from interface: InstanceService
Find instance by id.

Specified by:
findInstanceById in interface InstanceService
Parameters:
id - the id
Returns:
the item instance

findItemInstanceByAppIdentifierAndSbCode

@Transactional
public ItemInstance findItemInstanceByAppIdentifierAndSbCode(java.lang.String appIdentifier,
                                                                           java.lang.String sbCode)
Description copied from interface: InstanceService
Find item instance by app identifier and sb code.

Specified by:
findItemInstanceByAppIdentifierAndSbCode in interface InstanceService
Parameters:
appIdentifier - the app identifier
sbCode - the sb code
Returns:
the item instance

findMessageInstanceByAppIdentifier

@Transactional
public MessageInstance findMessageInstanceByAppIdentifier(java.lang.String appIdentifier,
                                                                        java.util.Date appIdentifierDate)
Description copied from interface: InstanceService
Find message instance by app identifier.

Specified by:
findMessageInstanceByAppIdentifier in interface InstanceService
Parameters:
appIdentifier - the app identifier
appIdentifierDate - the app identifier date
Returns:
the message instance

findMessageInstanceByAppIdentifierAndYear

@Transactional
public MessageInstance findMessageInstanceByAppIdentifierAndYear(java.lang.String appIdentifier,
                                                                               int year)
Description copied from interface: InstanceService
Find message instance by app identifier and year.

Specified by:
findMessageInstanceByAppIdentifierAndYear in interface InstanceService
Parameters:
appIdentifier - the app identifier
year - the year
Returns:
the message instance

findFirstMessageInstanceByAppIdentifierAndYear

@Transactional
public MessageInstance findFirstMessageInstanceByAppIdentifierAndYear(java.lang.String appIdentifier,
                                                                                    int year)
Description copied from interface: InstanceService
Come sopra ma in presenza di duplicati ritorna il primo che trova. Serve a tamponare le registrazioni importate con quelle fatte per prova con lo stesso numero

Specified by:
findFirstMessageInstanceByAppIdentifierAndYear in interface InstanceService
Parameters:
appIdentifier - the app identifier
year - the year
Returns:
the message instance

findMessageServiceInstanceByAppIdentifier

@Transactional
public MessageServiceInstance findMessageServiceInstanceByAppIdentifier(java.lang.String appIdentifier,
                                                                                      java.util.Date appIdentifierDate,
                                                                                      MessageServiceInstance.XmlAutomationType xmlAutomationType)
Description copied from interface: InstanceService
Find message service instance by app identifier.

Specified by:
findMessageServiceInstanceByAppIdentifier in interface InstanceService
Parameters:
appIdentifier - the app identifier
appIdentifierDate - the app identifier date
xmlAutomationType - the xml automation type
Returns:
the message service instance

findMessageServiceInstanceByAppIdentifier

@Transactional
public MessageServiceInstance findMessageServiceInstanceByAppIdentifier(java.lang.String appIdentifier,
                                                                                      java.util.Date appIdentifierDate,
                                                                                      javax.mail.internet.InternetAddress recipient,
                                                                                      MessageServiceInstance.XmlAutomationType xmlAutomationType)
Description copied from interface: InstanceService
Find message service instance by app identifier.

Specified by:
findMessageServiceInstanceByAppIdentifier in interface InstanceService
Parameters:
appIdentifier - the app identifier
appIdentifierDate - the app identifier date
recipient - the recipient
xmlAutomationType - the xml automation type
Returns:
the message service instance

findContactInstanceById

@Transactional
public ContactInstance findContactInstanceById(java.lang.Long id)
Description copied from interface: InstanceService
Find contact instance by id.

Specified by:
findContactInstanceById in interface InstanceService
Parameters:
id - the id
Returns:
the contact instance

prepareInstanceContactByEmail

@Transactional
public ContactInstance prepareInstanceContactByEmail(javax.mail.internet.InternetAddress email)
Description copied from interface: InstanceService
Prepare instance contact by email.

Specified by:
prepareInstanceContactByEmail in interface InstanceService
Parameters:
email - the email
Returns:
the contact instance

addInstanceContact

@Transactional
public ContactInstance addInstanceContact(ItemInstance instance,
                                                        ContactInstance contactInstance)
Description copied from interface: InstanceService
Adds the instance contact.

Specified by:
addInstanceContact in interface InstanceService
Parameters:
instance - the instance
contactInstance - the contact instance
Returns:
the contact instance

addInstanceContact

@Transactional
public ContactInstance addInstanceContact(ItemInstance instance,
                                                        ContactInstance.DestinationType destinationType,
                                                        java.lang.String contactDescription)
Description copied from interface: InstanceService
Adds the instance contact.

Specified by:
addInstanceContact in interface InstanceService
Parameters:
instance - the instance
destinationType - the destination type
contactDescription - the contact description
Returns:
the contact instance

addInstanceContact

public ContactInstance addInstanceContact(ItemInstance instance,
                                          ContactInstance.DestinationType destinationType,
                                          Contact contact)
Description copied from interface: InstanceService
Adds the instance contact.

Specified by:
addInstanceContact in interface InstanceService
Parameters:
instance - the instance
destinationType - the destination type
contact - the contact
Returns:
the contact instance

addInstanceContact

public ContactInstance addInstanceContact(ItemInstance instance,
                                          ContactInstance.DestinationType destinationType,
                                          LocationAttribute location)
Description copied from interface: InstanceService
Adds the instance contact.

Specified by:
addInstanceContact in interface InstanceService
Parameters:
instance - the instance
destinationType - the destination type
location - the location
Returns:
the contact instance

addInstanceContact

@Transactional
public ContactInstance addInstanceContact(ItemInstance instance,
                                                        ContactInstance.DestinationType destinationType,
                                                        it.neverworks.security.User user,
                                                        ContactInstance parent)
Description copied from interface: InstanceService
Adds the instance contact.

Specified by:
addInstanceContact in interface InstanceService
Parameters:
instance - the instance
destinationType - the destination type
user - the user
parent - the parent
Returns:
the contact instance

addInstanceContact

@Transactional
public ContactInstance addInstanceContact(ItemInstance instance,
                                                        ContactInstance.DestinationType destinationType,
                                                        Organization organization,
                                                        ContactInstance parent)
Description copied from interface: InstanceService
Adds the instance contact.

Specified by:
addInstanceContact in interface InstanceService
Parameters:
instance - the instance
destinationType - the destination type
organization - the organization
parent - the parent
Returns:
the contact instance

addInstanceContactOrganization

@Transactional
public ContactInstance addInstanceContactOrganization(ItemInstance instance,
                                                                    ContactInstance.DestinationType destinationType,
                                                                    java.lang.String organizationId,
                                                                    ContactInstance parent)
Description copied from interface: InstanceService
Adds the instance contact organization.

Specified by:
addInstanceContactOrganization in interface InstanceService
Parameters:
instance - the instance
destinationType - the destination type
organizationId - the organization id
parent - the parent
Returns:
the contact instance

addInstanceContactOrganization

@Transactional
public ContactInstance addInstanceContactOrganization(java.lang.String instanceId,
                                                                    ContactInstance.DestinationType destinationType,
                                                                    java.lang.String organizationId,
                                                                    ContactInstance parent)
Description copied from interface: InstanceService
Adds the instance contact organization.

Specified by:
addInstanceContactOrganization in interface InstanceService
Parameters:
instanceId - the instance id
destinationType - the destination type
organizationId - the organization id
parent - the parent
Returns:
the contact instance

addInstanceContactUserOrganization

@Transactional
public ContactInstance addInstanceContactUserOrganization(java.lang.String instanceId,
                                                                        ContactInstance.DestinationType destinationType,
                                                                        java.lang.String userOrganizationId,
                                                                        ContactInstance parent)
Description copied from interface: InstanceService
Adds the instance contact user organization.

Specified by:
addInstanceContactUserOrganization in interface InstanceService
Parameters:
instanceId - the instance id
destinationType - the destination type
userOrganizationId - the user organization id
parent - the parent
Returns:
the contact instance

removeInstanceContact

@Transactional
public void removeInstanceContact(ContactInstance contactInstance)
Description copied from interface: InstanceService
Removes the instance contact.

Specified by:
removeInstanceContact in interface InstanceService
Parameters:
contactInstance - the contact instance

removeInstanceContactOrganization

@Transactional
public void removeInstanceContactOrganization(java.lang.String instanceId,
                                                            ContactInstance.DestinationType destinationType,
                                                            java.lang.String organizationId)
Description copied from interface: InstanceService
Removes the instance contact organization.

Specified by:
removeInstanceContactOrganization in interface InstanceService
Parameters:
instanceId - the instance id
destinationType - the destination type
organizationId - the organization id

createItemInstance

@Transactional
public ItemInstance createItemInstance(java.lang.String storyboardCode,
                                                     MessageBox mbox,
                                                     MessageInstance.MessageType msgType,
                                                     java.util.List<AttachmentItem> attachments,
                                                     java.util.HashMap<java.lang.String,java.lang.Object> variables)
Description copied from interface: InstanceService
Creates the item instance.

Specified by:
createItemInstance in interface InstanceService
Parameters:
storyboardCode - the storyboard process name
mbox - the mbox
msgType - the msg type
attachments - the attachments
variables - the variables
Returns:
the item instance

createItemInstance

@Transactional
public ItemInstance createItemInstance(java.lang.String storyboardCode,
                                                     MessageBox mbox,
                                                     MessageInstance.MessageType msgType,
                                                     java.util.List<AttachmentItem> attachments,
                                                     java.util.HashMap<java.lang.String,java.lang.Object> variables,
                                                     View processLayout)
Description copied from interface: InstanceService
Creates the item instance.

Specified by:
createItemInstance in interface InstanceService
Parameters:
storyboardCode - the storyboard process name
mbox - the mbox
msgType - the msg type
attachments - the attachments
variables - the variables
processLayout - the process layout
Returns:
the item instance

createItemInstance

@Transactional
public ItemInstance createItemInstance(java.lang.String storyboardCode,
                                                     MessageBox mbox,
                                                     MessageInstance.MessageType msgType,
                                                     java.util.List<AttachmentItem> attachments,
                                                     java.util.HashMap<java.lang.String,java.lang.Object> variables,
                                                     boolean startProcess)
Description copied from interface: InstanceService
Creates the item instance.

Specified by:
createItemInstance in interface InstanceService
Parameters:
storyboardCode - the storyboard process name
mbox - the mbox
msgType - the msg type
attachments - the attachments
variables - the variables
startProcess - the start process
Returns:
the item instance

createItemInstance

@Transactional
public ItemInstance createItemInstance(java.lang.String storyboardCode,
                                                     MessageBox mbox,
                                                     MessageInstance.MessageType msgType,
                                                     java.util.List<AttachmentItem> attachments,
                                                     java.util.HashMap<java.lang.String,java.lang.Object> variables,
                                                     View processLayout,
                                                     boolean startProcess)
Description copied from interface: InstanceService
Creates the item instance.

Specified by:
createItemInstance in interface InstanceService
Parameters:
storyboardCode - the storyboard process name
mbox - the mbox
msgType - the msg type
attachments - the attachments
variables - the variables
processLayout - the process layout
startProcess - the start process
Returns:
the item instance

createItemInstance

@Transactional
public ItemInstance createItemInstance(Storyboard storyboard,
                                                     MessageBox mbox,
                                                     MessageInstance.MessageType msgType,
                                                     java.util.List<AttachmentItem> attachments,
                                                     java.util.HashMap<java.lang.String,java.lang.Object> variables)
Description copied from interface: InstanceService
Creates the item instance.

Specified by:
createItemInstance in interface InstanceService
Parameters:
storyboard - the storyboard
mbox - the mbox
msgType - the msg type
attachments - the attachments
variables - the variables
Returns:
the item instance

createItemInstance

@Transactional
public ItemInstance createItemInstance(Storyboard storyboard,
                                                     MessageBox mbox,
                                                     MessageInstance.MessageType msgType,
                                                     java.util.List<AttachmentItem> attachments,
                                                     java.util.HashMap<java.lang.String,java.lang.Object> variables,
                                                     boolean startProcess)
Description copied from interface: InstanceService
Creates the item instance.

Specified by:
createItemInstance in interface InstanceService
Parameters:
storyboard - the storyboard
mbox - the mbox
msgType - the msg type
attachments - the attachments
variables - the variables
startProcess - the start process
Returns:
the item instance

createItemInstance

@Transactional
public ItemInstance createItemInstance(Storyboard storyboard,
                                                     MessageBox mbox,
                                                     MessageInstance.MessageType msgType,
                                                     java.util.List<AttachmentItem> attachments,
                                                     java.util.HashMap<java.lang.String,java.lang.Object> variables,
                                                     View processLayout)
Description copied from interface: InstanceService
Creates the item instance.

Specified by:
createItemInstance in interface InstanceService
Parameters:
storyboard - the storyboard
mbox - the mbox
msgType - the msg type
attachments - the attachments
variables - the variables
processLayout - the process layout
Returns:
the item instance

createItemInstance

@Transactional
public ItemInstance createItemInstance(Storyboard storyboard,
                                                     MessageBox mbox,
                                                     MessageInstance.MessageType msgType,
                                                     java.util.List<AttachmentItem> attachments,
                                                     java.util.HashMap<java.lang.String,java.lang.Object> variables,
                                                     View processLayout,
                                                     boolean startProcess)
Description copied from interface: InstanceService
Creates the item instance.

Specified by:
createItemInstance in interface InstanceService
Parameters:
storyboard - the storyboard
mbox - the mbox
msgType - the msg type
attachments - the attachments
variables - the variables
processLayout - the process layout
startProcess - the start process
Returns:
the item instance

cloneItemInstance

@Transactional
public ItemInstance cloneItemInstance(ItemInstance instance,
                                                    boolean cloneFrom,
                                                    boolean cloneTo,
                                                    boolean cloneCc,
                                                    boolean cloneBcc,
                                                    boolean cloneAttachments)
Description copied from interface: InstanceService
Clone item instance.

Specified by:
cloneItemInstance in interface InstanceService
Parameters:
instance - the instance
cloneFrom - the clone from
cloneTo - the clone to
cloneCc - the clone cc
cloneBcc - the clone bcc
cloneAttachments - the clone attachments
Returns:
the item instance

cloneMultipleItemInstance

@Transactional
public java.util.List<ItemInstance> cloneMultipleItemInstance(ItemInstance instance,
                                                                            boolean spamBccIntoTo,
                                                                            boolean cloneOnlyExternal)
Description copied from interface: InstanceService
Clone multiple item instance.

Specified by:
cloneMultipleItemInstance in interface InstanceService
Parameters:
instance - the instance
spamBccIntoTo - the spam bcc into to
cloneOnlyExternal - the clone only external
Returns:
the list

saveItemInstance

@Transactional
public void saveItemInstance(ItemInstance instance)
Description copied from interface: InstanceService
Save item instance.

Specified by:
saveItemInstance in interface InstanceService
Parameters:
instance - the instance

updateItemHistoryVariables

@Transactional
public void updateItemHistoryVariables(java.lang.String id,
                                                     java.util.Map<java.lang.String,java.lang.Object> variables)
Description copied from interface: InstanceService
Update item history variables.

Specified by:
updateItemHistoryVariables in interface InstanceService
Parameters:
id - the id
variables - the variables

updateItemHistoryVariables

@Transactional
public void updateItemHistoryVariables(ItemInstance instance,
                                                     java.util.Map<java.lang.String,java.lang.Object> variables)
Description copied from interface: InstanceService
Update item history variables.

Specified by:
updateItemHistoryVariables in interface InstanceService
Parameters:
instance - the instance
variables - the variables

moveToTrash

public void moveToTrash(ItemInstance instance)
Description copied from interface: InstanceService
Move to trash.

Specified by:
moveToTrash in interface InstanceService
Parameters:
instance - the instance

recoveryFromTrash

public void recoveryFromTrash(ItemInstance instance)
Description copied from interface: InstanceService
Recovery from trash.

Specified by:
recoveryFromTrash in interface InstanceService
Parameters:
instance - the instance

restartInstance

@Transactional
public void restartInstance(ItemInstance instance,
                                          boolean preserveVariables)
Description copied from interface: InstanceService
void exportMessageInstance(Collection instances, OutputStream output, TaskLink link) throws Exception; void importMessageInstance(String appIdentifier, Date appIdentifierDate, String sender, Collection to, Collection cc, Map variables, MessageType messageType, String sConfidentialityLevel, Collection attachments, String orgVersion, boolean isPec, boolean skipCreated) throws Exception; void importMessageInstanceFromSheet(String filePath) throws Exception;

Specified by:
restartInstance in interface InstanceService
Parameters:
instance - the instance
preserveVariables - the preserve prot variables

restartInstance

@Transactional
public void restartInstance(ItemInstance instance,
                                          boolean preserveVariables,
                                          Storyboard storyboard)
Description copied from interface: InstanceService
Restart instance.

Specified by:
restartInstance in interface InstanceService
Parameters:
instance - the instance
preserveVariables - the preserve prot variables
storyboard - the storyboard

suspendProcessInstance

@Transactional
public void suspendProcessInstance(ItemInstance instance)
Description copied from interface: InstanceService
Suspend process instance.

Specified by:
suspendProcessInstance in interface InstanceService
Parameters:
instance - the instance

resumeProcessInstance

@Transactional
public void resumeProcessInstance(ItemInstance instance)
Description copied from interface: InstanceService
Resume process instance.

Specified by:
resumeProcessInstance in interface InstanceService
Parameters:
instance - the instance

deleteProcessInstance

@Transactional
public void deleteProcessInstance(ItemInstance instance)
Description copied from interface: InstanceService
Delete process instance.

Specified by:
deleteProcessInstance in interface InstanceService
Parameters:
instance - the instance

restartAssignment

@Transactional
public void restartAssignment(MessageInstance messageInstance,
                                            java.util.List<InstanceAssignmentEntry> instanceAssignmentEntries)
                       throws java.lang.Exception
Description copied from interface: InstanceService
Restart assignment.

Specified by:
restartAssignment in interface InstanceService
Parameters:
messageInstance - the message instance
instanceAssignmentEntries - the instance assignment entries
Throws:
java.lang.Exception - the exception

restartAssignment

@Transactional
public void restartAssignment(MessageInstance messageInstance,
                                            java.util.List<InstanceAssignmentEntry> instanceAssignmentEntries,
                                            java.util.Map<java.lang.String,java.lang.Object> customVariables)
                       throws java.lang.Exception
Description copied from interface: InstanceService
Restart assignment.

Specified by:
restartAssignment in interface InstanceService
Parameters:
messageInstance - the message instance
instanceAssignmentEntries - the instance assignment entries
customVariables - the custom variables
Throws:
java.lang.Exception - the exception

restartAssignmentFromSheet

@Transactional
public void restartAssignmentFromSheet(java.lang.String filePath,
                                                     ContactInstance parentCi)
                                throws java.lang.Exception
Description copied from interface: InstanceService
Restart assignment from sheet.

Specified by:
restartAssignmentFromSheet in interface InstanceService
Parameters:
filePath - the file path
parentCi - the parent ci
Throws:
java.lang.Exception - the exception

cleanTrash

@Transactional
public void cleanTrash()
Description copied from interface: InstanceService
Clean trash.

Specified by:
cleanTrash in interface InstanceService

cleanTrash

@Transactional
public void cleanTrash(MessageBox mbox)
Description copied from interface: InstanceService
Clean trash.

Specified by:
cleanTrash in interface InstanceService
Parameters:
mbox - the mbox

getOriginalMessagePEC

@Transactional
public it.neverworks.mail.helper.MessageHelper getOriginalMessagePEC(MessageServiceInstance instance)
Description copied from interface: InstanceService
Gets the original message pec.

Specified by:
getOriginalMessagePEC in interface InstanceService
Parameters:
instance - the instance
Returns:
the original message pec

getMessageHelper

@Transactional
public it.neverworks.mail.helper.MessageHelper getMessageHelper(MessageInstance messageInstance)
Description copied from interface: InstanceService
Gets the message helper.

Specified by:
getMessageHelper in interface InstanceService
Parameters:
messageInstance - the message instance
Returns:
the message helper

findMailEML

public Document findMailEML(MessageInstance messageInstance)
Description copied from interface: InstanceService
Find mail eml.

Specified by:
findMailEML in interface InstanceService
Parameters:
messageInstance - the message instance
Returns:
the document

createFromAttachment

@Transactional
public File createFromAttachment(ItemInstance instance,
                                               AttachmentItem ar,
                                               ConfidentialityLevel confidentialityLevel)
Description copied from interface: InstanceService
Creates the from attachment.

Specified by:
createFromAttachment in interface InstanceService
Parameters:
instance - the instance
ar - the ar
confidentialityLevel - the confidentiality level
Returns:
the file

createFromAttachment

@Transactional
public File createFromAttachment(ItemInstance instance,
                                               InstanceBaseAction.AttachmentInfo attachment,
                                               ConfidentialityLevel confidentialityLevel)
Description copied from interface: InstanceService
Creates the from attachment.

Specified by:
createFromAttachment in interface InstanceService
Parameters:
instance - the instance
attachment - the attachment
confidentialityLevel - the confidentiality level
Returns:
the file

createRemoteAttachment

@Transactional
public RemoteDocument createRemoteAttachment(ItemInstance instance,
                                                           java.lang.String name,
                                                           CloudFile remoteFile)
Description copied from interface: InstanceService
Creates the remote attachment.

Specified by:
createRemoteAttachment in interface InstanceService
Parameters:
instance - the instance
name - the name
remoteFile - the remote file
Returns:
the remote document

createLocalAttachment

@Transactional
public Document createLocalAttachment(ItemInstance instance,
                                                    java.lang.String name,
                                                    java.lang.String contentType,
                                                    ObjectTemplate objectTemplate,
                                                    ConfidentialityLevel confidentialityLevel,
                                                    java.io.InputStream stream,
                                                    long size)
Description copied from interface: InstanceService
Creates the local attachment.

Specified by:
createLocalAttachment in interface InstanceService
Parameters:
instance - the instance
name - the name
contentType - the content type
objectTemplate - the object template
confidentialityLevel - the confidentiality level
stream - the stream
size - the size
Returns:
the document

getFiles

public java.util.Set<File> getFiles(ItemInstance instance,
                                    java.lang.String fileSetName)
Description copied from interface: InstanceService
Gets the files.

Specified by:
getFiles in interface InstanceService
Parameters:
instance - the instance
fileSetName - the file set name
Returns:
the files

getFile

public File getFile(ItemInstance instance,
                    java.lang.String fileSetName,
                    java.lang.String fileName)
Description copied from interface: InstanceService
Gets the file.

Specified by:
getFile in interface InstanceService
Parameters:
instance - the instance
fileSetName - the file set name
fileName - the file name
Returns:
the file

getUserFilesAll

public java.util.Set<File> getUserFilesAll(ItemInstance instance)
Description copied from interface: InstanceService
Gets the user files all.

Specified by:
getUserFilesAll in interface InstanceService
Parameters:
instance - the instance
Returns:
the user files all

getFilesAll

public java.util.Set<File> getFilesAll(ItemInstance instance)
Description copied from interface: InstanceService
Gets the files all.

Specified by:
getFilesAll in interface InstanceService
Parameters:
instance - the instance
Returns:
the files all

getFileSet

public FileSet getFileSet(ItemInstance instance,
                          java.lang.String fileSetName)
Description copied from interface: InstanceService
Gets the file set.

Specified by:
getFileSet in interface InstanceService
Parameters:
instance - the instance
fileSetName - the file set name
Returns:
the file set

getOrCreateFileSet

@Transactional
public FileSet getOrCreateFileSet(ItemInstance instance,
                                                java.lang.String fileSetName)
Description copied from interface: InstanceService
Gets the or create file set.

Specified by:
getOrCreateFileSet in interface InstanceService
Parameters:
instance - the instance
fileSetName - the file set name
Returns:
the or create file set

addFiles

@Transactional
public void addFiles(ItemInstance instance,
                                   java.lang.String fileSetName,
                                   File... files)
Description copied from interface: InstanceService
Adds the files.

Specified by:
addFiles in interface InstanceService
Parameters:
instance - the instance
fileSetName - the file set name
files - the files

addFiles

public void addFiles(ItemInstance instance,
                     java.lang.String fileSetName,
                     java.util.Collection<? extends File> files)
Description copied from interface: InstanceService
Adds the files.

Specified by:
addFiles in interface InstanceService
Parameters:
instance - the instance
fileSetName - the file set name
files - the files

addFile

public void addFile(ItemInstance instance,
                    java.lang.String fileSetName,
                    File file)
Description copied from interface: InstanceService
Adds the file.

Specified by:
addFile in interface InstanceService
Parameters:
instance - the instance
fileSetName - the file set name
file - the file

removeFiles

@Transactional
public void removeFiles(ItemInstance instance,
                                      java.lang.String fileSetName,
                                      boolean deleteFromDms,
                                      File... files)
Description copied from interface: InstanceService
Removes the files.

Specified by:
removeFiles in interface InstanceService
Parameters:
instance - the instance
fileSetName - the file set name
deleteFromDms - the delete from dms
files - the files

removeFiles

public void removeFiles(ItemInstance instance,
                        java.lang.String fileSetName,
                        boolean deleteFromDms,
                        java.util.Collection<? extends File> files)
Description copied from interface: InstanceService
Removes the files.

Specified by:
removeFiles in interface InstanceService
Parameters:
instance - the instance
fileSetName - the file set name
deleteFromDms - the delete from dms
files - the files

removeFile

public void removeFile(ItemInstance instance,
                       java.lang.String fileSetName,
                       boolean deleteFromDms,
                       File file)
Description copied from interface: InstanceService
Removes the file.

Specified by:
removeFile in interface InstanceService
Parameters:
instance - the instance
fileSetName - the file set name
deleteFromDms - the delete from dms
file - the file

clearFiles

@Transactional
public void clearFiles(ItemInstance instance,
                                     java.lang.String fileSetName,
                                     boolean deleteFromDms)
Description copied from interface: InstanceService
Clear files.

Specified by:
clearFiles in interface InstanceService
Parameters:
instance - the instance
fileSetName - the file set name
deleteFromDms - the delete from dms

replaceFiles

public void replaceFiles(ItemInstance instance,
                         java.lang.String fileSetName,
                         boolean deleteFromDms,
                         File... files)
Description copied from interface: InstanceService
Replace files.

Specified by:
replaceFiles in interface InstanceService
Parameters:
instance - the instance
fileSetName - the file set name
deleteFromDms - the delete from dms
files - the files

replaceFiles

public void replaceFiles(ItemInstance instance,
                         java.lang.String fileSetName,
                         boolean deleteFromDms,
                         java.util.Collection<? extends File> files)
Description copied from interface: InstanceService
Replace files.

Specified by:
replaceFiles in interface InstanceService
Parameters:
instance - the instance
fileSetName - the file set name
deleteFromDms - the delete from dms
files - the files

getDocumentByName

public Document getDocumentByName(ItemInstance instance,
                                  java.lang.String attachmentName)
Description copied from interface: InstanceService
Gets the document by name.

Specified by:
getDocumentByName in interface InstanceService
Parameters:
instance - the instance
attachmentName - the attachment name
Returns:
the document by name

findInstances

public java.util.Set<ItemInstance> findInstances(CloudFile file)
Description copied from interface: InstanceService
Find instances.

Specified by:
findInstances in interface InstanceService
Parameters:
file - the file
Returns:
the sets the

findInstances

public java.util.Set<ItemInstance> findInstances(File file)
Description copied from interface: InstanceService
Find instances.

Specified by:
findInstances in interface InstanceService
Parameters:
file - the file
Returns:
the sets the

findInstanceRelated

public ItemInstance findInstanceRelated(File file)
Description copied from interface: InstanceService
Find instance related.

Specified by:
findInstanceRelated in interface InstanceService
Parameters:
file - the file
Returns:
the item instance

findInstanceRelated

public ItemInstance findInstanceRelated(CloudFile file)
Description copied from interface: InstanceService
Find instance related.

Specified by:
findInstanceRelated in interface InstanceService
Parameters:
file - the file
Returns:
the item instance

replicaAttachments

@Transactional
public void replicaAttachments(java.lang.String replicaServerId,
                                             ItemInstance instance,
                                             java.lang.String fileRegEx)
Description copied from interface: InstanceService
Replica attachments.

Specified by:
replicaAttachments in interface InstanceService
Parameters:
replicaServerId - the replica server id
instance - the instance
fileRegEx - the file reg ex

exportInstancesXml

@Transactional
public void exportInstancesXml(InstancesSet instances,
                                             java.io.File exportFile)
                        throws java.io.IOException
Description copied from interface: InstanceService
Export instances xml.

Specified by:
exportInstancesXml in interface InstanceService
Parameters:
instances - the instances
exportFile - the export file
Throws:
java.io.IOException - Signals that an I/O exception has occurred.

exportInstancesXml

@Transactional
public void exportInstancesXml(java.util.Date fromDate,
                                             java.util.Date toDate,
                                             java.io.File exportFile)
                        throws java.io.IOException
Description copied from interface: InstanceService
Export instances xml.

Specified by:
exportInstancesXml in interface InstanceService
Parameters:
fromDate - the from date
toDate - the to date
exportFile - the export file
Throws:
java.io.IOException - Signals that an I/O exception has occurred.

createItemLink

public File createItemLink(ItemInstance itemInstance,
                           File destination,
                           java.lang.String newName)
Description copied from interface: InstanceService
Creates the item link.

Specified by:
createItemLink in interface InstanceService
Parameters:
itemInstance - the item instance
destination - the destination
newName - the new name
Returns:
the it.sistematica.isharedoc.model.dms. file

createItemLink

@Transactional
public File createItemLink(ItemInstance itemInstance,
                                         File destination,
                                         java.lang.String newName,
                                         java.lang.String note)
Description copied from interface: InstanceService
Creates the item link.

Specified by:
createItemLink in interface InstanceService
Parameters:
itemInstance - the item instance
destination - the destination
newName - the new name
note - the note
Returns:
the it.sistematica.isharedoc.model.dms. file

removeItemLink

@Transactional
public void removeItemLink(ItemInstance itemInstance,
                                         ItemLink link)
Description copied from interface: InstanceService
Removes the item link.

Specified by:
removeItemLink in interface InstanceService
Parameters:
itemInstance - the item instance
link - the link

itemLinkExists

@Transactional
public boolean itemLinkExists(ItemInstance itemInstance,
                                            File destination)
Description copied from interface: InstanceService
Item link exists.

Specified by:
itemLinkExists in interface InstanceService
Parameters:
itemInstance - the item instance
destination - the destination
Returns:
true, if successful

getActiveItemLinks

@Transactional
public java.util.Set<ItemLink> getActiveItemLinks(ItemInstance instance)
Description copied from interface: InstanceService
Gets the active item links.

Specified by:
getActiveItemLinks in interface InstanceService
Parameters:
instance - the instance
Returns:
the active item links