\StaticSiteDataTypeTransformer
Base content transformer. Comprises logic common to all types of legacy/scraped text and binary content for import into native SilverStripe DataObjects.
Use this as your starting-point for creating custom content transformers for other data-types.
Hint: You'll need to use the returned object from getContentFieldsAndSelectors() if the dataType
you wish to work with is not 'File' or 'SiteTree'.
- Author: Sam Minee <sam@silverstripe.com>
Synopsis
class StaticSiteDataTypeTransformer
implements
ExternalContentTransformer
{
- // members
- public StaticSiteUtils $utils;
- public StaticSiteMimeProcessor $mimeProcessor;
- public number $parentId = 0;
- // methods
- public void __construct()
- public null getContentFieldsAndSelectors()
- protected boolean duplicationStrategy()
- public number getCurrentImportID()
- public array getSSExtensions()
- public void setParentId()
- public number getParentId()
Hierarchy
Implements
- ExternalContentTransformer
Members
public
- $mimeProcessor — StaticSiteMimeProcessor
- $parentId
—
number
The parent ID of an imported object - $utils
—
StaticSiteUtils
Holds the StaticSiteUtils object on construct
Methods
protected
- duplicationStrategy() — Process incoming content according to CMS user-inputted duplication strategy.
public
- __construct()
- getContentFieldsAndSelectors() — Get content from remote datasource (e.g. a File, Image or page-text).
- getCurrentImportID() — Get current import ID. If none can be found, start one and return that.
- getParentId() — Gets the parent ID for an imported object.
- getSSExtensions() — Build an array of file extensions. Utilised in buildFileProperties() to check incoming file-extensions are valid against those found on {@link File}.
- setParentId() — Sets the parent ID for an imported object.