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

java.lang.Object
  extended by fr.paris.lutece.plugins.document.business.DocumentDAO
All Implemented Interfaces:
IDocumentDAO

public final class DocumentDAO
extends java.lang.Object
implements IDocumentDAO

This class provides Data Access methods for Document objects


Constructor Summary
DocumentDAO()
           
 
Method Summary
 void delete(int nDocumentId)
          Delete a record from the table
 boolean documentIsPublished(int nDocumentId)
          Tests before deleting if an document is published in a portlet
 java.lang.String getPageTemplateDocumentPath(int IdPageTemplateDocument)
          Load document pageTemplatePath
 void insert(Document document)
          Insert a new record in the table.
 Document load(int nDocumentId)
          Load the data of Document from the table
 void loadAttributes(Document document)
          Load document attributes
 DocumentResource loadResource(int nDocumentId)
          Load a resource (image, file, ...) corresponding to an attribute of a Document
 DocumentResource loadSpecificResource(int nDocumentId, int nAttributeId)
          Load a resource (image, file, ...) corresponding to an attribute of a Document
 int newPrimaryKey()
          Generates a new primary key
 java.util.List<Document> selectAll()
          Gets all documents
 java.util.List<Document> selectByFilter(DocumentFilter filter)
          Load the list of documents
 java.util.List<Document> selectPublishedByRelatedCategories(Document document)
          Load the list of published documents in relation with categories of specified document
 void store(Document document, boolean bUpdateContent)
          Update the record in the table
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentDAO

public DocumentDAO()
Method Detail

newPrimaryKey

public int newPrimaryKey()
Generates a new primary key

Specified by:
newPrimaryKey in interface IDocumentDAO
Returns:
The new primary key

insert

public void insert(Document document)
Insert a new record in the table.

Specified by:
insert in interface IDocumentDAO
Parameters:
document - The document object

load

public Document load(int nDocumentId)
Load the data of Document from the table

Specified by:
load in interface IDocumentDAO
Parameters:
nDocumentId - The identifier of Document
Returns:
the instance of the Document

loadAttributes

public void loadAttributes(Document document)
Description copied from interface: IDocumentDAO
Load document attributes

Specified by:
loadAttributes in interface IDocumentDAO
Parameters:
document - the reference of the document

delete

public void delete(int nDocumentId)
Delete a record from the table

Specified by:
delete in interface IDocumentDAO
Parameters:
nDocumentId - the document identifier

store

public void store(Document document,
                  boolean bUpdateContent)
Update the record in the table

Specified by:
store in interface IDocumentDAO
Parameters:
document - The reference of document
bUpdateContent - the boolean

selectByFilter

public java.util.List<Document> selectByFilter(DocumentFilter filter)
Load the list of documents

Specified by:
selectByFilter in interface IDocumentDAO
Parameters:
filter - The DocumentFilter Object
Returns:
The Collection of the Documents

selectPublishedByRelatedCategories

public java.util.List<Document> selectPublishedByRelatedCategories(Document document)
Load the list of published documents in relation with categories of specified document

Specified by:
selectPublishedByRelatedCategories in interface IDocumentDAO
Parameters:
document - The document with the categories
Returns:
The Collection of the Documents

loadResource

public DocumentResource loadResource(int nDocumentId)
Load a resource (image, file, ...) corresponding to an attribute of a Document

Specified by:
loadResource in interface IDocumentDAO
Parameters:
nDocumentId - The Document Id
Returns:
the instance of the DocumentResource

loadSpecificResource

public DocumentResource loadSpecificResource(int nDocumentId,
                                             int nAttributeId)
Load a resource (image, file, ...) corresponding to an attribute of a Document

Specified by:
loadSpecificResource in interface IDocumentDAO
Parameters:
nDocumentId - The Document Id
nAttributeId - The Attribute Id
Returns:
the instance of the DocumentResource

selectAll

public java.util.List<Document> selectAll()
Gets all documents

Specified by:
selectAll in interface IDocumentDAO
Returns:
the document list

documentIsPublished

public boolean documentIsPublished(int nDocumentId)
Tests before deleting if an document is published in a portlet

Specified by:
documentIsPublished in interface IDocumentDAO
Parameters:
nDocumentId - The identifier of the document
Returns:
true if the document is already published, false otherwise

getPageTemplateDocumentPath

public java.lang.String getPageTemplateDocumentPath(int IdPageTemplateDocument)
Description copied from interface: IDocumentDAO
Load document pageTemplatePath

Specified by:
getPageTemplateDocumentPath in interface IDocumentDAO
Parameters:
IdPageTemplateDocument - the Id page template identifier


Copyright © 2007 Mairie de Paris. All Rights Reserved.