pt.digitalis.dif.utils.extensions.document
Interface IDocumentRepositoryManager

All Known Implementing Classes:
AbstractDocumentRepository

public interface IDocumentRepositoryManager

Author:
Pedro Viegas pviegas@digitalis.pt
Created on:
Jun 5, 2009

Method Summary
 DocumentRepositoryEntry addDocument(DocumentRepositoryEntry document)
          Adds a new document to the repository
 DocumentRepositoryEntry addDocument(DocumentRepositoryEntry document, Boolean ignoreSizeLimit)
          Adds a new document to the repository
 void authorizeDocumentForCurrentSession(IDIFSession session, Long documentID)
          Declares the requested document to be declared as authorized access for the current session scope.
 void deleteDocument(Long id)
          Deletes an existing document from the repository
 DocumentRepositoryEntry getDocument(Long id)
          Searches an existing document by it's unique identifier
 List<DocumentRepositoryEntry> getDocumentByOriginalFileName(String originalFileName)
          Searches for a document by it's original file name
 List<DocumentRepositoryEntry> getDocumentsByCreator(String creatorUserID)
          Searches an existing document by it's creator
 List<DocumentRepositoryEntry> getDocumentsByIds(List<Long> documentIds)
          Get DocumentRepositoryEntry by ids
 boolean isDocumentAuthorizedInCurrentSession(IDIFSession session, Long documentID)
          Searches the authorization list in session for the document ID
 DocumentRepositoryEntry updateDocument(DocumentRepositoryEntry document)
          Updates an existing document with the new data
 

Method Detail

addDocument

DocumentRepositoryEntry addDocument(DocumentRepositoryEntry document)
                                    throws DocumentRepositoryException
Adds a new document to the repository

Parameters:
document - the document to add
Returns:
the added document
Throws:
DocumentRepositoryException

addDocument

DocumentRepositoryEntry addDocument(DocumentRepositoryEntry document,
                                    Boolean ignoreSizeLimit)
                                    throws DocumentRepositoryException
Adds a new document to the repository

Parameters:
document - the document to add
ignoreSizeLimit - ignores the size limit
Returns:
the added document
Throws:
DocumentRepositoryException

authorizeDocumentForCurrentSession

void authorizeDocumentForCurrentSession(IDIFSession session,
                                        Long documentID)
Declares the requested document to be declared as authorized access for the current session scope. If not called an access to this document will result in an Authorization Exception

Parameters:
session - the current session
documentID - the document ID to authorize

deleteDocument

void deleteDocument(Long id)
                    throws DocumentRepositoryException
Deletes an existing document from the repository

Parameters:
id - the document to delete
Throws:
DocumentRepositoryException

getDocument

DocumentRepositoryEntry getDocument(Long id)
                                    throws DocumentRepositoryException
Searches an existing document by it's unique identifier

Parameters:
id - the document id
Returns:
the document
Throws:
DocumentRepositoryException

getDocumentByOriginalFileName

List<DocumentRepositoryEntry> getDocumentByOriginalFileName(String originalFileName)
                                                            throws DocumentRepositoryException
Searches for a document by it's original file name

Parameters:
originalFileName - the file name
Returns:
the document
Throws:
DocumentRepositoryException

getDocumentsByCreator

List<DocumentRepositoryEntry> getDocumentsByCreator(String creatorUserID)
                                                    throws DocumentRepositoryException
Searches an existing document by it's creator

Parameters:
creatorUserID - the user id that created the document
Returns:
the document
Throws:
DocumentRepositoryException

getDocumentsByIds

List<DocumentRepositoryEntry> getDocumentsByIds(List<Long> documentIds)
                                                throws DocumentRepositoryException
Get DocumentRepositoryEntry by ids

Parameters:
documentIds - the array of document ids
Returns:
List of DocumentRepositoryEntry
Throws:
DocumentRepositoryException

isDocumentAuthorizedInCurrentSession

boolean isDocumentAuthorizedInCurrentSession(IDIFSession session,
                                             Long documentID)
Searches the authorization list in session for the document ID

Parameters:
session - the current session
documentID - the document ID to check for authorization
Returns:
T if the document is authorized

updateDocument

DocumentRepositoryEntry updateDocument(DocumentRepositoryEntry document)
Updates an existing document with the new data

Parameters:
document - the document to update in the respository
Returns:
the updated document


Copyright © 2014 Digitalis Informática Lda. All Rights Reserved.