C# Class Composite.Data.PageMetaDataFacade

Mostra file Open project: Orckestra/C1-CMS Class Usage Examples

Public Methods

Method Description
AddDefinition ( System.Guid definingItemId, string name, string label, System.Guid metaDataTypeId, System.Guid metaDataContainerId, int startLevel, int levels = 100000 ) : void

Adds a new metadata definition to the given definingItemId. Guid.Empty is the whole website

AddMetaDataDefinition ( this definingPageType, string name, string label, System.Guid metaDataTypeId, System.Guid metaDataContainerId ) : void

Adds a new metadata definition to the given pagetype

AddMetaDataDefinition ( this definingPage, string name, string label, System.Guid metaDataTypeId, System.Guid metaDataContainerId, int startLevel, int levels = 100000 ) : void

Adds a new metadata definition to the given page

AddNewMetaDataToExistingPage ( this page, string metaDataDefinitionName, Type metaDataType, IData newDataTemplate ) : void
AddNewMetaDataToExistingPages ( this definingPage, string metaDataDefinitionName, IData newDataTemplate ) : void

Using the given page this methods adds meta data instances that are missing

AssignMetaDataSpecificValues ( IData metaData, string metaDataDefinitionName, IPage definingPage ) : void

Updates the given metadata item with new Id and setting the metadata defintion name and defining item id

GetAllMetaDataContainers ( ) : string>>.List

Gets all meta data containers ordered. If none exists in the system, a default is created

GetAllMetaDataTypes ( ) : IEnumerable

Returns all possible meta data types. This is NOT types that only have been defined on any pages or page type

GetAllowedMetaDataContainers ( this page ) : IEnumerable

Returns all allowed metadata containers on the given page

GetAllowedMetaDataDefinitions ( this page ) : List

Returns all allowed metadata definitions on the given page

GetAllowedMetaDataTypes ( this page ) : IEnumerable

Return all allowed metadata types on the given page

GetDefinedMetaDataTypeAndNames ( this page ) : string>>.IEnumerable
GetDefinedMetaDataTypes ( this page ) : IEnumerable

Returns all meta data types that are defined on the given page.

GetDefinitionNamePropertyInfo ( Type metaDataType ) : PropertyInfo
GetDefinitionPageReferencePropertyInfo ( Type metaDataType ) : PropertyInfo
GetDefinitionPageReferencePropertyVersionInfo ( Type metaDataType ) : PropertyInfo
GetMetaData ( System.Guid pageId, System.Guid pageVersionId, string definitionName, Type metaDataType ) : IData
GetMetaData ( this page, string definitionName, System.Guid metaDataTypeId ) : IData
GetMetaData ( this page, string definitionName, Type metaDataType ) : IData
GetMetaData ( string definitionName, Type metaDataType ) : IEnumerable
GetMetaData ( this page ) : IEnumerable
GetMetaData ( this page, Composite.Data.DataScopeIdentifier dataScopeIdentifier ) : IEnumerable
GetMetaDataAffectedPages ( this definingPage, int startLevel, int levels ) : IEnumerable

Gets all existing pages that are affected by the given meta data definition

GetMetaDataAffectedPages ( this definingPage, string definitionName ) : IEnumerable

Gets all existing pages that are affected by the given meta data definition

GetMetaDataAffectedPagesByPageTypeId ( System.Guid definingPageTypeId ) : IEnumerable
GetMetaDataDefinition ( System.Guid definingItemId, string name ) : IPageMetaDataDefinition

Returns a pagemeta data definition given the defining item id or null if none exists.

GetMetaDataReferencedPage ( this metaData ) : IPage
GetMetaDataReferencedPageId ( IData metaData ) : System.Guid
IsDefinitionAllowed ( System.Guid definingItemId, string name, string label, System.Guid metaDataTypeId ) : bool
IsDefinitionAllowed ( IPageMetaDataDefinition pageMetaDataDefinition, IPage page ) : bool

Returns true if the given page metadata definition is allowed for the given page

IsNewContainerIdAllowed ( System.Guid definingItemId, string name, System.Guid newMetaDataContainerName ) : bool
RemoveAllDefinitions ( System.Guid metaDataTypeId, bool deleteExistingMetaData = true ) : void
RemoveDefinition ( System.Guid definingItemId, string definitionName, bool deleteExistingMetaData = true ) : void

Removes a metadata definition and possibly deletes all data items that are defined by it

RemoveMetaDataDefinition ( this definingPage, string definitionName, bool deleteExistingMetaData = true ) : void

Removes a metadata definition and possibly deletes all data items that are defined by it

UpdateDefinition ( System.Guid definingItemId, string definitionName, string newLabel, System.Guid newMetaDataContainerId ) : void

Update an existing metadata definition with possible new label and container id

UpdateDefinition ( System.Guid definingItemId, string definitionName, string newLabel, int newStartLevel, int newLevels, System.Guid newMetaDataContainerId ) : void

Update an existing metadata definition with possible new label and container id

Private Methods

Method Description
AddNewMetaDataToExistingPages ( IEnumerable affectedPages, string metaDataDefinitionName, Type metaDataType, IData newDataTemplate ) : void
CountLevelsToParent ( System.Guid definingPageId, System.Guid pageId ) : int
ExistInOtherScope ( IPage page, IEnumerable otherPageMetaDataDefinition ) : bool
GetMetaDataContainerByDefinitionName ( string name ) : ICompositionContainer
GetPageIdOrNull ( this page ) : System.Guid
RemoveDefinitionDeleteData ( string definitionName, Type metaDataType, IEnumerable otherPageMetaDataDefinitions ) : void

Method Details

AddDefinition() public static method

Adds a new metadata definition to the given definingItemId. Guid.Empty is the whole website
public static AddDefinition ( System.Guid definingItemId, string name, string label, System.Guid metaDataTypeId, System.Guid metaDataContainerId, int startLevel, int levels = 100000 ) : void
definingItemId System.Guid
name string
label string
metaDataTypeId System.Guid
metaDataContainerId System.Guid
startLevel int
levels int
return void

AddMetaDataDefinition() public static method

Adds a new metadata definition to the given pagetype
public static AddMetaDataDefinition ( this definingPageType, string name, string label, System.Guid metaDataTypeId, System.Guid metaDataContainerId ) : void
definingPageType this
name string
label string
metaDataTypeId System.Guid
metaDataContainerId System.Guid
return void

AddMetaDataDefinition() public static method

Adds a new metadata definition to the given page
public static AddMetaDataDefinition ( this definingPage, string name, string label, System.Guid metaDataTypeId, System.Guid metaDataContainerId, int startLevel, int levels = 100000 ) : void
definingPage this
name string
label string
metaDataTypeId System.Guid
metaDataContainerId System.Guid
startLevel int
levels int
return void

AddNewMetaDataToExistingPage() public static method

public static AddNewMetaDataToExistingPage ( this page, string metaDataDefinitionName, Type metaDataType, IData newDataTemplate ) : void
page this
metaDataDefinitionName string
metaDataType System.Type
newDataTemplate IData
return void

AddNewMetaDataToExistingPages() public static method

Using the given page this methods adds meta data instances that are missing
public static AddNewMetaDataToExistingPages ( this definingPage, string metaDataDefinitionName, IData newDataTemplate ) : void
definingPage this If null, empty guid is used
metaDataDefinitionName string
newDataTemplate IData
return void

AssignMetaDataSpecificValues() public static method

Updates the given metadata item with new Id and setting the metadata defintion name and defining item id
public static AssignMetaDataSpecificValues ( IData metaData, string metaDataDefinitionName, IPage definingPage ) : void
metaData IData
metaDataDefinitionName string
definingPage IPage
return void

GetAllMetaDataContainers() public static method

Gets all meta data containers ordered. If none exists in the system, a default is created
public static GetAllMetaDataContainers ( ) : string>>.List
return string>>.List

GetAllMetaDataTypes() public static method

Returns all possible meta data types. This is NOT types that only have been defined on any pages or page type
public static GetAllMetaDataTypes ( ) : IEnumerable
return IEnumerable

GetAllowedMetaDataContainers() public static method

Returns all allowed metadata containers on the given page
public static GetAllowedMetaDataContainers ( this page ) : IEnumerable
page this If null, empty guid is used (whole website)
return IEnumerable

GetAllowedMetaDataDefinitions() public static method

Returns all allowed metadata definitions on the given page
public static GetAllowedMetaDataDefinitions ( this page ) : List
page this If null, empty guid is used (whole website)
return List

GetAllowedMetaDataTypes() public static method

Return all allowed metadata types on the given page
public static GetAllowedMetaDataTypes ( this page ) : IEnumerable
page this
return IEnumerable

GetDefinedMetaDataTypeAndNames() public static method

public static GetDefinedMetaDataTypeAndNames ( this page ) : string>>.IEnumerable
page this
return string>>.IEnumerable

GetDefinedMetaDataTypes() public static method

Returns all meta data types that are defined on the given page.
public static GetDefinedMetaDataTypes ( this page ) : IEnumerable
page this If this is null, Guid.Empty is assumed as defining item id
return IEnumerable

GetDefinitionNamePropertyInfo() public static method

public static GetDefinitionNamePropertyInfo ( Type metaDataType ) : PropertyInfo
metaDataType System.Type
return System.Reflection.PropertyInfo

GetDefinitionPageReferencePropertyInfo() public static method

public static GetDefinitionPageReferencePropertyInfo ( Type metaDataType ) : PropertyInfo
metaDataType System.Type
return System.Reflection.PropertyInfo

GetDefinitionPageReferencePropertyVersionInfo() public static method

public static GetDefinitionPageReferencePropertyVersionInfo ( Type metaDataType ) : PropertyInfo
metaDataType System.Type
return System.Reflection.PropertyInfo

GetMetaData() public static method

public static GetMetaData ( System.Guid pageId, System.Guid pageVersionId, string definitionName, Type metaDataType ) : IData
pageId System.Guid
pageVersionId System.Guid
definitionName string
metaDataType System.Type
return IData

GetMetaData() public static method

public static GetMetaData ( this page, string definitionName, System.Guid metaDataTypeId ) : IData
page this
definitionName string
metaDataTypeId System.Guid
return IData

GetMetaData() public static method

public static GetMetaData ( this page, string definitionName, Type metaDataType ) : IData
page this
definitionName string
metaDataType System.Type
return IData

GetMetaData() public static method

public static GetMetaData ( string definitionName, Type metaDataType ) : IEnumerable
definitionName string
metaDataType System.Type
return IEnumerable

GetMetaData() public static method

public static GetMetaData ( this page ) : IEnumerable
page this
return IEnumerable

GetMetaData() public static method

public static GetMetaData ( this page, Composite.Data.DataScopeIdentifier dataScopeIdentifier ) : IEnumerable
page this
dataScopeIdentifier Composite.Data.DataScopeIdentifier
return IEnumerable

GetMetaDataAffectedPages() public static method

Gets all existing pages that are affected by the given meta data definition
public static GetMetaDataAffectedPages ( this definingPage, int startLevel, int levels ) : IEnumerable
definingPage this
startLevel int
levels int
return IEnumerable

GetMetaDataAffectedPages() public static method

Gets all existing pages that are affected by the given meta data definition
public static GetMetaDataAffectedPages ( this definingPage, string definitionName ) : IEnumerable
definingPage this If null, empty guid is used
definitionName string
return IEnumerable

GetMetaDataAffectedPagesByPageTypeId() public static method

public static GetMetaDataAffectedPagesByPageTypeId ( System.Guid definingPageTypeId ) : IEnumerable
definingPageTypeId System.Guid
return IEnumerable

GetMetaDataDefinition() public static method

Returns a pagemeta data definition given the defining item id or null if none exists.
public static GetMetaDataDefinition ( System.Guid definingItemId, string name ) : IPageMetaDataDefinition
definingItemId System.Guid
name string
return IPageMetaDataDefinition

GetMetaDataReferencedPage() public static method

public static GetMetaDataReferencedPage ( this metaData ) : IPage
metaData this
return IPage

GetMetaDataReferencedPageId() public static method

public static GetMetaDataReferencedPageId ( IData metaData ) : System.Guid
metaData IData
return System.Guid

IsDefinitionAllowed() public static method

public static IsDefinitionAllowed ( System.Guid definingItemId, string name, string label, System.Guid metaDataTypeId ) : bool
definingItemId System.Guid
name string
label string
metaDataTypeId System.Guid
return bool

IsDefinitionAllowed() public static method

Returns true if the given page metadata definition is allowed for the given page
public static IsDefinitionAllowed ( IPageMetaDataDefinition pageMetaDataDefinition, IPage page ) : bool
pageMetaDataDefinition IPageMetaDataDefinition
page IPage If null, empty guid is used (whole website)
return bool

IsNewContainerIdAllowed() public static method

public static IsNewContainerIdAllowed ( System.Guid definingItemId, string name, System.Guid newMetaDataContainerName ) : bool
definingItemId System.Guid
name string
newMetaDataContainerName System.Guid
return bool

RemoveAllDefinitions() public static method

public static RemoveAllDefinitions ( System.Guid metaDataTypeId, bool deleteExistingMetaData = true ) : void
metaDataTypeId System.Guid
deleteExistingMetaData bool
return void

RemoveDefinition() public static method

Removes a metadata definition and possibly deletes all data items that are defined by it
public static RemoveDefinition ( System.Guid definingItemId, string definitionName, bool deleteExistingMetaData = true ) : void
definingItemId System.Guid
definitionName string
deleteExistingMetaData bool
return void

RemoveMetaDataDefinition() public static method

Removes a metadata definition and possibly deletes all data items that are defined by it
public static RemoveMetaDataDefinition ( this definingPage, string definitionName, bool deleteExistingMetaData = true ) : void
definingPage this
definitionName string
deleteExistingMetaData bool
return void

UpdateDefinition() public static method

Update an existing metadata definition with possible new label and container id
public static UpdateDefinition ( System.Guid definingItemId, string definitionName, string newLabel, System.Guid newMetaDataContainerId ) : void
definingItemId System.Guid
definitionName string
newLabel string
newMetaDataContainerId System.Guid
return void

UpdateDefinition() public static method

Update an existing metadata definition with possible new label and container id
public static UpdateDefinition ( System.Guid definingItemId, string definitionName, string newLabel, int newStartLevel, int newLevels, System.Guid newMetaDataContainerId ) : void
definingItemId System.Guid
definitionName string
newLabel string
newStartLevel int
newLevels int
newMetaDataContainerId System.Guid
return void