com.ds.fw.dv
Class FwCatTree

java.lang.Object
  |
  +--com.ds.fw.types.FwSimpleObject
        |
        +--com.ds.fw.dv.FwCatTree
All Implemented Interfaces:
java.lang.Cloneable, FwCopyableIF, FwDisplayableIF, FwSimpleObjectIF, java.io.Serializable

public class FwCatTree
extends FwSimpleObject

See Also:
Serialized Form

Field Summary
 long cat
          The category id
 java.lang.String fi_cat
           
 java.lang.String fi_cat1
           
 java.lang.String fi_id
           
 java.lang.String fi_id1
           
 java.lang.String fi_name
           
 java.lang.String fi_name1
           
 java.lang.String img_nd0
           
 java.lang.String img_nd1
           
 java.lang.String img_nm1
           
 java.lang.String img_np0
           
 int max_view_items
          The maximum number of the items that can be viewed in the tree.
 int maxLevel
          The maximum number of levels that the category tree can contain
 java.lang.String nextLine
          A string containing the html code for getting at the next line in an html file
 java.lang.String otmest
          The offset - the space from a category to its subcategory in the tree
 int page
          The maximum number of the items that can be viewed in the tree.
 java.lang.String path_images
          The url to the image , that are shown before the name of the node
 long rootcat
          The root id
 java.lang.String sCat
           
 java.lang.String sFile
           
 java.lang.String sOP
           
 java.lang.String SQL
           
 
Constructor Summary
FwCatTree()
          The constructor for this class
 
Method Summary
 com.ds.fw.beans.FwBaseBean getCat(long id)
          Gets a category
 com.ds.fw.beans.FwBaseBean getCatElements(long id)
          Gets the category's elements
 java.lang.String getOtmest(int level)
          Gets the offset(the space between a category and the root)
 java.lang.String getTreeList()
          Generate the html code for the visualization of the category's tree.
 java.lang.String getTreeList(int level, java.util.Vector vec, java.lang.String s)
          Generate the html code for the visualization of the category's tree.
 java.util.Vector getTreePath(long iCat, java.util.Vector vec)
          Gets the path from the root to a given node of the tree.
 int haveCatInCat(long id)
          Check if a category has a subcategory
 void initParameters()
          Initsialize the fields .
 
Methods inherited from class com.ds.fw.types.FwSimpleObject
getClassName, getClone, getCopy, getCopy, getDeepCopy, getDisplayString, getDisplayStringFor, postCopy, printStackTrace, toString, toStringValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

rootcat

public long rootcat
The root id


cat

public long cat
The category id


max_view_items

public int max_view_items
The maximum number of the items that can be viewed in the tree. Don't work at the moment.


page

public int page
The maximum number of the items that can be viewed in the tree. Don't work at the moment.


otmest

public java.lang.String otmest
The offset - the space from a category to its subcategory in the tree


nextLine

public java.lang.String nextLine
A string containing the html code for getting at the next line in an html file


maxLevel

public int maxLevel
The maximum number of levels that the category tree can contain


path_images

public java.lang.String path_images
The url to the image , that are shown before the name of the node


img_nm1

public java.lang.String img_nm1

img_nd1

public java.lang.String img_nd1

img_np0

public java.lang.String img_np0

img_nd0

public java.lang.String img_nd0

SQL

public java.lang.String SQL

sOP

public java.lang.String sOP

sFile

public java.lang.String sFile

sCat

public java.lang.String sCat

fi_id

public java.lang.String fi_id

fi_id1

public java.lang.String fi_id1

fi_name

public java.lang.String fi_name

fi_name1

public java.lang.String fi_name1

fi_cat

public java.lang.String fi_cat

fi_cat1

public java.lang.String fi_cat1
Constructor Detail

FwCatTree

public FwCatTree()
The constructor for this class

Method Detail

initParameters

public void initParameters()
Initsialize the fields . Called by the constructor. You don't need to call it when create a new instance of this class . Call it only to reinitsialize the fields with their default values.


getTreePath

public java.util.Vector getTreePath(long iCat,
                                    java.util.Vector vec)
Gets the path from the root to a given node of the tree.

Parameters:
iCat - the category id , which path we want to receive
vec -
Returns:
a vector , containing the parent's ids of the category

haveCatInCat

public int haveCatInCat(long id)
Check if a category has a subcategory

Parameters:
id - the category's id
Returns:
the number of the subcategories , 0 - if the category has no subcategories

getCatElements

public com.ds.fw.beans.FwBaseBean getCatElements(long id)
Gets the category's elements

Parameters:
id - the category's id
Returns:
FwBaseBean object, containing the information from the database, null if there was an error , during the execution.

getCat

public com.ds.fw.beans.FwBaseBean getCat(long id)
Gets a category

Parameters:
id - the category id
Returns:
FwBaseBean object , containing the information from the database , null if there was an error , during the execution .

getOtmest

public java.lang.String getOtmest(int level)
Gets the offset(the space between a category and the root)

Parameters:
level - the category's level
Returns:
an html code as string for the offset

getTreeList

public java.lang.String getTreeList()
Generate the html code for the visualization of the category's tree.

Returns:
a string , containing the html code for the visualization of the tree.
See Also:
getTreeList(int, Vector, String)

getTreeList

public java.lang.String getTreeList(int level,
                                    java.util.Vector vec,
                                    java.lang.String s)
Generate the html code for the visualization of the category's tree.

Parameters:
level - the category's level
vec -
s - string , containing some html code, the code for the visualization of the category's tree is appended at its end.
Returns:
a string , containing the html code for the visualization of the tree.