fr.paris.lutece.plugins.document.business.portlet
Class DocumentListPortletDAO

java.lang.Object
  extended by fr.paris.lutece.plugins.document.business.portlet.DocumentListPortletDAO
All Implemented Interfaces:
IDocumentListPortletDAO, fr.paris.lutece.portal.business.portlet.IPortletInterfaceDAO

public final class DocumentListPortletDAO
extends java.lang.Object
implements IDocumentListPortletDAO

This class provides Data Access methods for ArticlesListPortlet objects


Constructor Summary
DocumentListPortletDAO()
           
 
Method Summary
 boolean checkAssignIntoPortlet(int nDocumentId, int nPortletId)
          Tests before insert it, if an article is already assigned in a portlet
 boolean checkPublishingIntoPortlet(int nDocumentId, int nPortletId)
          Tests before insert it, if an document is already published in a portlet
 void delete(int nPortletId)
          Deletes records for a portlet identifier in the tables portlet_articles_list, published_article_portlet, auto_publishing
 void deleteFromPortlet(int nDocumentId, int nPortletId)
          Deletes an document assigned from a portlet
 void getModifyDocumentOrder(int nNewOrder, int nDocumentId, int nPortletId)
          Modify the order of a document
 void insert(fr.paris.lutece.portal.business.portlet.Portlet portlet)
          Insert a new record in the table portlet_articles_list
 void insertIntoPortlet(int nDocumentId, int nPortletId, int nStatus)
          Insert the documents whose identifier is specified in parameter in a portlet for assignes
 fr.paris.lutece.portal.business.portlet.Portlet load(int nPortletId)
          Loads the data of Document List Portlet whose identifier is specified in parameter
 int maxOrderDocumentList(int nPortletId)
          Calculate the new max order
 void publishedIntoPortlet(int nDocumentId, int nPortletId, int nStatus)
          Published the documents whose identifier is specified in parameter in a portlet for publishing : set status to 0
 java.util.Collection selectAssignedDocumentsList(int nPortletId)
          Load the list of documentTypes
 java.util.Collection<Document> selectByPortlet(int nPortletId)
          Returns all the documents of a portlet whose identifier is specified
 DocumentListPortlet selectDocument(int nDocumentId, int nPortletId)
          Load the data of DocumentListPortlet from the table
 java.util.Collection<Document> selectDocumentsByPortlet(int nPortletId)
          Returns all the documents of a portlet whose identifier is specified
 java.util.Collection selectDocumentTypeListByCode(int nDocumentId, java.lang.String strCodeDocumentType)
          Load the list of documentTypes
 int selectIdByOrder(int nDocumentOrder, int nPortletId)
          Returns a document identifier in a distinct order
 java.util.Collection selectPortletsListByDocumentId(java.lang.String strDocumentId)
          Loads the list of the portlets whose type is the same as the one specified in parameter
 java.util.Collection selectPublishedDocumentsList(int nPortletId)
          Loads the list of the documents whose type is the same as the one specified in parameter
 void store(fr.paris.lutece.portal.business.portlet.Portlet portlet)
          Update the record in the table
 void unPublishedIntoPortlet(int nDocumentId, int nPortletId, int nStatus)
          UnPublished the documents whose identifier is specified in parameter in a portlet for publishing : set status to 1 and order to -1
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentListPortletDAO

public DocumentListPortletDAO()
Method Detail

insert

public void insert(fr.paris.lutece.portal.business.portlet.Portlet portlet)
Insert a new record in the table portlet_articles_list

Specified by:
insert in interface IDocumentListPortletDAO
Specified by:
insert in interface fr.paris.lutece.portal.business.portlet.IPortletInterfaceDAO
Parameters:
portlet - the instance of the Portlet object to insert

delete

public void delete(int nPortletId)
Deletes records for a portlet identifier in the tables portlet_articles_list, published_article_portlet, auto_publishing

Specified by:
delete in interface IDocumentListPortletDAO
Specified by:
delete in interface fr.paris.lutece.portal.business.portlet.IPortletInterfaceDAO
Parameters:
nPortletId - the portlet identifier

load

public fr.paris.lutece.portal.business.portlet.Portlet load(int nPortletId)
Loads the data of Document List Portlet whose identifier is specified in parameter

Specified by:
load in interface IDocumentListPortletDAO
Specified by:
load in interface fr.paris.lutece.portal.business.portlet.IPortletInterfaceDAO
Parameters:
nPortletId - The Portlet identifier
Returns:
theDocumentListPortlet object

store

public void store(fr.paris.lutece.portal.business.portlet.Portlet portlet)
Update the record in the table

Specified by:
store in interface IDocumentListPortletDAO
Specified by:
store in interface fr.paris.lutece.portal.business.portlet.IPortletInterfaceDAO
Parameters:
portlet - A portlet

selectDocumentTypeListByCode

public java.util.Collection selectDocumentTypeListByCode(int nDocumentId,
                                                         java.lang.String strCodeDocumentType)
Load the list of documentTypes

Specified by:
selectDocumentTypeListByCode in interface IDocumentListPortletDAO
Parameters:
strCodeDocumentType - The code
Returns:
The Collection of the DocumentTypes

selectPortletsListByDocumentId

public java.util.Collection selectPortletsListByDocumentId(java.lang.String strDocumentId)
Loads the list of the portlets whose type is the same as the one specified in parameter

Specified by:
selectPortletsListByDocumentId in interface IDocumentListPortletDAO
Parameters:
strDocumentId - the document identifier
Returns:
the list of the portlets in form of a List

selectPublishedDocumentsList

public java.util.Collection selectPublishedDocumentsList(int nPortletId)
Loads the list of the documents whose type is the same as the one specified in parameter

Specified by:
selectPublishedDocumentsList in interface IDocumentListPortletDAO
Parameters:
nPortletId - the portlet identifier
Returns:
the list of the documents in form of a List

selectAssignedDocumentsList

public java.util.Collection selectAssignedDocumentsList(int nPortletId)
Load the list of documentTypes

Specified by:
selectAssignedDocumentsList in interface IDocumentListPortletDAO
Parameters:
nPortletId - The portlet identifier
Returns:
The Collection of the DocumentTypes

checkPublishingIntoPortlet

public boolean checkPublishingIntoPortlet(int nDocumentId,
                                          int nPortletId)
Tests before insert it, if an document is already published in a portlet

Specified by:
checkPublishingIntoPortlet in interface IDocumentListPortletDAO
Parameters:
nDocumentId - The identifier of the document
nPortletId - The identifier of the portlet
Returns:
true if the article is already published, false otherwise

checkAssignIntoPortlet

public boolean checkAssignIntoPortlet(int nDocumentId,
                                      int nPortletId)
Tests before insert it, if an article is already assigned in a portlet

Specified by:
checkAssignIntoPortlet in interface IDocumentListPortletDAO
Parameters:
nDocumentId - The identifier of the document
nPortletId - The identifier of the portlet
Returns:
true if the article is already published, false otherwise

insertIntoPortlet

public void insertIntoPortlet(int nDocumentId,
                              int nPortletId,
                              int nStatus)
Insert the documents whose identifier is specified in parameter in a portlet for assignes

Specified by:
insertIntoPortlet in interface IDocumentListPortletDAO
Parameters:
nDocumentId - the identifier of the document
nPortletId - the identifier of the portlet

deleteFromPortlet

public void deleteFromPortlet(int nDocumentId,
                              int nPortletId)
Deletes an document assigned from a portlet

Specified by:
deleteFromPortlet in interface IDocumentListPortletDAO
Parameters:
nDocumentId - the identifier of the document to delete
nPortletId - the identifier of the portlet

publishedIntoPortlet

public void publishedIntoPortlet(int nDocumentId,
                                 int nPortletId,
                                 int nStatus)
Published the documents whose identifier is specified in parameter in a portlet for publishing : set status to 0

Specified by:
publishedIntoPortlet in interface IDocumentListPortletDAO
Parameters:
document - the DocumentListPortlet object
nPortletId - the identifier of the portlet
nStatus - the publishing status : 1 for unpublished - 0 for published

unPublishedIntoPortlet

public void unPublishedIntoPortlet(int nDocumentId,
                                   int nPortletId,
                                   int nStatus)
UnPublished the documents whose identifier is specified in parameter in a portlet for publishing : set status to 1 and order to -1

Specified by:
unPublishedIntoPortlet in interface IDocumentListPortletDAO
Parameters:
document - the DocumentListPortlet object
nPortletId - the identifier of the portlet
nStatus - the publishing status : 1 for unpublished - 0 for published

maxOrderDocumentList

public int maxOrderDocumentList(int nPortletId)
Calculate the new max order

Specified by:
maxOrderDocumentList in interface IDocumentListPortletDAO
Parameters:
nPortletId - the portlet identifer
Returns:
the max order of document

selectByPortlet

public java.util.Collection<Document> selectByPortlet(int nPortletId)
Returns all the documents of a portlet whose identifier is specified

Specified by:
selectByPortlet in interface IDocumentListPortletDAO
Parameters:
nPortletId - the identifier of the portlet
Returns:
the document list in form of a Collection object

selectDocumentsByPortlet

public java.util.Collection<Document> selectDocumentsByPortlet(int nPortletId)
Returns all the documents of a portlet whose identifier is specified

Specified by:
selectDocumentsByPortlet in interface IDocumentListPortletDAO
Parameters:
nPortletId - the identifier of the portlet
Returns:
the document list in form of a Collection object

selectDocument

public DocumentListPortlet selectDocument(int nDocumentId,
                                          int nPortletId)
Load the data of DocumentListPortlet from the table

Specified by:
selectDocument in interface IDocumentListPortletDAO
Parameters:
nDocumentId - The identifier of DocumentListPortlet
nPortletId - the identifier of portlet
Returns:
the instance of the DocumentListPortlet

selectIdByOrder

public int selectIdByOrder(int nDocumentOrder,
                           int nPortletId)
Returns a document identifier in a distinct order

Specified by:
selectIdByOrder in interface IDocumentListPortletDAO
Parameters:
nDocumentOrder - The order number
nPortletId - the portlet identifier
Returns:
The order of the Document

getModifyDocumentOrder

public void getModifyDocumentOrder(int nNewOrder,
                                   int nDocumentId,
                                   int nPortletId)
Modify the order of a document

Specified by:
getModifyDocumentOrder in interface IDocumentListPortletDAO
Parameters:
nNewOrder - The order number
nDocumentId - The document identifier
nPortletId - the portlet identifier


Copyright © 2007 Mairie de Paris. All Rights Reserved.