C# Class Sdl.Web.Tridion.Common.TemplateBase

Base class for common functionality used by TBBs
Inheritance: ITemplate
Afficher le fichier Open project: sdl/dxa-content-management

Méthodes publiques

Méthode Description
GetComponent ( ) : Component

Returns the component object that is defined in the package for this template.

This method should only be called when there is an actual Component item in the package. It does not currently handle the situation where no such item is available.

GetPage ( ) : Page

Returns the Page object that is defined in the package for this template.

IsPageTemplate ( ) : bool

True if the rendering context is a page, rather than component

Transform ( Engine engine, Package package ) : void

Méthodes protégées

Méthode Description
AddBootstrapJsonBinary ( IList binaries, Component relatedComponent, StructureGroup sg, string variantName ) : void
AddJsonBinary ( object objectToSerialize, Component relatedComponent, StructureGroup structureGroup, string name, string variantId = null ) : Binary
ExtractKeyValuePairs ( Component component ) : string>.Dictionary
GetActiveModules ( ) : Component>.Dictionary
GetChildOrganizationalItem ( OrganizationalItem root, string title ) : OrganizationalItem
GetComponentTemplate ( ) : ComponentTemplate

Returns the Template from the resolved item if it's a Component Template

GetOrganizationalItemContents ( OrganizationalItem orgItem, ItemType itemType, bool recursive ) : string>>.List
GetPublication ( ) : Publication

Gets the context Publication.

GetRegionName ( ComponentTemplate template ) : string
GetSystemStructureGroup ( string subStructureGroupTitle = null ) : StructureGroup
GetUsingItems ( RepositoryLocalObject subject, ItemType itemType ) : string>>.List
Initialize ( Engine engine, Package package ) : void

Initializes the engine and package to use in this TemplateBase object.

IsMasterWebPublication ( Publication publication ) : bool
IsPreviewMode ( ) : bool
JsonSerialize ( object objectToSerialize ) : string
MergeData ( string>.Dictionary source, string>.Dictionary mergeData ) : string>.Dictionary
OutputSummary ( string name, IEnumerable files ) : void

Update the (JSON) summary in the Output item.

PutContextComponentOnTop ( ) : void

Put the context component back on top of the package stack As some TBBs (like SiteEdit ones) rely on this being the first Component in the stack

XmlElementToTcmUriList ( XmlElement data ) : string>>.List

Private Methods

Méthode Description
CheckInitialized ( ) : void
GetActiveModules ( Component coreConfigComponent ) : Component>.Dictionary
GetModuleConfigSchema ( ) : Schema
GetModuleNameFromItem ( RepositoryLocalObject item, string moduleRoot ) : string
IsPublishingToStaging ( ) : bool
JsonEncode ( object json ) : string
PublishBootstrapJson ( List filesCreated, Component relatedComponent, StructureGroup sg, string variantName = null, List additionalData = null ) : string
PublishJson ( string json, Component relatedComponent, StructureGroup sg, string filename, string variantName ) : string
PublishJsonData ( Dictionary settings, Component relatedComponent, string variantName, StructureGroup sg, bool isArray = false ) : List
PublishJsonData ( string>.Dictionary data, Component relatedComponent, string filename, string variantName, StructureGroup sg, bool isArray = false ) : string
PublishJsonData ( List settings, Component relatedComponent, string filename, string variantName, StructureGroup sg, bool isArray = false ) : string
StripModuleFromName ( string name ) : string

Method Details

AddBootstrapJsonBinary() protected méthode

protected AddBootstrapJsonBinary ( IList binaries, Component relatedComponent, StructureGroup sg, string variantName ) : void
binaries IList
relatedComponent Component
sg StructureGroup
variantName string
Résultat void

AddJsonBinary() protected méthode

protected AddJsonBinary ( object objectToSerialize, Component relatedComponent, StructureGroup structureGroup, string name, string variantId = null ) : Binary
objectToSerialize object
relatedComponent Component
structureGroup StructureGroup
name string
variantId string
Résultat Binary

ExtractKeyValuePairs() protected méthode

protected ExtractKeyValuePairs ( Component component ) : string>.Dictionary
component Component
Résultat string>.Dictionary

GetActiveModules() protected méthode

protected GetActiveModules ( ) : Component>.Dictionary
Résultat Component>.Dictionary

GetChildOrganizationalItem() protected méthode

protected GetChildOrganizationalItem ( OrganizationalItem root, string title ) : OrganizationalItem
root OrganizationalItem
title string
Résultat OrganizationalItem

GetComponent() public méthode

Returns the component object that is defined in the package for this template.
This method should only be called when there is an actual Component item in the package. It does not currently handle the situation where no such item is available.
public GetComponent ( ) : Component
Résultat Component

GetComponentTemplate() protected méthode

Returns the Template from the resolved item if it's a Component Template
protected GetComponentTemplate ( ) : ComponentTemplate
Résultat ComponentTemplate

GetOrganizationalItemContents() protected méthode

protected GetOrganizationalItemContents ( OrganizationalItem orgItem, ItemType itemType, bool recursive ) : string>>.List
orgItem OrganizationalItem
itemType ItemType
recursive bool
Résultat string>>.List

GetPage() public méthode

Returns the Page object that is defined in the package for this template.
public GetPage ( ) : Page
Résultat Page

GetPublication() protected méthode

Gets the context Publication.
protected GetPublication ( ) : Publication
Résultat Publication

GetRegionName() protected static méthode

protected static GetRegionName ( ComponentTemplate template ) : string
template ComponentTemplate
Résultat string

GetSystemStructureGroup() protected méthode

protected GetSystemStructureGroup ( string subStructureGroupTitle = null ) : StructureGroup
subStructureGroupTitle string
Résultat StructureGroup

GetUsingItems() protected méthode

protected GetUsingItems ( RepositoryLocalObject subject, ItemType itemType ) : string>>.List
subject RepositoryLocalObject
itemType ItemType
Résultat string>>.List

Initialize() protected méthode

Initializes the engine and package to use in this TemplateBase object.
protected Initialize ( Engine engine, Package package ) : void
engine Engine The engine to use in calls to the other methods of this TemplateBase object
package Package The package to use in calls to the other methods of this TemplateBase object
Résultat void

IsMasterWebPublication() protected méthode

protected IsMasterWebPublication ( Publication publication ) : bool
publication Publication
Résultat bool

IsPageTemplate() public méthode

True if the rendering context is a page, rather than component
public IsPageTemplate ( ) : bool
Résultat bool

IsPreviewMode() protected méthode

protected IsPreviewMode ( ) : bool
Résultat bool

JsonSerialize() protected méthode

protected JsonSerialize ( object objectToSerialize ) : string
objectToSerialize object
Résultat string

MergeData() protected méthode

protected MergeData ( string>.Dictionary source, string>.Dictionary mergeData ) : string>.Dictionary
source string>.Dictionary
mergeData string>.Dictionary
Résultat string>.Dictionary

OutputSummary() protected méthode

Update the (JSON) summary in the Output item.
protected OutputSummary ( string name, IEnumerable files ) : void
name string The name of the Template.
files IEnumerable The files/binaries created by the Template.
Résultat void

PutContextComponentOnTop() protected méthode

Put the context component back on top of the package stack As some TBBs (like SiteEdit ones) rely on this being the first Component in the stack
protected PutContextComponentOnTop ( ) : void
Résultat void

Transform() public abstract méthode

public abstract Transform ( Engine engine, Package package ) : void
engine Engine
package Package
Résultat void

XmlElementToTcmUriList() protected méthode

protected XmlElementToTcmUriList ( XmlElement data ) : string>>.List
data System.Xml.XmlElement
Résultat string>>.List