\ExternalContentSource
A class that represents any kind of an external content source where the data can be represented in a tree state
ExternalContentSources are hierarchical in nature, and are tagged
with the 'Hierarchy' extension to enable them to be displayed in
content trees without problem. Due to their nature though, some of the
hierarchy functionality is explicitly overridden to prevent DB
access
- Author: Marcus Nyeholt <marcus@silverstripe.com.au>
- License: BSD License http://silverstripe.org/bsd-license
Synopsis
class ExternalContentSource
extends DataObject
{
- // members
- private static array $db = ;
- private static array $defaults = ;
- private static array $extensions = ;
- private static string $icon = 'cms/images/treeicons/root.png';
- private ArrayList $children;
- // methods
- public DataObject getObject()
- public ExternalContentItem getRoot()
- public void Link()
- public void RelativeLink()
- public void TreeTitle()
- public FieldSet getCMSFields()
- public int numChildren()
- public ExternalContentImporter getContentImporter()
- public array allowedImportTargets()
- public bool canCreate()
- public void canEdit()
- public void canView()
- public bool canImport()
- public DataObjectSet stageChildren()
- public void Children()
- public string encodeId()
- public String decodeId()
- public string CMSTreeClasses()
- public string CMSTreeCSS()
- public string getTreeTitle()
Hierarchy
Extends
- DataObject
Members
private
- $children — ArrayList
- $db
- $defaults
- $extensions
- $icon — string
Methods
public
- CMSTreeCSS() — Return the CSS declarations to apply to nodes of this type in the CMS tree
- CMSTreeClasses() — Return the CSS classes to apply to this node in the CMS tree
- Children() — Handle a children call by retrieving from stageChildren
- Link()
- RelativeLink()
- TreeTitle()
- allowedImportTargets() — Return an array of import locations that the importer for this content source supports. For example, an alfresco content importer may only support importing to the 'file' tree
- canCreate() — Controls whether the user can create this content source.
- canEdit() — We flag external content as being editable so it's accessible in the backend, but the individual implementations will protect users from editing... for now
- canImport() — Returns whether or not this source can be imported, defaulting to true.
- canView() — Is this item viewable?
- decodeId() — Decode an ID encoded by the above encodeId method
- encodeId() — Helper function to encode a remote ID that is safe to use within silverstripe
- getCMSFields() — Child classes should provide connection details to the external content source
- getContentImporter() — Get the content importer to use for importing content from this external source
- getObject() — Get the object represented by an external ID
- getRoot() — Gets the root item of this content source (used in templates if there's not one specified)
- getTreeTitle() — getTreeTitle will return two <span> html DOM elements, an empty <span> with the class 'jstree-pageicon' in front, following by a <span> wrapping around its MenutTitle
- numChildren() — Override to replace Hierarchy::numChildren
- stageChildren() — Override to return the top level content items from the remote content source.