contentbox.models.content

Class ContentTemplateService

lucee.Component
    extended by cborm.models.BaseORMService
      extended by cborm.models.VirtualEntityService
        extended by contentbox.models.content.ContentTemplateService

ContentBox - A Modular Content Platform Copyright since 2012 by Ortus Solutions, Corp www.ortussolutions.com/products/contentbox --- Template service for contentbox

Class Attributes:
  • singleton
  •  
  • synchronized : false
  •  
  • accessors : false
  •  
  • persistent : false
  •  
    Property Summary
    type property default serializable required
    any contentService


    • access = public
    • returntype = any
    • inject = ContentService@contentbox
    true false
    any dateUtil


    • access = public
    • returntype = any
    • inject = DateUtil@contentbox
    true false
    Constructor Summary
    init()
          Constructor.
    Method Summary
    boolean delete(any template)
         Delete a template which also removes itself from all many-to-many relationships.
    array getAllForExport(any site)
         Get all data prepared for export.
    array getAvailableForContentType(string contentType, contentbox.models.content.Site site, [string fields])
         Gets all of the available templates for a content type.
    string importFromData(any importData, [boolean override='false'], [any importLog])
         Import data from an array of structures or a single structure of data.
    string importFromFile(any importFile, [boolean override='false'])
         Import data from a ContentBox JSON file.
    ContentTemplate newFromContentItem(BaseContent contentItem)
    array removeTemplateAssignments(any template)
         Remove all content associations from a template and returns all the content objects it was removed from.
    struct search([any search=''], [any siteID=''], [any max='0'], [any offset='0'], [any sortOrder='name asc'])
         Content Template search with filters.
     
    Methods inherited from class cborm.models.VirtualEntityService
    autoCast, convertIdValueToJavaType, convertValueToJavaType, count, countWhere, deleteAll, deleteByID, deleteByQuery, deleteWhere, evictCollection, executeQuery, exists, findAllWhere, findWhere, get, getAll, getEntityName, getKey, getOrFail, getPropertyNames, getTableName, idCast, list, new, newCriteria, onMissingMethod, setEntityName
     
    Methods inherited from class cborm.models.BaseORMService
    $transactioned, buildJavaProxy, clear, createService, evict, evictQueries, findAll, findByExample, findIt, findOrFail, getBeanPopulator, getDatasource, getDefaultAsQuery, getDirtyPropertyNames, getDynamicProcessor, getEntityGivenName, getEntityMetadata, getEventHandling, getKeyValue, getLogger, getORMEventHandler, getObjectPopulator, getOrm, getPropertyValues, getQueryCacheRegion, getRestrictions, getSessionStatistics, getStringBuilder, getUseQueryCaching, getUseTransactions, getWirebox, isDirty, isSessionDirty, merge, nullValue, populate, populateFromJson, populateFromQuery, populateFromXml, populateWithPrefix, refresh, save, saveAll, sessionContains, setDatasource, setDefaultAsQuery, setEventHandling, setLogger, setORM, setORMEventHandler, setQueryCacheRegion, setUseQueryCaching, setUseTransactions, setWirebox, when
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init()

    Constructor


    Property Detail

    contentService

    property any contentService

    Attributes:
    access - public
    required - false
    returntype - any
    inject - ContentService@contentbox
    serializable - true

    dateUtil

    property any dateUtil

    Attributes:
    access - public
    required - false
    returntype - any
    inject - DateUtil@contentbox
    serializable - true

    Method Detail

    delete

    public boolean delete(any template)

    Delete a template which also removes itself from all many-to-many relationships

    Overrides:
    delete in class cborm.models.BaseORMService
    Parameters:
    template - The template object to remove from the system

    getAllForExport

    public array getAllForExport(any site)

    Get all data prepared for export

    Parameters:
    site - The site to export from

    getAvailableForContentType

    public array getAvailableForContentType(string contentType, contentbox.models.content.Site site, [string fields])

    Gets all of the available templates for a content type

    Parameters:
    contentType - the content type designation
    site - The site entity
    fields - Any projection list fields to return

    importFromData

    public string importFromData(any importData, [boolean override='false'], [any importLog])

    Import data from an array of structures or a single structure of data

    Parameters:
    importData - A struct or array of data to import
    override - Override content if found in the database, defaults to false
    importLog - The import log buffer
    Returns:
    The console log of the import
    Throws:
    InvalidImportFormat

    importFromFile

    public string importFromFile(any importFile, [boolean override='false'])

    Import data from a ContentBox JSON file. Returns the import log

    Parameters:
    importFile - The json file to import
    override - Override content if found in the database, defaults to false
    Returns:
    The console log of the import
    Throws:
    InvalidImportFormat

    newFromContentItem

    public ContentTemplate newFromContentItem(BaseContent contentItem)

    Parameters:
    contentItem

    removeTemplateAssignments

    public array removeTemplateAssignments(any template)

    Remove all content associations from a template and returns all the content objects it was removed from

    Parameters:
    template - The template object

    search

    public struct search([any search=''], [any siteID=''], [any max='0'], [any offset='0'], [any sortOrder='name asc'])

    Content Template search with filters

    Parameters:
    search - The search term for the name
    siteID - The site id to filter on
    max - The max records
    offset - The offset to use
    sortOrder - The sort order
    Returns:
    struct of { count, templates }