|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--com.knowgate.dataobjs.DBPersist
|
+--com.knowgate.hipergate.Category
Categories from k_categories database table
| Field Summary | |
static int |
BROWSE_BOTTOMUP
|
static int |
BROWSE_DOWN
|
static int |
BROWSE_TOPDOWN
|
static int |
BROWSE_UP
|
static short |
ClassId
|
| Fields inherited from class com.knowgate.dataobjs.DBPersist |
AllVals, sAuditCls, sAuditUsr, sTransactId |
| Constructor Summary | |
|
Category()
Create empty Category |
|
Category(JDCConnection oConn,
java.lang.String sIdCategory)
Load Category from database |
|
Category(java.lang.String sIdCategory)
Create Category and set gu_category. |
protected |
Category(java.lang.String sTableName,
java.lang.String sClassName)
|
| Method Summary | |
int |
addObject(java.sql.Connection oConn,
java.lang.String sIdObject,
int iIdClass,
int iAttribs,
int iOdPosition)
Add object to Category. |
java.util.LinkedList |
browse(JDCConnection oConn,
int iDirection,
int iOrder)
Get a list of all parents or childs of a Category. |
static java.lang.String |
create(JDCConnection oConn,
java.lang.Object[] Values)
Create new Category with translated labels. |
boolean |
delete(JDCConnection oConn)
Delete Category and all its childs. |
static boolean |
delete(JDCConnection oConn,
java.lang.String sCategoryGUID)
Delete Category and all its childs. |
void |
expand(java.sql.Connection oConn)
Expand all Category childs. |
DBSubset |
getACLGroups(JDCConnection oConn)
Get Groups with permissions over this Category. |
DBSubset |
getACLUsers(JDCConnection oConn)
Get Users with direct permissions over this Category. |
DBSubset |
getChilds(JDCConnection oConn)
Get first level childs as a DBSubset. |
static java.lang.String |
getIdFromName(JDCConnection oConn,
java.lang.String sCategoryNm)
Get Category GUID given its internal name. |
boolean |
getIsRoot(java.sql.Connection oConn)
|
java.lang.String |
getLabel(java.sql.Connection oConn,
java.lang.String sLanguage)
Get translated label for a category. |
DBSubset |
getNames(JDCConnection oConn)
Get Category translated labels as a DBSubset. |
DBSubset |
getObjects(JDCConnection oConn)
Get objects contained at Category. |
DBSubset |
getParents(JDCConnection oConn)
Get inmediate parents as a DBSubset. |
java.lang.String |
getPath(java.sql.Connection oConn)
Compose a path to Category by concatenating all parents names. |
int |
getUserPermissions(java.sql.Connection oConn,
java.lang.String sIdUser)
Get User permissions for Category Calls k_sp_cat_usr_perm stored procedure. |
void |
inheritPermissions(JDCConnection oConn,
java.lang.String sFromCategory,
short iRecurse,
short iObjects)
Inherits permissions from another Category. |
boolean |
isChildOf(java.sql.Connection oConn,
java.lang.String sParentCategory)
Get whether or not this category descends at any level from another one. |
boolean |
isParentOf(java.sql.Connection oConn,
java.lang.String sChildCategory)
Get whether or not this category is parent at any level of another one. |
int |
level(JDCConnection oConn)
Get category depth level. |
static java.lang.String |
makeName(JDCConnection oConn,
java.lang.String sCategoryNm)
Make an internal category name from an arbitrary string. |
void |
removeGroupPermissions(java.sql.Connection oConn,
java.lang.String sIdGroups,
short iRecurse,
short iObjects)
Set group permissions. |
int |
removeObject(java.sql.Connection oConn,
java.lang.String sIdObject)
Remove object from Category Removing an object from a Category does not delete it. |
void |
removeUserPermissions(java.sql.Connection oConn,
java.lang.String sIdUsers,
short iRecurse,
short iObjects)
Remove permissions for user at a Category. |
void |
resetParent(java.sql.Connection oConn,
java.lang.String sIdParent)
Remove Category from parent. |
void |
setGroupPermissions(java.sql.Connection oConn,
java.lang.String sIdGroups,
int iACLMask,
short iRecurse,
short iObjects)
Set group permissions for Category Calls k_sp_cat_set_grp stored procedure. |
void |
setIsRoot(java.sql.Connection oConn,
boolean bIsRoot)
Make or unmake a root category. |
void |
setParent(java.sql.Connection oConn,
java.lang.String sIdParent)
Set New Parent for this category. |
void |
setUserPermissions(java.sql.Connection oConn,
java.lang.String sIdUsers,
int iACLMask,
short iRecurse,
short iObjects)
Set user permissions for a Category. |
boolean |
store(JDCConnection oConn)
Store Category. |
static java.lang.String |
store(JDCConnection oConn,
java.lang.String sCategoryId,
java.lang.String sParentId,
java.lang.String sCategoryName,
short iIsActive,
int iDocStatus,
java.lang.String sOwner,
java.lang.String sIcon1,
java.lang.String sIcon2)
Create or Store Category. |
void |
storeLabels(JDCConnection oConn,
java.lang.String sNamesTable,
java.lang.String sRowDelim,
java.lang.String sColDelim)
|
void |
uploadDirectory(JDCConnection oConn,
java.lang.String sSourcePath,
java.lang.String sProtocol,
java.lang.String sServer,
java.lang.String sTargetPath,
java.lang.String sLanguage)
|
| Methods inherited from class com.knowgate.dataobjs.DBPersist |
clear, exists, get, getDate, getDateFormated, getDecimal, getFloat, getInt, getInteger, getItemMap, getItems, getShort, getString, getStringNull, getTable, getTable, getTableName, getTimestamp, getUIdFromName, isNull, iterator, load, parseXML, put, put, put, put, put, put, put, put, put, put, put, put, putAll, remove, replace, replace, replace, replace, setAuditTransact, setAuditUser, toXML, toXML, toXML |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int BROWSE_UP
public static final int BROWSE_DOWN
public static final int BROWSE_TOPDOWN
public static final int BROWSE_BOTTOMUP
public static final short ClassId
| Constructor Detail |
public Category()
public Category(java.lang.String sIdCategory)
throws java.sql.SQLException
sIdCategory - Category GUID
java.sql.SQLException
public Category(JDCConnection oConn,
java.lang.String sIdCategory)
throws java.sql.SQLException
oConn - Database ConnectionsIdCategory - Category GUID
java.sql.SQLException
protected Category(java.lang.String sTableName,
java.lang.String sClassName)
| Method Detail |
public java.util.LinkedList browse(JDCConnection oConn,
int iDirection,
int iOrder)
throws java.sql.SQLException
Get a list of all parents or childs of a Category.
All levels up or down are scanned recursively.
oConn - Database ConnectioniDirection - BROWSE_UP for browsing parents or BROWSE_DOWN for browsing childs.iOrder - BROWSE_TOPDOWN first element on the list will be the top most parent,
BROWSE_BOTTOMUP first element on the list will be the deepest child.
java.sql.SQLException
public java.lang.String getPath(java.sql.Connection oConn)
throws java.sql.SQLException
Compose a path to Category by concatenating all parents names.
Calls k_sp_get_cat_path.
oConn - Database Connection
java.sql.SQLException
public boolean delete(JDCConnection oConn)
throws java.sql.SQLException
Delete Category and all its childs.
First delete all Products and Companies contained in Category, including physical disk files associted with Products and Company attachments.
delete in class DBPersistoConn - Database Connection
java.sql.SQLException
public int addObject(java.sql.Connection oConn,
java.lang.String sIdObject,
int iIdClass,
int iAttribs,
int iOdPosition)
throws java.sql.SQLException
Add object to Category.
The object GUID and numeric class identifier is inserted at k_x_cat_objs table.
oConn - Database ConnectionsIdObject - Object GUIDiIdClass - Object Numeric Class Identifier (variable ClassId)iAttribs - Object attributes mask (user defined)iOdPosition - Object Position. An arbitrary position for the object inside the
category. Position is not unique for an object. Two or more objects may have the same
position.
java.sql.SQLException - If object is alredy contanied in Category then a primary key violation exception is raised.
public int removeObject(java.sql.Connection oConn,
java.lang.String sIdObject)
throws java.sql.SQLException
Remove object from Category
Removing an object from a Category does not delete it.
oConn - Database ConnectionsIdObject - Object GUID
java.sql.SQLException
public void removeGroupPermissions(java.sql.Connection oConn,
java.lang.String sIdGroups,
short iRecurse,
short iObjects)
throws java.sql.SQLException
Set group permissions.
Calls k_sp_cat_del_grp stored procedure.
oConn - Database ConnectionsIdGroups - String of comma separated GUIDs of ACLGroups with permissions to remove.iRecurse - Remove permissions also from childs Categories all levels down.iObjects - Not Used, must be zero.
java.sql.SQLException
public void setGroupPermissions(java.sql.Connection oConn,
java.lang.String sIdGroups,
int iACLMask,
short iRecurse,
short iObjects)
throws java.sql.SQLException
Set group permissions for Category
Calls k_sp_cat_set_grp stored procedure.
oConn - Database ConnectionsIdGroups - String of comma separated GUIDs of ACLGroups with permissions to set.iACLMask - Permissions mask, any combination of { ACL.PERMISSION_LIST,
ACL.PERMISSION_READ,ACL.PERMISSION_ADD,ACL.PERMISSION_DELETE,ACL.PERMISSION_MODIFY,
ACL.PERMISSION_MODERATE,ACL.PERMISSION_SEND,ACL.PERMISSION_GRANT,
ACL.PERMISSION_FULL_CONTROL }iRecurse - Remove permissions also from childs Categories all levels down.iObjects - Not Used, must be zero.
java.sql.SQLExceptionACL
public int getUserPermissions(java.sql.Connection oConn,
java.lang.String sIdUser)
throws java.sql.SQLException
Get User permissions for Category
Calls k_sp_cat_usr_perm stored procedure.
oConn - Database ConnectionsIdUser - User GUID
java.sql.SQLException
public void removeUserPermissions(java.sql.Connection oConn,
java.lang.String sIdUsers,
short iRecurse,
short iObjects)
throws java.sql.SQLException
Remove permissions for user at a Category.
Calls k_sp_cat_del_usr.
oConn - Database ConnectionsIdUsers - String of user GUIDs separated by commas.iRecurse - Remove permissions from child categories.iObjects - Not used, must be zero.
java.sql.SQLException
public void setUserPermissions(java.sql.Connection oConn,
java.lang.String sIdUsers,
int iACLMask,
short iRecurse,
short iObjects)
throws java.sql.SQLException
Set user permissions for a Category.
Calls k_sp_cat_set_usr stored procedure.
oConn - Database ConnectionsIdUsers - String of user GUIDs separated by commas.iACLMask - Permissions mask. Any combination of:
{ ACL.PERMISSION_LIST, ACL.PERMISSION_READ,ACL.PERMISSION_ADD,
ACL.PERMISSION_DELETE,ACL.PERMISSION_MODIFY, ACL.PERMISSION_MODERATE,
ACL.PERMISSION_SEND,ACL.PERMISSION_GRANT,ACL.PERMISSION_FULL_CONTROL }iRecurse - Remove permissions from child categories.iObjects - Not used, must be zero.
java.sql.SQLException
public void inheritPermissions(JDCConnection oConn,
java.lang.String sFromCategory,
short iRecurse,
short iObjects)
throws java.sql.SQLException
Inherits permissions from another Category.
All previous permissions on this Category are removed before copying permission from the other Category.
oConn - Database ConnectionsFromCategory - GUID of category with permissions to be inherited.iRecurse - Propagate permissions to child categories.iObjects - Not used, must be zero.
java.sql.SQLException
public boolean isChildOf(java.sql.Connection oConn,
java.lang.String sParentCategory)
throws java.sql.SQLException
oConn - Database ConnectionsParentCategory - Parent category
java.sql.SQLException
public boolean isParentOf(java.sql.Connection oConn,
java.lang.String sChildCategory)
throws java.sql.SQLException
oConn - Database ConnectionsChildCategory - Child Category GUID
java.sql.SQLException
public int level(JDCConnection oConn)
throws java.sql.SQLException
Get category depth level.
Calls k_sp_cat_level stored procedure.
oConn - Database Connection
java.sql.SQLException
public boolean getIsRoot(java.sql.Connection oConn)
throws java.sql.SQLException
oConn - Database Connection
java.sql.SQLException
public void setIsRoot(java.sql.Connection oConn,
boolean bIsRoot)
throws java.sql.SQLException
oConn - Database ConnectionbIsRoot - true if category is to be made root.
java.sql.SQLException - If This Category is present as a child of another
category at k_cat_tree table.
public java.lang.String getLabel(java.sql.Connection oConn,
java.lang.String sLanguage)
throws java.sql.SQLException
oConn - Database ConnectionsLanguage - Language code from k_lu_languages table.
java.sql.SQLException
public DBSubset getNames(JDCConnection oConn)
throws java.sql.SQLException
Get Category translated labels as a DBSubset.
oConn - Database Connection
| id_language | tr_category | url_category |
| 2 chras. Lang. Id. | Translated Category Name | URL for Category |
java.sql.SQLException
public DBSubset getChilds(JDCConnection oConn)
throws java.sql.SQLException
Get first level childs as a DBSubset.
oConn - Database Connection
java.sql.SQLException
public DBSubset getParents(JDCConnection oConn)
throws java.sql.SQLException
Get inmediate parents as a DBSubset.
oConn - Database Connection
java.sql.SQLException
public DBSubset getObjects(JDCConnection oConn)
throws java.sql.SQLException
oConn - Database Connection
| gu_object | id_class | bi_attribs |
java.sql.SQLException
public DBSubset getACLGroups(JDCConnection oConn)
throws java.sql.SQLException
oConn - Database Connection
java.sql.SQLException
public DBSubset getACLUsers(JDCConnection oConn)
throws java.sql.SQLException
oConn - Database Connection
java.sql.SQLException
public void setParent(java.sql.Connection oConn,
java.lang.String sIdParent)
throws java.sql.SQLException
Set New Parent for this category.
The old parent (if any) is not changed nor removed.
oConn - Database ConnectionsIdParent - GUID of parent Category
java.sql.SQLException
public void resetParent(java.sql.Connection oConn,
java.lang.String sIdParent)
throws java.sql.SQLException
Remove Category from parent.
Removing a Category from a parent does not delete it.
oConn - Database ConnectionsIdParent - Parent Category GUID
java.sql.SQLException
public boolean store(JDCConnection oConn)
throws java.sql.SQLException
Store Category.
If gu_category is null a new GUID is automatically assigned.
store in class DBPersistoConn - Database Connection
java.sql.SQLException
public void expand(java.sql.Connection oConn)
throws java.sql.SQLException
Expand all Category childs.
Calls k_sp_cat_expand stored procedure.
oConn - Database Connection
java.sql.SQLException
public void storeLabels(JDCConnection oConn,
java.lang.String sNamesTable,
java.lang.String sRowDelim,
java.lang.String sColDelim)
throws java.sql.SQLException,
java.util.NoSuchElementException
java.sql.SQLException
java.util.NoSuchElementException
public void uploadDirectory(JDCConnection oConn,
java.lang.String sSourcePath,
java.lang.String sProtocol,
java.lang.String sServer,
java.lang.String sTargetPath,
java.lang.String sLanguage)
throws java.lang.Exception,
java.io.IOException,
java.sql.SQLException
java.lang.Exception
java.io.IOException
java.sql.SQLException
public static java.lang.String store(JDCConnection oConn,
java.lang.String sCategoryId,
java.lang.String sParentId,
java.lang.String sCategoryName,
short iIsActive,
int iDocStatus,
java.lang.String sOwner,
java.lang.String sIcon1,
java.lang.String sIcon2)
throws java.sql.SQLException
Create or Store Category.
oConn - Database ConnectionsCategoryId - GUID of Category to store or null if it is a new Category.sParentId - GUID of Parent Category or null if it is a root category.sCategoryName - Internal Category Name. It is recommended that makeName()
method is applied always on sCategoryName. Because category names are often used for composing
physical disk paths, assigning characters such as '*', '/', '?' etc. to category names may
lead to errors when creating directories for contained Products. As a general rule use ONLY
upper case letters and numbers for category names.iIsActive - 1 if category is to be marked active, 0 if it is to be marked as unactive.iDocStatus - Initial Document Status, { 0=Pending, 1=Active, 2=Locked } See k_lu_status table.sOwner - GUID of User owner of this Category.sIcon1 - Icon for closed folder.sIcon2 - Icon for opened folder.
java.sql.SQLException
public static boolean delete(JDCConnection oConn,
java.lang.String sCategoryGUID)
throws java.sql.SQLException,
java.io.IOException
Delete Category and all its childs.
First delete all Products and Companies contained in Category, including physical disk files associted with Products and Company attachments.
oConn - Database ConnectionsCategoryGUID - GUID of Category to delete.
java.sql.SQLException
java.io.IOException
public static java.lang.String create(JDCConnection oConn,
java.lang.Object[] Values)
throws java.sql.SQLException
oConn - Database ConnectionValues - An array with the following elements:java.sql.SQLException
public static java.lang.String getIdFromName(JDCConnection oConn,
java.lang.String sCategoryNm)
throws java.sql.SQLException
Get Category GUID given its internal name.
Calls k_sp_get_cat_id stored procedure.
oConn - Databse ConnectionsCategoryNm - Category Internal Name
java.sql.SQLException
public static java.lang.String makeName(JDCConnection oConn,
java.lang.String sCategoryNm)
throws java.sql.SQLException
Make an internal category name from an arbitrary string.
Because nm_category is a primary key for table k_categories and because category names are used for composing physical disk paths, some special rules must be followed when assigning category names.
oConn - Database ConnectionsCategoryNm - String to be used as a guide for making category name.
java.sql.SQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||