Package org.compiere.print
Class MPrintFormat
java.lang.Object
org.compiere.model.PO
org.compiere.model.X_AD_PrintFormat
org.compiere.print.MPrintFormat
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparator<Object>
,I_AD_PrintFormat
,I_Persistent
,Evaluatee
,ImmutablePOSupport
AD_PrintFormat - Print Format Model.
(Add missing Items with PrintFormatUtil)
- Version:
- $Id: MPrintFormat.java,v 1.3 2006/07/30 00:53:02 jjanke Exp $
- Author:
- Jorg Janke
- See Also:
-
Field Summary
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_PrintFormat
accessLevel, COLUMNNAME_AD_Client_ID, COLUMNNAME_AD_Org_ID, COLUMNNAME_AD_PrintColor_ID, COLUMNNAME_AD_PrintFont_ID, COLUMNNAME_AD_PrintFormat_ID, COLUMNNAME_AD_PrintFormat_UU, COLUMNNAME_AD_PrintHeaderFooter_ID, COLUMNNAME_AD_PrintPaper_ID, COLUMNNAME_AD_PrintTableFormat_ID, COLUMNNAME_AD_ReportView_ID, COLUMNNAME_AD_Table_ID, COLUMNNAME_AD_Window_ID, COLUMNNAME_CreateCopy, COLUMNNAME_Created, COLUMNNAME_CreatedBy, COLUMNNAME_Description, COLUMNNAME_FileNamePattern, COLUMNNAME_FooterMargin, COLUMNNAME_HeaderMargin, COLUMNNAME_IsActive, COLUMNNAME_IsBreakPagePerRecord, COLUMNNAME_IsDefault, COLUMNNAME_IsForm, COLUMNNAME_IsStandardHeaderFooter, COLUMNNAME_IsTableBased, COLUMNNAME_JasperProcess_ID, COLUMNNAME_Name, COLUMNNAME_PrinterName, COLUMNNAME_Updated, COLUMNNAME_UpdatedBy, Model, Table_ID, Table_Name
-
Constructor Summary
ConstructorDescriptionMPrintFormat
(Properties ctx, int AD_PrintFormat_ID, String trxName) Public Constructor.MPrintFormat
(Properties ctx, String AD_PrintFormat_UU, String trxName) UUID based ConstructorMPrintFormat
(Properties ctx, ResultSet rs, String trxName) Load ConstructorMPrintFormat
(Properties ctx, MPrintFormat copy) MPrintFormat
(Properties ctx, MPrintFormat copy, String trxName) MPrintFormat
(MPrintFormat copy) -
Method Summary
Modifier and TypeMethodDescriptionclone()
Deprecated.static MPrintFormat
copy
(Properties ctx, int from_AD_PrintFormat_ID, int to_AD_PrintFormat_ID) Copy existing Definition To Clientstatic MPrintFormat
copyToClient
(Properties ctx, int AD_PrintFormat_ID, int to_Client_ID) Copy existing Definition To Clientstatic MPrintFormat
copyToClient
(Properties ctx, int AD_PrintFormat_ID, int to_Client_ID, String trxName) Copy existing Definition To Clientstatic MPrintFormat
createFromGridLayout
(Properties ctx, GridTab gridTab, boolean allColumns) static MPrintFormat
createFromReportView
(Properties ctx, int AD_ReportView_ID, String ReportName) Create MPrintFormat for ReportViewstatic MPrintFormat
createFromTable
(Properties ctx, int AD_Table_ID) Create MPrintFormat for Tablestatic MPrintFormat
createFromTable
(Properties ctx, int AD_Table_ID, int AD_PrintFormat_ID) Create MPrintFormat for Tablestatic MPrintFormat
createFromTable
(Properties ctx, int AD_Table_ID, int AD_PrintFormat_ID, String trxName) Create MPrintFormat for Tablestatic void
deleteFromCache
(int AD_PrintFormat_ID) Delete Format from Cachestatic MPrintFormat
get
(int AD_PrintFormat_ID) Get Format from cache (immutable)static MPrintFormat
get
(Properties ctx, int AD_PrintFormat_ID, boolean readFromDisk) Get Format from cache (immutable)static MPrintFormat
get
(Properties ctx, int AD_ReportView_ID, int AD_Table_ID) Get (default) Printformat for Report View or Tablestatic List<KeyNamePair>
getAccessiblePrintFormats
(int AD_Table_ID, int AD_Window_ID, String trxName, boolean makeNewWhenEmpty) int[]
Get AD_Column_IDs of columns in ReportGet All ItemsgetAllItems
(String orderBy) Get All ItemsgetItem
(int index) Get Print Format Itemint
Get Item CountGet Languageint[]
Get AD_Column_ID of Order Columnsstatic int
getPrintFormat_ID
(String formatName, int AD_Table_ID, int AD_Client_ID) Get ID of Print Format use NameGet Table Formatstatic int
getZoomWindowID
(int AD_PrintFormat_ID) boolean
Get Translation View useprotected Object
loadSpecial
(ResultSet rs, int index) Load Special data (images, ..).mark PO as immutablevoid
protected String
saveNewSpecial
(Object value, int index) Save Special Data.void
setAD_PrintTableFormat_ID
(int AD_PrintTableFormat_ID) Get Optional TableFormatvoid
setIsTableBased
(boolean tableBased) Set Table based.void
setLanguage
(Language language) Set Languagevoid
setStandardHeaderFooter
(boolean standardHeaderFooter) Set Standard Headervoid
Set the translation of the Format Items to the originalvoid
setTranslationLanguage
(Language language) Set Translation View Language.void
setTranslationViewQuery
(MQuery query) Update the Query to access the Translation View.static void
setUniqueName
(int AD_Client_ID, MPrintFormat pf, String basename) toString()
String RepresentationMethods inherited from class org.compiere.model.X_AD_PrintFormat
get_AccessLevel, getAD_PrintColor, getAD_PrintColor_ID, getAD_PrintFont, getAD_PrintFont_ID, getAD_PrintFormat_ID, getAD_PrintFormat_UU, getAD_PrintHeaderFooter, getAD_PrintHeaderFooter_ID, getAD_PrintPaper, getAD_PrintPaper_ID, getAD_PrintTableFormat, getAD_PrintTableFormat_ID, getAD_ReportView, getAD_ReportView_ID, getAD_Table, getAD_Table_ID, getAD_Window, getAD_Window_ID, getCreateCopy, getDescription, getFileNamePattern, getFooterMargin, getHeaderMargin, getJasperProcess, getJasperProcess_ID, getKeyNamePair, getName, getPrinterName, initPO, isBreakPagePerRecord, isDefault, isForm, isStandardHeaderFooter, isTableBased, setAD_PrintColor_ID, setAD_PrintFont_ID, setAD_PrintFormat_ID, setAD_PrintFormat_UU, setAD_PrintHeaderFooter_ID, setAD_PrintPaper_ID, setAD_ReportView_ID, setAD_Table_ID, setAD_Window_ID, setCreateCopy, setDescription, setFileNamePattern, setFooterMargin, setHeaderMargin, setIsBreakPagePerRecord, setIsDefault, setIsForm, setIsStandardHeaderFooter, setJasperProcess_ID, setName, setPrinterName
Methods inherited from class org.compiere.model.PO
afterDelete, afterSave, beforeDelete, beforeSave, buildInsertSQL, checkImmutable, clearCrossTenantSafe, 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, lock, makeImmutable, postDelete, retrieveIdOfParentValue, retrieveIdOfParentValue, save, save, saveCrossTenantSafe, saveCrossTenantSafeEx, saveCrossTenantSafeEx, saveEx, saveEx, saveNew_afterSetID, saveNew_getID, 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_PrintFormat
getAD_Client_ID, getAD_Org_ID, getCreated, getCreatedBy, getUpdated, getUpdatedBy, isActive, setAD_Org_ID, setIsActive
Methods inherited from interface org.compiere.model.I_Persistent
save
-
Constructor Details
-
MPrintFormat
UUID based Constructor- Parameters:
ctx
- ContextAD_PrintFormat_UU
- UUID keytrxName
- Transaction
-
MPrintFormat
Public Constructor. Use static get methods- Parameters:
ctx
- contextAD_PrintFormat_ID
- AD_PrintFormat_IDtrxName
- transaction
-
MPrintFormat
Load Constructor- Parameters:
ctx
- contextrs
- result settrxName
- transaction
-
MPrintFormat
- Parameters:
copy
-
-
MPrintFormat
- Parameters:
ctx
-copy
-
-
MPrintFormat
- Parameters:
ctx
-copy
-trxName
-
-
-
Method Details
-
reloadItems
public void reloadItems() -
getLanguage
Get Language- Returns:
- language
-
setLanguage
Set Language- Parameters:
language
- language
-
getOrderAD_Column_IDs
public int[] getOrderAD_Column_IDs()Get AD_Column_ID of Order Columns- Returns:
- Array of AD_Column_IDs in Sort Order
-
getAD_Column_IDs
public int[] getAD_Column_IDs()Get AD_Column_IDs of columns in Report- Returns:
- Array of AD_Column_ID
-
getAllItems
Get All Items- Returns:
- items
-
getAllItems
Get All Items- Parameters:
orderBy
-- Returns:
- items
-
getItemCount
public int getItemCount()Get Item Count- Returns:
- number of items or -1 if items not defined
-
getItem
Get Print Format Item- Parameters:
index
- index- Returns:
- Print Format Item
-
setTranslation
public void setTranslation()Set the translation of the Format Items to the original -
setIsTableBased
public void setIsTableBased(boolean tableBased) Set Table based. Reset Form- Specified by:
setIsTableBased
in interfaceI_AD_PrintFormat
- Overrides:
setIsTableBased
in classX_AD_PrintFormat
- Parameters:
tableBased
- true if table based
-
setTranslationLanguage
Set Translation View Language.- Parameters:
language
- language (checked for base language)
-
isTranslationView
public boolean isTranslationView()Get Translation View use- Returns:
- true if a translation view is used
-
setTranslationViewQuery
Update the Query to access the Translation View. Can be called multiple times, adds only if not set already- Parameters:
query
- query to be updated
-
setAD_PrintTableFormat_ID
public void setAD_PrintTableFormat_ID(int AD_PrintTableFormat_ID) Get Optional TableFormat- Specified by:
setAD_PrintTableFormat_ID
in interfaceI_AD_PrintFormat
- Overrides:
setAD_PrintTableFormat_ID
in classX_AD_PrintFormat
- Parameters:
AD_PrintTableFormat_ID
- table format
-
getTableFormat
Get Table Format- Returns:
- Table Format
-
toString
String Representation- Overrides:
toString
in classX_AD_PrintFormat
- Returns:
- info
-
loadSpecial
Load Special data (images, ..). To be extended by sub-classes- Overrides:
loadSpecial
in classPO
- Parameters:
rs
- result setindex
- zero based index- Returns:
- value value
- Throws:
SQLException
-
saveNewSpecial
Save Special Data. To be extended by sub-classes- Overrides:
saveNewSpecial
in classPO
- Parameters:
value
- valueindex
- index- Returns:
- SQL code for INSERT VALUES clause
-
createFromGridLayout
public static MPrintFormat createFromGridLayout(Properties ctx, GridTab gridTab, boolean allColumns) -
createFromTable
Create MPrintFormat for Table- Parameters:
ctx
- contextAD_Table_ID
- table- Returns:
- print format
-
createFromTable
Create MPrintFormat for Table- Parameters:
ctx
- contextAD_Table_ID
- tableAD_PrintFormat_ID
- 0 or existing PrintFormat- Returns:
- print format
-
createFromTable
public static MPrintFormat createFromTable(Properties ctx, int AD_Table_ID, int AD_PrintFormat_ID, String trxName) Create MPrintFormat for Table- Parameters:
ctx
- contextAD_Table_ID
- tableAD_PrintFormat_ID
- 0 or existing PrintFormattrxName
- the transaction- Returns:
- print format
-
createFromReportView
public static MPrintFormat createFromReportView(Properties ctx, int AD_ReportView_ID, String ReportName) Create MPrintFormat for ReportView- Parameters:
ctx
- contextAD_ReportView_ID
- ReportViewReportName
- - optional Report Name- Returns:
- print format
-
setUniqueName
-
copy
public static MPrintFormat copy(Properties ctx, int from_AD_PrintFormat_ID, int to_AD_PrintFormat_ID) Copy existing Definition To Client- Parameters:
ctx
- contextfrom_AD_PrintFormat_ID
- formatto_AD_PrintFormat_ID
- format- Returns:
- print format
-
copyToClient
Copy existing Definition To Client- Parameters:
ctx
- contextAD_PrintFormat_ID
- formatto_Client_ID
- to client- Returns:
- print format
-
copyToClient
public static MPrintFormat copyToClient(Properties ctx, int AD_PrintFormat_ID, int to_Client_ID, String trxName) Copy existing Definition To Client- Parameters:
ctx
- contextAD_PrintFormat_ID
- formatto_Client_ID
- to clienttrxName
-- Returns:
- print format
-
get
Get Format from cache (immutable)- Parameters:
AD_PrintFormat_ID
- id- Returns:
- Format
-
get
Get Format from cache (immutable)- Parameters:
ctx
- contextAD_PrintFormat_ID
- idreadFromDisk
- refresh from disk- Returns:
- Format
-
get
Get (default) Printformat for Report View or Table- Parameters:
ctx
- contextAD_ReportView_ID
- id or 0AD_Table_ID
- id or 0- Returns:
- first print format found or null
-
deleteFromCache
public static void deleteFromCache(int AD_PrintFormat_ID) Delete Format from Cache- Parameters:
AD_PrintFormat_ID
- id
-
getPrintFormat_ID
Get ID of Print Format use Name- Parameters:
formatName
-AD_Table_ID
-AD_Client_ID
-- Returns:
- AD_PrintFormat_ID
-
getAccessiblePrintFormats
public static List<KeyNamePair> getAccessiblePrintFormats(int AD_Table_ID, int AD_Window_ID, String trxName, boolean makeNewWhenEmpty) - Parameters:
AD_Table_ID
-AD_Window_ID
-trxName
-makeNewWhenEmpty
-- Returns:
-
clone
Deprecated.- Overrides:
clone
in classPO
- Throws:
CloneNotSupportedException
-
getZoomWindowID
public static int getZoomWindowID(int AD_PrintFormat_ID) -
markImmutable
Description copied from interface:ImmutablePOSupport
mark PO as immutable- Specified by:
markImmutable
in interfaceImmutablePOSupport
- Returns:
- PO
-