|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.konakartadmin.bl.AdminBaseMgr
com.konakartadmin.bl.AdminTagMgr
public class AdminTagMgr
The AdminTagMgr - for Managing Tag Objects for the Admin Application
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.konakartadmin.bl.AdminBaseMgr |
---|
AdminBaseMgr.StaticData |
Field Summary | |
---|---|
protected static org.apache.commons.logging.Log |
log
the log |
Fields inherited from class com.konakartadmin.bl.AdminBaseMgr |
---|
adminEng, baseMgrMutex, baseStaticDataHM, cDataEnd, cDataStart, kkConf, kkInstanceId, mgrFactory, STORE_ID, templateBaseDir |
Constructor Summary | |
---|---|
AdminTagMgr(KKAdminIf eng)
Constructor |
Method Summary | |
---|---|
void |
addCategoriesToTagGroups(int tagGroupId,
int[] categories)
Add the array of categories to the tagGroup specified. |
protected void |
addTagGroupOrderBy(com.konakart.bl.KKCriteria c,
AdminSearch search)
|
protected int |
addTagGroupSearchCriteria(com.konakart.bl.KKCriteria c,
AdminSearch search,
java.lang.String aliasPrefix)
|
void |
addTagGroupsToCategory(AdminTagGroup[] tagGroups,
int categoryId)
Add the array of tagGroups to the category identified by categoryId. |
protected void |
addTagGroupToTagOrderBy(com.konakart.bl.KKCriteria c,
AdminSearch search)
|
protected int |
addTagGroupToTagSearchCriteria(com.konakart.bl.KKCriteria c,
AdminSearch search)
|
protected void |
addTagOrderBy(com.konakart.bl.KKCriteria c,
AdminSearch search)
|
protected int |
addTagSearchCriteria(com.konakart.bl.KKCriteria c,
AdminSearch search)
|
void |
addTagsToProduct(AdminTag[] tags,
int productId)
Add the array of tags to the product identified by productId. |
void |
deleteTag(java.lang.String sessionId,
int id)
Delete a Tag from the database. |
void |
deleteTagGroup(java.lang.String sessionId,
int id)
Delete a TagGroup from the database. |
protected boolean |
doesTagExist(int id)
Return true if the tag exists. |
protected boolean |
doesTagExist(int id,
int langId)
Return true if the tag exists. |
protected boolean |
doesTagGroupExist(int id)
Return true if the tagGroup exists. |
protected boolean |
doesTagGroupExist(int id,
int langId)
Return true if the tagGroup exists. |
AdminTagGroupSearchResult |
getTagGroups(java.lang.String sessionId,
AdminSearch search,
int offset,
int size)
Return the TagGroup objects defined by the search criteria. |
AdminTagGroup[] |
getTagGroupsPerCategory(int categoryId,
int languageId)
Return an array of AdminTagGroup objects for a category. |
AdminTagGroupToTag[] |
getTagGroupToTags(java.lang.String sessionId,
AdminSearch search,
int offset,
int size)
Return the TagGroupToTag objects defined by the search criteria. |
AdminTagSearchResult |
getTags(java.lang.String sessionId,
AdminSearch search,
int offset,
int size)
Return the Tag objects defined by the search criteria. |
int |
getTagsCount(AdminSearch search)
Returns a count of the number of Tags |
AdminTag[] |
getTagsPerProduct(int productId,
int languageId)
Fetches all of the tags for a product. |
protected AdminTag[] |
getTagsPerTagGroup(int tagGroupId,
int languageId)
Fetches all of the tags for a tag group |
int |
insertTag(java.lang.String sessionId,
AdminTag tag)
Insert a new Tag object. |
int |
insertTagGroup(java.lang.String sessionId,
AdminTagGroup tagGroup)
Insert a new TagGroup object. |
int |
insertTagGroups(java.lang.String sessionId,
AdminTagGroup[] tagGroups)
Insert an array of TagGroup objects - provide a TagGroup object for each language |
protected void |
insertTagGroupToTagRecords(AdminTag tag,
java.sql.Connection con)
|
protected void |
insertTagGroupToTagRecords(AdminTagGroup tagGroup,
java.sql.Connection con)
|
protected void |
insertTagGroupToTagRecords(AdminTagGroupToTag tagGroupToTag,
java.sql.Connection con)
Insert an AdminTagGroupToTag record |
void |
insertTagGroupToTags(AdminTagGroupToTag tagGroupToTag)
Insert an AdminTagGroupToTag record |
int |
insertTags(java.lang.String sessionId,
AdminTag[] tags)
Insert an array of Tag objects - provide a Tag record for each supported language. |
void |
refreshConfigs()
Refresh the configuration of the Manager |
void |
removeTagGroupsFromCategory(AdminTagGroup[] tagGroups,
int categoryId)
If associations exist between the tagGroups and the category identified by categoryId, then they are removed. |
void |
removeTagsFromProduct(AdminTag[] tags,
int productId)
If associations exist between the tags and the product identified by productId, then they are removed. |
protected void |
setTagCriteriaWithStandardAttributes(com.konakart.bl.KKCriteria c,
int languageId)
Set the Criteria attribute with standard attributes for a Tag object |
protected void |
setTagGroupCriteriaWithStandardAttributes(com.konakart.bl.KKCriteria c,
int languageId)
Set the Criteria attribute with standard attributes for a TagGroup object |
int |
updateTag(java.lang.String sessionId,
AdminTag tag)
Update an existing Tag object - only the Name, the SortOrder and associated TagGroups (if present) can be updated. |
int |
updateTagGroup(java.lang.String sessionId,
AdminTagGroup tagGroup)
Update an existing TagGroup object - You can update the name, description and the set of tags associated to the tag group if the tags attribute is non-null. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static org.apache.commons.logging.Log log
Constructor Detail |
---|
public AdminTagMgr(KKAdminIf eng) throws java.lang.Exception
eng
-
java.lang.Exception
Method Detail |
---|
public AdminTagSearchResult getTags(java.lang.String sessionId, AdminSearch search, int offset, int size) throws KKAdminException
getTags
in interface AdminTagMgrIf
sessionId
- session Id of logged in Admin usersearch
- the generic Admin search object that defines the tag objects to search for. If
null we use the default AdminSearch object. If you specify the LanguageId in the
search object, only the tag for that specified language will be returned. If you
specify AdminLanguage.ALL_LANGUAGES for the languageId the search will be made on
the default language, and if tags are found, tags with these tagIds for all of the
languages are returned.offset
- starting offset in database - so that you can page through resultssize
- size of the group that will be returned - the maximum number of records returned
KKAdminException
protected int addTagSearchCriteria(com.konakart.bl.KKCriteria c, AdminSearch search) throws java.lang.Exception
java.lang.Exception
protected void addTagOrderBy(com.konakart.bl.KKCriteria c, AdminSearch search)
public int getTagsCount(AdminSearch search) throws java.lang.Exception
search
- Search criteria
java.lang.Exception
public AdminTagGroupSearchResult getTagGroups(java.lang.String sessionId, AdminSearch search, int offset, int size) throws KKAdminException
getTagGroups
in interface AdminTagMgrIf
sessionId
- session Id of logged in Admin usersearch
- the generic Admin search object that defines the tag group objects to search foroffset
- starting offset in database - so that you can page through resultssize
- size of the group that will be returned - the maximum number of records returned
KKAdminException
protected int addTagGroupSearchCriteria(com.konakart.bl.KKCriteria c, AdminSearch search, java.lang.String aliasPrefix)
protected void addTagGroupOrderBy(com.konakart.bl.KKCriteria c, AdminSearch search)
public int insertTags(java.lang.String sessionId, AdminTag[] tags) throws java.lang.Exception
insertTags
in interface AdminTagMgrIf
sessionId
- session Id of logged in Admin usertags
- the array of AdminTag objects to insert - do not fill out the Id on these as this
will be created. It is assumed that all of these tags will have the same ID, and
there will be one for each language.
java.lang.Exception
public int insertTag(java.lang.String sessionId, AdminTag tag) throws java.lang.Exception
insertTag
in interface AdminTagMgrIf
sessionId
- session Id of logged in Admin usertag
- the new AdminTag object to insert - do not fill out the Id (unless inserting a tag
for a new language) as this will be created. If the tag specifies -1
(KonakartAdminConstants.DEFAULT_LANGUAGE_ID) for the languageId, we set the id of
the default language before inserting)
java.lang.Exception
protected void insertTagGroupToTagRecords(AdminTag tag, java.sql.Connection con) throws java.lang.RuntimeException, org.apache.torque.TorqueException, KKAdminException
java.lang.RuntimeException
org.apache.torque.TorqueException
KKAdminException
public int insertTagGroups(java.lang.String sessionId, AdminTagGroup[] tagGroups) throws KKAdminException
insertTagGroups
in interface AdminTagMgrIf
sessionId
- session Id of logged in Admin usertagGroups
- the new AdminTagGroup object to insert - do not fill out the Id on these as this
will be created. It is assumed that all of these tagGroups will have the same ID,
and there will be one for each language.
KKAdminException
public int insertTagGroup(java.lang.String sessionId, AdminTagGroup tagGroup) throws KKAdminException
insertTagGroup
in interface AdminTagMgrIf
sessionId
- session Id of logged in Admin usertagGroup
- the new AdminTagGroup object to insert - do not fill out the Id as this will be
created. If the tag group specifies -1
(KonakartAdminConstants.DEFAULT_LANGUAGE_ID) for the languageId, we set the id of
the default language before inserting)
KKAdminException
protected void insertTagGroupToTagRecords(AdminTagGroup tagGroup, java.sql.Connection con) throws java.lang.RuntimeException, org.apache.torque.TorqueException, KKAdminException
java.lang.RuntimeException
org.apache.torque.TorqueException
KKAdminException
public void insertTagGroupToTags(AdminTagGroupToTag tagGroupToTag) throws KKAdminException
insertTagGroupToTags
in interface AdminTagMgrIf
tagGroupToTag
-
KKAdminException
java.lang.RuntimeException
protected void insertTagGroupToTagRecords(AdminTagGroupToTag tagGroupToTag, java.sql.Connection con) throws java.lang.RuntimeException, org.apache.torque.TorqueException, KKAdminException
tagGroupToTag
- con
- db connection - if new, a new one is created
java.lang.RuntimeException
org.apache.torque.TorqueException
KKAdminException
public int updateTag(java.lang.String sessionId, AdminTag tag) throws KKAdminException
updateTag
in interface AdminTagMgrIf
sessionId
- session Id of logged in Admin usertag
- the AdminTag object to update
KKAdminException
public int updateTagGroup(java.lang.String sessionId, AdminTagGroup tagGroup) throws KKAdminException
updateTagGroup
in interface AdminTagMgrIf
sessionId
- session Id of logged in Admin usertagGroup
- the AdminTagGroup object to update
KKAdminException
public void deleteTag(java.lang.String sessionId, int id) throws KKAdminException
deleteTag
in interface AdminTagMgrIf
sessionId
- session Id of logged in Admin userid
- the id of the AdminTag to delete
KKAdminException
protected boolean doesTagExist(int id) throws org.apache.torque.TorqueException, KKAdminException
id
- tag id
org.apache.torque.TorqueException
KKAdminException
protected boolean doesTagExist(int id, int langId) throws org.apache.torque.TorqueException, KKAdminException
id
- tag idlangId
- language id
org.apache.torque.TorqueException
KKAdminException
public void deleteTagGroup(java.lang.String sessionId, int id) throws KKAdminException
deleteTagGroup
in interface AdminTagMgrIf
sessionId
- session Id of logged in Admin userid
- the id of the AdminTagGroup to delete
KKAdminException
protected boolean doesTagGroupExist(int id) throws org.apache.torque.TorqueException, KKAdminException
id
- tagGroup id
org.apache.torque.TorqueException
KKAdminException
protected boolean doesTagGroupExist(int id, int langId) throws org.apache.torque.TorqueException, KKAdminException
id
- tagGroup idlangId
- language id
org.apache.torque.TorqueException
KKAdminException
public AdminTagGroup[] getTagGroupsPerCategory(int categoryId, int languageId) throws java.lang.Exception
getTagGroupsPerCategory
in interface AdminTagMgrIf
categoryId
- languageId
-
java.lang.Exception
protected void setTagGroupCriteriaWithStandardAttributes(com.konakart.bl.KKCriteria c, int languageId)
c
- languageId
- protected void setTagCriteriaWithStandardAttributes(com.konakart.bl.KKCriteria c, int languageId)
c
- languageId
- protected AdminTag[] getTagsPerTagGroup(int tagGroupId, int languageId) throws com.workingdogs.village.DataSetException, org.apache.torque.TorqueException, KKAdminException
tagGroupId
- languageId
-
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException
KKAdminException
public void addTagGroupsToCategory(AdminTagGroup[] tagGroups, int categoryId) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, KKAdminException
addTagGroupsToCategory
in interface AdminTagMgrIf
tagGroups
- categoryId
-
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException
public void addCategoriesToTagGroups(int tagGroupId, int[] categories) throws org.apache.torque.TorqueException, KKAdminException
addCategoriesToTagGroups
in interface AdminTagMgrIf
tagGroupId
- the tag group Id to link to the categoriescategories
- an array of category Ids to link to the Tag Group
org.apache.torque.TorqueException
KKAdminException
public void removeTagGroupsFromCategory(AdminTagGroup[] tagGroups, int categoryId) throws org.apache.torque.TorqueException, KKAdminException
removeTagGroupsFromCategory
in interface AdminTagMgrIf
tagGroups
- categoryId
-
org.apache.torque.TorqueException
KKAdminException
public AdminTag[] getTagsPerProduct(int productId, int languageId) throws java.lang.Exception
getTagsPerProduct
in interface AdminTagMgrIf
productId
- languageId
-
java.lang.Exception
public void addTagsToProduct(AdminTag[] tags, int productId) throws org.apache.torque.TorqueException, KKAdminException
addTagsToProduct
in interface AdminTagMgrIf
tags
- productId
-
org.apache.torque.TorqueException
KKAdminException
public void removeTagsFromProduct(AdminTag[] tags, int productId) throws org.apache.torque.TorqueException, KKAdminException
removeTagsFromProduct
in interface AdminTagMgrIf
tags
- productId
-
org.apache.torque.TorqueException
KKAdminException
public void refreshConfigs() throws java.lang.Exception
refreshConfigs
in interface AdminTagMgrIf
refreshConfigs
in class AdminBaseMgr
java.lang.Exception
public AdminTagGroupToTag[] getTagGroupToTags(java.lang.String sessionId, AdminSearch search, int offset, int size) throws KKAdminException
getTagGroupToTags
in interface AdminTagMgrIf
sessionId
- session Id of logged in Admin usersearch
- the generic Admin search object that defines the tag objects to search for. If
null we use the default AdminSearch object. If id is not -1 this is used to define
the tag Group Id. If id2 is not -1 this is used to define the tag Id.offset
- starting offset in database - so that you can page through resultssize
- size of the group that will be returned - the maximum number of records returned
KKAdminException
protected int addTagGroupToTagSearchCriteria(com.konakart.bl.KKCriteria c, AdminSearch search)
protected void addTagGroupToTagOrderBy(com.konakart.bl.KKCriteria c, AdminSearch search)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |