fr.paris.lutece.plugins.document.business
Class DocumentHome

java.lang.Object
  extended by fr.paris.lutece.plugins.document.business.DocumentHome

public final class DocumentHome
extends java.lang.Object

This class provides instances management methods (create, find, ...) for Document objects


Method Summary
static Document create(Document document)
          Creation of an instance of document
static java.util.List<Document> findAll()
           
static java.util.Collection<java.lang.Integer> findAllPrimaryKeys()
          Gets all documents id
static java.util.List<Document> findByFilter(DocumentFilter filter, java.util.Locale locale)
          Returns a collection of documents objects
static Document findByPrimaryKey(int nKey)
          Returns an instance of a document whose identifier is specified in parameter
static Document findByPrimaryKeyWithoutBinaries(int nKey)
          Returns an instance of a document whose identifier is specified in parameter
static java.util.List<Document> findByRelatedCategories(Document document, java.util.Locale locale)
          Returns a collection of documents objects If more than one category is specified on filter, the result will corresponding to the document wich matched with one category at least.
static java.util.List<Document> findBySpaceKey(int nSpaceId)
          Returns documents by space id
static java.util.Collection<java.lang.Integer> findPrimaryKeysByFilter(DocumentFilter filter, java.util.Locale locale)
          Returns a collection of documents ids
static java.lang.String getPageTemplateDocumentPath(int IdPageTemplateDocument)
          Load document pageTemplatePath
static DocumentResource getResource(int nDocumentId)
           
static DocumentResource getResource(int nDocumentId, int nAttributeId)
           
static void loadAttributes(Document document)
          Load document attributes
static int newPrimaryKey()
           
static void remove(int nDocumentId)
          Remove the Document whose identifier is specified in parameter
static Document update(Document document, boolean bUpdateContent)
          Update of the document which is specified in parameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static Document create(Document document)
Creation of an instance of document

Parameters:
document - The instance of the document which contains the informations to store
Returns:
The instance of document which has been created with its primary key.

update

public static Document update(Document document,
                              boolean bUpdateContent)
Update of the document which is specified in parameter

Parameters:
bUpdateContent -
document - The instance of the document which contains the data to store
Returns:
The instance of the document which has been updated

remove

public static void remove(int nDocumentId)
Remove the Document whose identifier is specified in parameter

Parameters:
nDocumentId -

findByPrimaryKey

public static Document findByPrimaryKey(int nKey)
Returns an instance of a document whose identifier is specified in parameter

Parameters:
nKey - The Primary key of the document
Returns:
An instance of document

findByPrimaryKeyWithoutBinaries

public static Document findByPrimaryKeyWithoutBinaries(int nKey)
Returns an instance of a document whose identifier is specified in parameter

Parameters:
nKey - The Primary key of the document
Returns:
An instance of document

findBySpaceKey

public static java.util.List<Document> findBySpaceKey(int nSpaceId)
Returns documents by space id

Parameters:
nSpaceId - The space Id
Returns:
A list of documents

findPrimaryKeysByFilter

public static java.util.Collection<java.lang.Integer> findPrimaryKeysByFilter(DocumentFilter filter,
                                                                              java.util.Locale locale)
Returns a collection of documents ids

Parameters:
filter -
locale -
Returns:
A collection of documents ids

findByFilter

public static java.util.List<Document> findByFilter(DocumentFilter filter,
                                                    java.util.Locale locale)
Returns a collection of documents objects

Parameters:
filter -
locale -
Returns:
A collection of documents

findByRelatedCategories

public static java.util.List<Document> findByRelatedCategories(Document document,
                                                               java.util.Locale locale)
Returns a collection of documents objects If more than one category is specified on filter, the result will corresponding to the document wich matched with one category at least.

Parameters:
document - The Document
locale - The Locale
Returns:
A collection of documents

getResource

public static DocumentResource getResource(int nDocumentId,
                                           int nAttributeId)
Parameters:
nDocumentId -
nAttributeId -
Returns:

getResource

public static DocumentResource getResource(int nDocumentId)
Parameters:
nDocumentId -
Returns:

newPrimaryKey

public static int newPrimaryKey()
Returns:

findAllPrimaryKeys

public static java.util.Collection<java.lang.Integer> findAllPrimaryKeys()
Gets all documents id

Returns:
A collection of Integer

findAll

public static java.util.List<Document> findAll()
Returns:

loadAttributes

public static void loadAttributes(Document document)
Load document attributes

Parameters:
document - the document reference

getPageTemplateDocumentPath

public static java.lang.String getPageTemplateDocumentPath(int IdPageTemplateDocument)
Load document pageTemplatePath

Parameters:
IdPageTemplateDocument - the Id page template identifier


Copyright © 2009 Mairie de Paris. All Rights Reserved.