Klasse MailUtil

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

@Scriptable public final class MailUtil extends Object
  • Methodendetails

    • isMailServiceEnabled

      public static boolean isMailServiceEnabled()
      Test if the mail service is enabled.
      Gibt zurück:
      true if the mail service is enabled, or false otherwise.
    • getDefaultSenderAddress

      @Deprecated public static String getDefaultSenderAddress() throws de.uplanet.lucy.mail.SendMailConfigurationException
      Veraltet.
      Get the email address of the default sender configured for the portal.
      Gibt zurück:
      The default sender address.
      Löst aus:
      de.uplanet.lucy.server.mail.MailServiceNotAvailableException - If the mail service is not available.
      de.uplanet.lucy.mail.SendMailConfigurationException - If the mail configuration could not be loaded.
    • getDefaultSenderInternetAddress

      public static javax.mail.internet.InternetAddress getDefaultSenderInternetAddress() throws de.uplanet.lucy.mail.SendMailConfigurationException, javax.mail.internet.AddressException
      Get the email address of the default sender configured for the portal.
      Gibt zurück:
      The default sender address, or null if none is configured.
      Löst aus:
      de.uplanet.lucy.server.mail.MailServiceNotAvailableException - If the mail service is not available.
      de.uplanet.lucy.mail.SendMailConfigurationException - If the mail configuration could not be loaded.
      javax.mail.internet.AddressException - If the configured email address is invalid.
    • parseSemicolonOrLinefeedSeparatedAddresses

      @Deprecated public static List<String> parseSemicolonOrLinefeedSeparatedAddresses(String p_strAddresses)
      Note: This method also parses comma separators.
    • isDistributionList

      public static boolean isDistributionList(String p_strList)
      Check if the given string represents a ||-separated distribution list.
      Parameter:
      p_strList - The string to be checked.
      Gibt zurück:
      true if the given string represents a ||-separated distribution list, or false otherwise.
    • getUserMailBizFromDistributionList

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

      Deactivated users are excluded from the result.

      Parameter:
      p_conn - The database connection to be used.
      p_strList - A list of org structure GUIDs.
      Löst aus:
      SQLException - If a database error occurred.
      Siehe auch:
    • getUserMailBizFromDistributionList

      public static List<String> getUserMailBizFromDistributionList(de.uplanet.jdbc.JdbcConnection p_conn, String p_strList, boolean p_bIncludeDeactivatedUsers) throws SQLException
      Parse a pipe-separated list of org structure GUIDs and get the user mail addresses determined by it.
      Parameter:
      p_conn - The database connection to be used.
      p_strList - A list of org structure GUIDs.
      p_bIncludeDeactivatedUsers - false if deactivated users should be ignored, or true otherwise.
      Gibt zurück:
      A list that contains the (non-empty) addresses.
      Löst aus:
      SQLException - If a database error occurred.
      Seit:
      Intrexx 6.0.
    • buildSubject

      @Deprecated public static final String buildSubject(IProcessingContext p_ctx, String p_strStaticPart, IValueHolder<?> p_vhDynamicPart) throws de.uplanet.lucy.server.renderer.RendererException, de.uplanet.lucy.server.renderer.RendererFactoryException, de.uplanet.util.InvalidPropertyException
      Veraltet.

      Note: Do not use this method in scripts. It will be changed in the future

      Löst aus:
      de.uplanet.lucy.server.renderer.RendererException
      de.uplanet.lucy.server.renderer.RendererFactoryException
      de.uplanet.util.InvalidPropertyException
    • buildSubject

      public static final String buildSubject(IProcessingContext p_ctx, String p_strStaticPart, IValueHolder<?> p_vhDynamicPart, String p_strLanguage) throws de.uplanet.lucy.server.renderer.RendererException, de.uplanet.lucy.server.renderer.RendererFactoryException, de.uplanet.util.InvalidPropertyException

      Note: Do not use this method in scripts. It will be changed in the future

      If the static part of the subject is not null and it contains the special variable ${1} this special variable will be replaced with the dynamic part or the empty string if the dynamic part is null.

      If the static part of the subject is not null and it does not contain the special variable ${1} then an existing dynamic part will be appended with a space character prepended.

      If the given language is null the default language will be used.

      Parameter:
      p_ctx - The current processing context.
      p_strStaticPart - The static part of the subject, or null.
      p_vhDynamicPart - The dynamic part of the subject, or null.
      p_strLanguage - The language, or null.
      Gibt zurück:
      The build subject.
      Löst aus:
      de.uplanet.lucy.server.renderer.RendererException - If an error occurred.
      de.uplanet.lucy.server.renderer.RendererFactoryException - If an error occurred.
      de.uplanet.util.InvalidPropertyException - If an error occurred.
    • getMailInfoFromDatabase

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

      Note: Do not use this method in scripts.

      Parameter:
      p_ctx - The processing context.
      p_strGuid - The GUID of the requested mail info.
      Gibt zurück:
      A mail inf object.
      Löst aus:
      SQLException - If a database error occurred.
      de.uplanet.lucy.usermanager.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, String p_strGuid, String p_strType) throws SQLException, de.uplanet.lucy.usermanager.NotFoundException

      Note: Do not use this method in scripts.

      Parameter:
      p_conn - The database connection to be used.
      p_user - A 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.
      Gibt zurück:
      The recipient configuration from the database, or null if none was found.
      Löst aus:
      SQLException - If a database error occurred.
      de.uplanet.lucy.usermanager.NotFoundException - If the deputy of the given user was not found in the database.
    • getBossAddresses

      public static SortedSet<String> getBossAddresses(de.uplanet.jdbc.JdbcConnection p_conn, IUser p_user) throws SQLException
      Parameter:
      p_conn - The database connection to be used.
      p_user - The user.
      Gibt zurück:
      A possibly empty list of boss e-mail addresses.
      Löst aus:
      SQLException - If a database error occurred.
    • getDeputyAddress

      public static String getDeputyAddress(de.uplanet.jdbc.JdbcConnection p_conn, IUser p_user) throws SQLException, de.uplanet.lucy.usermanager.NotFoundException
      Get the mail address of the given user's deputy.
      Parameter:
      p_conn - The database connection to be used.
      p_user - The user.
      Gibt zurück:
      The given user's deputy, or null if there is none.
      Löst aus:
      SQLException - If a database error occurred.
      de.uplanet.lucy.usermanager.NotFoundException - If the deputy was not found in the database.
    • getApplicationResponsibleAddress

      public static String getApplicationResponsibleAddress(de.uplanet.jdbc.JdbcConnection p_conn, String p_strAppGuid) throws SQLException
      Löst aus:
      SQLException
    • getAddressListDataRange

      public static IDataRangeDataService getAddressListDataRange(IBusinessLogicProcessingContext p_ctx, String p_strFieldGuid, de.uplanet.lucy.server.businesslogic.rtdata.jdbc.filter.IFilterElement p_filter, TimeZone p_tz) throws de.uplanet.lucy.server.businesslogic.BlException

      Note: Do not use this method in scripts.

      Parameter:
      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.
      Gibt zurück:
      An object that gives access to the requested data.
      Löst aus:
      de.uplanet.lucy.server.businesslogic.BlException - If an error occurred.
    • getAddressListCloseableDataRange

      public static de.uplanet.lucy.server.businesslogic.util.ICloseableDataRangeDataService getAddressListCloseableDataRange(IBusinessLogicProcessingContext p_ctx, String p_strFieldGuid, de.uplanet.lucy.server.businesslogic.rtdata.jdbc.filter.IFilterElement p_filter, TimeZone p_tz) throws de.uplanet.lucy.server.businesslogic.BlException

      Note: Do not use this method in scripts.

      Parameter:
      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.
      Gibt zurück:
      An object that gives access to the requested data (must be closed after use).
      Löst aus:
      de.uplanet.lucy.server.businesslogic.BlException - If an error occurred.
    • getDistinctDataRangeList

      @Deprecated public static IDataRangeDataService getDistinctDataRangeList(IBusinessLogicProcessingContext p_ctx, String p_strFieldGuid, de.uplanet.lucy.server.businesslogic.rtdata.jdbc.filter.IFilterElement p_filter, TimeZone p_tz) throws de.uplanet.lucy.server.businesslogic.BlException
      Veraltet.
      Löst aus:
      de.uplanet.lucy.server.businesslogic.BlException
    • getDistinctDataRangeList

      @Deprecated public static IDataRangeDataService getDistinctDataRangeList(IBusinessLogicProcessingContext p_ctx, de.uplanet.lucy.server.mail.MailRecipientInfo p_mailRcp, TimeZone p_tz) throws de.uplanet.lucy.server.businesslogic.BlException
      Veraltet.
      Löst aus:
      de.uplanet.lucy.server.businesslogic.BlException
    • getDistinctDataRangeList

      @Deprecated public static IDataRangeDataService getDistinctDataRangeList(IBusinessLogicProcessingContext p_ctx, String p_strAppGuid, String p_strDgGuid, String p_strFieldGuid, de.uplanet.lucy.server.businesslogic.rtdata.jdbc.filter.IFilterElement p_filter, TimeZone p_tz) throws de.uplanet.lucy.server.businesslogic.BlException
      Veraltet.
      Löst aus:
      de.uplanet.lucy.server.businesslogic.BlException
    • getAddressesFromField

      public static Set<String> getAddressesFromField(IBusinessLogicProcessingContext p_ctx, de.uplanet.lucy.server.businesslogic.util.IDataRecord p_record, String p_strAppGuid, String p_strDgGuid, String p_strFieldGuid, de.uplanet.lucy.server.businesslogic.rtdata.jdbc.filter.IFilterElement p_filter, TimeZone p_tz) throws 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.

      Deactivated users are excluded from the result.

      Parameter:
      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.
      Gibt zurück:
      A set that contains non-empty mail adresses.
      Löst aus:
      Exception - If an error occurred.
      Siehe auch:
    • getAddressesFromField

      public static Set<String> getAddressesFromField(IBusinessLogicProcessingContext p_ctx, de.uplanet.lucy.server.businesslogic.util.IDataRecord p_record, String p_strAppGuid, String p_strDgGuid, String p_strFieldGuid, de.uplanet.lucy.server.businesslogic.rtdata.jdbc.filter.IFilterElement p_filter, TimeZone p_tz, boolean p_bIncludeDeactivatedUsers) throws de.uplanet.lucy.server.businesslogic.BlException, SQLException
      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.

      Parameter:
      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.
      p_bIncludeDeactivatedUsers - false if deactivated users should be ignored, or true otherwise.
      Gibt zurück:
      A set that contains non-empty mail adresses.
      Löst aus:
      de.uplanet.lucy.server.businesslogic.BlException - If an error occurred.
      SQLException - If an error occurred.
      Seit:
      Intrexx 6.0.
    • getRenderedValue

      public static String getRenderedValue(IProcessingContext p_ctx, IValueHolder<?> p_vh) throws de.uplanet.lucy.server.renderer.RendererException, de.uplanet.lucy.server.renderer.RendererFactoryException

      Note: Do not use this method in scripts.

      Löst aus:
      de.uplanet.lucy.server.renderer.RendererFactoryException
      de.uplanet.lucy.server.renderer.RendererException
    • getValueHolderFromField

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

      Note: Do not use this method in scripts.

      Parameter:
      p_ctx - The current processing context.
      p_strAppGuid - The application that contains the data group identified by p_strDgGuid.
      p_strDgGuid - The data group that contains the record identified by p_strRecId.
      p_strFieldGuid - The field that contains the subject (may belong to the parent data group).
      p_strRecId - The primary key of the record in p_strDgGuid.
      Gibt zurück:
      The value.
      Löst aus:
      de.uplanet.lucy.server.businesslogic.BlException - If an error occurred.
    • checkLevelOfTargetPage

      public static String checkLevelOfTargetPage(IBusinessLogicProcessingContext p_ctx, String p_strAppGuid, String p_strSrcPageGuid, String p_strTargetGuid, String p_strRecIdForMail) throws de.uplanet.lucy.server.businesslogic.BlException
      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.

      Note: Do not use this method in scripts.

      Parameter:
      p_strSrcPageGuid - Database GUID of the sourcepage
      p_strRecIdForMail - current Recid of the record of the mail.
      Gibt zurück:
      null, if the level is teh same otherwise the value of the parentid for the level of the targetpage.
      Löst aus:
      de.uplanet.lucy.server.businesslogic.BlException - If an error occurred.