it.sistematica.isharedoc.service.dms
Class DocumentManagerImpl

java.lang.Object
  extended by it.sistematica.isharedoc.service.dms.DocumentManagerImpl
All Implemented Interfaces:
DocumentManager

public class DocumentManagerImpl
extends java.lang.Object
implements DocumentManager


Nested Class Summary
 class DocumentManagerImpl.FileAclItem
           
 
Nested classes/interfaces inherited from interface it.sistematica.isharedoc.service.dms.DocumentManager
DocumentManager.CheckSignatureResult
 
Field Summary
protected static java.lang.ThreadLocal<Document.CheckoutApp> app
           
(package private)  CloudManager cloudManager
           
(package private)  it.neverworks.util.Configuration Configuration
           
(package private)  it.neverworks.cache.ehcache.EhCache<java.util.Map<java.lang.String,DocumentManagerImpl.FileAclItem>> dmsAclCache
           
(package private)  it.neverworks.data.EntityManager entities
           
static java.lang.String FIELD_CLASS
           
static java.lang.String FIELD_CONTENT
           
static java.lang.String FIELD_FILENAME
           
static java.lang.String FIELD_FULLTEXT
           
static java.lang.String FIELD_ID
           
static java.lang.String FIELD_PARENT
           
static java.lang.String FIELD_STATUS
           
static java.lang.String FIELD_TITLE
           
(package private)  IndexService indexService
           
(package private)  InstanceService instanceService
           
(package private)  NotificationService notificationService
           
(package private)  OrganizationService organitazionService
           
protected static java.lang.ThreadLocal<java.util.Stack<java.util.Properties>> propertiesStack
           
(package private)  it.neverworks.scripting.PythonEnvironment pythonEnvironment
           
(package private)  org.hibernate.SessionFactory sessionFactory
           
(package private)  it.neverworks.application.service.TemporaryFileService temporaryFileService
           
(package private)  it.neverworks.application.service.UserInfo userInfo
           
(package private)  UtilityService utilityService
           
static long WEBDAV_CHECKOUT_MS
           
 
Fields inherited from interface it.sistematica.isharedoc.service.dms.DocumentManager
FILECLASS_ATTRIBUTE_COMPARATOR, HINT_APPLY_DEST_PERMS, HINT_REMOVE_PHYSICAL, HINT_REMOVE_SYS_ATTRIBUTES
 
Constructor Summary
DocumentManagerImpl()
           
 
Method Summary
 DocumentContent addVersionDocument(Document document, java.lang.String name, java.lang.String comments, java.lang.String contentType, java.io.InputStream stream, long size)
          Adds the version document.
 void afterCreate(File entity)
           
 void afterSave(File entity)
           
 void applyCreationPermissions(File file, boolean applyDestinationPermission)
           
 void archiveFolder(Folder folder, java.util.Date archiveDate)
          Archive folder.
 void beforeCreate(File entity)
           
 boolean canAdmin(CloudFile cloudFile)
          Can admin.
 boolean canAdmin(File file)
          Can admin.
 void cancelCheckout(Document doc)
          Cancel checkout.
 void cancelCheckout(Document doc, boolean force)
           
 boolean canRead(CloudFile cloudFile)
          Can read.
 boolean canRead(File file)
          Can read.
 boolean canWrite(CloudFile cloudFile)
          Can write.
 boolean canWrite(File file)
          Can write.
 DocumentContent checkin(Document doc, java.lang.String comments)
          Checkin.
 DocumentContent checkin(Document doc, java.lang.String name, java.io.InputStream stream, long size, java.lang.String contentType, java.lang.String comments)
          Checkin.
 DocumentContent checkout(Document doc)
          Checkout.
 DocumentContent checkout(Document doc, java.lang.String name, java.io.InputStream stream, long size, java.lang.String contentType)
          Checkout.
 DocumentContent checkout(Document doc, java.lang.String name, java.io.InputStream stream, long size, java.lang.String contentType, java.util.concurrent.TimeUnit expireTimeUnit, long expireDuration)
          Checkout.
 DocumentContent checkout(Document doc, java.util.concurrent.TimeUnit expireTimeUnit, long expireDuration)
          Checkout.
 DocumentManager.CheckSignatureResult checkSignature(java.io.InputStream is, java.lang.String attachmentName)
          Check signature.
 void checkTree(File file, boolean traceInfo, boolean repairDuplicatedFolder, boolean repairDuplicatedDocument)
          Ripara un albero di directory accorpando le cartelle che hanno lo stesso nome TODO: implementare lo scenario in cui esistono documenti con lo stesso nome
 void clearAcl(File file)
          Clear acl.
 void clearFileRuleEventQueue()
          Clear file rule event queue.
 void clearHints()
          Clear hints.
 File clone(File fileToClone, File destination, java.lang.String newName, boolean cloneContent, boolean applyDestinationPermission)
          Clone.
 File cloneTree(File fileToClone, File destination, java.lang.String newName, boolean cloneContent, boolean applyDestinationPermission)
           
 java.io.InputStream convertTif2Pdf(java.io.File tif)
          Convert tif2 pdf.
 void copy(java.io.File file, File destinationFile)
          Viene copiato il file o la directory in maniera ricorsiva nel destinationFile.
 DocumentContent createDocument(java.lang.String name, java.lang.String comments, java.lang.String contentType, File parent, ObjectTemplate objectTemplate, ConfidentialityLevel confidentialityLevel, java.io.InputStream stream, long size)
          Creates the document.
 Drive createDrive(java.lang.String name, java.lang.String description, boolean hidden, it.neverworks.security.User owner)
          Creates the drive.
 Folder createFolder(File parent, java.lang.String name)
          Creates the folder.
 Folder createFolder(File parent, java.lang.String name, ObjectTemplate ot)
          Creates the folder.
 java.io.InputStream createItemInstanceWatermark(ItemInstance itemInstance, CloudDocumentVersion documentContent)
          Creates the item instance watermark.
 File createLink(File source, File destination, java.lang.String newName)
          Creates the link.
 File createLink(File source, File destination, java.lang.String newName, java.lang.String note)
          Creates the link.
 RemoteDocument createRemoteFile(CloudFile source, File destination, java.lang.String newName)
          Creates the remote file.
 void delete(File file)
          Delete.
 void delete(java.lang.String fileId)
          Delete.
 void deleteLogicalTree(File file)
          Delete logical tree.
 boolean deleteVersion(DocumentContent content)
          Delete version.
 void destroy(File file)
          Destroy.
 ConfidentialityLevel findConfidentialityLevelId(java.lang.Long confidentialityLevelId)
          Find confidentiality level id.
 ObjectTemplate findObjectTemplateId(java.lang.Long objectTemplateId)
          Find object template id.
 Organization findOrganizationId(java.lang.Long organizationId)
          Find organization id.
 it.neverworks.security.User findUserId(java.lang.String userId)
          Find user id.
 DocumentContent forceCheckin(Document doc)
          Force checkin.
 DocumentManagerImpl.FileAclItem getAcl(CloudFile cloudFile)
          Gets the acl.
 DocumentManagerImpl.FileAclItem getAcl(CloudFile cloudFile, boolean rebuildCache, java.util.List<java.lang.String> trace)
          Gets the acl.
 DocumentManagerImpl.FileAclItem getAcl(File file)
          Gets the acl.
 DocumentManagerImpl.FileAclItem getAcl(File file, boolean rebuildCache, java.util.List<java.lang.String> trace)
          Gets the acl.
 java.util.List<ObjectTemplate> getAuthorizedObjectTemplates()
          Gets the authorized object templates.
 java.util.List<Document> getDocuments(File folder)
          Gets the documents.
 java.lang.Boolean getDriveCanContainsDocuments()
          Gets the drive can contains documents.
 File getFileByFileClassAttribute(java.lang.String attributeName, java.lang.String attributeValue)
          Gets the file by file class attribute.
 FileSet getFileSet(File file, java.lang.String name)
          Gets the file set.
 ItemInstance getFileSetInstance(File file, java.lang.String name)
          Gets the file set instance.
 java.util.List<Folder> getFolders(Folder parent)
          Gets the folders.
 java.util.List<Folder> getTopFolders(Drive drive)
          Gets the top folders.
 Topic getTopicByName(java.lang.String topicName, java.lang.String parentSeparator)
          Gets the topic by name.
 java.lang.Boolean getTopicCanContainsDocuments()
          Gets the topic can contains documents.
 void importFolder(java.lang.String idImport, java.lang.String parentIdImport, java.lang.String uoCreazione, java.lang.String titolazione, java.lang.String oggetto, java.util.Date dataCreazione, java.util.Set<java.lang.String> lettori, java.util.Set<java.lang.String> autori, java.util.Map<java.lang.String,java.lang.Object> variables)
          Import folder.
 void importFolderAttachments(ObjectTemplate objectTemplate, java.lang.String idImport, java.util.Collection<java.io.File> attachments, java.lang.String attachmentDescription)
          Import folder attachments.
 void importFolderMessageInstances(java.lang.String idImport, java.lang.String messageInstancesList)
          Import folder message instances.
 void importFolderRelations(java.lang.String idImport, java.lang.String relations)
          Import folder relations.
 java.lang.Boolean isLocked(CloudFile cloudFile)
          Checks if is locked.
 boolean linkExists(File original, File destination)
          Link exists.
 File load(java.lang.Long id)
          Load.
 Folder loadFolder(java.lang.Long id)
          Load folder.
 DocumentSignatureInfo manageDocumentSignatureInfo(Document document)
          Manage document signature info.
 DocumentSignatureInfo manageDocumentSignatureInfo(Document document, java.util.Date timeStampRef)
          Manage document signature info.
 void move(File file, File destinationFile)
          Move.
 void move(File file, File destinationFile, boolean applyDestinationPermission, boolean removeSystemAttributes)
          Move.
 FilePermission permissionAdd(File file, AccessModeItem access, java.lang.Boolean replaceAll, java.lang.Boolean leaveTrack)
          Permission add.
 FilePermission permissionAdd(File file, Organization organization, AccessModeItem access, java.lang.Boolean includeAscending, java.lang.Boolean replaceAll, java.lang.Boolean leaveTrack)
          Permission add.
 FilePermission permissionAdd(FilePermission permission, java.lang.Boolean applyRecursively, java.lang.Boolean replaceAll, java.lang.Boolean leaveTrack)
          Permission add.
 FilePermission permissionAdd(File file, java.lang.String principalId, AccessModeItem access, java.lang.Boolean replaceAll, java.lang.Boolean leaveTrack)
          Permission add.
 FilePermission permissionAdd(File file, Team team, AccessModeItem access, java.lang.Boolean replaceAll, java.lang.Boolean leaveTrack)
          Permission add.
 FilePermission permissionAdd(File file, it.neverworks.security.User user, AccessModeItem access, java.lang.Boolean replaceAll, java.lang.Boolean leaveTrack)
          Permission add.
 boolean permissionExists(FilePermission permission)
          Permission exists.
 void permissionRemove(File file, java.lang.Boolean leaveTrack)
          Permission remove.
 void permissionRemove(File file, Organization organization, java.lang.Boolean leaveTrack)
          Permission remove.
 void permissionRemove(FilePermission permission, java.lang.Boolean applyRecursively, java.lang.Boolean leaveTrack)
          Permission remove.
 void permissionRemove(File file, java.lang.String principalId, java.lang.Boolean leaveTrack)
          Permission remove.
 void permissionRemove(File file, Team team, java.lang.Boolean leaveTrack)
          Permission remove.
 void permissionRemove(File file, it.neverworks.security.User user, java.lang.Boolean leaveTrack)
          Permission remove.
 void permissionRemoveAll(File file, java.lang.Boolean leaveTrack)
          Permission remove all.
 void permissionsApplyRecursive(File file, boolean mergePermissions, java.lang.Boolean leaveTrack)
          Permissions apply recursive.
 void permissionsCopyFromFile(File from, File to, boolean mergePermissions, java.lang.Boolean leaveTrack)
          Permissions copy from file.
 void ping()
          Ping.
 void processFileRuleEvent(FileRuleEvent event)
          Process file rule event.
 void pushHints(java.util.Properties properties)
          Push hints.
 void reorderMessageBoxFiles(MessageBox messageBox)
          Reorder message box files.
 void repair(File entity)
          Repair.
 void save(File file)
          Save.
 void save(File file, boolean applyDestinationPermission)
          Save.
 boolean saveAttribute(File file, java.lang.String fileClassName, java.lang.String attributeName, java.lang.String value)
          Save attribute.
 boolean saveFileClass(File file, java.lang.String fileClassName)
          Save file class.
 void saveHome(IsharedocProfile profile)
          Save home.
 java.util.List<File> searchFiles(java.lang.String queryString, int maxResults)
          Search files.
 void setCheckoutApp(Document.CheckoutApp checkoutApp)
          Sets the checkout app.
 void setContentDirectory(java.lang.String directoryName)
           
 void setDriveCanContainsDocuments(java.lang.Boolean driveCanContainsDocuments)
           
 void setTopicCanContainsDocuments(java.lang.Boolean topicCanContainsDocuments)
           
 void TEMP_archiveFolderRecursiveByIdImport(java.lang.String idImport, java.util.Date archiveDate)
          TEM p_archive folder recursive by id import.
 void trash(File file)
          Trash.
 void unarchiveFolder(Folder folder)
          Unarchive folder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WEBDAV_CHECKOUT_MS

public static final long WEBDAV_CHECKOUT_MS
See Also:
Constant Field Values

pythonEnvironment

it.neverworks.scripting.PythonEnvironment pythonEnvironment

userInfo

it.neverworks.application.service.UserInfo userInfo

entities

it.neverworks.data.EntityManager entities

Configuration

it.neverworks.util.Configuration Configuration

instanceService

InstanceService instanceService

organitazionService

OrganizationService organitazionService

notificationService

NotificationService notificationService

indexService

IndexService indexService

sessionFactory

org.hibernate.SessionFactory sessionFactory

utilityService

UtilityService utilityService

temporaryFileService

it.neverworks.application.service.TemporaryFileService temporaryFileService

cloudManager

CloudManager cloudManager

dmsAclCache

it.neverworks.cache.ehcache.EhCache<java.util.Map<java.lang.String,DocumentManagerImpl.FileAclItem>> dmsAclCache

FIELD_ID

public static java.lang.String FIELD_ID

FIELD_CLASS

public static java.lang.String FIELD_CLASS

FIELD_FULLTEXT

public static java.lang.String FIELD_FULLTEXT

FIELD_TITLE

public static java.lang.String FIELD_TITLE

FIELD_CONTENT

public static java.lang.String FIELD_CONTENT

FIELD_FILENAME

public static java.lang.String FIELD_FILENAME

FIELD_PARENT

public static java.lang.String FIELD_PARENT

FIELD_STATUS

public static java.lang.String FIELD_STATUS

propertiesStack

protected static java.lang.ThreadLocal<java.util.Stack<java.util.Properties>> propertiesStack

app

protected static java.lang.ThreadLocal<Document.CheckoutApp> app
Constructor Detail

DocumentManagerImpl

public DocumentManagerImpl()
Method Detail

ping

public void ping()
Description copied from interface: DocumentManager
Ping.

Specified by:
ping in interface DocumentManager

checkTree

@Transactional
public void checkTree(File file,
                                    boolean traceInfo,
                                    boolean repairDuplicatedFolder,
                                    boolean repairDuplicatedDocument)
Ripara un albero di directory accorpando le cartelle che hanno lo stesso nome TODO: implementare lo scenario in cui esistono documenti con lo stesso nome

Specified by:
checkTree in interface DocumentManager
Parameters:
file - the file
traceInfo - the trace info
repairDuplicatedFolder - the repair duplicated folder
repairDuplicatedDocument - the repair duplicated document

pushHints

public void pushHints(java.util.Properties properties)
Description copied from interface: DocumentManager
Push hints.

Specified by:
pushHints in interface DocumentManager
Parameters:
properties - the properties

clearHints

public void clearHints()
Description copied from interface: DocumentManager
Clear hints.

Specified by:
clearHints in interface DocumentManager

setCheckoutApp

public void setCheckoutApp(Document.CheckoutApp checkoutApp)
Description copied from interface: DocumentManager
Sets the checkout app.

Specified by:
setCheckoutApp in interface DocumentManager
Parameters:
checkoutApp - the new checkout app

setContentDirectory

public void setContentDirectory(java.lang.String directoryName)
                         throws java.io.IOException
Throws:
java.io.IOException

getDriveCanContainsDocuments

public java.lang.Boolean getDriveCanContainsDocuments()
Description copied from interface: DocumentManager
Gets the drive can contains documents.

Specified by:
getDriveCanContainsDocuments in interface DocumentManager
Returns:
the drive can contains documents

setDriveCanContainsDocuments

public void setDriveCanContainsDocuments(java.lang.Boolean driveCanContainsDocuments)

getTopicCanContainsDocuments

public java.lang.Boolean getTopicCanContainsDocuments()
Description copied from interface: DocumentManager
Gets the topic can contains documents.

Specified by:
getTopicCanContainsDocuments in interface DocumentManager
Returns:
the topic can contains documents

setTopicCanContainsDocuments

public void setTopicCanContainsDocuments(java.lang.Boolean topicCanContainsDocuments)

saveHome

@Transactional
public void saveHome(IsharedocProfile profile)
Description copied from interface: DocumentManager
Save home.

Specified by:
saveHome in interface DocumentManager
Parameters:
profile - the profile

save

@Transactional
public void save(File file)
Description copied from interface: DocumentManager
Save.

Specified by:
save in interface DocumentManager
Parameters:
file - the file

save

@Transactional
public void save(File file,
                               boolean applyDestinationPermission)
Description copied from interface: DocumentManager
Save.

Specified by:
save in interface DocumentManager
Parameters:
file - the file
applyDestinationPermission - the apply destination permission

applyCreationPermissions

public void applyCreationPermissions(File file,
                                     boolean applyDestinationPermission)

beforeCreate

public void beforeCreate(File entity)

afterCreate

public void afterCreate(File entity)

afterSave

public void afterSave(File entity)

repair

@Transactional
public void repair(File entity)
Description copied from interface: DocumentManager
Repair.

Specified by:
repair in interface DocumentManager
Parameters:
entity - the file

move

@Transactional
public void move(File file,
                               File destinationFile)
Description copied from interface: DocumentManager
Move.

Specified by:
move in interface DocumentManager
Parameters:
file - the file
destinationFile - the destination file

move

@Transactional
public void move(File file,
                               File destinationFile,
                               boolean applyDestinationPermission,
                               boolean removeSystemAttributes)
Description copied from interface: DocumentManager
Move.

Specified by:
move in interface DocumentManager
Parameters:
file - the file
destinationFile - the destination file
applyDestinationPermission - the apply destination permission
removeSystemAttributes - the remove system attributes

copy

@Transactional
public void copy(java.io.File file,
                               File destinationFile)
Viene copiato il file o la directory in maniera ricorsiva nel destinationFile.

Specified by:
copy in interface DocumentManager
Parameters:
file - the source file
destinationFile - the destination file

deleteLogicalTree

@Transactional
public void deleteLogicalTree(File file)
Description copied from interface: DocumentManager
Delete logical tree.

Specified by:
deleteLogicalTree in interface DocumentManager
Parameters:
file - the file

trash

@Transactional
public void trash(File file)
Description copied from interface: DocumentManager
Trash.

Specified by:
trash in interface DocumentManager
Parameters:
file - the file

delete

@Transactional
public void delete(File file)
Description copied from interface: DocumentManager
Delete.

Specified by:
delete in interface DocumentManager
Parameters:
file - the file

delete

@Transactional
public void delete(java.lang.String fileId)
Description copied from interface: DocumentManager
Delete.

Specified by:
delete in interface DocumentManager
Parameters:
fileId - the file id

destroy

@Transactional
public void destroy(File file)
Description copied from interface: DocumentManager
Destroy.

Specified by:
destroy in interface DocumentManager
Parameters:
file - the file

clone

@Transactional
public File clone(File fileToClone,
                                File destination,
                                java.lang.String newName,
                                boolean cloneContent,
                                boolean applyDestinationPermission)
Description copied from interface: DocumentManager
Clone.

Specified by:
clone in interface DocumentManager
Parameters:
fileToClone - the file to clone
destination - the destination
newName - the new name
cloneContent - the clone content
applyDestinationPermission - the apply destination permission
Returns:
the file

cloneTree

public File cloneTree(File fileToClone,
                      File destination,
                      java.lang.String newName,
                      boolean cloneContent,
                      boolean applyDestinationPermission)

saveFileClass

@Transactional
public boolean saveFileClass(File file,
                                           java.lang.String fileClassName)
Description copied from interface: DocumentManager
Save file class.

Specified by:
saveFileClass in interface DocumentManager
Parameters:
file - the file
fileClassName - the file class name
Returns:
true, if successful

saveAttribute

@Transactional
public boolean saveAttribute(File file,
                                           java.lang.String fileClassName,
                                           java.lang.String attributeName,
                                           java.lang.String value)
Description copied from interface: DocumentManager
Save attribute.

Specified by:
saveAttribute in interface DocumentManager
Parameters:
file - the file
fileClassName - the file class name
attributeName - the attribute name
value - the value
Returns:
true, if successful

getFolders

public java.util.List<Folder> getFolders(Folder parent)
Description copied from interface: DocumentManager
Gets the folders.

Specified by:
getFolders in interface DocumentManager
Parameters:
parent - the parent
Returns:
the folders

getTopFolders

public java.util.List<Folder> getTopFolders(Drive drive)
Description copied from interface: DocumentManager
Gets the top folders.

Specified by:
getTopFolders in interface DocumentManager
Parameters:
drive - the drive
Returns:
the top folders

getAuthorizedObjectTemplates

public java.util.List<ObjectTemplate> getAuthorizedObjectTemplates()
Description copied from interface: DocumentManager
Gets the authorized object templates.

Specified by:
getAuthorizedObjectTemplates in interface DocumentManager
Returns:
the authorized object templates

permissionExists

@Transactional
public boolean permissionExists(FilePermission permission)
Description copied from interface: DocumentManager
Permission exists.

Specified by:
permissionExists in interface DocumentManager
Parameters:
permission - the permission
Returns:
true, if successful

permissionAdd

@Transactional
public FilePermission permissionAdd(File file,
                                                  AccessModeItem access,
                                                  java.lang.Boolean replaceAll,
                                                  java.lang.Boolean leaveTrack)
Description copied from interface: DocumentManager
Permission add.

Specified by:
permissionAdd in interface DocumentManager
Parameters:
file - the file
access - the access
replaceAll - the replace all
leaveTrack - the leave track
Returns:
the file permission

permissionAdd

@Transactional
public FilePermission permissionAdd(File file,
                                                  java.lang.String principalId,
                                                  AccessModeItem access,
                                                  java.lang.Boolean replaceAll,
                                                  java.lang.Boolean leaveTrack)
Description copied from interface: DocumentManager
Permission add.

Specified by:
permissionAdd in interface DocumentManager
Parameters:
file - the file
principalId - the principal id
access - the access
replaceAll - the replace all
leaveTrack - the leave track
Returns:
the file permission

permissionAdd

@Transactional
public FilePermission permissionAdd(File file,
                                                  Organization organization,
                                                  AccessModeItem access,
                                                  java.lang.Boolean includeAscending,
                                                  java.lang.Boolean replaceAll,
                                                  java.lang.Boolean leaveTrack)
Description copied from interface: DocumentManager
Permission add.

Specified by:
permissionAdd in interface DocumentManager
Parameters:
file - the file
organization - the organization
access - the access
includeAscending - the include ascending
replaceAll - the replace all
leaveTrack - the leave track
Returns:
the file permission

permissionAdd

@Transactional
public FilePermission permissionAdd(File file,
                                                  it.neverworks.security.User user,
                                                  AccessModeItem access,
                                                  java.lang.Boolean replaceAll,
                                                  java.lang.Boolean leaveTrack)
Description copied from interface: DocumentManager
Permission add.

Specified by:
permissionAdd in interface DocumentManager
Parameters:
file - the file
user - the user
access - the access
replaceAll - the replace all
leaveTrack - the leave track
Returns:
the file permission

permissionAdd

@Transactional
public FilePermission permissionAdd(File file,
                                                  Team team,
                                                  AccessModeItem access,
                                                  java.lang.Boolean replaceAll,
                                                  java.lang.Boolean leaveTrack)
Description copied from interface: DocumentManager
Permission add.

Specified by:
permissionAdd in interface DocumentManager
Parameters:
file - the file
team - the team
access - the access
replaceAll - the replace all
leaveTrack - the leave track
Returns:
the file permission

permissionAdd

@Transactional
public FilePermission permissionAdd(FilePermission permission,
                                                  java.lang.Boolean applyRecursively,
                                                  java.lang.Boolean replaceAll,
                                                  java.lang.Boolean leaveTrack)
Description copied from interface: DocumentManager
Permission add.

Specified by:
permissionAdd in interface DocumentManager
Parameters:
permission - the permission
applyRecursively - the apply recursively
replaceAll - the replace all
leaveTrack - the leave track
Returns:
the file permission

permissionRemove

@Transactional
public void permissionRemove(File file,
                                           java.lang.Boolean leaveTrack)
Description copied from interface: DocumentManager
Permission remove.

Specified by:
permissionRemove in interface DocumentManager
Parameters:
file - the file
leaveTrack - the leave track

permissionRemove

@Transactional
public void permissionRemove(File file,
                                           java.lang.String principalId,
                                           java.lang.Boolean leaveTrack)
Description copied from interface: DocumentManager
Permission remove.

Specified by:
permissionRemove in interface DocumentManager
Parameters:
file - the file
principalId - the principal id
leaveTrack - the leave track

permissionRemoveAll

@Transactional
public void permissionRemoveAll(File file,
                                              java.lang.Boolean leaveTrack)
Description copied from interface: DocumentManager
Permission remove all.

Specified by:
permissionRemoveAll in interface DocumentManager
Parameters:
file - the file
leaveTrack - the leave track

permissionRemove

@Transactional
public void permissionRemove(File file,
                                           it.neverworks.security.User user,
                                           java.lang.Boolean leaveTrack)
Description copied from interface: DocumentManager
Permission remove.

Specified by:
permissionRemove in interface DocumentManager
Parameters:
file - the file
user - the user
leaveTrack - the leave track

permissionRemove

@Transactional
public void permissionRemove(File file,
                                           Organization organization,
                                           java.lang.Boolean leaveTrack)
Description copied from interface: DocumentManager
Permission remove.

Specified by:
permissionRemove in interface DocumentManager
Parameters:
file - the file
organization - the organization
leaveTrack - the leave track

permissionRemove

@Transactional
public void permissionRemove(File file,
                                           Team team,
                                           java.lang.Boolean leaveTrack)
Description copied from interface: DocumentManager
Permission remove.

Specified by:
permissionRemove in interface DocumentManager
Parameters:
file - the file
team - the team
leaveTrack - the leave track

permissionRemove

@Transactional
public void permissionRemove(FilePermission permission,
                                           java.lang.Boolean applyRecursively,
                                           java.lang.Boolean leaveTrack)
Description copied from interface: DocumentManager
Permission remove.

Specified by:
permissionRemove in interface DocumentManager
Parameters:
permission - the permission
applyRecursively - the apply recursively
leaveTrack - the leave track

permissionsApplyRecursive

@Transactional
public void permissionsApplyRecursive(File file,
                                                    boolean mergePermissions,
                                                    java.lang.Boolean leaveTrack)
Description copied from interface: DocumentManager
Permissions apply recursive.

Specified by:
permissionsApplyRecursive in interface DocumentManager
Parameters:
file - the file
mergePermissions - the merge permissions
leaveTrack - the leave track

permissionsCopyFromFile

@Transactional
public void permissionsCopyFromFile(File from,
                                                  File to,
                                                  boolean mergePermissions,
                                                  java.lang.Boolean leaveTrack)
Description copied from interface: DocumentManager
Permissions copy from file.

Specified by:
permissionsCopyFromFile in interface DocumentManager
Parameters:
from - the from
to - the to
mergePermissions - the merge permissions
leaveTrack - the leave track

isLocked

@Transactional
public java.lang.Boolean isLocked(CloudFile cloudFile)
Description copied from interface: DocumentManager
Checks if is locked.

Specified by:
isLocked in interface DocumentManager
Parameters:
cloudFile - the cloud file
Returns:
the boolean

getAcl

@Transactional
public DocumentManagerImpl.FileAclItem getAcl(CloudFile cloudFile)
Description copied from interface: DocumentManager
Gets the acl.

Specified by:
getAcl in interface DocumentManager
Parameters:
cloudFile - the cloud file
Returns:
the acl

getAcl

@Transactional
public DocumentManagerImpl.FileAclItem getAcl(CloudFile cloudFile,
                                                            boolean rebuildCache,
                                                            java.util.List<java.lang.String> trace)
Description copied from interface: DocumentManager
Gets the acl.

Specified by:
getAcl in interface DocumentManager
Parameters:
cloudFile - the cloud file
rebuildCache - the rebuild cache
trace - the trace
Returns:
the acl

canRead

public boolean canRead(CloudFile cloudFile)
Description copied from interface: DocumentManager
Can read.

Specified by:
canRead in interface DocumentManager
Parameters:
cloudFile - the cloud file
Returns:
true, if successful

canWrite

public boolean canWrite(CloudFile cloudFile)
Description copied from interface: DocumentManager
Can write.

Specified by:
canWrite in interface DocumentManager
Parameters:
cloudFile - the cloud file
Returns:
true, if successful

canAdmin

public boolean canAdmin(CloudFile cloudFile)
Description copied from interface: DocumentManager
Can admin.

Specified by:
canAdmin in interface DocumentManager
Parameters:
cloudFile - the cloud file
Returns:
true, if successful

getAcl

@Transactional
public DocumentManagerImpl.FileAclItem getAcl(File file)
Description copied from interface: DocumentManager
Gets the acl.

Specified by:
getAcl in interface DocumentManager
Parameters:
file - the file
Returns:
the acl

getAcl

@Transactional
public DocumentManagerImpl.FileAclItem getAcl(File file,
                                                            boolean rebuildCache,
                                                            java.util.List<java.lang.String> trace)
Description copied from interface: DocumentManager
Gets the acl.

Specified by:
getAcl in interface DocumentManager
Parameters:
file - the file
rebuildCache - the rebuild cache
trace - the trace
Returns:
the acl

clearAcl

public void clearAcl(File file)
Description copied from interface: DocumentManager
Clear acl.

Specified by:
clearAcl in interface DocumentManager
Parameters:
file - the file

canRead

public boolean canRead(File file)
Description copied from interface: DocumentManager
Can read.

Specified by:
canRead in interface DocumentManager
Parameters:
file - the file
Returns:
true, if successful

canWrite

public boolean canWrite(File file)
Description copied from interface: DocumentManager
Can write.

Specified by:
canWrite in interface DocumentManager
Parameters:
file - the file
Returns:
true, if successful

canAdmin

public boolean canAdmin(File file)
Description copied from interface: DocumentManager
Can admin.

Specified by:
canAdmin in interface DocumentManager
Parameters:
file - the file
Returns:
true, if successful

load

@Transactional
public File load(java.lang.Long id)
Description copied from interface: DocumentManager
Load.

Specified by:
load in interface DocumentManager
Parameters:
id - the id
Returns:
the file

loadFolder

@Transactional
public Folder loadFolder(java.lang.Long id)
Description copied from interface: DocumentManager
Load folder.

Specified by:
loadFolder in interface DocumentManager
Parameters:
id - the id
Returns:
the folder

createDrive

@Transactional
public Drive createDrive(java.lang.String name,
                                       java.lang.String description,
                                       boolean hidden,
                                       it.neverworks.security.User owner)
Description copied from interface: DocumentManager
Creates the drive.

Specified by:
createDrive in interface DocumentManager
Parameters:
name - the name
description - the description
hidden - the hidden
owner - the owner
Returns:
the drive

createFolder

@Transactional
public Folder createFolder(File parent,
                                         java.lang.String name)
Description copied from interface: DocumentManager
Creates the folder.

Specified by:
createFolder in interface DocumentManager
Parameters:
parent - the parent
name - the name
Returns:
the folder

createFolder

@Transactional
public Folder createFolder(File parent,
                                         java.lang.String name,
                                         ObjectTemplate ot)
Description copied from interface: DocumentManager
Creates the folder.

Specified by:
createFolder in interface DocumentManager
Parameters:
parent - the parent
name - the name
ot - the ot
Returns:
the folder

createLink

public File createLink(File source,
                       File destination,
                       java.lang.String newName)
Description copied from interface: DocumentManager
Creates the link.

Specified by:
createLink in interface DocumentManager
Parameters:
source - the source
destination - the destination
newName - the new name
Returns:
the file

createLink

@Transactional
public File createLink(File source,
                                     File destination,
                                     java.lang.String newName,
                                     java.lang.String note)
Description copied from interface: DocumentManager
Creates the link.

Specified by:
createLink in interface DocumentManager
Parameters:
source - the source
destination - the destination
newName - the new name
note - the note
Returns:
the file

createRemoteFile

public RemoteDocument createRemoteFile(CloudFile source,
                                       File destination,
                                       java.lang.String newName)
Description copied from interface: DocumentManager
Creates the remote file.

Specified by:
createRemoteFile in interface DocumentManager
Parameters:
source - the source
destination - the destination
newName - the new name
Returns:
the remote document

linkExists

@Transactional
public boolean linkExists(File original,
                                        File destination)
Description copied from interface: DocumentManager
Link exists.

Specified by:
linkExists in interface DocumentManager
Parameters:
original - the original
destination - the destination
Returns:
true, if successful

createDocument

@Transactional
public DocumentContent createDocument(java.lang.String name,
                                                    java.lang.String comments,
                                                    java.lang.String contentType,
                                                    File parent,
                                                    ObjectTemplate objectTemplate,
                                                    ConfidentialityLevel confidentialityLevel,
                                                    java.io.InputStream stream,
                                                    long size)
Description copied from interface: DocumentManager
Creates the document.

Specified by:
createDocument in interface DocumentManager
Parameters:
name - the name
comments - the comments
contentType - the content type
parent - the parent
objectTemplate - the object template
confidentialityLevel - the confidentiality level
stream - the stream
size - the size
Returns:
the document content

addVersionDocument

@Transactional
public DocumentContent addVersionDocument(Document document,
                                                        java.lang.String name,
                                                        java.lang.String comments,
                                                        java.lang.String contentType,
                                                        java.io.InputStream stream,
                                                        long size)
Description copied from interface: DocumentManager
Adds the version document.

Specified by:
addVersionDocument in interface DocumentManager
Parameters:
document - the document
name - the name
comments - the comments
contentType - the content type
stream - the stream
size - the size
Returns:
the document content

archiveFolder

@Transactional
public void archiveFolder(Folder folder,
                                        java.util.Date archiveDate)
Description copied from interface: DocumentManager
Archive folder.

Specified by:
archiveFolder in interface DocumentManager
Parameters:
folder - the folder
archiveDate - the archive date

unarchiveFolder

@Transactional
public void unarchiveFolder(Folder folder)
Description copied from interface: DocumentManager
Unarchive folder.

Specified by:
unarchiveFolder in interface DocumentManager
Parameters:
folder - the folder

TEMP_archiveFolderRecursiveByIdImport

@Transactional
public void TEMP_archiveFolderRecursiveByIdImport(java.lang.String idImport,
                                                                java.util.Date archiveDate)
Description copied from interface: DocumentManager
TEM p_archive folder recursive by id import.

Specified by:
TEMP_archiveFolderRecursiveByIdImport in interface DocumentManager
Parameters:
idImport - the id import
archiveDate - the archive date

getDocuments

public java.util.List<Document> getDocuments(File folder)
Description copied from interface: DocumentManager
Gets the documents.

Specified by:
getDocuments in interface DocumentManager
Parameters:
folder - the folder
Returns:
the documents

searchFiles

public java.util.List<File> searchFiles(java.lang.String queryString,
                                        int maxResults)
Description copied from interface: DocumentManager
Search files.

Specified by:
searchFiles in interface DocumentManager
Parameters:
queryString - the query string
maxResults - the max results
Returns:
the list

reorderMessageBoxFiles

public void reorderMessageBoxFiles(MessageBox messageBox)
Description copied from interface: DocumentManager
Reorder message box files.

Specified by:
reorderMessageBoxFiles in interface DocumentManager
Parameters:
messageBox - the message box

importFolder

@Transactional
public void importFolder(java.lang.String idImport,
                                       java.lang.String parentIdImport,
                                       java.lang.String uoCreazione,
                                       java.lang.String titolazione,
                                       java.lang.String oggetto,
                                       java.util.Date dataCreazione,
                                       java.util.Set<java.lang.String> lettori,
                                       java.util.Set<java.lang.String> autori,
                                       java.util.Map<java.lang.String,java.lang.Object> variables)
                  throws java.lang.Exception
Description copied from interface: DocumentManager
Import folder.

Specified by:
importFolder in interface DocumentManager
Parameters:
idImport - the id import
parentIdImport - the parent id import
uoCreazione - the uo creazione
titolazione - the titolazione
oggetto - the oggetto
dataCreazione - the data creazione
lettori - the lettori
autori - the autori
variables - the variables
Throws:
java.lang.Exception - the exception

importFolderMessageInstances

@Transactional
public void importFolderMessageInstances(java.lang.String idImport,
                                                       java.lang.String messageInstancesList)
                                  throws java.lang.Exception
Description copied from interface: DocumentManager
Import folder message instances.

Specified by:
importFolderMessageInstances in interface DocumentManager
Parameters:
idImport - the id import
messageInstancesList - the message instances list
Throws:
java.lang.Exception - the exception

importFolderRelations

@Transactional
public void importFolderRelations(java.lang.String idImport,
                                                java.lang.String relations)
                           throws java.lang.Exception
Description copied from interface: DocumentManager
Import folder relations.

Specified by:
importFolderRelations in interface DocumentManager
Parameters:
idImport - the id import
relations - the relations
Throws:
java.lang.Exception - the exception

importFolderAttachments

@Transactional
public void importFolderAttachments(ObjectTemplate objectTemplate,
                                                  java.lang.String idImport,
                                                  java.util.Collection<java.io.File> attachments,
                                                  java.lang.String attachmentDescription)
                             throws java.lang.Exception
Description copied from interface: DocumentManager
Import folder attachments.

Specified by:
importFolderAttachments in interface DocumentManager
Parameters:
objectTemplate - the object template
idImport - the id import
attachments - the attachments
attachmentDescription - the attachment description
Throws:
java.lang.Exception - the exception

getFileByFileClassAttribute

@Transactional
public File getFileByFileClassAttribute(java.lang.String attributeName,
                                                      java.lang.String attributeValue)
                                 throws java.lang.Exception
Description copied from interface: DocumentManager
Gets the file by file class attribute.

Specified by:
getFileByFileClassAttribute in interface DocumentManager
Parameters:
attributeName - the attribute name
attributeValue - the attribute value
Returns:
the file by file class attribute
Throws:
java.lang.Exception - the exception

convertTif2Pdf

public java.io.InputStream convertTif2Pdf(java.io.File tif)
                                   throws java.lang.Exception
Description copied from interface: DocumentManager
Convert tif2 pdf.

Specified by:
convertTif2Pdf in interface DocumentManager
Parameters:
tif - the tif
Returns:
the input stream
Throws:
java.lang.Exception - the exception

getTopicByName

public Topic getTopicByName(java.lang.String topicName,
                            java.lang.String parentSeparator)
Description copied from interface: DocumentManager
Gets the topic by name.

Specified by:
getTopicByName in interface DocumentManager
Parameters:
topicName - the topic name
parentSeparator - the parent separator
Returns:
the topic by name

clearFileRuleEventQueue

public void clearFileRuleEventQueue()
Description copied from interface: DocumentManager
Clear file rule event queue.

Specified by:
clearFileRuleEventQueue in interface DocumentManager

processFileRuleEvent

public void processFileRuleEvent(FileRuleEvent event)
Description copied from interface: DocumentManager
Process file rule event.

Specified by:
processFileRuleEvent in interface DocumentManager
Parameters:
event - the event

findUserId

@Transactional
public it.neverworks.security.User findUserId(java.lang.String userId)
Description copied from interface: DocumentManager
Find user id.

Specified by:
findUserId in interface DocumentManager
Parameters:
userId - the user id
Returns:
the user

findOrganizationId

@Transactional
public Organization findOrganizationId(java.lang.Long organizationId)
Description copied from interface: DocumentManager
Find organization id.

Specified by:
findOrganizationId in interface DocumentManager
Parameters:
organizationId - the organization id
Returns:
the organization

findConfidentialityLevelId

@Transactional
public ConfidentialityLevel findConfidentialityLevelId(java.lang.Long confidentialityLevelId)
Description copied from interface: DocumentManager
Find confidentiality level id.

Specified by:
findConfidentialityLevelId in interface DocumentManager
Parameters:
confidentialityLevelId - the confidentiality level id
Returns:
the confidentiality level

findObjectTemplateId

@Transactional
public ObjectTemplate findObjectTemplateId(java.lang.Long objectTemplateId)
Description copied from interface: DocumentManager
Find object template id.

Specified by:
findObjectTemplateId in interface DocumentManager
Parameters:
objectTemplateId - the object template id
Returns:
the object template

getFileSet

public FileSet getFileSet(File file,
                          java.lang.String name)
Description copied from interface: DocumentManager
Gets the file set.

Specified by:
getFileSet in interface DocumentManager
Parameters:
file - the file
name - the name
Returns:
the file set

getFileSetInstance

public ItemInstance getFileSetInstance(File file,
                                       java.lang.String name)
Description copied from interface: DocumentManager
Gets the file set instance.

Specified by:
getFileSetInstance in interface DocumentManager
Parameters:
file - the file
name - the name
Returns:
the file set instance

manageDocumentSignatureInfo

public DocumentSignatureInfo manageDocumentSignatureInfo(Document document)
Description copied from interface: DocumentManager
Manage document signature info.

Specified by:
manageDocumentSignatureInfo in interface DocumentManager
Parameters:
document - the document
Returns:
the document signature info

manageDocumentSignatureInfo

public DocumentSignatureInfo manageDocumentSignatureInfo(Document document,
                                                         java.util.Date timeStampRef)
Description copied from interface: DocumentManager
Manage document signature info.

Specified by:
manageDocumentSignatureInfo in interface DocumentManager
Parameters:
document - the document
timeStampRef - the time stamp ref
Returns:
the document signature info

checkSignature

public DocumentManager.CheckSignatureResult checkSignature(java.io.InputStream is,
                                                           java.lang.String attachmentName)
Description copied from interface: DocumentManager
Check signature.

Specified by:
checkSignature in interface DocumentManager
Parameters:
is - the is
attachmentName - the attachment name
Returns:
the check signature result

createItemInstanceWatermark

public java.io.InputStream createItemInstanceWatermark(ItemInstance itemInstance,
                                                       CloudDocumentVersion documentContent)
                                                throws java.lang.Exception
Description copied from interface: DocumentManager
Creates the item instance watermark.

Specified by:
createItemInstanceWatermark in interface DocumentManager
Parameters:
itemInstance - the item instance
documentContent - the document content
Returns:
the input stream
Throws:
java.lang.Exception - the exception

checkout

@Transactional
public DocumentContent checkout(Document doc)
Description copied from interface: DocumentManager
Checkout.

Specified by:
checkout in interface DocumentManager
Parameters:
doc - the document
Returns:
the document content

checkout

@Transactional
public DocumentContent checkout(Document doc,
                                              java.util.concurrent.TimeUnit expireTimeUnit,
                                              long expireDuration)
Description copied from interface: DocumentManager
Checkout.

Specified by:
checkout in interface DocumentManager
Parameters:
doc - the document
expireTimeUnit - the expire time unit
expireDuration - the expire duration
Returns:
the document content

checkout

@Transactional
public DocumentContent checkout(Document doc,
                                              java.lang.String name,
                                              java.io.InputStream stream,
                                              long size,
                                              java.lang.String contentType)
Description copied from interface: DocumentManager
Checkout.

Specified by:
checkout in interface DocumentManager
Parameters:
doc - the document
name - the name
stream - the stream
size - the size
contentType - the content type
Returns:
the document content

checkout

@Transactional
public DocumentContent checkout(Document doc,
                                              java.lang.String name,
                                              java.io.InputStream stream,
                                              long size,
                                              java.lang.String contentType,
                                              java.util.concurrent.TimeUnit expireTimeUnit,
                                              long expireDuration)
Description copied from interface: DocumentManager
Checkout.

Specified by:
checkout in interface DocumentManager
Parameters:
doc - the document
name - the name
stream - the stream
size - the size
contentType - the content type
expireTimeUnit - the expire time unit
expireDuration - the expire duration
Returns:
the document content

checkin

@Transactional
public DocumentContent checkin(Document doc,
                                             java.lang.String name,
                                             java.io.InputStream stream,
                                             long size,
                                             java.lang.String contentType,
                                             java.lang.String comments)
Description copied from interface: DocumentManager
Checkin.

Specified by:
checkin in interface DocumentManager
Parameters:
doc - the document
name - the name
stream - the stream
size - the size
contentType - the content type
comments - the comments
Returns:
the document content

forceCheckin

@Transactional
public DocumentContent forceCheckin(Document doc)
Description copied from interface: DocumentManager
Force checkin.

Specified by:
forceCheckin in interface DocumentManager
Parameters:
doc - the doc
Returns:
the document content

checkin

@Transactional
public DocumentContent checkin(Document doc,
                                             java.lang.String comments)
Description copied from interface: DocumentManager
Checkin.

Specified by:
checkin in interface DocumentManager
Parameters:
doc - the doc
comments - the comments
Returns:
the document content

deleteVersion

@Transactional
public boolean deleteVersion(DocumentContent content)
Description copied from interface: DocumentManager
Delete version.

Specified by:
deleteVersion in interface DocumentManager
Parameters:
content - the content
Returns:
true, if successful

cancelCheckout

@Transactional
public void cancelCheckout(Document doc)
Description copied from interface: DocumentManager
Cancel checkout.

Specified by:
cancelCheckout in interface DocumentManager
Parameters:
doc - the document

cancelCheckout

public void cancelCheckout(Document doc,
                           boolean force)