C# Class Felinesoft.UmbracoCodeFirst.Core.Modules.ContentTypeModuleBase

Inheritance: IContentTypeModuleBase, IEntityTreeFilter
Show file Open project: DanMannMann/UmbracoCodeFirst

Public Methods

Method Description
CreateOrUpdateContentType ( ContentTypeRegistration registration ) : void
Filter ( Umbraco nodes, bool &changesMade ) : void
Initialise ( IEnumerable types ) : void
IsFilter ( string treeAlias ) : bool
TryGetContentType ( Type type, ContentTypeRegistration &registration ) : bool
TryGetContentType ( string alias, ContentTypeRegistration &registration ) : bool

Protected Methods

Method Description
ContentTypeModuleBase ( IPropertyModule propertyModule, System.Guid performanceTimer ) : System
CreateContentType ( ContentTypeRegistration registration, bool &modified ) : IContentTypeBase

This method is called when the Content Type declared in the attribute hasn't been found in Umbraco

CreateContentType ( IContentTypeBase parent ) : IContentTypeComposition
CreateRegistration ( Type type ) : ContentTypeRegistration
Delete ( IContentTypeBase contentType ) : void
DeleteContentType ( IContentTypeBase contentType ) : void
DoPerType ( IEnumerable types, Action action, bool resetCacheBeforeAndAfter = true ) : void
DoPerTypeConcurrent ( IEnumerable types, Action action, bool resetCacheBeforeAndAfter = true ) : void
GenerateContentTypes ( string nameSpace, string folderPath, string attributeName, Func selector, ContentTypeDescription>.Action customAction = null ) : void
GetAllContentTypes ( ) : IEnumerable
GetChildren ( IContentTypeBase contentType ) : IEnumerable
GetContentTypeByAlias ( string alias ) : IContentTypeComposition
GetRegistration ( Type type ) : ContentTypeRegistration
GetRegistration ( string alias ) : ContentTypeRegistration
Register ( ContentTypeRegistration registration ) : void
ResetContentTypesCache ( ) : void
Save ( IContentTypeBase contentType ) : void
SaveContentType ( IContentTypeBase contentType ) : void
SyncAllowedChildren ( ContentTypeRegistration docTypeReg ) : void
SyncCompositions ( ContentTypeRegistration docTypeReg ) : void
UpdateContentType ( ContentTypeRegistration registration, bool &modified ) : IContentTypeBase

Update the existing content Type based on the data in the attributes

Private Methods

Method Description
AddAllowedChildTypes ( IContentTypeComposition node, ContentTypeDescription type ) : void
AddCompositions ( List descriptions, IEnumerable items, string parentAlias ) : void
AddProperties ( List list, IEnumerable propertyTypeCollection, string nspace, string typeName, string tabName = null ) : void
AddTabs ( string nspace, IContentTypeComposition node, ContentTypeDescription type ) : void
BuildContentTypeModel ( string nameSpace, IContentTypeComposition node, string attributeName, ContentTypeDescription>.Action customAction ) : ContentTypeDescription
BuildContentTypeModels ( string nameSpace, string folderPath, string attributeName, List &types, Func selector, ContentTypeDescription>.Action customAction ) : void
BuildPropertyModel ( string nameSpace, string tabName, PropertyType propType, string typeName ) : PropertyDescription
BuildTabModel ( string nameSpace, PropertyGroup group, List ignoredProperties, string typeName ) : TabDescription
CheckBuiltIn ( ContentTypeRegistration registration ) : void
CreateProperties ( PropertyInfo propertyInfo, IContentTypeBase newContentType, TabRegistration tab, List propertyRegister, Type documentClrType ) : void

Every property on the Tab object is scanned for the UmbracoProperty attribute

CreateTabs ( IContentTypeBase newContentType, List tabRegister, Type contentClrType ) : void

Scans for properties on the model which have the UmbracoTab attribute

CreateTypeDescription ( IContentTypeComposition node, string attributeName ) : ContentTypeDescription
FetchAllowedContentTypes ( Type types, Type parentType ) : List

Gets the allowed children

GenerateClassFiles ( string nameSpace, string folderPath, List types ) : void
GetAliasesFromTypes ( Type types, Type parentType ) : List

Gets all the document type aliases from the supplied list of types

GetAllAncestorTypes ( ContentTypeRegistration docTypeReg ) : List
GetCodeFirstParent ( Type type, ContentTypeAttribute &parentAttribute, Type &parentType ) : void
GetComposingTypes ( ContentTypeRegistration docTypeReg, List usedInCompositions ) : List
Prune ( IContentTypeBase contentType, Type documentClrType, PropertyInfo tabProperties, IEnumerable propertiesOfRoot ) : void
RemovePropertyFromChildren ( string alias, IEnumerable children ) : void
Reparent ( ContentTypeRegistration registration, IContentTypeComposition contentType, IContentTypeBase newParent, IContentTypeBase oldParent ) : IContentTypeComposition
SyncChildrenAndCompositions ( List sortedTypes ) : void
SyncContentTypes ( List generation ) : void
ValidateComposition ( ContentTypeRegistration docTypeReg, List targetBases, PropertyInfo comp, ContentTypeRegistration compReg, List usedInCompositions ) : void
VerifyAllPropertiesOnTab ( PropertyInfo propertyTab, IContentTypeBase contentType, TabRegistration registration, Type documentType, bool &modified ) : IEnumerable

Scan the properties on tabs

VerifyProperties ( IContentTypeBase contentType, Type documentClrType, List propertyRegister, List tabRegister, bool &modified ) : void

Loop through all properties and remove existing ones if necessary

Method Details

ContentTypeModuleBase() protected method

protected ContentTypeModuleBase ( IPropertyModule propertyModule, System.Guid performanceTimer ) : System
propertyModule IPropertyModule
performanceTimer System.Guid
return System

CreateContentType() protected method

This method is called when the Content Type declared in the attribute hasn't been found in Umbraco
protected CreateContentType ( ContentTypeRegistration registration, bool &modified ) : IContentTypeBase
registration ContentTypeRegistration
modified bool
return IContentTypeBase

CreateContentType() protected abstract method

protected abstract CreateContentType ( IContentTypeBase parent ) : IContentTypeComposition
parent IContentTypeBase
return IContentTypeComposition

CreateOrUpdateContentType() public method

public CreateOrUpdateContentType ( ContentTypeRegistration registration ) : void
registration ContentTypeRegistration
return void

CreateRegistration() protected abstract method

protected abstract CreateRegistration ( Type type ) : ContentTypeRegistration
type System.Type
return ContentTypeRegistration

Delete() protected method

protected Delete ( IContentTypeBase contentType ) : void
contentType IContentTypeBase
return void

DeleteContentType() protected abstract method

protected abstract DeleteContentType ( IContentTypeBase contentType ) : void
contentType IContentTypeBase
return void

DoPerType() protected method

protected DoPerType ( IEnumerable types, Action action, bool resetCacheBeforeAndAfter = true ) : void
types IEnumerable
action Action
resetCacheBeforeAndAfter bool
return void

DoPerTypeConcurrent() protected method

protected DoPerTypeConcurrent ( IEnumerable types, Action action, bool resetCacheBeforeAndAfter = true ) : void
types IEnumerable
action Action
resetCacheBeforeAndAfter bool
return void

Filter() public method

public Filter ( Umbraco nodes, bool &changesMade ) : void
nodes Umbraco
changesMade bool
return void

GenerateContentTypes() protected method

protected GenerateContentTypes ( string nameSpace, string folderPath, string attributeName, Func selector, ContentTypeDescription>.Action customAction = null ) : void
nameSpace string
folderPath string
attributeName string
selector Func
customAction ContentTypeDescription>.Action
return void

GetAllContentTypes() protected abstract method

protected abstract GetAllContentTypes ( ) : IEnumerable
return IEnumerable

GetChildren() protected abstract method

protected abstract GetChildren ( IContentTypeBase contentType ) : IEnumerable
contentType IContentTypeBase
return IEnumerable

GetContentTypeByAlias() protected abstract method

protected abstract GetContentTypeByAlias ( string alias ) : IContentTypeComposition
alias string
return IContentTypeComposition

GetRegistration() protected method

protected GetRegistration ( Type type ) : ContentTypeRegistration
type System.Type
return ContentTypeRegistration

GetRegistration() protected method

protected GetRegistration ( string alias ) : ContentTypeRegistration
alias string
return ContentTypeRegistration

Initialise() public method

public Initialise ( IEnumerable types ) : void
types IEnumerable
return void

IsFilter() public abstract method

public abstract IsFilter ( string treeAlias ) : bool
treeAlias string
return bool

Register() protected method

protected Register ( ContentTypeRegistration registration ) : void
registration ContentTypeRegistration
return void

ResetContentTypesCache() protected method

protected ResetContentTypesCache ( ) : void
return void

Save() protected method

protected Save ( IContentTypeBase contentType ) : void
contentType IContentTypeBase
return void

SaveContentType() protected abstract method

protected abstract SaveContentType ( IContentTypeBase contentType ) : void
contentType IContentTypeBase
return void

SyncAllowedChildren() protected method

protected SyncAllowedChildren ( ContentTypeRegistration docTypeReg ) : void
docTypeReg ContentTypeRegistration
return void

SyncCompositions() protected method

protected SyncCompositions ( ContentTypeRegistration docTypeReg ) : void
docTypeReg ContentTypeRegistration
return void

TryGetContentType() public method

public TryGetContentType ( Type type, ContentTypeRegistration &registration ) : bool
type System.Type
registration ContentTypeRegistration
return bool

TryGetContentType() public method

public TryGetContentType ( string alias, ContentTypeRegistration &registration ) : bool
alias string
registration ContentTypeRegistration
return bool

UpdateContentType() protected method

Update the existing content Type based on the data in the attributes
protected UpdateContentType ( ContentTypeRegistration registration, bool &modified ) : IContentTypeBase
registration ContentTypeRegistration
modified bool
return IContentTypeBase