Package org.compiere.model
Class MMailText
- java.lang.Object
-
- org.compiere.model.PO
-
- org.compiere.model.X_R_MailText
-
- org.compiere.model.MMailText
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparator<Object>
,I_Persistent
,I_R_MailText
,Evaluatee
public class MMailText extends X_R_MailText
Request Mail Template Model. Cannot be cached as it holds PO/BPartner/User to parse- Version:
- $Id: MMailText.java,v 1.3 2006/07/30 00:51:03 jjanke Exp $
- Author:
- Jorg Janke
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected MBPartner
m_bpartner
Parse BPartnerprotected String
m_language
protected String
m_MailHeader
Translated Headerprotected String
m_MailText
Translated Textprotected String
m_MailText2
Translated Text 2protected String
m_MailText3
Translated Text 3protected PO
m_po
Parse POprotected MUser
m_user
Parse Userprotected static CCache<String,org.compiere.model.MMailText.MMailTextTrl>
s_cacheTrl
Translation Cache-
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_R_MailText
accessLevel, COLUMNNAME_AD_Client_ID, COLUMNNAME_AD_Org_ID, COLUMNNAME_Created, COLUMNNAME_CreatedBy, COLUMNNAME_IsActive, COLUMNNAME_IsHtml, COLUMNNAME_MailHeader, COLUMNNAME_MailText, COLUMNNAME_MailText2, COLUMNNAME_MailText3, COLUMNNAME_Name, COLUMNNAME_R_MailText_ID, COLUMNNAME_R_MailText_UU, COLUMNNAME_Updated, COLUMNNAME_UpdatedBy, Model, Table_ID, Table_Name
-
-
Constructor Summary
Constructors Constructor Description MMailText(Properties ctx, int R_MailText_ID, String trxName)
Standard ConstructorMMailText(Properties ctx, ResultSet rs, String trxName)
Load Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MBPartner
getBPartner()
String
getLanguage()
String
getMailHeader()
Get parsed/translated Mail HeaderString
getMailText()
Get parsed/translated Mail TextString
getMailText(boolean all)
Get parsed/translated Mail TextString
getMailText2()
Get parsed/translated Mail Text 2String
getMailText3()
Get parsed/translated Mail Text 2PO
getPO()
protected org.compiere.model.MMailText.MMailTextTrl
getTranslation(String AD_Language)
Get TranslationMUser
getUser()
protected String
parse(String text)
Parse Textprotected String
parse(String text, PO po)
Parse textprotected String
parseVariable(String variable, PO po)
Parse Variablevoid
setBPartner(int C_BPartner_ID)
Set BPartner for parsevoid
setBPartner(MBPartner bpartner)
Set BPartner for parsevoid
setLanguage(String language)
void
setPO(PO po)
Set PO for parsevoid
setPO(PO po, boolean analyse)
Set PO for parsevoid
setUser(int AD_User_ID)
Set User for parsevoid
setUser(MUser user)
Set User for parseprotected void
translate()
Translate to BPartner Language-
Methods inherited from class org.compiere.model.X_R_MailText
get_AccessLevel, getKeyNamePair, getName, getR_MailText_ID, getR_MailText_UU, initPO, isHtml, setIsHtml, setMailHeader, setMailText, setMailText2, setMailText3, setName, setR_MailText_ID, setR_MailText_UU, toString
-
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, 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_Persistent
save
-
Methods inherited from interface org.compiere.model.I_R_MailText
getAD_Client_ID, getAD_Org_ID, getCreated, getCreatedBy, getUpdated, getUpdatedBy, isActive, setAD_Org_ID, setIsActive
-
-
-
-
Field Detail
-
m_user
protected MUser m_user
Parse User
-
m_bpartner
protected MBPartner m_bpartner
Parse BPartner
-
m_po
protected PO m_po
Parse PO
-
m_MailHeader
protected String m_MailHeader
Translated Header
-
m_MailText
protected String m_MailText
Translated Text
-
m_MailText2
protected String m_MailText2
Translated Text 2
-
m_MailText3
protected String m_MailText3
Translated Text 3
-
s_cacheTrl
protected static CCache<String,org.compiere.model.MMailText.MMailTextTrl> s_cacheTrl
Translation Cache
-
m_language
protected String m_language
-
-
Constructor Detail
-
MMailText
public MMailText(Properties ctx, int R_MailText_ID, String trxName)
Standard Constructor- Parameters:
ctx
- contextR_MailText_ID
- idtrxName
- transaction
-
MMailText
public MMailText(Properties ctx, ResultSet rs, String trxName)
Load Constructor- Parameters:
ctx
- contextrs
- result settrxName
- transaction
-
-
Method Detail
-
getMailText
public String getMailText(boolean all)
Get parsed/translated Mail Text- Parameters:
all
- concatinate all- Returns:
- parsed/translated text
-
getMailText
public String getMailText()
Get parsed/translated Mail Text- Specified by:
getMailText
in interfaceI_R_MailText
- Overrides:
getMailText
in classX_R_MailText
- Returns:
- parsed/translated text
-
getMailText2
public String getMailText2()
Get parsed/translated Mail Text 2- Specified by:
getMailText2
in interfaceI_R_MailText
- Overrides:
getMailText2
in classX_R_MailText
- Returns:
- parsed/translated text
-
getMailText3
public String getMailText3()
Get parsed/translated Mail Text 2- Specified by:
getMailText3
in interfaceI_R_MailText
- Overrides:
getMailText3
in classX_R_MailText
- Returns:
- parsed/translated text
-
getMailHeader
public String getMailHeader()
Get parsed/translated Mail Header- Specified by:
getMailHeader
in interfaceI_R_MailText
- Overrides:
getMailHeader
in classX_R_MailText
- Returns:
- parsed/translated text
-
parse
protected String parse(String text, PO po)
Parse text- Parameters:
text
- textpo
- object- Returns:
- parsed text
-
parseVariable
protected String parseVariable(String variable, PO po)
Parse Variable- Parameters:
variable
- variablepo
- po- Returns:
- translated variable or if not found the original tag
-
setUser
public void setUser(int AD_User_ID)
Set User for parse- Parameters:
AD_User_ID
- user
-
setUser
public void setUser(MUser user)
Set User for parse- Parameters:
user
- user
-
setBPartner
public void setBPartner(int C_BPartner_ID)
Set BPartner for parse- Parameters:
C_BPartner_ID
- bp
-
setBPartner
public void setBPartner(MBPartner bpartner)
Set BPartner for parse- Parameters:
bpartner
- bp
-
setPO
public void setPO(PO po)
Set PO for parse- Parameters:
po
- po
-
setPO
public void setPO(PO po, boolean analyse)
Set PO for parse- Parameters:
po
- poanalyse
- if set to true, search for BPartner/User
-
translate
protected void translate()
Translate to BPartner Language
-
getTranslation
protected org.compiere.model.MMailText.MMailTextTrl getTranslation(String AD_Language)
Get Translation- Parameters:
AD_Language
- language- Returns:
- trl
-
setLanguage
public void setLanguage(String language)
-
getPO
public PO getPO()
-
getBPartner
public MBPartner getBPartner()
-
getLanguage
public String getLanguage()
-
getUser
public MUser getUser()
-
-