Class DocumentHome
java.lang.Object
fr.paris.lutece.plugins.document.business.DocumentHome
This class provides instances management methods (create, find, ...) for Document objects
-
Method Summary
Modifier and TypeMethodDescriptionstatic DocumentCreation of an instance of documentfindAll()Get the list of every documentsstatic Collection<Integer>Gets all documents idfindByFilter(DocumentFilter filter, Locale locale) Returns a collection of documents objectsstatic DocumentfindByPrimaryKey(int nKey) Returns an instance of a document whose identifier is specified in parameterstatic DocumentfindByPrimaryKeyWithoutBinaries(int nKey) Returns an instance of a document whose identifier is specified in parameterfindByRelatedCategories(Document document, 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.findBySpaceKey(int nSpaceId) Returns documents by space idstatic Collection<Integer>findPrimaryKeysByFilter(DocumentFilter filter, Locale locale) Returns a collection of documents idsstatic StringGet the max_allowed_packet value from MySQL configurationstatic StringgetPageTemplateDocumentPath(int idPageTemplateDocument) Load document pageTemplatePathstatic DocumentResourcegetResource(int nDocumentId) Get a document resourcestatic DocumentResourcegetValidatedResource(int nDocumentId, int nAttributeId) Get the validated resource of an attribute of a documentstatic DocumentResourcegetWorkingResource(int nDocumentId, int nAttributeId) Get the working resource of an attribute of a documentstatic voidloadAttributes(Document document) Load document attributesstatic voidloadAttributesWithoutBinaries(Document document, boolean bValidated) Load document attributesstatic DocumentloadLastModifiedAttributes(int nDocumentId) Load document type and date last modification for HTTP GET conditional request ("If-Modified-Since")static DocumentloadLastModifiedDocumentFromUser(String strUserName) Load the data of last Document the user worked in from the tablestatic DocumentLoad the data of last Document the user worked in from the tablestatic voidremove(int nDocumentId) Remove the Document whose identifier is specified in parameterstatic DocumentUpdate of the document which is specified in parameterstatic voidvalidateAttributes(int nIdDocument) Validate of the document attributes
-
Method Details
-
create
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
Update of the document which is specified in parameter- Parameters:
bUpdateContent- True to update content, false otherwisedocument- The instance of the document which contains the data to store- Returns:
- The instance of the document which has been updated
-
validateAttributes
public static void validateAttributes(int nIdDocument) Validate of the document attributes- Parameters:
nIdDocument- The id of the document
-
remove
public static void remove(int nDocumentId) Remove the Document whose identifier is specified in parameter- Parameters:
nDocumentId- The id of the document to remove
-
findByPrimaryKey
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
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
Returns documents by space id- Parameters:
nSpaceId- The space Id- Returns:
- A list of documents
-
findPrimaryKeysByFilter
Returns a collection of documents ids- Parameters:
filter- The filterlocale- The locale- Returns:
- A collection of documents ids
-
findByFilter
Returns a collection of documents objects- Parameters:
filter- The filterlocale- The locale- Returns:
- A collection of documents
-
findByRelatedCategories
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. -
getValidatedResource
Get the validated resource of an attribute of a document- Parameters:
nDocumentId- The id of the documentnAttributeId- The id of the attribute to get the resource of- Returns:
- the document resource, of null if none was found
-
getWorkingResource
Get the working resource of an attribute of a document- Parameters:
nDocumentId- The id of the documentnAttributeId- the id of the attribute- Returns:
- the document resource, of null if none was found
-
getResource
Get a document resource- Parameters:
nDocumentId- The id of the document- Returns:
- The document resource
-
findAllPrimaryKeys
Gets all documents id- Returns:
- A collection of Integer
-
findAll
Get the list of every documents- Returns:
- The list of every documents
-
loadAttributes
Load document attributes- Parameters:
document- the document reference
-
loadAttributesWithoutBinaries
Load document attributes- Parameters:
document- the document referencebValidated- true if the content of the document must be validated, false otherwise
-
getPageTemplateDocumentPath
Load document pageTemplatePath- Parameters:
idPageTemplateDocument- the Id page template identifier- Returns:
- the page template document path
-
loadLastModifiedAttributes
Load document type and date last modification for HTTP GET conditional request ("If-Modified-Since")- Parameters:
nDocumentId- The document id- Returns:
- the document
-
loadLastModifiedDocumentFromUser
Load the data of last Document the user worked in from the table- Parameters:
strUserName- the user name- Returns:
- the instance of the Document
-
loadLastPublishedDocument
Load the data of last Document the user worked in from the table- Returns:
- the instance of the Document
-
getMaxAllowedPacket
Get the max_allowed_packet value from MySQL configuration- Returns:
- the max_allowed_packet value as a String (e.g., "16777216" or "16M"), or null if unable to retrieve
-