Package org.compiere.model
Class MClient
java.lang.Object
org.compiere.model.PO
org.compiere.model.X_AD_Client
org.compiere.model.MClient
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparator<Object>
,I_AD_Client
,I_Persistent
,Evaluatee
,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:
-
Field Summary
Fields inherited from class org.compiere.model.X_AD_Client
AD_LANGUAGE_AD_Reference_ID, AUTHENTICATIONTYPE_AD_Reference_ID, AUTHENTICATIONTYPE_ApplicationAndSSO, AUTHENTICATIONTYPE_ApplicationOnly, AUTHENTICATIONTYPE_SSOOnly, AUTOARCHIVE_AD_Reference_ID, AUTOARCHIVE_AllReportsDocuments, AUTOARCHIVE_Documents, AUTOARCHIVE_ExternalDocuments, AUTOARCHIVE_None, MMPOLICY_AD_Reference_ID, MMPOLICY_FiFo, MMPOLICY_LiFo
Fields inherited from class org.compiere.model.PO
ACCESSLEVEL_ALL, ACCESSLEVEL_CLIENT, ACCESSLEVEL_CLIENTORG, ACCESSLEVEL_ORG, ACCESSLEVEL_SYSTEM, ACCESSLEVEL_SYSTEMCLIENT, ENTITYTYPE_Dictionary, ENTITYTYPE_UserMaintained, I_ZERO, LOCAL_TRX_PREFIX, log, p_ctx, p_info, UUID_NEW_RECORD, XML_ATTRIBUTE_AD_Table_ID, XML_ATTRIBUTE_Record_ID
Fields inherited from interface org.compiere.model.I_AD_Client
accessLevel, COLUMNNAME_AD_Client_ID, COLUMNNAME_AD_Client_UU, COLUMNNAME_AD_Language, COLUMNNAME_AD_Org_ID, COLUMNNAME_AD_PasswordRule_ID, COLUMNNAME_AD_ReplicationStrategy_ID, COLUMNNAME_AuthenticationType, COLUMNNAME_AutoArchive, COLUMNNAME_Created, COLUMNNAME_CreatedBy, COLUMNNAME_Description, COLUMNNAME_DocumentDir, COLUMNNAME_EMailTest, COLUMNNAME_IsActive, COLUMNNAME_IsMultiLingualDocument, COLUMNNAME_IsPostImmediate, COLUMNNAME_IsSecureSMTP, COLUMNNAME_IsSmtpAuthorization, COLUMNNAME_IsUseASP, COLUMNNAME_IsUseBetaFunctions, COLUMNNAME_LoginPrefix, COLUMNNAME_MMPolicy, COLUMNNAME_ModelValidationClasses, COLUMNNAME_Name, COLUMNNAME_RequestEMail, COLUMNNAME_RequestFolder, COLUMNNAME_RequestUser, COLUMNNAME_RequestUserPW, COLUMNNAME_SMTPHost, COLUMNNAME_SMTPPort, COLUMNNAME_Updated, COLUMNNAME_UpdatedBy, COLUMNNAME_Value, Model, Table_ID, Table_Name
-
Constructor Summary
ConstructorDescriptionMClient
(Properties ctx, int AD_Client_ID, boolean createNew, String trxName) Standard ConstructorMClient
(Properties ctx, int AD_Client_ID, String trxName) Standard ConstructorMClient
(Properties ctx, String trxName) Constructor using AD_Client_ID from context (ctx)MClient
(Properties ctx, String AD_Client_UU, String trxName) UUID based ConstructorMClient
(Properties ctx, ResultSet rs, String trxName) Load ConstructorMClient
(Properties ctx, MClient copy) Copy constructorMClient
(Properties ctx, MClient copy, String trxName) Copy constructorCopy constructor -
Method Summary
Modifier and TypeMethodDescriptioncreateEMail
(String to, String subject, String message) Create EMail from Request UsercreateEMail
(String to, String subject, String message, boolean html) Create EMail from Request UsercreateEMail
(MUser from, String to, String subject, String message) Create EMail from UsercreateEMail
(MUser from, String to, String subject, String message, boolean html) Create EMail from UsercreateEMail
(MUser from, MUser to, String subject, String message) Create EMail from UsercreateEMail
(MUser from, MUser to, String subject, String message, boolean html) Create EMail from UsercreateEMailFrom
(String from, String to, String subject, String message, boolean html) Create EMail with a specific from addressstatic MClient
get
(int AD_Client_ID) Get client from cache (immutable)static MClient
get
(Properties ctx) Get optionally cached clientstatic MClient
get
(Properties ctx, int AD_Client_ID) Get client from cache (immutable)Get Primary Accounting Schema (from AD_ClientInfo)Get AD_Languagestatic MClient[]
getAll
(Properties ctx) Get all clientsstatic MClient[]
getAll
(Properties ctx, String orderBy) Get all clientsstatic MClient
getByLoginPrefix
(String loginPrefix) Get a MClient object based on LoginPrefixint
Get Default Accounting Currency (from AD_ClientInfo)getInfo()
Get Client InfoGet LanguageGet LocaleGet Request User.Get Request User Password.int
Get AD_Tree_Account_ID created in setup client infoGet SMTP Hostint
Get SMTP Port.boolean
Is Auto Archive onstatic boolean
static boolean
static boolean
boolean
isDisplayField
(int aDFieldID) Define is a field is displayed based on ASP rulesboolean
Get SMTP SSL/TLS.static boolean
static boolean
boolean
Get SMTP Authentication.mark PO as immutableboolean
save()
Saveboolean
Send EMail from Request User - with traceboolean
Send EMail from Request User - no traceboolean
Send EMail from Request User - no traceboolean
Send EMail from Userboolean
Send EMail from Userboolean
sendEMailAttachments
(int AD_User_ID, String subject, String message, Collection<File> attachments) Send EMail from Request User - with traceboolean
sendEMailAttachments
(int AD_User_ID, String subject, String message, Collection<File> attachments, boolean html) Send EMail from Request User - with traceboolean
Send EMail from Userboolean
sendEMailAttachments
(MUser from, MUser to, String subject, String message, List<File> attachments, boolean isHtml) Send EMail from Userboolean
sendEmailNow
(MUser from, MUser to, EMail email) Send Email Nowvoid
setAD_Language
(String AD_Language) Set AD_Languageboolean
setupClientInfo
(String language) Create Trees and Setup Client InfoTest EMailtoString()
String RepresentationMethods inherited from class org.compiere.model.X_AD_Client
get_AccessLevel, getAD_Client_UU, getAD_PasswordRule, getAD_PasswordRule_ID, getAD_ReplicationStrategy, getAD_ReplicationStrategy_ID, getAuthenticationType, getAutoArchive, getDescription, getDocumentDir, getEMailTest, getKeyNamePair, getLoginPrefix, getMMPolicy, getModelValidationClasses, getName, getRequestEMail, getRequestFolder, getValue, initPO, isMultiLingualDocument, isPostImmediate, isUseASP, isUseBetaFunctions, setAD_Client_UU, setAD_PasswordRule_ID, setAD_ReplicationStrategy_ID, setAuthenticationType, setAutoArchive, setDescription, setDocumentDir, setEMailTest, setIsMultiLingualDocument, setIsPostImmediate, setIsSecureSMTP, setIsSmtpAuthorization, setIsUseASP, setIsUseBetaFunctions, setLoginPrefix, setMMPolicy, setModelValidationClasses, setName, setRequestEMail, setRequestFolder, setRequestUser, setRequestUserPW, setSMTPHost, setSMTPPort, setValue
Methods inherited from class org.compiere.model.PO
afterDelete, afterSave, beforeDelete, beforeSave, buildInsertSQL, checkImmutable, clearCrossTenantSafe, clone, columnExists, columnExists, compare, copyPO, copyValues, copyValues, createAttachment, delete, delete, delete_Accounting, delete_Tree, deleteEx, deleteEx, dump, dump, equals, get_Attribute, get_Attributes, get_ColumnCount, get_ColumnDescription, get_ColumnDisplayType, get_ColumnIndex, get_ColumnLabel, get_ColumnLookup, get_ColumnName, get_DisplayValue, get_HashMap, get_ID, get_IDOld, get_KeyColumns, get_Logger, get_OptimisticLockingColumns, get_Table_ID, get_TableName, get_Translation, get_Translation, get_Translation, get_Translation, get_Translation, get_TrxName, get_UUID, get_Value, get_Value, get_ValueAsBoolean, get_ValueAsInt, get_ValueAsInt, get_ValueAsString, get_ValueAsString, get_ValueDifference, get_ValueDifference, get_ValueE, get_ValueOfColumn, get_ValueOld, get_ValueOld, get_ValueOldAsInt, get_WhereClause, get_WhereClause, get_xmlDocument, get_xmlString, getAD_Client_ID, getAD_Org_ID, getAllIDs, getAttachment, getAttachment, getAttachmentData, getCreated, getCreatedBy, getCtx, getDoc, getFindParameter, getPdfAttachment, getUpdated, getUpdatedBy, getUUIDColumnName, getUUIDColumnName, hashCode, insert_Accounting, insert_Tree, insert_Tree, is_Changed, is_Immutable, is_new, is_UseOptimisticLocking, is_ValueChanged, is_ValueChanged, isActive, isAttachment, isColumnMandatory, isColumnUpdateable, isMandatoryOK, isPdfAttachment, isReplication, load, load, load, load, loadByUU, loadComplete, loadDefaults, loadPO, loadSpecial, lock, makeImmutable, postDelete, retrieveIdOfParentValue, retrieveIdOfParentValue, save, saveCrossTenantSafe, saveCrossTenantSafeEx, saveCrossTenantSafeEx, saveEx, saveEx, saveNew_afterSetID, saveNew_getID, saveNewSpecial, saveReplica, saveUpdate, set_Attribute, set_ColumnUpdateable, set_CustomColumn, set_CustomColumnReturningBoolean, set_OptimisticLockingColumns, set_TrxName, set_TrxName, set_UseOptimisticLocking, set_Value, set_Value, set_Value, set_Value, set_ValueE, set_ValueNoCheck, set_ValueNoCheckE, set_ValueOfColumn, set_ValueOfColumn, set_ValueOfColumnReturningBoolean, set_ValueOfColumnReturningBoolean, setAD_Client_ID, setAD_Org_ID, setClientOrg, setClientOrg, setCrossTenantSafe, setDoc, setDocWorkflowMgr, setIsActive, setProcessedOn, setReplication, setStandardDefaults, setUpdateable, setUpdatedBy, toInsertSQL, unlock, update_Tree, validForeignKeys
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
Methods inherited from interface org.compiere.model.I_AD_Client
getAD_Client_ID, getAD_Org_ID, getCreated, getCreatedBy, getUpdated, getUpdatedBy, isActive, setAD_Org_ID, setIsActive
-
Constructor Details
-
MClient
Standard Constructor- Parameters:
ctx
- contextAD_Client_ID
- idcreateNew
- create newtrxName
- transaction
-
MClient
UUID based Constructor- Parameters:
ctx
- ContextAD_Client_UU
- UUID keytrxName
- Transaction
-
MClient
Standard Constructor- Parameters:
ctx
- contextAD_Client_ID
- idtrxName
- transaction
-
MClient
Load Constructor- Parameters:
ctx
- contextrs
- result settrxName
- transaction
-
MClient
Constructor using AD_Client_ID from context (ctx)- Parameters:
ctx
- contexttrxName
- transaction
-
MClient
Copy constructor- Parameters:
copy
-
-
MClient
Copy constructor- Parameters:
ctx
-copy
-
-
MClient
Copy constructor- Parameters:
ctx
-copy
-trxName
-
-
-
Method Details
-
get
Get client from cache (immutable)- Parameters:
AD_Client_ID
- id- Returns:
- client
-
get
Get client from cache (immutable)- Parameters:
ctx
- contextAD_Client_ID
- id- Returns:
- client
-
getAll
Get all clients- Parameters:
ctx
- context- Returns:
- clients
-
getAll
Get all clients- Parameters:
ctx
- contextorderBy
- by clause- Returns:
- clients
-
getByLoginPrefix
Get a MClient object based on LoginPrefix- Parameters:
loginPrefix
-- Returns:
- MClient
-
get
Get optionally cached client- Parameters:
ctx
- context- Returns:
- client
-
getInfo
Get Client Info- Returns:
- Client Info
-
toString
String Representation- Overrides:
toString
in classX_AD_Client
- Returns:
- info
-
getC_Currency_ID
public int getC_Currency_ID()Get Default Accounting Currency (from AD_ClientInfo)- Returns:
- currency or 0
-
getLanguage
Get Language- Returns:
- client language
-
setAD_Language
Set AD_Language- Specified by:
setAD_Language
in interfaceI_AD_Client
- Overrides:
setAD_Language
in classX_AD_Client
- Parameters:
AD_Language
- new language
-
getAD_Language
Get AD_Language- Specified by:
getAD_Language
in interfaceI_AD_Client
- Overrides:
getAD_Language
in classX_AD_Client
- Returns:
- Language
-
getLocale
Get Locale- Returns:
- client locale
-
setupClientInfo
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
Get Primary Accounting Schema (from AD_ClientInfo)- Returns:
- Acct Schema or null
-
save
public boolean save()Save- Specified by:
save
in interfaceI_Persistent
- Overrides:
save
in classPO
- Returns:
- true if saved
-
testEMail
Test EMail- Returns:
- OK or error
-
sendEMail
Send EMail from Request User - with trace- Parameters:
AD_User_ID
- recipientsubject
- subjectmessage
- messageattachment
- 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
- recipientsubject
- subjectmessage
- messageattachments
- 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
- recipientsubject
- subjectmessage
- messageattachments
- optional collection of attachmentshtml
-- 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
- senderto
- recipientsubject
- subjectmessage
- messageattachments
- 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
- senderto
- recipientsubject
- subjectmessage
- messageattachments
- optional attachmentisHtml
-- Returns:
- true if sent
-
sendEMail
Send EMail from Request User - no trace- Parameters:
to
- recipient email addresssubject
- subjectmessage
- messageattachment
- optional attachment- Returns:
- true if sent
-
sendEMail
Send EMail from Request User - no trace- Parameters:
to
- recipient email addresssubject
- subjectmessage
- messageattachment
- optional attachmenthtml
-- Returns:
- true if sent
-
sendEMail
Send EMail from User- Parameters:
from
- senderto
- recipientsubject
- subjectmessage
- messageattachment
- 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
- senderto
- recipientsubject
- subjectmessage
- messageattachment
- optional attachmentisHtml
-- Returns:
- true if sent
-
sendEmailNow
Send Email Now- Parameters:
from
- optional from userto
- to useremail
- email- Returns:
- true if sent
-
createEMail
Create EMail from Request User- Parameters:
to
- recipientsubject
- subjectmessage
- message- Returns:
-
createEMail
Create EMail from Request User- Parameters:
to
- recipientsubject
- subjectmessage
- messagehtml
-- Returns:
-
createEMailFrom
Create EMail with a specific from address- Parameters:
from
- recipientto
- recipientsubject
- subjectmessage
- messagehtml
-- Returns:
-
createEMail
Create EMail from User- Parameters:
from
- optional senderto
- recipientsubject
- subjectmessage
- message- Returns:
-
createEMail
Create EMail from User- Parameters:
from
- optional senderto
- recipientsubject
- subjectmessage
- messagehtml
-- Returns:
-
createEMail
Create EMail from User- Parameters:
from
- optional senderto
- recipientsubject
- subjectmessage
- message- Returns:
-
createEMail
Create EMail from User- Parameters:
from
- optional senderto
- recipientsubject
- subjectmessage
- messagehtml
-- Returns:
-
isClientAccounting
public static boolean isClientAccounting()- Returns:
- true if posting is using
CLIENT_ACCOUNTING_IMMEDIATE
orCLIENT_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
Description copied from class:X_AD_Client
Get Request User.- Specified by:
getRequestUser
in interfaceI_AD_Client
- Overrides:
getRequestUser
in classX_AD_Client
- Returns:
- User Name (ID) of the email owner
-
getRequestUserPW
Description copied from class:X_AD_Client
Get Request User Password.- Specified by:
getRequestUserPW
in interfaceI_AD_Client
- Overrides:
getRequestUserPW
in classX_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 interfaceI_AD_Client
- Overrides:
isSmtpAuthorization
in classX_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 interfaceI_AD_Client
- Overrides:
getSMTPPort
in classX_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 interfaceI_AD_Client
- Overrides:
isSecureSMTP
in classX_AD_Client
- Returns:
- Use SSL/TLS for SMTP
-
getSMTPHost
Get SMTP Host- Specified by:
getSMTPHost
in interfaceI_AD_Client
- Overrides:
getSMTPHost
in classX_AD_Client
- Returns:
- SMTP or localhost
-
markImmutable
Description copied from interface:ImmutablePOSupport
mark PO as immutable- Specified by:
markImmutable
in interfaceImmutablePOSupport
- 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
-