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.workareas
Class WorkArea

    java.lang.Object
      com.knowgate.dataobjs.DBPersist
          com.knowgate.workareas.WorkArea

All Implemented Interfaces:
  java.io.Serializable, java.util.Map

    public class WorkArea

extends DBPersist

WorkArea

See Also:
  Serialized Form

Nested Class Summary

Nested classes/interfaces inherited from interface java.util.Map
`java.util.Map.Entry<K,V>`

Field Summary
`static short` | `ClassId`

Fields inherited from class com.knowgate.dataobjs.DBPersist
`AllVals, sAuditCls, sAuditUsr, sTransactId`

Constructor Summary
`WorkArea()` Create empty WorkArea.
`WorkArea(JDCConnection oConn, java.lang.String sIdWorkArea)` Load WorkArea from database

Method Summary
`boolean` | `allCaps()` Whether all capitals mode is activated for this WorkArea or not
`static boolean` | `allCaps(java.sql.Connection oConn, java.lang.String sWorkArea)` Whether all capitals mode is activated for a WorkArea or not
`boolean` | `allowDuplicatedIdentityDocuments()` Whether all capitals mode is activated for this WorkArea or not
`static boolean` | `allowDuplicatedIdentityDocuments(java.sql.Connection oConn, java.lang.String sWorkArea)` Whether duplicated identity documents are allowed for a WorkArea or not
`boolean` | `autoNumericContactReferences()` Whether autonumeric contact references must be generated
`static boolean` | `autoNumericContactReferences(java.sql.Connection oConn, java.lang.String sWorkArea)` Whether autonumeric contact references are generated for a WorkArea or not
`boolean` | `delete(JDCConnection oConn)` Delete a WorkArea and all its associated data.
`static boolean` | `delete(JDCConnection oConn, java.lang.String sWrkAreaGUID)` Delete a WorkArea and all its associated data.
`static boolean` | `delete(JDCConnection oConn, java.lang.String sWrkAreaGUID, java.util.Properties oProps)` Delete a WorkArea, its associated data and working directories.
`static java.lang.String` | `getDateFormat(java.sql.Connection oConn, java.lang.String sWorkAreaGuid)` Get value of tx_date_format column at k_workareas table for given WorkArea
`static java.lang.String` | `getIdFromName(java.sql.Connection oConn, int iDomainId, java.lang.String sWorkAreaNm)`
`static java.lang.String` | `getIdFromName(JDCConnection oConn, int iDomainId, java.lang.String sWorkAreaNm)`
`static java.lang.String` | `getPath(JDCConnection oConn, java.lang.String sWrkAId)` Get path_logo field from k_workareas table
`static java.text.SimpleDateFormat` | `getSimpleDateFormat(java.sql.Connection oConn, java.lang.String sWorkAreaGuid)` Get SimpleDateFormat objects based on the values of tx_date_format and id_locale columns from k_workareas table
`static boolean` | `getUserAppAccess(JDCConnection oConn, java.lang.String guWorkArea, java.lang.String sUserId, int idApp)` Checks whether or not a user has access rights for a given WorkArea and Application
`int` | `getUserAppMask(JDCConnection oConn, java.lang.String sUserId)`
`static int` | `getUserAppMask(JDCConnection oConn, java.lang.String guWorkArea, java.lang.String sUserId)` Get applications bitmask for a user at a given WorkArea The bitmask is a 32 bits integer with one bit per application.
`DBSubset` | `getUsers(JDCConnection oConn)` Users that may have access to this WorkArea Get a list of users that have any kind of access to this WorkArea.
`static boolean` | `isAdmin(JDCConnection oConn, java.lang.String guWorkArea, java.lang.String sUserId)` Check if given user belongs to the administrators' group of a WorkArea
`static boolean` | `isAnyRole(JDCConnection oConn, java.lang.String guWorkArea, java.lang.String sUserId)` Check if given user belongs to any permissions group associated with a WorkArea This is equivalent to doing [isAdmin() Or isPowerUser() Or isUser() Or isGuest()] but faster to compute than the previous expresion
`static boolean` | `isGuest(JDCConnection oConn, java.lang.String guWorkArea, java.lang.String sUserId)` Check if given user belongs to the guests' group of a WorkArea
`static boolean` | `isPowerUser(JDCConnection oConn, java.lang.String guWorkArea, java.lang.String sUserId)` Check if given user belongs to the power users' group of a WorkArea
`static boolean` | `isUser(JDCConnection oConn, java.lang.String guWorkArea, java.lang.String sUserId)` Check if given user belongs to the users' group of a WorkArea
`boolean` | `store(JDCConnection oConn)` Store a register at database representing this instance of DBPersist Insertions and updates : The store method automatically manages register insertions and updates.

Methods inherited from class com.knowgate.dataobjs.DBPersist
`allcaps, allcaps, changelog, clear, clone, containsKey, containsValue, entrySet, exists, get, get, getAuditClassName, getCreationDate, getDate, getDateFormated, getDateShort, getDateTime, getDateTime24, getDecimal, getDecimalFormated, getDecimalFormated, getDouble, getDoubleFormated, getFloat, getFloatFormated, getInt, getInteger, getIntervalPart, getItemMap, getItems, getMoney, getShort, getSQLDate, getSQLTime, getString, getStringHtml, getStringNull, getTable, getTable, getTableName, getTime, getTimeOfDay, getTimestamp, getUIdFromName, isEmpty, isNull, iterator, keySet, load, load, parseXML, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, putAll, putAll, remove, remove, replace, replace, replace, replace, replace, replace, replace, replace, setAuditTransact, setAuditUser, setCreationDate, size, toLowerCase, toUpperCase, toXML, toXML, toXML, toXML, values`

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

Methods inherited from interface java.util.Map
`equals, hashCode`

Field Detail

### ClassId

    public static final short ClassId

See Also:
  Constant Field Values

Constructor Detail

### WorkArea

    public WorkArea()

  Create empty WorkArea.

### WorkArea

    public WorkArea(JDCConnection oConn,
                    java.lang.String sIdWorkArea)
             throws java.sql.SQLException

  Load WorkArea from database

  Parameters:
    `oConn` - Database Conenction
    `sIdWorkArea` - GUID of WorkArea to be loaded
  Throws:
    `java.sql.SQLException`

Method Detail

### delete

    public boolean delete(JDCConnection oConn)
                   throws java.sql.SQLException

  Delete a WorkArea and all its associated data.

  USE THIS METHOD WITH EXTREME CARE. AS IT WILL DELETE DATA FROM EVERY TABLE CONTAINING A gu_workarea COLUMN MATCHING THE DELETED WORKAREA GUID.
  Deletion takes place by delegating it in other objects delete() method.

  Overrides:
    `delete` in class `DBPersist`
  Parameters:
    `oConn` - Database Connection
  Returns:
    true if register was successfully erased, false if not.
  Throws:
    `java.sql.SQLException`

### store

    public boolean store(JDCConnection oConn)
                  throws java.sql.SQLException

  Description copied from class: `DBPersist`

  Store a register at database representing this instance of DBPersist

  Insertions and updates : The store method automatically manages register insertions and updates. If the stored object already exists at database then it is updated, if it does not exists then it is inserted. A primary key violation error is never thrown so ther is no need to call delete() method before re-writing an existing object.

  NULL fields : All values not set calling put() methods for DBPersist will be assumed to be NULL. If a not nullable field is not set then an SQLException will be raised.
  On storing an already existing object all values will we overwrited, so is a DBPersist is not fully loaded before storing it, values not set by calling put() methods that already were present at database will be lost.

  Overrides:
    `store` in class `DBPersist`
  Parameters:
    `oConn` - Database Connection
  Returns:
    boolean true if register was stored for the first time, false if register already existed.
  Throws:
    `java.sql.SQLException`

### getUserAppMask

    public int getUserAppMask(JDCConnection oConn,
                              java.lang.String sUserId)
                       throws java.sql.SQLException

  Throws:
    `java.sql.SQLException`

### getUsers

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

  Users that may have access to this WorkArea

  Get a list of users that have any kind of access to this WorkArea. The list is taken by querying k_x_group_user table looking for users that belong to any of the five permissions groups of the WorkArea {admins,powusers,users,guests,other}

  Returns:
    A DBSubset with columns gu_user,tx_nickname,nm_user,tx_surname1,tx_surname2,bo_searchable,tx_main_email
  Throws:
    `java.sql.SQLException`

### delete

    public static boolean delete(JDCConnection oConn,
                                 java.lang.String sWrkAreaGUID)
                          throws java.sql.SQLException

  Delete a WorkArea and all its associated data.

  USE THIS METHOD WITH EXTREME CARE. AS IT WILL DELETE DATA FROM EVERY TABLE CONTAINING A gu_workarea COLUMN MATCHING THE DELETED WORKAREA GUID.
  Deletion takes place by delegating it in other objects delete() method.
  In this order:

  k_activities
  k_x_activity_audience
  DELETE k_sms_audit
  DELETE k_sms_audit
  DELETE k_syndentries
  DELETE k_x_portlet_user
  QueryByForm.delete
  MicrositeDB.delete
  PageSetDB.delete
  DELETE k_images
  DELETE k_global_black_list
  DistributionList.delete
  Meeting.delete
  Fellow.delete
  DELETE k_lu_fellow_titles
  DELETE k_fellows_lookup
  Room.delete
  DELETE k_rooms_lookup
  DELETE k_to_do
  DELETE k_to_do_lookup
  DELETE k_phone_calls
  DELETE k_sales_men
  DELETE k_sales_men_lookup
  DELETE k_bulkloads
  Supplier.delete
  Company.delete
  DELETE k_companies_lookup
  DELETE k_contacts_lookup
  DELETE k_oportunities_lookup
  DELETE k_welcome_packs_lookup
  Project.delete
  DELETE k_projects_lookup
  DELETE k_duties_lookup
  DELETE k_bugs_lookup
  DELETE k_invoices
  DELETE k_invoice_lines
  DELETE k_invoices_lookup
  DELETE k_invoices_next
  DELETE k_returned_invoices
  DELETE k_x_order_invoices
  DELETE k_despatch_advices
  DELETE k_despatch_lines
  DELETE k_despatch_advices_lookup
  DELETE k_x_orders_despatch
  DELETE k_despatch_next
  DELETE k_orders
  DELETE k_order_lines
  DELETE k_orders_lookup
  DELETE k_quotations
  DELETE k_quotation_lines
  DELETE k_x_quotations_orders
  DELETE k_quotation_next
  DELETE k_warehouses
  DELETE k_sale_points
  DELETE k_lu_business_states
  DELETE k_business_states
  Shop.delete
  DELETE k_events
  Job.delete
  DELETE k_lu_meta_attrs
  DELETE k_addresses
  DELETE k_addresses_lookup
  DELETE k_thesauri_lookup
  DELETE k_bank_accounts
  DELETE k_bank_accounts_lookup
  DELETE k_urls
  DELETE k_x_app_workarea
  DELETE k_workareas

  Parameters:
    `oConn` - Database Connection
    `sWrkAreaGUID` - GUID of WorkArea to be deleted.
  Throws:
    `java.sql.SQLException`

### allCaps

    public boolean allCaps()

  Whether all capitals mode is activated for this WorkArea or not

  Since:
    4.0

### allowDuplicatedIdentityDocuments

    public boolean allowDuplicatedIdentityDocuments()

  Whether all capitals mode is activated for this WorkArea or not

  Since:
    4.0

### autoNumericContactReferences

    public boolean autoNumericContactReferences()

  Whether autonumeric contact references must be generated

  Since:
    4.0

### allCaps

    public static boolean allCaps(java.sql.Connection oConn,
                                  java.lang.String sWorkArea)
                           throws java.sql.SQLException

  Whether all capitals mode is activated for a WorkArea or not

  Parameters:
    `oConn` - Connection
    `sWorkArea` - String WorkArea GUID
  Throws:
    `java.sql.SQLException`
  Since:
    4.0

### allowDuplicatedIdentityDocuments

    public static boolean allowDuplicatedIdentityDocuments(java.sql.Connection oConn,
                                                           java.lang.String sWorkArea)
                                                    throws java.sql.SQLException

  Whether duplicated identity documents are allowed for a WorkArea or not

  Parameters:
    `oConn` - Connection
    `sWorkArea` - String WorkArea GUID
  Throws:
    `java.sql.SQLException`
  Since:
    4.0

### autoNumericContactReferences

    public static boolean autoNumericContactReferences(java.sql.Connection oConn,
                                                       java.lang.String sWorkArea)
                                                throws java.sql.SQLException

  Whether autonumeric contact references are generated for a WorkArea or not

  Parameters:
    `oConn` - Connection
    `sWorkArea` - String WorkArea GUID
  Throws:
    `java.sql.SQLException`
  Since:
    4.0

### delete

    public static boolean delete(JDCConnection oConn,
                                 java.lang.String sWrkAreaGUID,
                                 java.util.Properties oProps)
                          throws java.lang.Exception,
                                 java.io.IOException,
                                 java.sql.SQLException

  Delete a WorkArea, its associated data and working directories.

  USE THIS METHOD WITH EXTREME CARE. AS IT WILL DELETE DATA FROM EVERY TABLE CONTAINING A gu_workarea COLUMN MATCHING THE DELETED WORKAREA GUID.

  Parameters:
    `oConn` - Database Connection
    `sWrkAreaGUID` - GUID of WorkArea to be deleted
    `oProps` - Properties Colection containing "storage" and "workareasput" properties.
    /storage/domains/nnnn/workareas/sWrkAreaGUID and /workareasput/sWrkAreaGUID will be taken as base directories for deleting WorkArea files.
    javamode property will determine whether directories shall be deleted witha tomic operating systems calls or by Pure Java functions.
  Returns:
    true if specified WorkArea GUID was found and deleted at k_workareas, false if specified WorkArea GUID was not found.
  Throws:
    `java.io.IOException`
    `java.sql.SQLException`
    `java.lang.Exception`
  See Also:
    `com.knowgate.dfs.FileSystem.delete(String)`

### getPath

    public static java.lang.String getPath(JDCConnection oConn,
                                           java.lang.String sWrkAId)
                                    throws java.sql.SQLException

  Get path_logo field from k_workareas table

  Parameters:
    `oConn` - JDCConnection
    `sWrkAId` - String GUID of WorkArea
  Returns:
    String Value of field path_logo
  Throws:
    `java.sql.SQLException`

### isAdmin

    public static boolean isAdmin(JDCConnection oConn,
                                  java.lang.String guWorkArea,
                                  java.lang.String sUserId)
                           throws java.sql.SQLException

  Check if given user belongs to the administrators' group of a WorkArea

  Parameters:
    `oConn` - JDCConnection
    `guWorkArea` - String GUID of WorkArea
    `sUserId` - GUID of User
  Throws:
    `java.sql.SQLException`

### isPowerUser

    public static boolean isPowerUser(JDCConnection oConn,
                                      java.lang.String guWorkArea,
                                      java.lang.String sUserId)
                               throws java.sql.SQLException

  Check if given user belongs to the power users' group of a WorkArea

  Parameters:
    `oConn` - JDCConnection
    `guWorkArea` - String GUID of WorkArea
    `sUserId` - GUID of User
  Throws:
    `java.sql.SQLException`

### isUser

    public static boolean isUser(JDCConnection oConn,
                                 java.lang.String guWorkArea,
                                 java.lang.String sUserId)
                          throws java.sql.SQLException

  Check if given user belongs to the users' group of a WorkArea

  Parameters:
    `oConn` - JDCConnection
    `guWorkArea` - String GUID of WorkArea
    `sUserId` - GUID of User
  Throws:
    `java.sql.SQLException`

### isGuest

    public static boolean isGuest(JDCConnection oConn,
                                  java.lang.String guWorkArea,
                                  java.lang.String sUserId)
                           throws java.sql.SQLException

  Check if given user belongs to the guests' group of a WorkArea

  Parameters:
    `oConn` - JDCConnection
    `guWorkArea` - String GUID of WorkArea
    `sUserId` - GUID of User
  Throws:
    `java.sql.SQLException`

### isAnyRole

    public static boolean isAnyRole(JDCConnection oConn,
                                    java.lang.String guWorkArea,
                                    java.lang.String sUserId)
                             throws java.sql.SQLException

  Check if given user belongs to any permissions group associated with a WorkArea

  This is equivalent to doing [isAdmin() Or isPowerUser() Or isUser() Or isGuest()] but faster to compute than the previous expresion

  Parameters:
    `oConn` - JDCConnection
    `guWorkArea` - String GUID of WorkArea
    `sUserId` - GUID of User
  Throws:
    `java.sql.SQLException`
  Since:
    4.0

### getUserAppMask

    public static int getUserAppMask(JDCConnection oConn,
                                     java.lang.String guWorkArea,
                                     java.lang.String sUserId)
                              throws java.sql.SQLException

  Get applications bitmask for a user at a given WorkArea

  The bitmask is a 32 bits integer with one bit per application. A bit set to one means that the application is available for the user, if it s set to zero then the application is not available. Applications bits positions are as follows:

  Bit Number | Application Name
  10 | Incidents Tracker
  11 | Duty Manager
  12 | Project Manager
  13 | Mailwire
  14 | Web Builder
  15 | Virtual Disk
  16 | Contact & Sales Management
  17 | Collaborative Tools
  18 | Marketing Tools
  19 | Directory
  20 | Shop
  21 | Hipermail
  22 | Training
  23 | Wiki
  24 | Passwords Manager
  25 | Surveys
  30 | Configuration & Administration

  Returns:
    integer with one bit for each application signaling its availability for the user
  Throws:
    `java.sql.SQLException`

### getUserAppAccess

    public static boolean getUserAppAccess(JDCConnection oConn,
                                           java.lang.String guWorkArea,
                                           java.lang.String sUserId,
                                           int idApp)
                                    throws java.sql.SQLException

  Checks whether or not a user has access rights for a given WorkArea and Application

  Parameters:
    `oConn` - JDBC database connection
    `guWorkArea` - WorkArea GUID
    `isApp` - Application Identifier
  Returns:
    boolean
  Throws:
    `java.sql.SQLException`
  Since:
    5.0

### getIdFromName

    public static java.lang.String getIdFromName(JDCConnection oConn,
                                                 int iDomainId,
                                                 java.lang.String sWorkAreaNm)
                                          throws java.sql.SQLException

  Throws:
    `java.sql.SQLException`

### getIdFromName

    public static java.lang.String getIdFromName(java.sql.Connection oConn,
                                                 int iDomainId,
                                                 java.lang.String sWorkAreaNm)
                                          throws java.sql.SQLException

  Throws:
    `java.sql.SQLException`

### getDateFormat

    public static java.lang.String getDateFormat(java.sql.Connection oConn,
                                                 java.lang.String sWorkAreaGuid)
                                          throws java.sql.SQLException

  Get value of tx_date_format column at k_workareas table for given WorkArea

  Parameters:
    `oConn` - JDBC database connection
    `sWorkAreaGuid` - WorkArea GUID
  Returns:
    Short date format (like yyyy-MM-dd) or null if no WorkArea with such GUID was found
  Throws:
    `java.sql.SQLException`
  Since:
    4.0

### getSimpleDateFormat

    public static java.text.SimpleDateFormat getSimpleDateFormat(java.sql.Connection oConn,
                                                                 java.lang.String sWorkAreaGuid)
                                                          throws java.sql.SQLException

  Get SimpleDateFormat objects based on the values of tx_date_format and id_locale columns from k_workareas table

  Parameters:
    `oConn` - JDBC database connection
    `sWorkAreaGuid` - WorkArea GUID
  Returns:
    If tx_date_format is not null then its value is used as a pattern for the SimpleDateFormat, if tx_date_format is null then the SimpleDateFormat is created according to the Locale specified at id_locale, if both tx_date_format and id_locale are null then pattern yyyy-MM-dd is used as default, if no WorkArea with given GUID is found then null is returned
  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