Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.knowgate.hipergate
Class Categories

    java.lang.Object
      com.knowgate.hipergate.Categories

    public class Categories

extends java.lang.Object

Singleton manager for Categories Tree

Field Summary
`static int` | `ORDER_BY_ID`
`static int` | `ORDER_BY_LOCALE_NAME`
`static int` | `ORDER_BY_NEUTRAL_NAME`
`static int` | `ORDER_BY_NONE`

Constructor Summary
`Categories()`

Method Summary
`void` | `clearCache()` Clear root categories cache.
`static void` | `expand(JDCConnection oConn, java.lang.String sRootCategoryId)` Expand Category Childs into k_cat_expand table
`Category` | `forDomain(JDCConnection oConn, int iDomain)` Get root category for a given Domain The root Category for a Domain will be the one such that nm_category=nm_domain
`DBSubset` | `getChildsNamed(JDCConnection oConn, java.lang.String idParent, java.lang.String sLanguage, int iOrderBy)` Get first level childs for a given category.
`DBSubset` | `getRoots(JDCConnection oConn)` Get root categories as a DBSubset.
`int` | `getRootsCount()` Get root categories count.
`DBSubset` | `getRootsNamed(JDCConnection oConn, java.lang.String sLanguage, int iOrderBy)` Get Root Caetgories and their names as a DBSubset Categories not having any translation at k_cat_labels will not be retrieved.
`Category` | `getSharedFilesCategoryForDomain(JDCConnection oConn, int iDomain)` Get shared files category for a given Domain The shared files Category for a Domain will be the child of the root category for domain which nm_category = nm_domain + "_SHARED"
`static int` | `removeObject(JDCConnection oConn, java.lang.String sIdObject, int iClassId)` Remove object from all Categories Removing an object from a Category does not delete it.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### ORDER_BY_NONE

    public static final int ORDER_BY_NONE

See Also:
  Constant Field Values

### ORDER_BY_ID

    public static final int ORDER_BY_ID

See Also:
  Constant Field Values

### ORDER_BY_NEUTRAL_NAME

    public static final int ORDER_BY_NEUTRAL_NAME

See Also:
  Constant Field Values

### ORDER_BY_LOCALE_NAME

    public static final int ORDER_BY_LOCALE_NAME

See Also:
  Constant Field Values

Constructor Detail

### Categories

    public Categories()

Method Detail

### clearCache

    public void clearCache()

  Clear root categories cache. Root category names are loaded once and then cached into a static variable. Use this method for forcing reload of categories from database on next call to getRoots() or getRootsNamed().

### expand

    public static void expand(JDCConnection oConn,
                              java.lang.String sRootCategoryId)
                       throws java.sql.SQLException

  Expand Category Childs into k_cat_expand table

  Parameters:
    `oConn` - Database Connection
    `sRootCategoryId` - GUID of Category to expand.
  Throws:
    `java.sql.SQLException`

### forDomain

    public Category forDomain(JDCConnection oConn,
                              int iDomain)
                       throws java.sql.SQLException

  Get root category for a given Domain

  The root Category for a Domain will be the one such that nm_category=nm_domain

  Parameters:
    `oConn` - Database Connection
    `iDomain` - Domain Numeric Identifier
  Returns:
    Category GUID or null if root Category for Domain was not found.
  Throws:
    `java.sql.SQLException`

### getSharedFilesCategoryForDomain

    public Category getSharedFilesCategoryForDomain(JDCConnection oConn,
                                                    int iDomain)
                                             throws java.sql.SQLException

  Get shared files category for a given Domain

  The shared files Category for a Domain will be the child of the root category for domain which nm_category = nm_domain + "_SHARED"

  Parameters:
    `oConn` - Database Connection
    `iDomain` - Domain Numeric Identifier
  Returns:
    Category GUID or null if shared files Category for Domain was not found.
  Throws:
    `java.sql.SQLException`
  Since:
    4.0

### getRoots

    public DBSubset getRoots(JDCConnection oConn)
                      throws java.sql.SQLException

  Get root categories as a DBSubset.

  Root categories are those present at k_cat_root table.
  It is recommended to use this criteria instead of seeking those categories not present as childs at k_cat_tree. Selecting from k_cat_root is much faster than scanning the k_cat_tree table.

  Parameters:
    `oConn` - Database Connection
  Returns:
    A single column DBSubset containing th GUID of root categories.
  Throws:
    `java.sql.SQLException`

### getRootsCount

    public int getRootsCount()
                      throws java.lang.IllegalStateException

  Get root categories count.

  Throws:
    `java.lang.IllegalStateException` - If getRoots() or getRootsNamed() have not been called prior to getRootsCount()

### getRootsNamed

    public DBSubset getRootsNamed(JDCConnection oConn,
                                  java.lang.String sLanguage,
                                  int iOrderBy)
                           throws java.sql.SQLException

  Get Root Caetgories and their names as a DBSubset

  Categories not having any translation at k_cat_labels will not be retrieved.
  Root Category Names are loaded once and then cached internally as a static object.
  Use clearCahce() method for refreshing root categories from database.

  Parameters:
    `oConn` - Database Connection
    `sLanguage` - Language for category label retrieval.
    `iOrderBy` - Column for order by { ORDER_BY_NONE, ORDER_BY_NEUTRAL_NAME, ORDER_BY_LOCALE_NAME }
  Returns:
    A DBSubset with the following columns:

    gu_category | nm_category | tr_category | nm_icon | nm_icon2
    Category GUID | Category Internal Name | Category Translated Label | Icon for Closed Folder | Icon for Opened Folder

  Throws:
    `java.sql.SQLException`

### getChildsNamed

    public DBSubset getChildsNamed(JDCConnection oConn,
                                   java.lang.String idParent,
                                   java.lang.String sLanguage,
                                   int iOrderBy)
                            throws java.sql.SQLException

  Get first level childs for a given category.

  Categories not having any translation at k_cat_labels will not be retrieved.

  Parameters:
    `oConn` - Database Connection
    `idParent` - Parent Category
    `sLanguage` - Language for label retrieval
    `iOrderBy` - Column for order by { ORDER_BY_NONE, ORDER_BY_NEUTRAL_NAME, ORDER_BY_LOCALE_NAME }
  Returns:
    A DBSubset with the following columns:

    gu_category | nm_category | tr_category | nm_icon | nm_icon2
    Category GUID | Category Internal Name | Category Translated Label | Icon for Closed Folder | Icon for Opened Folder

  Throws:
    `java.sql.SQLException`

### removeObject

    public static int removeObject(JDCConnection oConn,
                                   java.lang.String sIdObject,
                                   int iClassId)
                            throws java.sql.SQLException

  Remove object from all Categories

  Removing an object from a Category does not delete it.

  Parameters:
    `oConn` - Database Connection
    `sIdObject` - Object GUID
    `iClassId` - Object Class Numeric Identifier
  Returns:
    A Positive integer if the object was present at any category or 0 if the object was not present at any category.
  Throws:
    `java.sql.SQLException`
  Since:
    4.0

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD