public class Category extends JDBCObject<Category>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
IMG_GIF
The file extension for a ".gif" type of image file.
|
static java.lang.String |
IMG_JPG
The file extension for a ".jpg" type of image file.
|
static java.lang.String |
IMG_PNG
The file extension for a ".png" type of image file.
|
private static long |
serialVersionUID
The class' serialization version id.
|
LOWVAL_RPG_DATE, LOWVAL_RPG_TIME, STATUS_ACTIVE, STATUS_BLANK, STATUS_CANCELED, STATUS_DELETED, STATUS_INACTIVE, STATUS_PENDING
ivHashCode, ivHashFlds, ivObjAttrs
Constructor and Description |
---|
Category()
Constructs a
Category object with all field values set to
null . |
Modifier and Type | Method and Description |
---|---|
java.util.ArrayList<Category> |
get1stChildren(FlashServletContext ctx)
Returns a collection of category objects for the first level children of
this category.
|
java.util.ArrayList<Category> |
get1stParents(FlashServletContext ctx)
Returns a collection of category objects for the first level parents of
this category.
|
java.util.ArrayList<Category> |
getAllChildren(FlashServletContext ctx,
boolean unique)
Returns a collection of category objects for all levels of children of
this category.
|
java.util.ArrayList<Category> |
getAllChildren(JDBCConnectionInfo cninfo,
boolean unique)
Returns a collection of category objects for all levels of children of
this category.
|
java.lang.String |
getClassCode()
Returns the default classification code for products in the category.
|
java.lang.String |
getCode()
Returns the unique code for the category.
|
java.io.File |
getDescriptionFile()
Returns a file object for this category's description file.
|
static java.io.File |
getDescriptionFile(java.lang.String code)
Returns a file object for a category's description file.
|
java.lang.String |
getDescriptionFileContent()
Returns the file content for this category's description file.
|
java.lang.String |
getDescriptionFileContent(boolean prune)
Returns the file content for this category's description file.
|
static java.lang.String |
getDescriptionFileContent(java.lang.String code)
Returns the file content for a category's description file.
|
static java.lang.String |
getDescriptionFileContent(java.lang.String code,
boolean prune)
Returns the file content for a category's description file.
|
java.lang.String |
getDescriptionFileURL()
Returns a relative url for this category's description file.
|
java.lang.String |
getDescriptionFileURL(boolean full)
Returns the relative or full URL for a category description file.
|
static java.lang.String |
getDescriptionFileURL(java.lang.String code)
Returns a relative url for a category's description file.
|
static java.lang.String |
getDescriptionFileURL(java.lang.String code,
boolean full)
Returns the relative or full URL for a category description file.
|
java.io.File |
getImageFile()
Returns a file object for a category image file.
|
static java.io.File |
getImageFile(java.lang.String code)
Returns a file object for a category image file.
|
java.lang.String |
getImageURL()
Returns the relative URL for a category image file.
|
java.lang.String |
getImageURL(boolean full)
Returns the relative or full URL for a category image file.
|
static java.lang.String |
getImageURL(java.lang.String code)
Returns the relative URL for a category image file.
|
static java.lang.String |
getImageURL(java.lang.String code,
boolean full)
Returns the relative or full URL for a category image file.
|
Leadtime |
getLeadtime()
Returns the default lead time object for products in the category.
|
java.lang.String |
getLeadtimeCode()
Returns the default lead time code for products in the category.
|
java.lang.String |
getName()
Returns the description.
|
java.util.ArrayList<Category> |
getPathFromParent(FlashServletContext ctx,
Category parent)
Returns a collection of category objects for the path to this category,
starting with the given parent category.
|
java.util.ArrayList<Category> |
getPathToParent(FlashServletContext ctx,
Category parent)
Returns a collection of category for the path from this category, ending
with the given parent category.
|
java.lang.Integer |
getStockLowQty()
Returns the default low stock quantity for products in the category.
|
java.lang.String |
getStockLowQtyStr()
Returns the default low stock quantity for products in the category.
|
java.lang.Integer |
getStockOutQty()
Returns the default out of stock quantity for products in the category.
|
java.lang.String |
getStockOutQtyStr()
Returns the default out of stock quantity for products in the category.
|
boolean |
hasDescriptionFile()
Answers if this category has a category description file.
|
static boolean |
hasDescriptionFile(java.lang.String code)
Answers if a category has a category description file.
|
boolean |
hasImageFile()
Answers if this category has a category-specific image file.
|
static boolean |
hasImageFile(java.lang.String code)
Answers if the category has a category-specific image file.
|
boolean |
isDescendant(FlashServletContext ctx,
Category parent)
Determines if this category is a descendant (child, grandchild, etc.) of
the given parent category.
|
void |
setClassCode(java.lang.String value)
Sets the default classification code for products in the category.
|
void |
setCode(java.lang.String value)
Sets the unique code for the category.
|
void |
setLeadtime(Leadtime value)
Sets the default lead time object for products in the category.
|
private void |
setLeadtimeCode(java.lang.String value)
Sets the default lead time code for products in the category.
|
void |
setName(java.lang.String value)
Sets the description.
|
void |
setStockLowQty(java.lang.Integer value)
Sets the default low stock quantity for products in the category.
|
void |
setStockOutQty(java.lang.Integer value)
Sets the default out of stock quantity for products in the category.
|
after, before, compareTo, equals, fmtStatus, fmtStatus, getObjectStatus, hashKey, setObjectStatus
cloneMapAttributes, formatValue, formatValue, getHashFields, getMapArrayList, getMapAttributes, getMapBigDecimal, getMapBoolean, getMapDate, getMapDouble, getMapInteger, getMapLong, getMapMapped, getMapObject, getMapShort, getMapString, getMapString, getMapStringBuffer, getMapStringBuilder, getMapTime, getMapTimestamp, getMapVector, hashCode, setHashFields, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMapAttributes, setMapObject, setMapTime, setMapTimestamp, toStringArray
private static final long serialVersionUID
public static final java.lang.String IMG_GIF
public static final java.lang.String IMG_JPG
public static final java.lang.String IMG_PNG
public Category()
Category
object with all field values set to
null
.public java.lang.String getCode()
public void setCode(java.lang.String value)
value
- (String) The unique code for the category.public java.lang.String getName()
public void setName(java.lang.String value)
value
- (String) The description.public java.lang.Integer getStockLowQty()
null
if a default is not defined.public java.lang.String getStockLowQtyStr()
public void setStockLowQty(java.lang.Integer value)
value
- (Integer) The default low stock quantity for products in
the category or null
if a default is not defined.public java.lang.Integer getStockOutQty()
null
if a default is not defined.public java.lang.String getStockOutQtyStr()
public void setStockOutQty(java.lang.Integer value)
value
- (Integer) The default out of stock quantity for products
in the category or null
if a default is not defined.public Leadtime getLeadtime()
public void setLeadtime(Leadtime value)
value
- (Leadtime) The default lead time object for products in
the category.public java.lang.String getLeadtimeCode()
private void setLeadtimeCode(java.lang.String value)
value
- (String) The default lead time code for products in the
category.public java.lang.String getClassCode()
public void setClassCode(java.lang.String value)
value
- (String) The default classification code for products in
the category.public java.util.ArrayList<Category> get1stChildren(FlashServletContext ctx)
CategoryController
.ctx
- (FlashServletContext) The current servlet context.public java.util.ArrayList<Category> getAllChildren(FlashServletContext ctx, boolean unique)
CategoryController
.ctx
- (FlashServletContext) The current servlet context.unique
- (boolean) true
if the returned collection should
not contain any duplicate category objects. false
if
the returned collection should contain all child category objects
found, even if a child category occurs more than once in this
category's tree.public java.util.ArrayList<Category> getAllChildren(JDBCConnectionInfo cninfo, boolean unique)
CategoryController
.cninfo
- (JDBCConnectionInfo) A database connection info object.unique
- (boolean) true
if the returned collection should
not contain any duplicate category objects. false
if
the returned collection should contain all child category objects
found, even if a child category occurs more than once in this
category's tree.public java.util.ArrayList<Category> get1stParents(FlashServletContext ctx)
CategoryController
.ctx
- (FlashServletContext) The current servlet context.public java.util.ArrayList<Category> getPathFromParent(FlashServletContext ctx, Category parent)
CategoryController
.ctx
- (FlashServletContext) The current servlet context.parent
- (Category) The parent category from which the path is to
be built.public java.util.ArrayList<Category> getPathToParent(FlashServletContext ctx, Category parent)
CategoryController
.ctx
- (FlashServletContext) The current servlet context.parent
- (Category) The parent category to which the path is to
be built.public boolean isDescendant(FlashServletContext ctx, Category parent)
CategoryController
.ctx
- (FlashServletContext) The current servlet context.parent
- (Category) The parent category to which ancestory is to
be determined.true
if this category is a child, grandchild,
great-grandchild, etc. of the specified parent, otherwise
false
.public boolean hasDescriptionFile()
true
if a category description file is found
for this category, otherwise false
.public static boolean hasDescriptionFile(java.lang.String code)
code
- (String) The category code for the desired description file.true
if a category description file is found
for the category, otherwise false
.public java.io.File getDescriptionFile()
public static java.io.File getDescriptionFile(java.lang.String code)
code
- (String) The category code for the desired description file.public java.lang.String getDescriptionFileContent()
TemplatePruner
class to remove potentially harmful html code.public static java.lang.String getDescriptionFileContent(java.lang.String code)
TemplatePruner
class to remove potentially harmful html code.code
- (String) The category code for the desired description file.public java.lang.String getDescriptionFileContent(boolean prune)
prune
- (boolean) true
if the content is to be pruned by
invoking the TemplatePruner
class to remove potentially
harmful html code.public static java.lang.String getDescriptionFileContent(java.lang.String code, boolean prune)
code
- (String) The category code for the desired description file.prune
- (boolean) true
if the content is to be pruned by
invoking the TemplatePruner
class to remove potentially
harmful html code.public java.lang.String getDescriptionFileURL()
public static java.lang.String getDescriptionFileURL(java.lang.String code)
code
- (String) The category code for the desired description file.public java.lang.String getDescriptionFileURL(boolean full)
full
- (boolean) true
to return the fully qualified URL
or false
to return the relative URL. The fully qualified
URL is per Profile.BASE_URL_NONSECURE
.public static java.lang.String getDescriptionFileURL(java.lang.String code, boolean full)
code
- (String) The category code for the desired description file.full
- (boolean) true
to return the fully qualified URL
or false
to return the relative URL. The fully qualified
URL is per Profile.BASE_URL_NONSECURE
.public boolean hasImageFile()
true
if a category-specific image file exists,
otherwise false
.public static boolean hasImageFile(java.lang.String code)
code
- (String) The category code for the desired image file.true
if a category-specific image file exists,
otherwise false
.public java.io.File getImageFile()
public static java.io.File getImageFile(java.lang.String code)
code
- (String) The category code for the desired image file.public java.lang.String getImageURL()
public static java.lang.String getImageURL(java.lang.String code)
code
- (String) The category code for the desired image file.public java.lang.String getImageURL(boolean full)
full
- (boolean) true
to return the fully qualified URL
or false
to return the relative URL. The fully qualified
URL is per Profile.BASE_URL_NONSECURE
.public static java.lang.String getImageURL(java.lang.String code, boolean full)
code
- (String) The category code for the desired image file.full
- (boolean) true
to return the fully qualified URL
or false
to return the relative URL. The fully qualified
URL is per Profile.BASE_URL_NONSECURE
.