Class SystemMessagesMailHelper
java.lang.Object
de.uplanet.lucy.server.share.businesslogic.systemmessage.SystemMessagesMailHelper
-
Constructor Summary
ConstructorDescriptionSystemMessagesMailHelper
(IBusinessLogicProcessingContext p_ctx, ApplicationInfo p_appInfo) -
Method Summary
Modifier and TypeMethodDescriptiongetAdministrationLinkTag
(String p_strStyleClass) Get the open tag for the link to the ProfileId.static String
getColor
(IBusinessLogicProcessingContext p_ctx, String p_strType, String p_strDefault) Get defined colors.getEventImage
(String p_strEventId, int p_iWidth, int p_iHeight) Get the image for the given event.getEventLinkTag
(String p_strEventId, String p_strStyleClass) Get the open tag for the link to the given event.getGroupImage
(String p_strGroupId, int p_iWidth, int p_iHeight) Get the image for the given group.getGroupLinkTag
(String p_strGroupId, String p_strStyleClass) Get the open tag for the link to the given group.Get the recipients for the languages.Get the recipients for the languages and time zones.Get the mail title.getMessageAndLoadImmediatelyRecipients
(String p_strRecId, boolean p_bReference) Get the system message and loads the immediately recipients.getMessageAndLoadImmediatelyRecipients
(String p_strRecId, IValueHolder<?> p_vhProfileId, IValueHolder<?> p_vhKey, IValueHolder<?> p_vhMessageText, IValueHolder<?> p_vhObjectId, IValueHolder<?> p_vhFeedRecId, IValueHolder<?> p_vhPluginGuid, IValueHolder<?> p_vhCount) Get the system message and loads the immediately recipients.getMessageImage
(String p_strMessageId, int p_iWidth, int p_iHeight) Get the image for the given message.getMessageLinkTag
(String p_strMessageId, String p_strStyleClass) Get the open tag for the link to the given message.getMessagesText
(String p_strType, String p_strSeparator) Get the rendered text of all system messages for the given type.getMessageText
(SystemMessage p_message) Get the rendered text for the given message.getObjectIds
(String p_strType) Get the object RecIds of all messages for the given type.getPluginGuids
(String p_strType) Get the plugin Guids of all messages for the given type.getPluginImage
(String p_strPluginGuid) Get the image for the given plugin.Set
<de.uplanet.lucy.server.share.businesslogic.profile.ProfileId> getProfileIds
(String p_strType) Get the ProfileIds of all messages for the given type.getProfileImage
(de.uplanet.lucy.server.share.businesslogic.profile.ProfileId p_profileId, int p_iWidth, int p_iHeight) Get the image for the given profile.getProfileImage
(String p_strProfileId, int p_iWidth, int p_iHeight) Get the image for the given profile.getProfileLinkTag
(de.uplanet.lucy.server.share.businesslogic.profile.ProfileId p_profileId, String p_strStyleClass) Get the open tag for the link to the ProfileId.Get the link to share start page.getSystemMessagesOverviewLink
(String p_strLinkStyleClass) Get the link to all system messages.getTypeForMessage
(SystemMessage p_message) boolean
Are there messages to sent as email.boolean
isAdministrationMessage
(SystemMessage p_message) void
loadMessagesForCurrentUser
(String p_strFrequenz) Loads the new message for the given interval and the current user.void
setLanguage
(String p_strLanguage) Set the language for rendering the mail.void
setLanguageAndTimeZone
(String p_strLanguage, String p_strTimeZoneId) Set the language for rendering the mail.
-
Constructor Details
-
SystemMessagesMailHelper
public SystemMessagesMailHelper(IBusinessLogicProcessingContext p_ctx, ApplicationInfo p_appInfo) throws de.uplanet.lucy.server.businesslogic.BlException - Throws:
de.uplanet.lucy.server.businesslogic.BlException
-
-
Method Details
-
loadMessagesForCurrentUser
Loads the new message for the given interval and the current user.- Parameters:
p_strFrequenz
-- Throws:
Exception
-
getMessageAndLoadImmediatelyRecipients
public SystemMessage getMessageAndLoadImmediatelyRecipients(String p_strRecId, IValueHolder<?> p_vhProfileId, IValueHolder<?> p_vhKey, IValueHolder<?> p_vhMessageText, IValueHolder<?> p_vhObjectId, IValueHolder<?> p_vhFeedRecId, IValueHolder<?> p_vhPluginGuid, IValueHolder<?> p_vhCount) throws Exception Get the system message and loads the immediately recipients. If there are no recipients for the message it returnsnull
.- Parameters:
p_strRecId
- The system message RecId.p_vhProfileId
- The ProfileId.p_vhKey
- The key.p_vhMessageText
- The text.p_vhObjectId
- The object RecId.p_vhFeedRecId
- The FeedRecId.p_vhPluginGuid
- The PluginGuid.p_vhCount
- The count.- Returns:
- the map with the language as key, and a list of recipient email addresses as value.
- Throws:
Exception
-
getMessageAndLoadImmediatelyRecipients
public SystemMessage getMessageAndLoadImmediatelyRecipients(String p_strRecId, boolean p_bReference) throws Exception Get the system message and loads the immediately recipients. If there are no recipients for the message it returnsnull
.- Parameters:
p_strRecId
- The system message RecId.p_bReference
- True if a new reference was added to a existing system message.- Returns:
- the map with the language as key, and a list of recipient email addresses as value.
- Throws:
Exception
-
hasNewMessages
public boolean hasNewMessages()Are there messages to sent as email.- Returns:
true
if there are messages to sent, otherwisefalse
.
-
getLanguageToRecipientMailMap
Get the recipients for the languages.- Returns:
- A map with the language as key and the mail addresses as value.
-
getLanguageToTimeZoneIdToRecipientMailMap
Get the recipients for the languages and time zones.- Returns:
- A map with the language as key and as value a second map with the time zone as key and the mail addresses as value.
-
getMessagesText
public String getMessagesText(String p_strType, String p_strSeparator) throws de.uplanet.lucy.server.businesslogic.BlException Get the rendered text of all system messages for the given type.- Parameters:
p_strType
- The type.p_strSeparator
- The separator between two messages.- Returns:
- the text of the system messages.
- Throws:
de.uplanet.lucy.server.businesslogic.BlException
-
getObjectIds
Get the object RecIds of all messages for the given type.- Parameters:
p_strType
- The type.- Returns:
- the list of object RecIds.
-
getPluginGuids
Get the plugin Guids of all messages for the given type.- Parameters:
p_strType
- The type.- Returns:
- the list of plugin Guids.
-
getProfileIds
public Set<de.uplanet.lucy.server.share.businesslogic.profile.ProfileId> getProfileIds(String p_strType) Get the ProfileIds of all messages for the given type.- Parameters:
p_strType
- The type.- Returns:
- the list of ProfileIds.
-
getEventImage
public File getEventImage(String p_strEventId, int p_iWidth, int p_iHeight) throws de.uplanet.lucy.server.businesslogic.BlException Get the image for the given event.- Parameters:
p_strEventId
- The event id.p_iWidth
- The scaled image width.p_iHeight
- The scaled image height.- Returns:
- the image or
null
, if no image is defined. - Throws:
de.uplanet.lucy.server.businesslogic.BlException
-
getGroupImage
public File getGroupImage(String p_strGroupId, int p_iWidth, int p_iHeight) throws de.uplanet.lucy.server.businesslogic.BlException Get the image for the given group.- Parameters:
p_strGroupId
- The group id.p_iWidth
- The scaled image width.p_iHeight
- The scaled image height.- Returns:
- the image or
null
, if no image is defined. - Throws:
de.uplanet.lucy.server.businesslogic.BlException
-
getMessageImage
public File getMessageImage(String p_strMessageId, int p_iWidth, int p_iHeight) throws de.uplanet.lucy.server.businesslogic.BlException Get the image for the given message.- Parameters:
p_strMessageId
- The message id.p_iWidth
- The scaled image width.p_iHeight
- The scaled image height.- Returns:
- the image or
null
, if no image is defined. - Throws:
de.uplanet.lucy.server.businesslogic.BlException
-
getPluginImage
public File getPluginImage(String p_strPluginGuid) throws de.uplanet.lucy.server.businesslogic.BlException Get the image for the given plugin.- Parameters:
p_strPluginGuid
- The plugin Guid.- Returns:
- the image or
null
, if no image is defined. - Throws:
de.uplanet.lucy.server.businesslogic.BlException
-
getProfileImage
public File getProfileImage(String p_strProfileId, int p_iWidth, int p_iHeight) throws de.uplanet.lucy.server.businesslogic.BlException Get the image for the given profile.- Parameters:
p_strProfileId
- The ProfileId as String.p_iWidth
- The scaled image width.p_iHeight
- The scaled image height.- Returns:
- the image or
null
, if no image is defined. - Throws:
de.uplanet.lucy.server.businesslogic.BlException
-
getEventLinkTag
public String getEventLinkTag(String p_strEventId, String p_strStyleClass) throws de.uplanet.lucy.server.share.text.RenderingException Get the open tag for the link to the given event.- Parameters:
p_strEventId
- The event id.p_strStyleClass
- The link style class.- Returns:
- the link open tag.
- Throws:
de.uplanet.lucy.server.share.text.RenderingException
-
getGroupLinkTag
public String getGroupLinkTag(String p_strGroupId, String p_strStyleClass) throws de.uplanet.lucy.server.share.text.RenderingException Get the open tag for the link to the given group.- Parameters:
p_strGroupId
- The group id.p_strStyleClass
- The link style class.- Returns:
- the link open tag.
- Throws:
de.uplanet.lucy.server.share.text.RenderingException
-
getMessageLinkTag
public String getMessageLinkTag(String p_strMessageId, String p_strStyleClass) throws de.uplanet.lucy.server.share.text.RenderingException Get the open tag for the link to the given message.- Parameters:
p_strMessageId
- The message id.p_strStyleClass
- The link style class.- Returns:
- the link open tag.
- Throws:
de.uplanet.lucy.server.share.text.RenderingException
-
getAdministrationLinkTag
public String getAdministrationLinkTag(String p_strStyleClass) throws de.uplanet.lucy.server.share.text.RenderingException Get the open tag for the link to the ProfileId.- Parameters:
p_strStyleClass
- The link style class.- Returns:
- the link open tag.
- Throws:
de.uplanet.lucy.server.share.text.RenderingException
-
getSystemMessagesOverviewLink
public String getSystemMessagesOverviewLink(String p_strLinkStyleClass) throws de.uplanet.lucy.server.share.text.RenderingException Get the link to all system messages.- Parameters:
p_strLinkStyleClass
- The link style class.- Returns:
- the link.
- Throws:
de.uplanet.lucy.server.share.text.RenderingException
-
getMailTitle
Get the mail title.- Returns:
- The title of the mail.
- Throws:
de.uplanet.lucy.server.share.text.RenderingException
-
setLanguage
Set the language for rendering the mail.- Parameters:
p_strLanguage
- The language to set.
-
setLanguageAndTimeZone
Set the language for rendering the mail.- Parameters:
p_strLanguage
- The language to set.p_strTimeZoneId
- The timozone id.
-
getColor
public static String getColor(IBusinessLogicProcessingContext p_ctx, String p_strType, String p_strDefault) Get defined colors.- Parameters:
p_ctx
- The BusinessLogicProcessingContext.p_strType
- The key to access the system data group.p_strDefault
- The default value.- Returns:
- The color if defined, otherwise the given default value.
-