Compiere 3.1

org.compiere.model
Class MTree

java.lang.Object
  extended by org.compiere.framework.PO
      extended by org.compiere.model.X_AD_Tree
          extended by org.compiere.model.MTree
All Implemented Interfaces:
Serializable, Cloneable, Comparator<PO>, Evaluatee

public class MTree
extends X_AD_Tree

Builds Tree. Creates tree structure - maintained in VTreePanel

Version:
$Id: MTree.java,v 1.2 2006/07/30 00:51:02 jjanke Exp $
Author:
Jorg Janke
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.compiere.model.X_AD_Tree
accessLevel, Model, Table_ID, Table_Name, TREETYPE_Activity, TREETYPE_AD_Reference_ID, TREETYPE_BoM, TREETYPE_BPartner, TREETYPE_Campaign, TREETYPE_CMContainer, TREETYPE_CMContainerStage, TREETYPE_CMMedia, TREETYPE_CMTemplate, TREETYPE_ElementValue, TREETYPE_Menu, TREETYPE_Organization, TREETYPE_Other, TREETYPE_Product, TREETYPE_ProductCategory, TREETYPE_Project, TREETYPE_SalesRegion, TREETYPE_User1, TREETYPE_User2, TREETYPE_User3, TREETYPE_User4, updatedMS
 
Fields inherited from class org.compiere.framework.PO
ACCESSLEVEL_ALL, ACCESSLEVEL_CLIENT, ACCESSLEVEL_CLIENTORG, ACCESSLEVEL_ORG, ACCESSLEVEL_SYSTEM, ACCESSLEVEL_SYSTEMCLIENT, ENTITYTYPE_Dictionary, ENTITYTYPE_UserMaintained, I_ZERO, log, p_changeVO, p_info, XML_ATTRIBUTE_AD_Table_ID, XML_ATTRIBUTE_Record_ID
 
Constructor Summary
MTree(Ctx ctx, int AD_Tree_ID, boolean editable, boolean clientTree, String trxName)
          Construct & Load Tree
MTree(Ctx ctx, int AD_Tree_ID, String trxName)
          Default Constructor.
MTree(Ctx ctx, ResultSet rs, String trxName)
          Load Constructor
MTree(Ctx ctx, String Name, String TreeType, String trxName)
          Full Constructor
MTree(MClient client, String name, String treeType)
          Parent Constructor
 
Method Summary
protected  boolean afterSave(boolean newRecord, boolean success)
          After Save
protected  boolean beforeSave(boolean newRecord)
          Before Save
static MTree get(Ctx ctx, int AD_Tree_ID, String trxName)
          Get MTree_Base from Cache
 String getActionColorName()
          Get fully qualified Name of Action/Color Column
 int getAD_Table_ID()
          Get AD_Table_ID
 int getAD_Table_ID(boolean base)
          Get AD_Table_ID
static int getDefaultAD_Tree_ID(int AD_Client_ID, int AD_Table_ID)
          Get default (oldest) complete AD_Tree_ID for KeyColumn.
static int getDefaultAD_Tree_ID(int AD_Client_ID, String tableName)
          Get default (oldest) complete AD_Tree_ID for KeyColumn.
 String getNodeTableName()
          Get Node TableName
static String getNodeTableName(int AD_Table_ID)
          Get Node TableName
 CTreeNode getRoot()
          Get Root node
 String getSourceTableName(boolean tableNameOnly)
          Get Source TableName (i.e. where to get the name and color)
static boolean hasTree(int AD_Table_ID)
          Table has Tree
static boolean hasTree(String tableName)
          Table has Tree
 boolean isBPartner()
          Is Business Partner Tree
 boolean isMenu()
          Is Menu Tree
 boolean isProduct()
          Is Product Tree
 String toString()
          String representation
 void trimTree()
          Trim tree of empty summary nodes
 void updateTrees()
          Update all Trees with Table_ID
 
Methods inherited from class org.compiere.model.X_AD_Tree
get_AccessLevel, getAD_Tree_ID, getDescription, getKeyNamePair, getName, getTreeType, initPO, isAllNodes, isDefault, isProcessing, isTreeTypeValid, setAD_Table_ID, setAD_Tree_ID, setDescription, setIsAllNodes, setIsDefault, setName, setProcessing, setTreeType
 
Methods inherited from class org.compiere.framework.PO
addAttachment, addAttachment, addError, afterDelete, beforeDelete, compare, convertToBigDecimal, convertToBoolean, convertToInt, convertToTimestamp, copy, copyValues, copyValues, createAttachment, delete_Accounting, delete, delete, dump, dump, equals, get_ChangeVO, get_ColumnCount, get_ColumnDescription, get_ColumnDisplayType, get_ColumnIndex, get_ColumnLabel, get_ColumnLookup, get_ColumnName, get_DisplayValue, get_EntityType, get_HashMap, get_ID, get_IDOld, get_Info, get_KeyColumns, get_Logger, get_Table_ID, get_Table_ID, get_TableName, get_Translation, get_TrxName, get_Value, get_Value, get_ValueAsInt, get_ValueAsInt, get_ValueAsString, get_ValueDifference, get_ValueDifference, get_ValueOfColumn, get_ValueOld, get_ValueOld, get_ValueOldAsInt, get_ValuesAsString, get_WhereClause, get_xmlDocument, get_xmlString, get_xmlString, getAD_Client_ID, getAD_Org_ID, getAllIDs, getAttachment, getAttachment, getAttachmentData, getCreated, getCreatedBy, getCtx, getFindParameter, getPdfAttachment, getUpdated, getUpdatedBy, getVO, hashCode, insert_Accounting, is_Changed, is_KeyColumn, is_new, is_ValueChanged, is_ValueChanged, isActive, isAttachment, isColumnMandatory, isColumnUpdateable, isMandatoryOK, isPdfAttachment, load, load, load, load, loadComplete, loadDefaults, loadSpecial, lock, save, save, saveNew_getID, saveNewInsertSQL, saveNewSpecial, saveUpdate, set_ChangeVO, set_ColumnUpdateable, set_CustomColumn, set_TrxName, set_Value, set_Value, set_ValueE, set_ValueNoCheck, set_ValueNoCheckE, set_ValueOfColumn, set_ValueString, setAD_Client_ID, setAD_Org_ID, setClientOrg, setClientOrg, setContext, setCtx, setDocWorkflowMgr, setIsActive, setStandardDefaults, setUpdateable, setUpdatedBy, toStringX, unlock, update
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MTree

public MTree(Ctx ctx,
             int AD_Tree_ID,
             String trxName)
Default Constructor. Need to call loadNodes explicitly

Parameters:
ctx - context for security
AD_Tree_ID - The tree to build
trxName - transaction

MTree

public MTree(Ctx ctx,
             ResultSet rs,
             String trxName)
Load Constructor

Parameters:
ctx - context
rs - result set
trxName - transaction

MTree

public MTree(MClient client,
             String name,
             String treeType)
Parent Constructor

Parameters:
client - client
name - name
treeType -

MTree

public MTree(Ctx ctx,
             String Name,
             String TreeType,
             String trxName)
Full Constructor

Parameters:
ctx - context
Name - name
TreeType - tree type
trxName - transaction

MTree

public MTree(Ctx ctx,
             int AD_Tree_ID,
             boolean editable,
             boolean clientTree,
             String trxName)
Construct & Load Tree

Parameters:
AD_Tree_ID - The tree to build
editable - True, if tree can be modified - includes inactive and empty summary nodes
ctx - context for security
clientTree - the tree is displayed on the java client (not on web)
trxName - transaction
Method Detail

getDefaultAD_Tree_ID

public static int getDefaultAD_Tree_ID(int AD_Client_ID,
                                       int AD_Table_ID)
Get default (oldest) complete AD_Tree_ID for KeyColumn. Called from GridController

Parameters:
AD_Client_ID - client
AD_Table_ID - table
Returns:
AD_Tree_ID or 0

getDefaultAD_Tree_ID

public static int getDefaultAD_Tree_ID(int AD_Client_ID,
                                       String tableName)
Get default (oldest) complete AD_Tree_ID for KeyColumn. Called from GridController

Parameters:
AD_Client_ID - client
AD_Table_ID - table
Returns:
AD_Tree_ID or 0

getNodeTableName

public static String getNodeTableName(int AD_Table_ID)
Get Node TableName

Parameters:
AD_Table_ID - table
Returns:
node table name, e.g. AD_TreeNode

hasTree

public static boolean hasTree(int AD_Table_ID)
Table has Tree

Parameters:
AD_Table_ID - table
Returns:
true if table has tree

hasTree

public static boolean hasTree(String tableName)
Table has Tree

Parameters:
tableName - table
Returns:
true if table has tree

get

public static MTree get(Ctx ctx,
                        int AD_Tree_ID,
                        String trxName)
Get MTree_Base from Cache

Parameters:
ctx - context
AD_Tree_ID - id
trxName - transaction
Returns:
MTree_Base

trimTree

public void trimTree()
Trim tree of empty summary nodes


getRoot

public CTreeNode getRoot()
Get Root node

Returns:
root

isMenu

public boolean isMenu()
Is Menu Tree

Returns:
true if menu

isProduct

public boolean isProduct()
Is Product Tree

Returns:
true if product

isBPartner

public boolean isBPartner()
Is Business Partner Tree

Returns:
true if partner

getNodeTableName

public String getNodeTableName()
Get Node TableName

Returns:
node table name, e.g. AD_TreeNode

getSourceTableName

public String getSourceTableName(boolean tableNameOnly)
Get Source TableName (i.e. where to get the name and color)

Parameters:
tableNameOnly - if false return From clause (alias = t)
Returns:
source table name, e.g. AD_Org or null

getActionColorName

public String getActionColorName()
Get fully qualified Name of Action/Color Column

Returns:
NULL or Action or Color

getAD_Table_ID

public int getAD_Table_ID()
Get AD_Table_ID

Overrides:
getAD_Table_ID in class X_AD_Tree
Returns:
table

getAD_Table_ID

public int getAD_Table_ID(boolean base)
Get AD_Table_ID

Parameters:
base - base info
Returns:
table

beforeSave

protected boolean beforeSave(boolean newRecord)
Before Save

Overrides:
beforeSave in class PO
Parameters:
newRecord - new
Returns:
true

afterSave

protected boolean afterSave(boolean newRecord,
                            boolean success)
After Save

Overrides:
afterSave in class PO
Parameters:
newRecord - new
success - success
Returns:
success

updateTrees

public void updateTrees()
Update all Trees with Table_ID


toString

public String toString()
String representation

Overrides:
toString in class X_AD_Tree
Returns:
info

Compiere 3.1

Compiere® is a registered trademark of ComPiere, Inc. ©2004-2008 HumanFlash.com All rights reserved.