de.uplanet.lucy.server.mail
Class MailUtil

java.lang.Object
  extended by de.uplanet.lucy.server.mail.MailUtil

@Scriptable
public final class MailUtil
extends java.lang.Object

Version:
$Revision: 92937 $

Method Summary
static java.lang.String buildSubject(de.uplanet.lucy.server.businesslogic.IBusinessLogicProcessingContext p_ctx, java.lang.String p_strStaticPart, IValueHolder<?> p_vhDynamicPart)
           
static java.lang.String checkLevelOfTargetPage(de.uplanet.lucy.server.businesslogic.IBusinessLogicProcessingContext p_ctx, java.lang.String p_strAppGuid, java.lang.String p_strSrcPageGuid, java.lang.String p_strTargetGuid, java.lang.String p_strRecIdForMail)
          Checks if the level of the targetpage and the level of the sourcepage is different.
static java.util.Set<java.lang.String> getAddressesFromField(de.uplanet.lucy.server.businesslogic.IBusinessLogicProcessingContext p_ctx, java.lang.String p_strAppGuid, java.lang.String p_strDgGuid, java.lang.String p_strFieldGuid, de.uplanet.lucy.server.businesslogic.rtdata.jdbc.filter.IFilterElement p_filter, java.util.TimeZone p_tz)
          Get a set of non-empty mail addresses from the given field.
static java.lang.String getApplicationResponsibleAddress(de.uplanet.jdbc.JdbcConnection p_conn, java.lang.String p_strAppGuid)
           
static java.util.SortedSet<java.lang.String> getBossAddresses(de.uplanet.jdbc.JdbcConnection p_conn, IUser p_user)
           
static java.lang.String getDefaultSenderAddress()
           
static java.lang.String getDeputyAddress(de.uplanet.jdbc.JdbcConnection p_conn, IUser p_user)
          Get the mail address of the given user's deputy.
static IDataRangeDataService getDistinctDataRangeList(de.uplanet.lucy.server.businesslogic.IBusinessLogicProcessingContext p_ctx, de.uplanet.lucy.server.mail.MailRecipientInfo p_mailRcp, java.util.TimeZone p_tz)
          Deprecated. 
static IDataRangeDataService getDistinctDataRangeList(de.uplanet.lucy.server.businesslogic.IBusinessLogicProcessingContext p_ctx, java.lang.String p_strFieldGuid, de.uplanet.lucy.server.businesslogic.rtdata.jdbc.filter.IFilterElement p_filter, java.util.TimeZone p_tz)
          Note: text columns are not selected DISTINCT if the database does not support it.
static IDataRangeDataService getDistinctDataRangeList(de.uplanet.lucy.server.businesslogic.IBusinessLogicProcessingContext p_ctx, java.lang.String p_strAppGuid, java.lang.String p_strDgGuid, java.lang.String p_strFieldGuid, de.uplanet.lucy.server.businesslogic.rtdata.jdbc.filter.IFilterElement p_filter, java.util.TimeZone p_tz)
          Deprecated. 
static de.uplanet.lucy.server.mail.MailInfo getMailInfoFromDatabase(de.uplanet.lucy.server.IProcessingContext p_ctx, java.lang.String p_strGuid)
          Read a mail info object from the database.
static de.uplanet.lucy.server.mail.MailRecipientInfo getRecipientsFromDatabase(de.uplanet.jdbc.JdbcConnection p_conn, IUser p_user, java.lang.String p_strGuid, java.lang.String p_strType)
           
static java.lang.String getRenderedValue(de.uplanet.lucy.server.businesslogic.IBusinessLogicProcessingContext p_ctx, IValueHolder<?> p_vh)
           
static java.util.List<java.lang.String> getUserMailBizFromDistributionList(de.uplanet.jdbc.JdbcConnection p_conn, java.lang.String p_strList)
          Parse a pipe-separated list of org structure GUIDs and get the user mail addresses determined by it.
static IValueHolder<?> getValueHolderFromField(de.uplanet.lucy.server.businesslogic.IBusinessLogicProcessingContext p_ctx, java.lang.String p_strAppGuid, java.lang.String p_strDgGuid, java.lang.String p_strFieldGuid, java.lang.String p_strRecId)
           
static boolean isDistributionList(java.lang.String p_strList)
          Check if the given string represents a ||-separated distribution list.
static java.util.List<java.lang.String> parseSemicolonOrLinefeedSeparatedAddresses(java.lang.String p_strAddresses)
          Parse a list of semicolon-separated, or line-feed-separated mail addresses.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDefaultSenderAddress

public static java.lang.String getDefaultSenderAddress()

parseSemicolonOrLinefeedSeparatedAddresses

public static java.util.List<java.lang.String> parseSemicolonOrLinefeedSeparatedAddresses(java.lang.String p_strAddresses)
Parse a list of semicolon-separated, or line-feed-separated mail addresses.

Parameters:
p_strAddresses - A semicolon separated list of mail addresses.
Returns:
A list that contains the (non-empty) parsed addresses.

isDistributionList

public static boolean isDistributionList(java.lang.String p_strList)
Check if the given string represents a ||-separated distribution list.

Parameters:
p_strList - The string to be checked.
Returns:
true if the given string represents a ||-separated distribution list, or false otherwise.

getUserMailBizFromDistributionList

public static java.util.List<java.lang.String> getUserMailBizFromDistributionList(de.uplanet.jdbc.JdbcConnection p_conn,
                                                                                  java.lang.String p_strList)
                                                                           throws java.sql.SQLException,
                                                                                  java.io.IOException
Parse a pipe-separated list of org structure GUIDs and get the user mail addresses determined by it.

Parameters:
p_strList - A list of org structure GUIDs.
Returns:
A list that contains the (non-empty) addresses.
Throws:
java.io.IOException
java.sql.SQLException

buildSubject

public static final java.lang.String buildSubject(de.uplanet.lucy.server.businesslogic.IBusinessLogicProcessingContext p_ctx,
                                                  java.lang.String p_strStaticPart,
                                                  IValueHolder<?> p_vhDynamicPart)
                                           throws java.lang.Exception
Throws:
java.lang.Exception

getMailInfoFromDatabase

public static de.uplanet.lucy.server.mail.MailInfo getMailInfoFromDatabase(de.uplanet.lucy.server.IProcessingContext p_ctx,
                                                                           java.lang.String p_strGuid)
                                                                    throws java.sql.SQLException,
                                                                           DsException,
                                                                           NotFoundException
Read a mail info object from the database.

Parameters:
p_ctx - The processing context.
p_strGuid - The GUID of the requested mail info.
Returns:
A mail inf object.
Throws:
java.sql.SQLException - If a database error occurred.
DsException
NotFoundException - If the deputy of the user in the context was not found in the database.

getRecipientsFromDatabase

public static de.uplanet.lucy.server.mail.MailRecipientInfo getRecipientsFromDatabase(de.uplanet.jdbc.JdbcConnection p_conn,
                                                                                      IUser p_user,
                                                                                      java.lang.String p_strGuid,
                                                                                      java.lang.String p_strType)
                                                                               throws java.sql.SQLException,
                                                                                      DsException,
                                                                                      NotFoundException
Parameters:
p_conn - The database connection to be used.
p_user - An user, if boss or deputy mails should be sent. If this parameter is null, and boss or deputy are configured as recipients, an IllegalProcessingContextException will be thrown.
p_strGuid - The unique identifier of the recipient configuration.
p_strType - The recipient type, i.e. either To, or Cc, or Bcc.
Returns:
The recipient configuration from the database, or null if none was found.
Throws:
java.sql.SQLException - If a database error occurred.
DsException - E.g. if boss information could not be retrieved.
NotFoundException - If the deputy of the given user was not found in the database.

getBossAddresses

public static java.util.SortedSet<java.lang.String> getBossAddresses(de.uplanet.jdbc.JdbcConnection p_conn,
                                                                     IUser p_user)
                                                              throws java.sql.SQLException,
                                                                     DsException
Parameters:
p_conn - The database connection to be used.
p_user - The user.
Returns:
A possibly empty list of boss e-mail addresses.
Throws:
java.sql.SQLException
DsException

getDeputyAddress

public static java.lang.String getDeputyAddress(de.uplanet.jdbc.JdbcConnection p_conn,
                                                IUser p_user)
                                         throws java.sql.SQLException,
                                                NotFoundException
Get the mail address of the given user's deputy.

Parameters:
p_conn - The database connection to be used.
p_user - The user.
Returns:
The given user's deputy, or null if there is none.
Throws:
java.sql.SQLException - If a database error occurred.
NotFoundException - If the deputy was not found in the database.

getApplicationResponsibleAddress

public static java.lang.String getApplicationResponsibleAddress(de.uplanet.jdbc.JdbcConnection p_conn,
                                                                java.lang.String p_strAppGuid)
                                                         throws java.sql.SQLException
Throws:
java.sql.SQLException

getDistinctDataRangeList

public static IDataRangeDataService getDistinctDataRangeList(de.uplanet.lucy.server.businesslogic.IBusinessLogicProcessingContext p_ctx,
                                                             java.lang.String p_strFieldGuid,
                                                             de.uplanet.lucy.server.businesslogic.rtdata.jdbc.filter.IFilterElement p_filter,
                                                             java.util.TimeZone p_tz)
                                                      throws java.lang.Exception
Note: text columns are not selected DISTINCT if the database does not support it.

Parameters:
p_ctx - The processing context.
p_strFieldGuid - The field GUID.
p_filter - A filter to be applied, or null.
p_tz - The current user's time zone.
Returns:
An object that gives access to the requested data.
Throws:
java.lang.Exception - If an error occurred.

getDistinctDataRangeList

@Deprecated
public static IDataRangeDataService getDistinctDataRangeList(de.uplanet.lucy.server.businesslogic.IBusinessLogicProcessingContext p_ctx,
                                                                        de.uplanet.lucy.server.mail.MailRecipientInfo p_mailRcp,
                                                                        java.util.TimeZone p_tz)
                                                      throws java.lang.Exception
Deprecated. 

Throws:
java.lang.Exception

getDistinctDataRangeList

@Deprecated
public static IDataRangeDataService getDistinctDataRangeList(de.uplanet.lucy.server.businesslogic.IBusinessLogicProcessingContext p_ctx,
                                                                        java.lang.String p_strAppGuid,
                                                                        java.lang.String p_strDgGuid,
                                                                        java.lang.String p_strFieldGuid,
                                                                        de.uplanet.lucy.server.businesslogic.rtdata.jdbc.filter.IFilterElement p_filter,
                                                                        java.util.TimeZone p_tz)
                                                      throws java.lang.Exception
Deprecated. 

Throws:
java.lang.Exception

getAddressesFromField

public static java.util.Set<java.lang.String> getAddressesFromField(de.uplanet.lucy.server.businesslogic.IBusinessLogicProcessingContext p_ctx,
                                                                    java.lang.String p_strAppGuid,
                                                                    java.lang.String p_strDgGuid,
                                                                    java.lang.String p_strFieldGuid,
                                                                    de.uplanet.lucy.server.businesslogic.rtdata.jdbc.filter.IFilterElement p_filter,
                                                                    java.util.TimeZone p_tz)
                                                             throws java.lang.Exception
Get a set of non-empty mail addresses from the given field.

The addresses are parsed as a case insensitive semicolon, or line-feed separated list of strings, or as a ||-delimited list of org structure GUIDs.

Parameters:
p_ctx - The processing context.
p_strAppGuid - The GUID of the application.
p_strDgGuid - The GUID of the data group.
p_strFieldGuid - The field GUID.
p_filter - A filter to be applied, or null.
p_tz - The current user's time zone.
Returns:
A set that contains non-empty mail adresses.
Throws:
java.lang.Exception - If an error occurred.

getRenderedValue

public static java.lang.String getRenderedValue(de.uplanet.lucy.server.businesslogic.IBusinessLogicProcessingContext p_ctx,
                                                IValueHolder<?> p_vh)
                                         throws java.lang.Exception
Throws:
java.lang.Exception

getValueHolderFromField

public static IValueHolder<?> getValueHolderFromField(de.uplanet.lucy.server.businesslogic.IBusinessLogicProcessingContext p_ctx,
                                                      java.lang.String p_strAppGuid,
                                                      java.lang.String p_strDgGuid,
                                                      java.lang.String p_strFieldGuid,
                                                      java.lang.String p_strRecId)
                                               throws java.lang.Exception
Throws:
java.lang.Exception

checkLevelOfTargetPage

public static java.lang.String checkLevelOfTargetPage(de.uplanet.lucy.server.businesslogic.IBusinessLogicProcessingContext p_ctx,
                                                      java.lang.String p_strAppGuid,
                                                      java.lang.String p_strSrcPageGuid,
                                                      java.lang.String p_strTargetGuid,
                                                      java.lang.String p_strRecIdForMail)
                                               throws java.lang.Exception
Checks if the level of the targetpage and the level of the sourcepage is different. If so it gets the recid of the parentfield of that level of the targetpage for the given recordid.

Parameters:
p_strSrcPageGuid - Database GUID of the sourcepage
p_strRecIdForMail - current Recid of the record of the mail.
Returns:
null, if the level is teh same otherwise the value of the parentid for the level of the targetpage.
Throws:
java.lang.Exception


Last updated: 2011-08-11 10-04
Copyright © 2000-2011 United Planet. All Rights Reserved.