|
ContentBox Core API 1.5.7 | ||||
FRAMES |
WEB-INF.cftags.componentcoldbox.system.orm.hibernate.BaseORMService
coldbox.system.orm.hibernate.VirtualEntityService
contentbox.model.content.ContentService
public class ContentService
******************************************************************************* 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. ******************************************************************************* A generic content service for content objects
Constructor Summary | |
---|---|
init([any entityName='cbContent'])
Constructor |
Method Summary | |
---|---|
any |
bulkPublishStatus(any contentID, any status)
Bulk Publish Status Updates |
any |
clearAllCaches([boolean async='false'])
Clear all content caches |
any |
clearAllPageWrapperCaches([boolean async='false'])
Clear all page wrapper caches |
any |
clearPageWrapper(any slug, [boolean async='false'])
Clear a page wrapper cache |
any |
clearPageWrapperCaches(any slug, [boolean async='false'])
Clear all page wrapper caches |
ContentService |
deleteContent(any content)
Delete a content object safely via hierarchies |
any |
findBySlug(any slug, boolean showUnpublished='false')
Find a published content object by slug and published unpublished flags, if not found it returns a new content object |
any |
findPublishedContent([numeric max='0'], [numeric offset='0'], [any searchTerm=''], [any category=''], [boolean asQuery='false'], [any parent], [boolean showInMenu])
Find published content objects |
array |
getAllFlatSlugs()
Returns an array of slugs of all the content objects in the system |
array |
getAllForExport([any inData])
Get all content for export as flat data |
any |
getIDBySlug(any slug)
Get an id from a slug of a content object |
array |
getTopCommentedContent([numeric max='5'])
Get the top commented content entries |
array |
getTopVisitedContent([numeric max='5'])
Get the top visited content entries |
string |
importFromData(any importData, [boolean override='false'], any importLog)
Import data from an array of structures of content or just one structure of a content entry |
string |
importFromFile(any importFile, [boolean override='false'])
Import data from a ContentBox JSON file |
private any |
inflateFromStruct(any contentData, any importLog, [any parent])
Inflate a content object from a ContentBox JSON structure |
any |
isSlugUnique(any slug, [any contentID=''])
Verify an incoming slug is unique or not |
any |
searchContent([any searchTerm=''], [numeric max='0'], [numeric offset='0'], [boolean asQuery='false'], [any sortOrder='publishedDate DESC'], [any isPublished='true'], [boolean searchActiveContent='true'])
Searches published content with cool paramters, remember published content only |
private any |
syncUpdateHits(any contentID)
Update the content hits |
ContentService |
updateHits(any contentID, [boolean async='true'])
Update a content's hits with some async flava |
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, GETQUERYCACHEREGION, GETUSEQUERYCACHING, GETUSETRANSACTIONS, SETDEFAULTASQUERY, SETEVENTHANDLING, SETHQLDYNAMICCACHE, SETQUERYCACHEREGION, SETUSEQUERYCACHING, SETUSETRANSACTIONS, compileHQLFromDynamicMethod, createCriteriaQuery, createService, delete, evictEntity, evictQueries, findAll, findByExample, findDynamically, findIt, getEntityGivenName, getRestrictions, merge, populate, populateFromJSON, populateFromQuery, populateFromXML, refresh, save, saveAll, sessionContains
|
Methods inherited from class WEB-INF.cftags.component |
---|
|
Constructor Detail |
---|
public init([any entityName='cbContent'])
entityName
- The content entity name to bind this service to.Method Detail |
---|
public any bulkPublishStatus(any contentID, any status)
contentID
- The list or array of ID's to bulk updatestatus
- The status either 'publish' or 'draftpublic any clearAllCaches([boolean async='false'])
async
- Run it asynchronously or not, defaults to falsepublic any clearAllPageWrapperCaches([boolean async='false'])
async
- Run it asynchronously or not, defaults to falsepublic any clearPageWrapper(any slug, [boolean async='false'])
slug
- The slug to cleanasync
- Run it asynchronously or not, defaults to falsepublic any clearPageWrapperCaches(any slug, [boolean async='false'])
slug
- The slug partial to clean onasync
- Run it asynchronously or not, defaults to falsepublic ContentService deleteContent(any content)
content
- the Content object to deletepublic any findBySlug(any slug, boolean showUnpublished='false')
slug
- The slug to searchshowUnpublished
- To also show unpublished content, defaults to false.public any findPublishedContent([numeric max='0'], [numeric offset='0'], [any searchTerm=''], [any category=''], [boolean asQuery='false'], [any parent], [boolean showInMenu])
max
- The maximum number of records to paginateoffset
- The offset in the paginationsearchTerm
- The search term to searchcategory
- The category to filter the content onasQuery
- Return as query or array of objects, defaults to array of objectsparent
- The parent ID to filter on or notshowInMenu
- Whether to filter with the show in menu bit or notpublic array getAllFlatSlugs()
public array getAllForExport([any inData])
inData
- The data to use for exporting, usually concrete implementtions can override this.public any getIDBySlug(any slug)
slug
- The slug to search an ID for.public array getTopCommentedContent([numeric max='5'])
max
- The maximum to retrieve, defaults to 5 entriespublic array getTopVisitedContent([numeric max='5'])
max
- The maximum to retrieve, defaults to 5 entriespublic string importFromData(any importData, [boolean override='false'], any importLog)
importData
- The data to importoverride
- Override records or notimportLog
- The import log bufferpublic string importFromFile(any importFile, [boolean override='false'])
importFile
- The absolute file path to use for importingoverride
- Override records or notprivate any inflateFromStruct(any contentData, any importLog, [any parent])
contentData
- The content structure inflated from JSONimportLog
- The string builder import logparent
- If the inflated content object has a parent then it can be linked directly, no inflating necessary. Usually for recursionspublic any isSlugUnique(any slug, [any contentID=''])
slug
- The slug to search for uniquenesscontentID
- Limit the search to the passed contentID usually for updatespublic any searchContent([any searchTerm=''], [numeric max='0'], [numeric offset='0'], [boolean asQuery='false'], [any sortOrder='publishedDate DESC'], [any isPublished='true'], [boolean searchActiveContent='true'])
searchTerm
- The search term to searchmax
- The maximum number of records to paginateoffset
- The offset in the paginationasQuery
- Return as query or array of objects, defaults to array of objectssortOrder
- The sorting of the search results, defaults to publishedDate DESCisPublished
- Search for published, non-published or both content objects [true, false, 'all']searchActiveContent
- Search only content titles or both title and active content. Defaults to both.private any syncUpdateHits(any contentID)
contentID
- The content id to updatepublic ContentService updateHits(any contentID, [boolean async='true'])
contentID
- The content id to updateasync
- Async or not
|
ContentBox Core API 1.5.7 | ||||
FRAMES |