fr.paris.lutece.plugins.greetingscard.business
Class GreetingsCardHome

java.lang.Object
  extended by fr.paris.lutece.plugins.greetingscard.business.GreetingsCardHome

public final class GreetingsCardHome
extends java.lang.Object

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


Method Summary
static GreetingsCard create(GreetingsCard greetingsCard, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Creates a greetings card in the database
static java.util.Collection<GreetingsCard> findAll(fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Returns GreetingsCard list
static java.util.Collection<GreetingsCard> findByGreetingsCardTemplateId(int nIdGreetingsCardTemplate, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Returns the list of greetings cards of a greetings card template
static GreetingsCard findByPrimaryKey(java.lang.String strKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Returns an instance of the article GreetingsCard whose identifier is specified in parameter
static java.util.Collection<GreetingsCard> findByTemplateAndDate(int nIdGreetingsCardTemplate, java.util.Date dateMin, java.util.Date dateMax, int nResultsLimit, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get greetings card with a given template and sent between two given dates
static java.util.Collection<GreetingsCard> findCardsToSendNotification(fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the collection of greetings cards that has been red and that has the notify sender flag set.
static java.util.List<java.lang.String> findDomainNameOfMailSent(GreetingsCardFilter greetingsCardFilter, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Returns the list of domain name of mail sent
static java.util.Map<java.lang.String,java.lang.Integer> findNumberOfMailReadByDomain(GreetingsCardFilter greetingsCardFilter, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Return the number of mail red for each domains
static java.util.Map<java.lang.String,java.lang.Integer> findNumberOfMailSentByDomain(GreetingsCardFilter greetingsCardFilter, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Return the number of mail sent for each domains
static int findNumberTotalOfMailSentWithoutCopy(fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the total number of cards sent without archives.
static void remove(java.lang.String strIdGC, fr.paris.lutece.portal.service.plugin.Plugin plugin)
           
static void removeList(java.lang.String strIdGC, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Remove a list of greetings card
static GreetingsCard update(GreetingsCard greetingsCard, fr.paris.lutece.portal.service.plugin.Plugin plugin)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static GreetingsCard create(GreetingsCard greetingsCard,
                                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
Creates a greetings card in the database

Parameters:
greetingsCard - An instance of the GreetingsCard which contains the informations to insert
plugin - The plugin
Returns:
The instance of the GreetingsCard which has been created.

update

public static GreetingsCard update(GreetingsCard greetingsCard,
                                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
Parameters:
greetingsCard - An instance of the GreetingsCard which contains the informations to store
plugin - The plugin
Returns:
The instance of the GreetingsCard which has been updated.

remove

public static void remove(java.lang.String strIdGC,
                          fr.paris.lutece.portal.service.plugin.Plugin plugin)
Parameters:
strIdGC - The Id of the deleted greeting card
plugin - The plugin

removeList

public static void removeList(java.lang.String strIdGC,
                              fr.paris.lutece.portal.service.plugin.Plugin plugin)
Remove a list of greetings card

Parameters:
strIdGC - The comma separated list of greetings cards ids
plugin - The plugin

findByPrimaryKey

public static GreetingsCard findByPrimaryKey(java.lang.String strKey,
                                             fr.paris.lutece.portal.service.plugin.Plugin plugin)
Returns an instance of the article GreetingsCard whose identifier is specified in parameter

Parameters:
strKey - The primary key of the article to find in the database
plugin - The plugin
Returns:
An instance of the GreetingsCard which corresponds to the key

findAll

public static java.util.Collection<GreetingsCard> findAll(fr.paris.lutece.portal.service.plugin.Plugin plugin)
Returns GreetingsCard list

Parameters:
plugin - The plugin
Returns:
the list of the GreetingsCard of the database in form of a GreetingsCard Collection object

findByGreetingsCardTemplateId

public static java.util.Collection<GreetingsCard> findByGreetingsCardTemplateId(int nIdGreetingsCardTemplate,
                                                                                fr.paris.lutece.portal.service.plugin.Plugin plugin)
Returns the list of greetings cards of a greetings card template

Parameters:
nIdGreetingsCardTemplate - The greetings card template identifier
plugin - The plugin
Returns:
A Collection of greetings cards

findDomainNameOfMailSent

public static java.util.List<java.lang.String> findDomainNameOfMailSent(GreetingsCardFilter greetingsCardFilter,
                                                                        fr.paris.lutece.portal.service.plugin.Plugin plugin)
Returns the list of domain name of mail sent

Parameters:
greetingsCardFilter - The greetings card filter
plugin - The plugin
Returns:
A Collection of greetings cards

findNumberOfMailSentByDomain

public static java.util.Map<java.lang.String,java.lang.Integer> findNumberOfMailSentByDomain(GreetingsCardFilter greetingsCardFilter,
                                                                                             fr.paris.lutece.portal.service.plugin.Plugin plugin)
Return the number of mail sent for each domains

Parameters:
greetingsCardFilter - The greetings card filter
plugin - The plugin
Returns:
A map containing associations of domain names and numbers of email sent. Only cards matching the filter are considered.

findNumberTotalOfMailSentWithoutCopy

public static int findNumberTotalOfMailSentWithoutCopy(fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the total number of cards sent without archives. Copies are ignored

Parameters:
plugin - The plugin
Returns:
The number of cards sent without copies and archives.

findNumberOfMailReadByDomain

public static java.util.Map<java.lang.String,java.lang.Integer> findNumberOfMailReadByDomain(GreetingsCardFilter greetingsCardFilter,
                                                                                             fr.paris.lutece.portal.service.plugin.Plugin plugin)
Return the number of mail red for each domains

Parameters:
greetingsCardFilter - The greetings card filter
plugin - The plugin
Returns:
A map containing associations of domain names and numbers of email red. Only cards matching the filter are considered.

findCardsToSendNotification

public static java.util.Collection<GreetingsCard> findCardsToSendNotification(fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the collection of greetings cards that has been red and that has the notify sender flag set.

Parameters:
nStatus - Status
plugin - The plugin
Returns:
The collection of greetings cards that has been red and that has the notify sender flag set. The collection may be empty.

findByTemplateAndDate

public static java.util.Collection<GreetingsCard> findByTemplateAndDate(int nIdGreetingsCardTemplate,
                                                                        java.util.Date dateMin,
                                                                        java.util.Date dateMax,
                                                                        int nResultsLimit,
                                                                        fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get greetings card with a given template and sent between two given dates

Parameters:
nIdGreetingsCardTemplate - Id of the template of greetings cards
dateMin - Minimum sent date. If the date is null, then it is ignored
dateMax - Maximum sent date. If the date is null, then it is ignored
nResultsLimit - Maximum number of results returned. If the number is 0, then every object is considered
plugin - The plugin
Returns:
The collection of greetings cards. Messages and messages 2 of greetings cards are not loaded.


Copyright © 2012 Mairie de Paris. All Rights Reserved.