|
ContentBox Core API 1.6.0 | ||||
FRAMES |
WEB-INF.cftags.componentcoldbox.system.orm.hibernate.BaseORMService
coldbox.system.orm.hibernate.VirtualEntityService
contentbox.model.comments.CommentService
public class CommentService
******************************************************************************* ContentBox - A Modular Content Platform Copyright 2012 by Luis Majano and Ortus Solutions, Corp www.gocontentbox.org | www.luismajano.com | www.ortussolutions.com ******************************************************************************* Apache License, Version 2.0 Copyright Since [2012] [Luis Majano and Ortus Solutions,Corp] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ******************************************************************************* Service to handle comment operations.
Property Summary | ||||
---|---|---|---|---|
Type | Property & Description | Default | Serializable | Required |
any
|
CBHelper
Attributes:
|
|
true
|
false
|
any
|
interceptorService
Attributes:
|
|
true
|
false
|
any
|
log
Attributes:
|
|
true
|
false
|
any
|
mailService
Attributes:
|
|
true
|
false
|
any
|
renderer
Attributes:
|
|
true
|
false
|
any
|
settingService
Attributes:
|
|
true
|
false
|
Constructor Summary | |
---|---|
init()
Constructor |
Method Summary | |
---|---|
private any |
activateURLs(any text)
Activate URL's from text |
private boolean |
anyKeywordMatch([any comment], [any matchList])
Regex matching of a list of entries against a comment and matching keyword list |
any |
bulkStatus([any commentID], [any status])
Bulk Updates |
void |
deleteUnApprovedComments([numeric expirationDays='0'])
Deletes unapproved comments |
any |
findApprovedComments([any contentID], [any contentType], [any max='0'], [any offset='0'], [any sortOrder='desc'])
Comment listing for UI of approved comments, returns struct of results=[comments,count] |
numeric |
getApprovedCommentCount()
Get the total number of approved comments in the system |
numeric |
getUnApprovedCommentCount()
Get the total number of unapproved comments in the system |
private boolean |
runModerationRules(any comment, any settings)
Run moderation rules on an incoming comment and set of contentbox settings |
struct |
saveComment(any comment)
Save a comment according to our rules and process it |
struct |
search([any search=''], [any isApproved], [any contentID], [any max='0'], [any offset='0'])
comment search returns struct with keys [comments,count] |
private void |
sendNotificationEmails([any comment], [any settings])
Send a notification email for comments |
private boolean |
userHasPreviousAcceptedComment(any email)
Check if the user has already a comment in the system |
Methods inherited from class coldbox.system.orm.hibernate.VirtualEntityService |
---|
GETDATASOURCE, GETENTITYNAME, SETDATASOURCE, SETENTITYNAME, clear, convertIDValueToJavaType, convertValueToJavaType, count, countWhere, criteriaCount, criteriaQuery, deleteAll, deleteByID, deleteByQuery, deleteWhere, evict, executeQuery, exists, findAllWhere, findWhere, get, getAll, getKey, getPropertyNames, getSessionStatistics, getTableName, isSessionDirty, list, new, newCriteria, onMissingMethod
|
Methods inherited from class coldbox.system.orm.hibernate.BaseORMService |
---|
$delete, $deleteAll, $deleteByID, $deleteByQuery, $deleteWhere, $save, $saveAll, $transactioned, GETDEFAULTASQUERY, GETEVENTHANDLING, GETHQLDYNAMICCACHE, GETORM, GETORMEVENTHANDLER, GETQUERYCACHEREGION, GETUSEQUERYCACHING, GETUSETRANSACTIONS, SETDEFAULTASQUERY, SETEVENTHANDLING, SETHQLDYNAMICCACHE, SETORM, SETORMEVENTHANDLER, SETQUERYCACHEREGION, SETUSEQUERYCACHING, SETUSETRANSACTIONS, compileHQLFromDynamicMethod, createCriteriaQuery, createService, delete, evictEntity, evictQueries, findAll, findByExample, findDynamically, findIt, getEntityGivenName, getRestrictions, merge, populate, populateFromJSON, populateFromQuery, populateFromXML, populateWithPrefix, refresh, save, saveAll, sessionContains
|
Methods inherited from class WEB-INF.cftags.component |
---|
None
|
Constructor Detail |
---|
public init()
Property Detail |
---|
any CBHelper
inject
- id:CBHelper@cbrequired
- falseserializable
- truedefault
- any interceptorService
inject
- coldbox:interceptorServicerequired
- falseserializable
- truedefault
- any log
inject
- logbox:logger:{this}required
- falseserializable
- truedefault
- any mailService
inject
- coldbox:plugin:MailServicerequired
- falseserializable
- truedefault
- any renderer
inject
- provider:ColdBoxRendererrequired
- falseserializable
- truedefault
- any settingService
inject
- id:settingService@cbrequired
- falseserializable
- truedefault
- Method Detail |
---|
private any activateURLs(any text)
text
private boolean anyKeywordMatch([any comment], [any matchList])
comment
matchList
public any bulkStatus([any commentID], [any status])
commentID
- The list or array of ID's to bulk updatestatus
- The status either 'approve' or 'moderatepublic void deleteUnApprovedComments([numeric expirationDays='0'])
expirationDays
- Required level of staleness in days to delete (0=all unapproved)public any findApprovedComments([any contentID], [any contentType], [any max='0'], [any offset='0'], [any sortOrder='desc'])
contentID
- The content ID to filter oncontentType
- The content type discriminator to filter onmax
- The maximum number of records to return, 0 means alloffset
- The offset in the paging, 0 means 0sortOrder
- Sort the comments asc or desc, by default it is descpublic numeric getApprovedCommentCount()
public numeric getUnApprovedCommentCount()
private boolean runModerationRules(any comment, any settings)
comment
- Comment to moderate checksettings
- The contentbox settings to moderate againstpublic struct saveComment(any comment)
comment
- The comment to try to savepublic struct search([any search=''], [any isApproved], [any contentID], [any max='0'], [any offset='0'])
search
isApproved
contentID
max
offset
private void sendNotificationEmails([any comment], [any settings])
comment
- Comment to moderate checksettings
- The contentbox settings to moderate againstprivate boolean userHasPreviousAcceptedComment(any email)
email
- The email address to check.
|
ContentBox Core API 1.6.0 | ||||
FRAMES |