com.konakartadmin.app
Class AdminCategory

java.lang.Object
  extended by com.konakartadmin.app.AdminCategory
All Implemented Interfaces:
AdminObjectIf

public class AdminCategory
extends java.lang.Object
implements AdminObjectIf

The AdminCategory


Field Summary
private  AdminCategory[] children
          children
private  java.lang.String custom1
          custom field
private  java.lang.String custom2
          custom field
private  java.lang.String custom3
          custom field
private  java.lang.String description
          description
private  AdminCategoryDescription[] descriptions
          Array of descriptions
private  int id
          id
private  java.lang.String image
          image
private  boolean invisible
          Invisible - Doesn't appear in the category tree
private  AdminMiscItem[] miscItems
          Miscellaneous Items
private  java.lang.String name
          name
private  int numberOfProducts
          numberOfProducts
private  int parentId
          parentId
private  int sortOrder
          sortOrder
 
Constructor Summary
AdminCategory()
          Constructor
AdminCategory(com.workingdogs.village.Record vr, org.apache.torque.util.Criteria c)
          Instantiates the attributes of the AdminCategory object from a Record object
 
Method Summary
 void calculateNumberOfProducts()
          Recursively parses through the children of this category and adds the total amount of products contained by the category to the number of products that this category may already have.
 AdminCategory findCategory(int categoryId)
          Searches all of the children, grandchildren etc of this object and returns the category object with the given id .
 void getAllChildrenIds(java.util.List<java.lang.Integer> childList)
          Adds all of the ids of the children, grandchildren etc of this object to the given childList.
 AdminCategory[] getChildren()
           
 java.lang.String getCustom1()
           
 java.lang.String getCustom2()
           
 java.lang.String getCustom3()
           
 java.lang.String getDescription()
           
 AdminCategoryDescription[] getDescriptions()
           
 int getId()
           
 java.lang.String getImage()
           
 AdminMiscItem[] getMiscItems()
          Returns the array of Miscellaneous Items associated with this category.
 java.lang.String getName()
           
 int getNumberOfProducts()
           
 int getParentId()
           
 int getSortOrder()
           
 boolean isInvisible()
           
 void setChildren(AdminCategory[] children)
           
 void setCustom1(java.lang.String custom1)
           
 void setCustom2(java.lang.String custom2)
           
 void setCustom3(java.lang.String custom3)
           
 void setDescription(java.lang.String description)
           
 void setDescriptions(AdminCategoryDescription[] descriptions)
           
 void setId(int id)
           
 void setImage(java.lang.String image)
           
 void setInvisible(boolean invisible)
           
 void setMiscItems(AdminMiscItem[] miscItems)
           
 void setName(java.lang.String name)
           
 void setNumberOfProducts(int numberOfProducts)
           
 void setParentId(int parentId)
           
 void setSortOrder(int sortOrder)
           
 java.lang.String toString()
           
 java.lang.String toStringBrief()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

id

private int id
id


image

private java.lang.String image
image


parentId

private int parentId
parentId


sortOrder

private int sortOrder
sortOrder


name

private java.lang.String name
name


description

private java.lang.String description
description


descriptions

private AdminCategoryDescription[] descriptions
Array of descriptions


numberOfProducts

private int numberOfProducts
numberOfProducts


children

private AdminCategory[] children
children


custom1

private java.lang.String custom1
custom field


custom2

private java.lang.String custom2
custom field


custom3

private java.lang.String custom3
custom field


invisible

private boolean invisible
Invisible - Doesn't appear in the category tree


miscItems

private AdminMiscItem[] miscItems
Miscellaneous Items

Constructor Detail

AdminCategory

public AdminCategory()
Constructor


AdminCategory

public AdminCategory(com.workingdogs.village.Record vr,
                     org.apache.torque.util.Criteria c)
              throws com.workingdogs.village.DataSetException
Instantiates the attributes of the AdminCategory object from a Record object

Parameters:
vr - Record containing data
c - Criteria containing column names
Throws:
com.workingdogs.village.DataSetException
Method Detail

calculateNumberOfProducts

public void calculateNumberOfProducts()
Recursively parses through the children of this category and adds the total amount of products contained by the category to the number of products that this category may already have.


toString

public java.lang.String toString()
Specified by:
toString in interface AdminObjectIf
Overrides:
toString in class java.lang.Object
Returns:
Returns a string containing the attributes of the Category object and those of its children.

toStringBrief

public java.lang.String toStringBrief()
Returns:
Returns a string containing selected attributes of the Category object

getAllChildrenIds

public void getAllChildrenIds(java.util.List<java.lang.Integer> childList)
Adds all of the ids of the children, grandchildren etc of this object to the given childList.

Parameters:
childList -

findCategory

public AdminCategory findCategory(int categoryId)
Searches all of the children, grandchildren etc of this object and returns the category object with the given id . If it can't be found, it returns null.

Parameters:
categoryId -
Returns:
Returns a category object or null

getChildren

public AdminCategory[] getChildren()
Returns:
Returns the children.

setChildren

public void setChildren(AdminCategory[] children)
Parameters:
children - The children to set.

getId

public int getId()
Specified by:
getId in interface AdminObjectIf
Returns:
Returns the id.

setId

public void setId(int id)
Specified by:
setId in interface AdminObjectIf
Parameters:
id - The id to set.

getImage

public java.lang.String getImage()
Returns:
Returns the image.

setImage

public void setImage(java.lang.String image)
Parameters:
image - The image to set.

getName

public java.lang.String getName()
Returns:
Returns the name.

setName

public void setName(java.lang.String name)
Parameters:
name - The name to set.

getNumberOfProducts

public int getNumberOfProducts()
Returns:
Returns the numberOfProducts.

setNumberOfProducts

public void setNumberOfProducts(int numberOfProducts)
Parameters:
numberOfProducts - The numberOfProducts to set.

getParentId

public int getParentId()
Returns:
Returns the parentId.

setParentId

public void setParentId(int parentId)
Parameters:
parentId - The parentId to set.

getSortOrder

public int getSortOrder()
Returns:
Returns the sortOrder.

setSortOrder

public void setSortOrder(int sortOrder)
Parameters:
sortOrder - The sortOrder to set.

getDescriptions

public AdminCategoryDescription[] getDescriptions()
Returns:
Returns the descriptions.

setDescriptions

public void setDescriptions(AdminCategoryDescription[] descriptions)
Parameters:
descriptions - The descriptions to set.

getCustom1

public java.lang.String getCustom1()
Returns:
Returns the custom1.

setCustom1

public void setCustom1(java.lang.String custom1)
Parameters:
custom1 - The custom1 to set.

getCustom2

public java.lang.String getCustom2()
Returns:
Returns the custom2.

setCustom2

public void setCustom2(java.lang.String custom2)
Parameters:
custom2 - The custom2 to set.

getCustom3

public java.lang.String getCustom3()
Returns:
Returns the custom3.

setCustom3

public void setCustom3(java.lang.String custom3)
Parameters:
custom3 - The custom3 to set.

isInvisible

public boolean isInvisible()
Returns:
the invisible

setInvisible

public void setInvisible(boolean invisible)
Parameters:
invisible - the invisible to set

getDescription

public java.lang.String getDescription()
Returns:
the description

setDescription

public void setDescription(java.lang.String description)
Parameters:
description - the description to set

getMiscItems

public AdminMiscItem[] getMiscItems()
Returns the array of Miscellaneous Items associated with this category.

Returns:
the miscItems associated with this product.

setMiscItems

public void setMiscItems(AdminMiscItem[] miscItems)
Parameters:
miscItems - the miscItems to set


Copyright © 2011 DS Data Systems UK Ltd.