railo-context.Componentcoldbox.system.orm.hibernate.BaseORMService
coldbox.system.orm.hibernate.VirtualEntityService
contentbox.model.content.ContentService
ContentBox - A Modular Content Platform Copyright 2012 by Luis Majano and Ortus Solutions, Corp 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
Property Summary | ||||
---|---|---|---|---|
type | property | default | serializable | required |
any
|
authorService
|
true
|
false
|
|
any
|
cacheBox
|
true
|
false
|
|
any
|
categoryService
|
true
|
false
|
|
any
|
commentService
|
true
|
false
|
|
any
|
contentStoreService
|
true
|
false
|
|
any
|
contentVersionService
|
true
|
false
|
|
any
|
customFieldService
|
true
|
false
|
|
any
|
entryService
|
true
|
false
|
|
any
|
log
|
true
|
false
|
|
any
|
pageService
|
true
|
false
|
|
any
|
populator
|
true
|
false
|
|
any
|
settingService
|
true
|
false
|
|
any
|
statsService
|
true
|
false
|
|
any
|
systemUtil
|
true
|
false
|
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. |
any
|
findPublishedContent([numeric max='0'], [numeric offset='0'], [any searchTerm=''], [any category=''], [boolean asQuery='false'], [any parent], [boolean showInMenu])
Find published content objects. |
array
|
getAllFlatContent()
Returns an array of [contentID, title, slug] structures of all the content in the system. |
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. |
private any
|
getUniqueSlugHash(string slug)
Get a unique slug hash. |
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. |
any
|
inflateFromStruct(any contentData, any importLog, [any parent], [struct newContent='[runtime expression]'])
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'], [string contentTypes=''], [any excludeIDs=''], [boolean showInSearch='false'])
Searches published content with cool paramters, remember published content only. |
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 |
---|
clear, convertIDValueToJavaType, convertValueToJavaType, count, countWhere, criteriaCount, criteriaQuery, deleteAll, deleteByID, deleteByQuery, deleteWhere, evict, executeQuery, exists, findAllWhere, findWhere, get, getAll, getDatasource, getEntityName, getKey, getPropertyNames, getSessionStatistics, getTableName, isSessionDirty, list, new, newCriteria, onMissingMethod, setDatasource, setEntityName |
Methods inherited from class coldbox.system.orm.hibernate.BaseORMService |
---|
$delete, $deleteAll, $deleteByID, $deleteByQuery, $deleteWhere, $save, $saveAll, $transactioned, compileHQLFromDynamicMethod, createCriteriaQuery, createService, delete, evictEntity, evictQueries, findAll, findByExample, findDynamically, findIt, getDefaultAsQuery, getEntityGivenName, getEventHandling, getHQLDynamicCache, getORM, getORMEventHandler, getQueryCacheRegion, getRestrictions, getUseQueryCaching, getUseTransactions, merge, populate, populateFromJSON, populateFromQuery, populateFromXML, populateWithPrefix, refresh, save, saveAll, sessionContains, setDefaultAsQuery, setEventHandling, setHQLDynamicCache, setORM, setORMEventHandler, setQueryCacheRegion, setUseQueryCaching, setUseTransactions |
Methods inherited from class railo-context.Component |
---|
None |
Constructor Detail |
---|
Constructor
entityName
- The content entity name to bind this service to.Property Detail |
---|
required
- falseinject
- authorService@cbserializable
- truerequired
- falseinject
- cacheboxserializable
- truerequired
- falseinject
- categoryService@cbserializable
- truerequired
- falseinject
- commentService@cbserializable
- truerequired
- falseinject
- contentStoreService@cbserializable
- truerequired
- falseinject
- contentVersionService@cbserializable
- truerequired
- falseinject
- customFieldService@cbserializable
- truerequired
- falseinject
- entryService@cbserializable
- truerequired
- falseinject
- logbox:logger:{this}serializable
- truerequired
- falseinject
- pageService@cbserializable
- truerequired
- falseinject
- wirebox:populatorserializable
- truerequired
- falseinject
- id:settingService@cbserializable
- truerequired
- falseinject
- statsService@cbserializable
- truerequired
- falseinject
- SystemUtil@cbserializable
- trueMethod Detail |
---|
Bulk Publish Status Updates
contentID
- The list or array of ID's to bulk updatestatus
- The status either 'publish' or 'draft'Clear all content caches
async
- Run it asynchronously or not, defaults to falseClear all page wrapper caches
async
- Run it asynchronously or not, defaults to falseClear a page wrapper cache
slug
- The slug to cleanasync
- Run it asynchronously or not, defaults to falseClear all page wrapper caches
slug
- The slug partial to clean onasync
- Run it asynchronously or not, defaults to falseDelete a content object safely via hierarchies
content
- the Content object to deleteFind a published content object by slug and published unpublished flags, if not found it returns a new content object
slug
- The slug to searchshowUnpublished
- To also show unpublished content, defaults to false.Find published content objects
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 notReturns an array of [contentID, title, slug] structures of all the content in the system
Returns an array of slugs of all the content objects in the system.
Get all content for export as flat data
inData
- The data to use for exporting, usually concrete implementtions can override this.Get an id from a slug of a content object
slug
- The slug to search an ID for.Get the top commented content entries
max
- The maximum to retrieve, defaults to 5 entriesGet the top visited content entries
max
- The maximum to retrieve, defaults to 5 entriesGet a unique slug hash
slug
- The slug to unique itImport data from an array of structures of content or just one structure of a content entry
importData
- The data to importoverride
- Override records or notimportLog
- The import log bufferImport data from a ContentBox JSON file. Returns the import log
importFile
- The absolute file path to use for importingoverride
- Override records or notInflate a content object from a ContentBox JSON structure
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 recursionsnewContent
- Map of new content by slug; useful for avoiding new content collisions with recusive relationshipsVerify an incoming slug is unique or not
slug
- The slug to search for uniquenesscontentID
- Limit the search to the passed contentID usually for updatesSearches published content with cool paramters, remember published content only
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.contentTypes
- Limit search to list of content types (comma-delimited). Leave blank to search all content typesexcludeIDs
- List of IDs to exclude from searchshowInSearch
- If true, it makes sure content has been stored as searchable, defaults to false, which means it searches no matter what this bit saysUpdate a content's hits with some async flava
contentID
- The content id to updateasync
- Async or not