Class MClient

All Implemented Interfaces:
Serializable, Cloneable, Comparator<Object>, I_AD_Client, I_Persistent, Evaluatee, ImmutablePOSupport

public class MClient extends X_AD_Client implements ImmutablePOSupport
Client Model
Version:
$Id: MClient.java,v 1.2 2006/07/30 00:58:37 jjanke Exp $
Author:
Jorg Janke, Carlos Ruiz - globalqss integrate bug fix reported by Teo Sarca [ 1619085 ] Client setup creates duplicate trees, Teo Sarca, SC ARHIPAC SERVICE SRL
  • BF [ 1886480 ] Print Format Item Trl not updated even if not multilingual
  • See Also:
    • Constructor Details

      • MClient

        public MClient(Properties ctx, int AD_Client_ID, boolean createNew, String trxName)
        Standard Constructor
        Parameters:
        ctx - context
        AD_Client_ID - id
        createNew - create new
        trxName - transaction
      • MClient

        public MClient(Properties ctx, String AD_Client_UU, String trxName)
        UUID based Constructor
        Parameters:
        ctx - Context
        AD_Client_UU - UUID key
        trxName - Transaction
      • MClient

        public MClient(Properties ctx, int AD_Client_ID, String trxName)
        Standard Constructor
        Parameters:
        ctx - context
        AD_Client_ID - id
        trxName - transaction
      • MClient

        public MClient(Properties ctx, ResultSet rs, String trxName)
        Load Constructor
        Parameters:
        ctx - context
        rs - result set
        trxName - transaction
      • MClient

        public MClient(Properties ctx, String trxName)
        Constructor using AD_Client_ID from context (ctx)
        Parameters:
        ctx - context
        trxName - transaction
      • MClient

        public MClient(MClient copy)
        Copy constructor
        Parameters:
        copy -
      • MClient

        public MClient(Properties ctx, MClient copy)
        Copy constructor
        Parameters:
        ctx -
        copy -
      • MClient

        public MClient(Properties ctx, MClient copy, String trxName)
        Copy constructor
        Parameters:
        ctx -
        copy -
        trxName -
    • Method Details

      • get

        public static MClient get(int AD_Client_ID)
        Get client from cache (immutable)
        Parameters:
        AD_Client_ID - id
        Returns:
        client
      • get

        public static MClient get(Properties ctx, int AD_Client_ID)
        Get client from cache (immutable)
        Parameters:
        ctx - context
        AD_Client_ID - id
        Returns:
        client
      • getAll

        public static MClient[] getAll(Properties ctx)
        Get all clients
        Parameters:
        ctx - context
        Returns:
        clients
      • getAll

        public static MClient[] getAll(Properties ctx, String orderBy)
        Get all clients
        Parameters:
        ctx - context
        orderBy - by clause
        Returns:
        clients
      • getByLoginPrefix

        public static MClient getByLoginPrefix(String loginPrefix)
        Get a MClient object based on LoginPrefix
        Parameters:
        loginPrefix -
        Returns:
        MClient
      • get

        public static MClient get(Properties ctx)
        Get optionally cached client
        Parameters:
        ctx - context
        Returns:
        client
      • getInfo

        public MClientInfo getInfo()
        Get Client Info
        Returns:
        Client Info
      • toString

        public String toString()
        String Representation
        Overrides:
        toString in class X_AD_Client
        Returns:
        info
      • getC_Currency_ID

        public int getC_Currency_ID()
        Get Default Accounting Currency (from AD_ClientInfo)
        Returns:
        currency or 0
      • getLanguage

        public Language getLanguage()
        Get Language
        Returns:
        client language
      • setAD_Language

        public void setAD_Language(String AD_Language)
        Set AD_Language
        Specified by:
        setAD_Language in interface I_AD_Client
        Overrides:
        setAD_Language in class X_AD_Client
        Parameters:
        AD_Language - new language
      • getAD_Language

        public String getAD_Language()
        Get AD_Language
        Specified by:
        getAD_Language in interface I_AD_Client
        Overrides:
        getAD_Language in class X_AD_Client
        Returns:
        Language
      • getLocale

        public Locale getLocale()
        Get Locale
        Returns:
        client locale
      • setupClientInfo

        public boolean setupClientInfo(String language)
        Create Trees and Setup Client Info
        Parameters:
        language - language
        Returns:
        true if created
      • getSetup_AD_Tree_Account_ID

        public int getSetup_AD_Tree_Account_ID()
        Get AD_Tree_Account_ID created in setup client info
        Returns:
        Account Tree ID
      • isAutoArchive

        public boolean isAutoArchive()
        Is Auto Archive on
        Returns:
        true if auto archive
      • getAcctSchema

        public MAcctSchema getAcctSchema()
        Get Primary Accounting Schema (from AD_ClientInfo)
        Returns:
        Acct Schema or null
      • save

        public boolean save()
        Save
        Specified by:
        save in interface I_Persistent
        Overrides:
        save in class PO
        Returns:
        true if saved
      • testEMail

        public String testEMail()
        Test EMail
        Returns:
        OK or error
      • sendEMail

        public boolean sendEMail(int AD_User_ID, String subject, String message, File attachment)
        Send EMail from Request User - with trace
        Parameters:
        AD_User_ID - recipient
        subject - subject
        message - message
        attachment - optional attachment
        Returns:
        true if sent
      • sendEMailAttachments

        public boolean sendEMailAttachments(int AD_User_ID, String subject, String message, Collection<File> attachments)
        Send EMail from Request User - with trace
        Parameters:
        AD_User_ID - recipient
        subject - subject
        message - message
        attachments - optional collection of attachments
        Returns:
        true if sent
      • sendEMailAttachments

        public boolean sendEMailAttachments(int AD_User_ID, String subject, String message, Collection<File> attachments, boolean html)
        Send EMail from Request User - with trace
        Parameters:
        AD_User_ID - recipient
        subject - subject
        message - message
        attachments - optional collection of attachments
        html -
        Returns:
        true if sent
      • sendEMailAttachments

        public boolean sendEMailAttachments(MUser from, MUser to, String subject, String message, List<File> attachments)
        Send EMail from User
        Parameters:
        from - sender
        to - recipient
        subject - subject
        message - message
        attachments - optional attachment
        Returns:
        true if sent
      • sendEMailAttachments

        public boolean sendEMailAttachments(MUser from, MUser to, String subject, String message, List<File> attachments, boolean isHtml)
        Send EMail from User
        Parameters:
        from - sender
        to - recipient
        subject - subject
        message - message
        attachments - optional attachment
        isHtml -
        Returns:
        true if sent
      • sendEMail

        public boolean sendEMail(String to, String subject, String message, File attachment)
        Send EMail from Request User - no trace
        Parameters:
        to - recipient email address
        subject - subject
        message - message
        attachment - optional attachment
        Returns:
        true if sent
      • sendEMail

        public boolean sendEMail(String to, String subject, String message, File attachment, boolean html)
        Send EMail from Request User - no trace
        Parameters:
        to - recipient email address
        subject - subject
        message - message
        attachment - optional attachment
        html -
        Returns:
        true if sent
      • sendEMail

        public boolean sendEMail(MUser from, MUser to, String subject, String message, File attachment)
        Send EMail from User
        Parameters:
        from - sender
        to - recipient
        subject - subject
        message - message
        attachment - optional attachment
        Returns:
        true if sent
      • sendEMail

        public boolean sendEMail(MUser from, MUser to, String subject, String message, File attachment, boolean isHtml)
        Send EMail from User
        Parameters:
        from - sender
        to - recipient
        subject - subject
        message - message
        attachment - optional attachment
        isHtml -
        Returns:
        true if sent
      • sendEmailNow

        public boolean sendEmailNow(MUser from, MUser to, EMail email)
        Send Email Now
        Parameters:
        from - optional from user
        to - to user
        email - email
        Returns:
        true if sent
      • createEMail

        public EMail createEMail(String to, String subject, String message)
        Create EMail from Request User
        Parameters:
        to - recipient
        subject - subject
        message - message
        Returns:
        EMail
      • createEMail

        public EMail createEMail(String to, String subject, String message, boolean html)
        Create EMail from Request User
        Parameters:
        to - recipient
        subject - subject
        message - message
        html -
        Returns:
        EMail
      • createEMailFrom

        public EMail createEMailFrom(String from, String to, String subject, String message, boolean html)
        Create EMail with a specific from address
        Parameters:
        from - recipient
        to - recipient
        subject - subject
        message - message
        html -
        Returns:
        EMail
      • createEMail

        public EMail createEMail(MUser from, MUser to, String subject, String message)
        Create EMail from User
        Parameters:
        from - optional sender
        to - recipient
        subject - subject
        message - message
        Returns:
        EMail
      • createEMail

        public EMail createEMail(MUser from, MUser to, String subject, String message, boolean html)
        Create EMail from User
        Parameters:
        from - optional sender
        to - recipient
        subject - subject
        message - message
        html -
        Returns:
        EMail
      • createEMail

        public EMail createEMail(MUser from, String to, String subject, String message)
        Create EMail from User
        Parameters:
        from - optional sender
        to - recipient
        subject - subject
        message - message
        Returns:
        EMail
      • createEMail

        public EMail createEMail(MUser from, String to, String subject, String message, boolean html)
        Create EMail from User
        Parameters:
        from - optional sender
        to - recipient
        subject - subject
        message - message
        html -
        Returns:
        EMail
      • isClientAccounting

        public static boolean isClientAccounting()
        Returns:
        true if posting is using CLIENT_ACCOUNTING_IMMEDIATE or CLIENT_ACCOUNTING_QUEUE
      • isClientAccountingQueue

        public static boolean isClientAccountingQueue()
        Returns:
        true if posting is using CLIENT_ACCOUNTING_QUEUE
      • isClientAccountingImmediate

        public static boolean isClientAccountingImmediate()
        Returns:
        true if posting is using CLIENT_ACCOUNTING_IMMEDIATE
      • isDisplayField

        public boolean isDisplayField(int aDFieldID)
        Define is a field is displayed based on ASP rules
        Parameters:
        aDFieldID -
        Returns:
        boolean indicating if it's displayed or not
      • getRequestUser

        public String getRequestUser()
        Description copied from class: X_AD_Client
        Get Request User.
        Specified by:
        getRequestUser in interface I_AD_Client
        Overrides:
        getRequestUser in class X_AD_Client
        Returns:
        User Name (ID) of the email owner
      • getRequestUserPW

        public String getRequestUserPW()
        Description copied from class: X_AD_Client
        Get Request User Password.
        Specified by:
        getRequestUserPW in interface I_AD_Client
        Overrides:
        getRequestUserPW in class X_AD_Client
        Returns:
        Password of the user name (ID) for mail processing
      • isSmtpAuthorization

        public boolean isSmtpAuthorization()
        Description copied from class: X_AD_Client
        Get SMTP Authentication.
        Specified by:
        isSmtpAuthorization in interface I_AD_Client
        Overrides:
        isSmtpAuthorization in class X_AD_Client
        Returns:
        Your mail server requires Authentication
      • getSMTPPort

        public int getSMTPPort()
        Description copied from class: X_AD_Client
        Get SMTP Port.
        Specified by:
        getSMTPPort in interface I_AD_Client
        Overrides:
        getSMTPPort in class X_AD_Client
        Returns:
        SMTP Port Number
      • isSecureSMTP

        public boolean isSecureSMTP()
        Description copied from class: X_AD_Client
        Get SMTP SSL/TLS.
        Specified by:
        isSecureSMTP in interface I_AD_Client
        Overrides:
        isSecureSMTP in class X_AD_Client
        Returns:
        Use SSL/TLS for SMTP
      • getSMTPHost

        public String getSMTPHost()
        Get SMTP Host
        Specified by:
        getSMTPHost in interface I_AD_Client
        Overrides:
        getSMTPHost in class X_AD_Client
        Returns:
        SMTP or localhost
      • markImmutable

        public MClient markImmutable()
        Description copied from interface: ImmutablePOSupport
        mark PO as immutable
        Specified by:
        markImmutable in interface ImmutablePOSupport
        Returns:
        PO
      • isSendCredentialsClient

        public static boolean isSendCredentialsClient()
        Returns:
        true if mail send credential is using MAIL_SEND_CREDENTIALS_CLIENT
      • isSendCredentialsSystem

        public static boolean isSendCredentialsSystem()
        Returns:
        true if mail send credential is using MAIL_SEND_CREDENTIALS_SYSTEM