public class CategoryHelper
extends java.lang.Object
Constructor and Description |
---|
CategoryHelper() |
Modifier and Type | Method and Description |
---|---|
void |
addCategory(CommandContext cmdContext)
Adds a category.
|
void |
deleteCategory(java.lang.Long nCatalogId,
java.lang.Long nCatgroupId,
CommandContext cmdContext)
Deletes a category.
|
boolean |
getAllowDuplicatedName()
Get the allow duplicate name flag.
|
java.lang.Long |
getCatalogId()
Get the catalog ID.
|
java.lang.Long |
getCatgroupId()
Get the catalog group ID.
|
java.lang.Long |
getCatgroupIdParent()
Get the parent catalog group ID.
|
CommandContext |
getCommandContext()
Get the command context.
|
java.lang.String |
getKeyword() |
void |
reset()
Resets all instance variables to null.
|
void |
setAllowDuplicatedName(boolean aboolAllowDuplicatedName)
Set the allow duplicate name.
|
void |
setCatalogId(java.lang.Long anCatalogId)
Set the catalog ID.
|
void |
setCatgroupId(java.lang.Long anCatgroupId)
Set the catalog group ID.
|
void |
setCatgroupIdParent(java.lang.Long anCatgroupIdParent)
Set the parent catalog group ID.
|
void |
setDescLanguage(java.lang.Integer anDescLanguage)
Set the language id of the catalog group description.
|
void |
setDisplay(java.lang.String astrDisplay)
Set the display for the catalog group description.
|
void |
setField1(java.lang.String astrField1)
Set the field1 of the catalog group.
|
void |
setField2(java.lang.String astrField2)
Set the field2 of the catalog group.
|
void |
setForContract(boolean bContract)
Setter to indicate if the category is to be used in a contract.
|
void |
setFullimage(java.lang.String astrFullimage)
Set the path of the full image of catalog group description.
|
void |
setIdentifier(java.lang.String astrIdentifier)
Set the identifier of the catalog group.
|
void |
setKeyword(java.lang.String istrKeyword)
Set the keyword of the catalog group description.
|
void |
setLongdescription(java.lang.String astrLongdescription)
Set the long description of the catalog group description.
|
void |
setMarkfordelete(java.lang.Integer anMarkfordelete)
Set the markfordelete of the catalog group.
|
void |
setName(java.lang.String astrName)
Set the language dependent name of catalog group description.
|
void |
setPublished(java.lang.Integer anPublished)
Set the published flag of catalog group description.
|
void |
setSequence(java.lang.Double adSequence)
Sets the sequence.
|
void |
setShortdescription(java.lang.String astrShortdescription)
Set the short description of catalog group description.
|
void |
setThumbnail(java.lang.String astrThumbnail)
Set the path to the thumbnail image of the catalog group description.
|
void |
setUpdateParentCategory(boolean bUpdate)
Set the 'UpdateParentCategory' flag.
|
void |
updateCategory(CommandContext cmdContext)
Update a category.
|
public void addCategory(CommandContext cmdContext) throws ECException, javax.ejb.RemoveException, CatalogToolException
CatalogGroupAddCmd
is used to
create the category. Before calling this method, uses the appropriate setters on CategoryHelper
,
including field1, field2, identifier, mark for delete, display, full image path, description language, long description, name, published flag, short description, thumbnail path, keyword, catalog ID, catalog group parent ID, and sequence number.
so that CatalogGroupAddCmd
executes without exceptions.cmdContext
- The CommandContext
.ECException
- If CatalogGroupAddCmd
fails.javax.ejb.RemoveException
- In the execution of the method, a RemoveException
occurs.CatalogToolException
- If we don't allow duplicate name and a duplicate name is detected.public void deleteCategory(java.lang.Long nCatalogId, java.lang.Long nCatgroupId, CommandContext cmdContext) throws ECException, javax.ejb.RemoveException, CatalogToolException
CatalogGroupDeleteCmd
will be called
to deleted the category. To be successful, the setCatGroupId
method should be called before this method. Product sets associated to the
catalog and the category will also be removed.nCatalogId
- The catalog ID.nCatgroupId
- The catalog group ID.cmdContext
- The CommandContext
.ECException
- If CatalogGroupDeleteCmd
fails.javax.ejb.RemoveException
- In the execution of the method, a RemoveException
occurs.CatalogToolException
- if the "to be deleted" catalog group has catalog groups or catalog entries.public java.lang.Long getCatalogId()
public java.lang.Long getCatgroupId()
public java.lang.Long getCatgroupIdParent()
public CommandContext getCommandContext()
public boolean getAllowDuplicatedName()
true
.true
if duplicate names are allowed, otherwise false
.public void reset()
public void setAllowDuplicatedName(boolean aboolAllowDuplicatedName)
aboolAllowDuplicatedName
- true
to allow duplicate catalog group name, false
otherwise.public void setCatalogId(java.lang.Long anCatalogId)
anCatalogId
- The catalog ID.public void setCatgroupId(java.lang.Long anCatgroupId)
anCatgroupId
- The catalog group ID.public void setCatgroupIdParent(java.lang.Long anCatgroupIdParent)
anCatgroupIdParent
- the parent catalog group ID.public void setDescLanguage(java.lang.Integer anDescLanguage) throws ECException
anDescLanguage
- The language id of the catalog group description.ECException
- If the CommandContext
cannot return a language ID.public void setDisplay(java.lang.String astrDisplay)
astrDisplay
- The display for the catalog group description.public void setField1(java.lang.String astrField1)
astrField1
- The field1 of the catalog group.public void setField2(java.lang.String astrField2)
astrField2
- The field2 of the catalog group.public void setForContract(boolean bContract)
false
.bContract
- true
if the category is to be used in a contract; false
otherwise.public void setFullimage(java.lang.String astrFullimage)
astrFullimage
- The path of the full image of catalog group description.public void setIdentifier(java.lang.String astrIdentifier)
astrIdentifier
- The identifier of the catalog group.public void setLongdescription(java.lang.String astrLongdescription)
astrLongdescription
- The long description of the catalog group description.public void setMarkfordelete(java.lang.Integer anMarkfordelete)
anMarkfordelete
- The markfordelete of the catalog group.public void setName(java.lang.String astrName)
astrName
- The language dependent name of catalog group description.public void setPublished(java.lang.Integer anPublished)
anPublished
- 0
indicates "no"; otherwise 1
indicates "yes".public void setSequence(java.lang.Double adSequence)
adSequence
- The sequence number.public void setShortdescription(java.lang.String astrShortdescription)
astrShortdescription
- The short description of catalog group description.public void setThumbnail(java.lang.String astrThumbnail)
astrThumbnail
- The path to the thumbnail image of the catalog group description.public void setUpdateParentCategory(boolean bUpdate)
false
.bUpdate
- true
to update the parent category; otherwise false
.public void updateCategory(CommandContext cmdContext) throws ECException, javax.ejb.RemoveException, CatalogToolException
CatalogGroupUpdateCmd
is used to
update the category. Before calling this method, uses the appropriate setters on CategoryHelper
cmdContext
- The CommandContext
.ECException
- If the CatalogGroupUpdateCmd
fails.javax.ejb.RemoveException
- In the execution of the method, a RemoveException
occurs.CatalogToolException
- If we try to create an invalid paretn-child categories relationship (like a cycle)public java.lang.String getKeyword()
public void setKeyword(java.lang.String istrKeyword)
istrKeyword
- The keyword of the catalog group description..