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
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:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.compiere.model.X_AD_Client
AD_LANGUAGE_AD_Reference_ID, 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, 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_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_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
Constructors Constructor Description MClient(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)Simplified ConstructorMClient(Properties ctx, ResultSet rs, String trxName)Load ConstructorMClient(Properties ctx, MClient copy)MClient(Properties ctx, MClient copy, String trxName)MClient(MClient copy)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description EMailcreateEMail(String to, String subject, String message)Create EMail from Request UserEMailcreateEMail(String to, String subject, String message, boolean html)Create EMail from Request UserEMailcreateEMail(MUser from, String to, String subject, String message)Create EMail from UserEMailcreateEMail(MUser from, String to, String subject, String message, boolean html)Create EMail from UserEMailcreateEMail(MUser from, MUser to, String subject, String message)Create EMail from UserEMailcreateEMail(MUser from, MUser to, String subject, String message, boolean html)Create EMail from UserEMailcreateEMailFrom(String from, String to, String subject, String message, boolean html)Create EMail with a specific from addressstatic MClientget(int AD_Client_ID)Get client from cache (immutable)static MClientget(Properties ctx)Get optionally cached clientstatic MClientget(Properties ctx, int AD_Client_ID)Get client from cache (immutable)MAcctSchemagetAcctSchema()Get Primary Accounting SchemaStringgetAD_Language()Get AD_Languagestatic MClient[]getAll(Properties ctx)Get all clientsstatic MClient[]getAll(Properties ctx, String orderBy)Get all clientsintgetC_Currency_ID()Get Default Accounting CurrencyMClientInfogetInfo()Get Client InfoLanguagegetLanguage()Get LanguageLocalegetLocale()Get LocaleStringgetRequestUser()Get Request User.StringgetRequestUserPW()Get Request User Password.intgetSetup_AD_Tree_Account_ID()Get AD_Tree_Account_ID created in setup client infoStringgetSMTPHost()Get SMTP HostintgetSMTPPort()Get SMTP Port.booleanisAutoArchive()Is Auto Archive onstatic booleanisClientAccounting()static booleanisClientAccountingImmediate()static booleanisClientAccountingQueue()booleanisDisplayField(int aDFieldID)Define is a field is displayed based on ASP rulesbooleanisSecureSMTP()Get SMTP SSL/TLS.static booleanisSendCredentialsClient()static booleanisSendCredentialsSystem()booleanisSmtpAuthorization()Get SMTP Authentication.MClientmarkImmutable()mark PO as immutablebooleansave()SavebooleansendEMail(int AD_User_ID, String subject, String message, File attachment)Send EMail from Request User - with tracebooleansendEMail(String to, String subject, String message, File attachment)Send EMail from Request User - no tracebooleansendEMail(String to, String subject, String message, File attachment, boolean html)Send EMail from Request User - no tracebooleansendEMail(MUser from, MUser to, String subject, String message, File attachment)Send EMail from UserbooleansendEMail(MUser from, MUser to, String subject, String message, File attachment, boolean isHtml)Send EMail from UserbooleansendEMailAttachments(int AD_User_ID, String subject, String message, Collection<File> attachments)Send EMail from Request User - with tracebooleansendEMailAttachments(int AD_User_ID, String subject, String message, Collection<File> attachments, boolean html)Send EMail from Request User - with tracebooleansendEMailAttachments(MUser from, MUser to, String subject, String message, List<File> attachments)Send EMail from UserbooleansendEMailAttachments(MUser from, MUser to, String subject, String message, List<File> attachments, boolean isHtml)Send EMail from UserbooleansendEmailNow(MUser from, MUser to, EMail email)Send Email NowvoidsetAD_Language(String AD_Language)Set AD_LanguagebooleansetupClientInfo(String language)Create Trees and Setup Client InfoStringtestEMail()Test EMailStringtoString()String Representation-
Methods inherited from class org.compiere.model.X_AD_Client
get_AccessLevel, getAD_Client_UU, getAD_PasswordRule, getAD_PasswordRule_ID, getAD_ReplicationStrategy, getAD_ReplicationStrategy_ID, getAutoArchive, getDescription, getDocumentDir, getEMailTest, getKeyNamePair, getMMPolicy, getModelValidationClasses, getName, getRequestEMail, getRequestFolder, getValue, initPO, isMultiLingualDocument, isPostImmediate, isUseASP, isUseBetaFunctions, setAD_Client_UU, setAD_PasswordRule_ID, setAD_ReplicationStrategy_ID, setAutoArchive, setDescription, setDocumentDir, setEMailTest, setIsMultiLingualDocument, setIsPostImmediate, setIsSecureSMTP, setIsSmtpAuthorization, setIsUseASP, setIsUseBetaFunctions, setMMPolicy, setModelValidationClasses, setName, setRequestEMail, setRequestFolder, setRequestUser, setRequestUserPW, setSMTPHost, setSMTPPort, setValue
-
Methods inherited from class org.compiere.model.PO
afterDelete, afterSave, beforeDelete, beforeSave, 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_Value, get_Value, get_ValueAsBoolean, get_ValueAsInt, get_ValueAsInt, 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, load, loadByUU, loadComplete, loadDefaults, loadSpecial, lock, makeImmutable, postDelete, retrieveIdOfParentValue, retrieveIdOfParentValue, save, 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, 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 Detail
-
MClient
public MClient(Properties ctx, int AD_Client_ID, boolean createNew, String trxName)
Standard Constructor- Parameters:
ctx- contextAD_Client_ID- idcreateNew- create newtrxName- transaction
-
MClient
public MClient(Properties ctx, int AD_Client_ID, String trxName)
Standard Constructor- Parameters:
ctx- contextAD_Client_ID- idtrxName- transaction
-
MClient
public MClient(Properties ctx, ResultSet rs, String trxName)
Load Constructor- Parameters:
ctx- contextrs- result settrxName- transaction
-
MClient
public MClient(Properties ctx, String trxName)
Simplified Constructor- Parameters:
ctx- contexttrxName- transaction
-
MClient
public MClient(MClient copy)
- Parameters:
copy-
-
MClient
public MClient(Properties ctx, MClient copy)
- Parameters:
ctx-copy-
-
MClient
public MClient(Properties ctx, MClient copy, String trxName)
- Parameters:
ctx-copy-trxName-
-
-
Method Detail
-
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- contextAD_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- contextorderBy- by clause- Returns:
- clients
-
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:
toStringin classX_AD_Client- Returns:
- info
-
getC_Currency_ID
public int getC_Currency_ID()
Get Default Accounting Currency- 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_Languagein interfaceI_AD_Client- Overrides:
setAD_Languagein classX_AD_Client- Parameters:
AD_Language- new language
-
getAD_Language
public String getAD_Language()
Get AD_Language- Specified by:
getAD_Languagein interfaceI_AD_Client- Overrides:
getAD_Languagein classX_AD_Client- Returns:
- Language
-
getLocale
public Locale getLocale()
Get Locale- Returns:
- 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- Returns:
- Acct Schema or null
-
save
public boolean save()
Save- Specified by:
savein interfaceI_Persistent- Overrides:
savein classPO- 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- 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
public boolean sendEMail(String to, String subject, String message, File attachment)
Send EMail from Request User - no trace- Parameters:
to- recipient email addresssubject- subjectmessage- messageattachment- 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 addresssubject- subjectmessage- messageattachment- optional attachmenthtml-- Returns:
- true if sent
-
sendEMail
public boolean sendEMail(MUser from, MUser to, String subject, String message, File attachment)
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
public boolean sendEmailNow(MUser from, MUser to, EMail email)
Send Email Now- Parameters:
from- optional from userto- to useremail- email- Returns:
- true if sent
-
createEMail
public EMail createEMail(String to, String subject, String message)
Create EMail from Request User- Parameters:
to- recipientsubject- subjectmessage- message- Returns:
-
createEMail
public EMail createEMail(String to, String subject, String message, boolean html)
Create EMail from Request User- Parameters:
to- recipientsubject- subjectmessage- messagehtml-- Returns:
-
createEMailFrom
public EMail createEMailFrom(String from, String to, String subject, String message, boolean html)
Create EMail with a specific from address- Parameters:
from- recipientto- recipientsubject- subjectmessage- messagehtml-- Returns:
-
createEMail
public EMail createEMail(MUser from, MUser to, String subject, String message)
Create EMail from User- Parameters:
from- optional senderto- recipientsubject- subjectmessage- message- Returns:
-
createEMail
public EMail createEMail(MUser from, MUser to, String subject, String message, boolean html)
Create EMail from User- Parameters:
from- optional senderto- recipientsubject- subjectmessage- messagehtml-- Returns:
-
createEMail
public EMail createEMail(MUser from, String to, String subject, String message)
Create EMail from User- Parameters:
from- optional senderto- recipientsubject- subjectmessage- message- Returns:
-
createEMail
public EMail createEMail(MUser from, String to, String subject, String message, boolean html)
Create EMail from User- Parameters:
from- optional senderto- recipientsubject- subjectmessage- messagehtml-- Returns:
-
isClientAccounting
public static boolean isClientAccounting()
-
isClientAccountingQueue
public static boolean isClientAccountingQueue()
-
isClientAccountingImmediate
public static boolean isClientAccountingImmediate()
-
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_ClientGet Request User.- Specified by:
getRequestUserin interfaceI_AD_Client- Overrides:
getRequestUserin classX_AD_Client- Returns:
- User Name (ID) of the email owner
-
getRequestUserPW
public String getRequestUserPW()
Description copied from class:X_AD_ClientGet Request User Password.- Specified by:
getRequestUserPWin interfaceI_AD_Client- Overrides:
getRequestUserPWin classX_AD_Client- Returns:
- Password of the user name (ID) for mail processing
-
isSmtpAuthorization
public boolean isSmtpAuthorization()
Description copied from class:X_AD_ClientGet SMTP Authentication.- Specified by:
isSmtpAuthorizationin interfaceI_AD_Client- Overrides:
isSmtpAuthorizationin classX_AD_Client- Returns:
- Your mail server requires Authentication
-
getSMTPPort
public int getSMTPPort()
Description copied from class:X_AD_ClientGet SMTP Port.- Specified by:
getSMTPPortin interfaceI_AD_Client- Overrides:
getSMTPPortin classX_AD_Client- Returns:
- SMTP Port Number
-
isSecureSMTP
public boolean isSecureSMTP()
Description copied from class:X_AD_ClientGet SMTP SSL/TLS.- Specified by:
isSecureSMTPin interfaceI_AD_Client- Overrides:
isSecureSMTPin classX_AD_Client- Returns:
- Use SSL/TLS for SMTP
-
getSMTPHost
public String getSMTPHost()
Get SMTP Host- Specified by:
getSMTPHostin interfaceI_AD_Client- Overrides:
getSMTPHostin classX_AD_Client- Returns:
- SMTP or loaclhost
-
markImmutable
public MClient markImmutable()
Description copied from interface:ImmutablePOSupportmark PO as immutable- Specified by:
markImmutablein interfaceImmutablePOSupport- Returns:
- PO
-
isSendCredentialsClient
public static boolean isSendCredentialsClient()
-
isSendCredentialsSystem
public static boolean isSendCredentialsSystem()
-
-