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) MPrintFormat
(Properties ctx, String AD_PrintFormat_UU, String trxName) UUID based ConstructorMPrintFormat
(Properties ctx, ResultSet rs, String trxName) Load ConstructorMPrintFormat
(Properties ctx, MPrintFormat copy) Copy constructorMPrintFormat
(Properties ctx, MPrintFormat copy, String trxName) Copy constructorMPrintFormat
(MPrintFormat copy) Copy constructor -
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) Create and save new print format from GridTabstatic MPrintFormat
createFromReportView
(Properties ctx, int AD_ReportView_ID, String ReportName) Create and save new MPrintFormat instance from ReportViewstatic MPrintFormat
createFromTable
(Properties ctx, int AD_Table_ID) Create and save new MPrintFormat instance for Tablestatic MPrintFormat
createFromTable
(Properties ctx, int AD_Table_ID, int AD_PrintFormat_ID) Create and save new MPrintFormat instance for Tablestatic MPrintFormat
createFromTable
(Properties ctx, int AD_Table_ID, int AD_PrintFormat_ID, String trxName) Create and save new MPrintFormat instance for Tablestatic void
deleteFromCache
(int AD_PrintFormat_ID) Delete Print Format from Cachestatic MPrintFormat
get
(int AD_PrintFormat_ID) Get Print Format from cache (immutable)static MPrintFormat
get
(Properties ctx, int AD_PrintFormat_ID, boolean readFromDisk) Get Print Format from cache (immutable)static MPrintFormat
get
(Properties ctx, int AD_ReportView_ID, int AD_Table_ID) Get (default) Print format for Report View or Tablestatic List<KeyNamePair>
getAccessiblePrintFormats
(int AD_Table_ID, int AD_Window_ID, String trxName, boolean makeNewWhenEmpty) Get accessible print formatsint[]
Get AD_Column_IDs of columns in ReportGet All ItemsgetAllItems
(String orderBy) Get All Items from DBgetItem
(int index) Get Print Format Item at indexint
Get Item CountGet Languageint[]
Get AD_Column_ID of Order By Columnsstatic int
getPrintFormat_ID
(String formatName, int AD_Table_ID, int AD_Client_ID) Get ID of Print Format via NameGet Table Formatstatic int
getZoomWindowID
(int AD_PrintFormat_ID) Get zoom window idboolean
Is use Translation Viewmark PO as immutablevoid
Reload print format items from DBprotected 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 Header and Footervoid
Set translation of Print Format Items to original valuevoid
setTranslationLanguage
(Language language) Set Translation View Language.void
setTranslationViewQuery
(MQuery query) Update Query to access the Translation View (with t postfix, for e.g c_order_header_vt instead of c_order_header_v).
Can be called multiple times, add postfix only if not added already.static void
setUniqueName
(int AD_Client_ID, MPrintFormat pf, String basename) Set unique name for print format (starting from 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, loadSpecial, 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
- Parameters:
ctx
- contextAD_PrintFormat_ID
- AD_PrintFormat_IDtrxName
- transaction
-
MPrintFormat
Load Constructor- Parameters:
ctx
- contextrs
- result settrxName
- transaction
-
MPrintFormat
Copy constructor- Parameters:
copy
-
-
MPrintFormat
Copy constructor- Parameters:
ctx
-copy
-
-
MPrintFormat
Copy constructor- Parameters:
ctx
-copy
-trxName
-
-
-
Method Details
-
reloadItems
public void reloadItems()Reload print format items from DB -
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 By Columns- Returns:
- Array of AD_Column_IDs in Sort Columns
-
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 from DB- 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 at index- Parameters:
index
-- Returns:
- Print Format Item
- Throws:
ArrayIndexOutOfBoundsException
- if index is invalid
-
setTranslation
public void setTranslation()Set translation of Print Format Items to original value -
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()Is use Translation View- Returns:
- true if a translation view is used
-
setTranslationViewQuery
Update Query to access the Translation View (with t postfix, for e.g c_order_header_vt instead of c_order_header_v).
Can be called multiple times, add postfix only if not added 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
-
saveNewSpecial
Save Special Data.- 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) Create and save new print format from GridTab- Parameters:
ctx
-gridTab
-allColumns
-- Returns:
- new print format instance
-
createFromTable
Create and save new MPrintFormat instance for Table- Parameters:
ctx
- contextAD_Table_ID
- table- Returns:
- new print format instance
-
createFromTable
Create and save new MPrintFormat instance for Table- Parameters:
ctx
- contextAD_Table_ID
- tableAD_PrintFormat_ID
- 0 or existing PrintFormat- Returns:
- new print format instance
-
createFromTable
public static MPrintFormat createFromTable(Properties ctx, int AD_Table_ID, int AD_PrintFormat_ID, String trxName) Create and save new MPrintFormat instance for Table- Parameters:
ctx
- contextAD_Table_ID
- tableAD_PrintFormat_ID
- 0 or existing PrintFormattrxName
- the transaction- Returns:
- new print format instance
-
createFromReportView
public static MPrintFormat createFromReportView(Properties ctx, int AD_ReportView_ID, String ReportName) Create and save new MPrintFormat instance from ReportView- Parameters:
ctx
- contextAD_ReportView_ID
- ReportViewReportName
- - optional Report Name- Returns:
- new print format instance
-
setUniqueName
Set unique name for print format (starting from basename)- Parameters:
AD_Client_ID
-pf
-basename
-
-
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 Print Format from cache (immutable)- Parameters:
AD_PrintFormat_ID
- id- Returns:
- Format
-
get
Get Print Format from cache (immutable)- Parameters:
ctx
- contextAD_PrintFormat_ID
- idreadFromDisk
- refresh from disk- Returns:
- Format
-
get
Get (default) Print format 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 Print Format from Cache- Parameters:
AD_PrintFormat_ID
- id
-
getPrintFormat_ID
Get ID of Print Format via Name- Parameters:
formatName
- print format nameAD_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) Get accessible print formats- Parameters:
AD_Table_ID
-AD_Window_ID
-trxName
-makeNewWhenEmpty
- if true, create new print format if no existing print format found for table- Returns:
- accessible print formats
-
clone
Deprecated.- Overrides:
clone
in classPO
- Throws:
CloneNotSupportedException
-
getZoomWindowID
public static int getZoomWindowID(int AD_PrintFormat_ID) Get zoom window id- Parameters:
AD_PrintFormat_ID
-- Returns:
- zoom AD_Window_ID
-
markImmutable
Description copied from interface:ImmutablePOSupport
mark PO as immutable- Specified by:
markImmutable
in interfaceImmutablePOSupport
- Returns:
- PO
-