Class NewsletterTopicService
- java.lang.Object
-
- fr.paris.lutece.plugins.newsletter.service.topic.NewsletterTopicService
-
- All Implemented Interfaces:
java.io.Serializable
public class NewsletterTopicService extends java.lang.Object implements java.io.SerializableService to manage newsletter content types- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringBEAN_NAMEName of the bean of this service
-
Constructor Summary
Constructors Constructor Description NewsletterTopicService()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateNewsletterTopic(NewsletterTopic newsletterTopic, fr.paris.lutece.portal.business.user.AdminUser user, java.util.Locale locale)Creates a new newsletter topicjava.lang.StringgetConfigurationPage(NewsletterTopic newsletterTopic, java.lang.String strBaseUrl, fr.paris.lutece.portal.business.user.AdminUser user, java.util.Locale locale)Get the configuration page of a topicfr.paris.lutece.util.ReferenceListgetNewsletterTopicTypeRefList(java.util.Locale locale)Get a reference list with every newsletter topic typesstatic NewsletterTopicServicegetService()Get the service from Spring contextjava.lang.StringgetTopicContent(NewsletterTopic newsletterTopic, fr.paris.lutece.portal.business.user.AdminUser user, java.util.Locale locale)Get the html content of a newsletter topicjava.lang.StringgetTopicTypeName(java.lang.String strTopicTypeCode)Get the name of the topic type from a topic type codevoidmodifyNewsletterTopicOrder(NewsletterTopic newsletterTopic, boolean bMoveUp)Move a topic up or down in its sectionvoidmodifyNewsletterTopicSection(NewsletterTopic newsletterTopic, int nSection)Modify the section of a topic of a newsletter.voidremoveNewsletterTopic(NewsletterTopic newsletterTopic, fr.paris.lutece.portal.business.user.AdminUser user)Removes a newsletter topic.voidsaveConfiguration(java.util.Map<java.lang.String,java.lang.String[]> mapParameters, NewsletterTopic newsletterTopic, fr.paris.lutece.portal.business.user.AdminUser user, java.util.Locale locale)Save the configuration of a topic
-
-
-
Field Detail
-
BEAN_NAME
public static final java.lang.String BEAN_NAME
Name of the bean of this service- See Also:
- Constant Field Values
-
-
Method Detail
-
getService
public static NewsletterTopicService getService()
Get the service from Spring context- Returns:
- An instance of the service
-
getNewsletterTopicTypeRefList
public fr.paris.lutece.util.ReferenceList getNewsletterTopicTypeRefList(java.util.Locale locale)
Get a reference list with every newsletter topic types- Parameters:
locale- The locale to get the topic types name in.- Returns:
- A reference list containing an item for each newsletter topic type.
-
createNewsletterTopic
public void createNewsletterTopic(NewsletterTopic newsletterTopic, fr.paris.lutece.portal.business.user.AdminUser user, java.util.Locale locale)
Creates a new newsletter topic- Parameters:
newsletterTopic- The newsletter topic to createuser- The current admin userlocale- The current locale
-
removeNewsletterTopic
public void removeNewsletterTopic(NewsletterTopic newsletterTopic, fr.paris.lutece.portal.business.user.AdminUser user)
Removes a newsletter topic.- Parameters:
newsletterTopic- The topic to removeuser- The current admin user
-
getConfigurationPage
public java.lang.String getConfigurationPage(NewsletterTopic newsletterTopic, java.lang.String strBaseUrl, fr.paris.lutece.portal.business.user.AdminUser user, java.util.Locale locale)
Get the configuration page of a topic- Parameters:
newsletterTopic- The topic to get the configuration page of.strBaseUrl- the base urluser- The current userlocale- The locale to use- Returns:
- The HTML content of the configuration page of the topic
-
saveConfiguration
public void saveConfiguration(java.util.Map<java.lang.String,java.lang.String[]> mapParameters, NewsletterTopic newsletterTopic, fr.paris.lutece.portal.business.user.AdminUser user, java.util.Locale locale)Save the configuration of a topic- Parameters:
mapParameters- The map of parameters of the the configuration. The map contains request parameter if it is a request context.newsletterTopic- The topic to save the configuration ofuser- The current user, or null if there is no current userlocale- The locale to use
-
modifyNewsletterTopicOrder
public void modifyNewsletterTopicOrder(NewsletterTopic newsletterTopic, boolean bMoveUp)
Move a topic up or down in its section- Parameters:
newsletterTopic- The topic to movebMoveUp- True to move the topic up (ie to decrease its order), false to move it down (ie to increase its order)
-
modifyNewsletterTopicSection
public void modifyNewsletterTopicSection(NewsletterTopic newsletterTopic, int nSection)
Modify the section of a topic of a newsletter. The order of the topic in its new section is the last one.- Parameters:
newsletterTopic- The topic to update with the old values of topic and order.nSection- The new section
-
getTopicContent
public java.lang.String getTopicContent(NewsletterTopic newsletterTopic, fr.paris.lutece.portal.business.user.AdminUser user, java.util.Locale locale)
Get the html content of a newsletter topic- Parameters:
newsletterTopic- The topic to get the content ofuser- The current userlocale- The locale to display the content in.- Returns:
- The html content of the topic
-
getTopicTypeName
public java.lang.String getTopicTypeName(java.lang.String strTopicTypeCode)
Get the name of the topic type from a topic type code- Parameters:
strTopicTypeCode- The code of the topic type to get the name of- Returns:
- The name of the topic type, or an empty string if no topic type is found.
-
-