public class NewsGroup extends Category
NewsGroup
Modifier and Type | Field and Description |
---|---|
static short |
ClassId |
static short |
FREE |
static short |
MODERATED |
BROWSE_BOTTOMUP, BROWSE_DOWN, BROWSE_TOPDOWN, BROWSE_UP
Constructor and Description |
---|
NewsGroup()
Create empty newsgroup
|
NewsGroup(JDCConnection oConn,
java.lang.String sIdNewsGroup)
Create newsGroup and load properties from Database
Both field sets from k_categories and k_newsgroups are loaded into
internal properties collection upon load.
|
NewsGroup(java.lang.String sIdNewsGroup)
Create NewsGroup and set its Category GUID
|
Modifier and Type | Method and Description |
---|---|
int |
countMessages(JDCConnection oConn)
Count messages for this NewsGroup
|
int |
countMessages(JDCConnection oConn,
short iMsgStatus)
Count messages for this NewsGroup in a given status
|
boolean |
delete(JDCConnection oConn)
Delete this NewsGroup and all its messages
|
static boolean |
delete(JDCConnection oConn,
java.lang.String sNewsGroupGUID)
Delete NewsGroup and all its messages.
|
NewsGroupJournal |
getJournal() |
DBSubset |
getTopLevelMessages(JDCConnection oConn,
int nMaxMsgs,
java.lang.String sOrderBy)
Get messages
|
boolean |
isSubscriber(JDCConnection oConn,
java.lang.String sUserId)
Get whether or not a user is subcribed this news group
|
boolean |
load(JDCConnection oConn,
java.lang.Object[] PKVals)
Load NewsGroup from database
Both field sets from k_categories and k_newsgroups are loaded into
internal properties collection upon load.
|
boolean |
load(JDCConnection oConn,
java.lang.String sGuNewsGroup)
Load NewsGroup from database
Both field sets from k_categories and k_newsgroups are loaded into
internal properties collection upon load.
|
static java.lang.String |
store(JDCConnection oConn,
int iDomain,
java.lang.String sWorkArea,
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)
Store Newsgroup
|
static java.lang.String |
store(JDCConnection oConn,
int iDomain,
java.lang.String sWorkArea,
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,
boolean boBinaries,
java.lang.String sDesc,
java.lang.String sTxJournalXml)
Store Newsgroup
|
DBSubset |
subscribers(JDCConnection oConn)
Get ACLUsers subscribed to this NewsGroup
|
java.lang.String |
toXML(JDCConnection oConn) |
java.lang.String |
toXML(JDCConnection oConn,
java.lang.String sIdent) |
java.lang.String |
toXML(JDCConnection oConn,
java.lang.String sIdent,
java.lang.String sDelim) |
addObject, browse, checkIn, checkOut, create, expand, getACLGroups, getACLUsers, getChilds, getDomainId, getGroupPermissions, getIdFromName, getIsRoot, getLabel, getNames, getObjects, getObjectsOfClass, getParents, getPath, getProducts, getUserPermissions, inheritPermissions, isChildOf, isParentOf, level, makeName, removeGroupPermissions, removeObject, removeObject, removeUserPermissions, resetParent, setGroupPermissions, setIsRoot, setLabel, setParent, setUserPermissions, store, store, storeLabels, toXMLWithLabels, toXMLWithLabels, toXMLWithLabels, uploadDirectory
allcaps, allcaps, clear, clone, columns, containsKey, containsValue, entrySet, exists, get, get, getAuditClassName, getCreationDate, getDate, getDate, getDateFormated, getDateShort, getDateTime, getDateTime24, getDecimal, getDecimalFormated, getDecimalFormated, getDouble, getDoubleFormated, getFloat, getFloatFormated, getInt, getIntArray, getInteger, getIntegerArray, getIntervalPart, getItemMap, getItems, getMoney, getPrimaryKey, getShort, getSQLDate, getSQLTime, getString, getStringHtml, getStringNull, getTable, getTable, getTime, getTimeOfDay, getTimestamp, isEmpty, isNull, iterator, keySet, parseXML, put, put, put, put, put, put, 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, setPrimaryKey, size, toLowerCase, toUpperCase, toXML, toXML, toXML, values
public static final short ClassId
public static final short FREE
public static final short MODERATED
public NewsGroup()
public NewsGroup(java.lang.String sIdNewsGroup) throws java.sql.SQLException
sIdNewsGroup
- GUID of NewsGroup/Categoryjava.sql.SQLException
public NewsGroup(JDCConnection oConn, java.lang.String sIdNewsGroup) throws java.sql.SQLException
Create newsGroup and load properties from Database
Both field sets from k_categories and k_newsgroups are loaded into internal properties collection upon load.oConn
- Database ConenctionsIdNewsGroup
- GUID of newsGroup to be loadedjava.sql.SQLException
public int countMessages(JDCConnection oConn) throws java.sql.SQLException
Count messages for this NewsGroup
oConn
- Database connectionjava.sql.SQLException
- If NewsGroup does not existpublic int countMessages(JDCConnection oConn, short iMsgStatus) throws java.sql.SQLException
Count messages for this NewsGroup in a given status
oConn
- Database connectioniMsgStatus
- One of { NewsMessage.STATUS_VALIDATED, NewsMessage.STATUS_PENDING, NewsMessage.STATUS_DISCARDED, NewsMessage.STATUS_EXPIRED }java.sql.SQLException
- If NewsGroup does not existpublic boolean load(JDCConnection oConn, java.lang.Object[] PKVals) throws java.sql.SQLException
Load NewsGroup from database
Both field sets from k_categories and k_newsgroups are loaded into internal properties collection upon load.load
in class DBPersist
oConn
- Database ConenctionPKVals
- A single element array containing the GUID of NewsGroup to be
loaded. For example: oNewsGrpObj.load(oConnection, new object[]{"123456789012345678901234567890AB"});java.sql.SQLException
public boolean load(JDCConnection oConn, java.lang.String sGuNewsGroup) throws java.sql.SQLException
Load NewsGroup from database
Both field sets from k_categories and k_newsgroups are loaded into internal properties collection upon load.public DBSubset subscribers(JDCConnection oConn) throws java.sql.SQLException
Get ACLUsers subscribed to this NewsGroup
oConn
- JDBC Database Connectiongu_user | tx_email | id_msg_type | tp_subscrip |
ACLUser GUID | ACLUser main e-mail | Message Format {TXT | HTM} | Message Grouping {GROUP_NONE | GROUP_DIGEST} |
java.sql.SQLException
public boolean isSubscriber(JDCConnection oConn, java.lang.String sUserId) throws java.sql.SQLException
Get whether or not a user is subcribed this news group
oConn
- JDBC Database ConnectionsUserId
- User GUIDjava.sql.SQLException
public NewsGroupJournal getJournal()
public boolean delete(JDCConnection oConn) throws java.sql.SQLException
Delete this NewsGroup and all its messages
public DBSubset getTopLevelMessages(JDCConnection oConn, int nMaxMsgs, java.lang.String sOrderBy) throws java.sql.SQLException, java.lang.IllegalArgumentException, java.lang.IllegalStateException
Get messages
oConn
- Database ConnectionnMaxMsgs
- Maximum number of messages to getsOrderBy
- Attribute to sort messages. By default it is dt_published which corresponds to publishing date. Can be also nu_votes to sort messages by number of votes or nm_author to sort by author.java.sql.SQLException
java.lang.IllegalArgumentException
- If nMaxMsgs<=0java.lang.IllegalStateException
- If this Newsgroup message has not been previously loadedpublic java.lang.String toXML(JDCConnection oConn, java.lang.String sIdent, java.lang.String sDelim) throws java.sql.SQLException
java.sql.SQLException
public java.lang.String toXML(JDCConnection oConn, java.lang.String sIdent) throws java.sql.SQLException
java.sql.SQLException
public java.lang.String toXML(JDCConnection oConn) throws java.sql.SQLException
java.sql.SQLException
public static java.lang.String store(JDCConnection oConn, int iDomain, java.lang.String sWorkArea, 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
Store Newsgroup
oConn
- Database ConnectioniDomain
- Identifier of Domain to with the NewsGroup will belong.sWorkArea
- GUID of WorkArea to with the NewsGroup will belong.sCategoryId
- Category GUID (newsgroups are subregisters of categories)sParentId
- GUID of Parent Group (groups, as categories, are hierarchical)sCategoryName
- Category name (k_categories.nm_category)iIsActive
- 1 if group is activem, 0 if it is inactive.iDocStatus
- Initial Document Status. One of { Newsgroup.FREE, Newsgroup.MODERATED }sOwner
- GUID of User owner of this NewsGroupsIcon1
- Closed Folder IconsIcon2
- Opened Folder Iconjava.sql.SQLException
public static java.lang.String store(JDCConnection oConn, int iDomain, java.lang.String sWorkArea, 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, boolean boBinaries, java.lang.String sDesc, java.lang.String sTxJournalXml) throws java.sql.SQLException
Store Newsgroup
oConn
- Database ConnectioniDomain
- Identifier of Domain to with the NewsGroup will belong.sWorkArea
- GUID of WorkArea to with the NewsGroup will belong.sCategoryId
- Category GUID (newsgroups are subregisters of categories)sParentId
- GUID of Parent Group (groups, as categories, are hierarchical)sCategoryName
- Category name (k_categories.nm_category)iIsActive
- 1 if group is activem, 0 if it is inactive.iDocStatus
- Initial Document Status. One of { Newsgroup.FREE, Newsgroup.MODERATED }sOwner
- GUID of User owner of this NewsGroupsIcon1
- Closed Folder IconsIcon2
- Opened Folder IconboBinaries
- true if group allows binay attachments false otherwisesDesc
- News Group Description (up to 254 characters)sTxJournalXml
- Journal XML definition file (up to 4000 characters)java.sql.SQLException
public static boolean delete(JDCConnection oConn, java.lang.String sNewsGroupGUID) throws java.sql.SQLException
Delete NewsGroup and all its messages.
Delete all files attached to messages contained in group and then call k_sp_del_newsgroup stored procedure.oConn
- Database ConnectionsNewsGroupGUID
- GUID of NewsGroup to be deleted.java.sql.SQLException
Product.delete(JDCConnection)