C# 클래스 Sitecore.SharedSource.Commons.Utilities.CreateItemUtil

Utilities for creating Sitecore items for imports
파일 보기 프로젝트 열기: Velir/Sitecore-Commons

공개 프로퍼티들

프로퍼티 타입 설명
alphabetFolderNames string[]

공개 메소드들

메소드 설명
CreateAlphabetFolderStructure ( Item parentItem, TemplateItem folderTemplate ) : void

Creates an alphabet folder structure under the passed in parent. This will also inlcude 123 as a folder for handling items that start with numbers. This defaults to lowercase letters for the folder names.

CreateAlphabetFolderStructure ( Item parentItem, TemplateItem folderTemplate, bool upperCase ) : void

Creates an alphabet folder structure under the passed in parent. This will also inlcude 123 as a folder for handling items that start with numbers.

GetOrCreateItem ( ICreateItem iCreateItem, bool &itemCreated ) : ID

Gets the or create item.

This is an updated version which has the complex dependencies removed So that it can be unit tested This method can/should be used directly, but for backwards compatability we still have the overloads which call this

GetOrCreateItem ( Item parentItem, string itemName, TemplateItem template ) : Item

Checks to see if an item already exists under a parent. If it exists return the item, otherwise create and return the new item. This defaults to using the master db.

GetOrCreateItem ( Item parentItem, string itemName, TemplateItem template, Database db ) : Item

Overriden without the itemCreated parameter to allow existing code to continue working

GetOrCreateItem ( Item parentItem, string itemName, TemplateItem template, Database db, bool &itemCreated ) : Item

Checks to see if an item already exists under a parent. If it exists return the item, otherwise create and return the new item.

This has been updated to call the testable method. Remaining logic is the item name cleaning.

GetOrCreateItem ( Item parentItem, string itemName, TemplateItem template, bool &itemCreated ) : Item

Checks to see if an item already exists under a parent. If it exists return the item, otherwise create and return the new item. This defaults to using the master db. Added the override option to determine if the item was created or not. the out value of itemCreated will return true if item has been created, false if the item already exists in sitecore and was found (and returned)

ItemNameCleaner ( string itemName ) : string

Cleans the Item Name - Changes & to "And", and removes disallowed characters

메소드 상세

CreateAlphabetFolderStructure() 공개 정적인 메소드

Creates an alphabet folder structure under the passed in parent. This will also inlcude 123 as a folder for handling items that start with numbers. This defaults to lowercase letters for the folder names.
public static CreateAlphabetFolderStructure ( Item parentItem, TemplateItem folderTemplate ) : void
parentItem Item The parent item.
folderTemplate TemplateItem The folder template.
리턴 void

CreateAlphabetFolderStructure() 공개 정적인 메소드

Creates an alphabet folder structure under the passed in parent. This will also inlcude 123 as a folder for handling items that start with numbers.
public static CreateAlphabetFolderStructure ( Item parentItem, TemplateItem folderTemplate, bool upperCase ) : void
parentItem Item The parent item.
folderTemplate TemplateItem The folder template.
upperCase bool if set to true make the letter folder name upper case.
리턴 void

GetOrCreateItem() 공개 정적인 메소드

Gets the or create item.
This is an updated version which has the complex dependencies removed So that it can be unit tested This method can/should be used directly, but for backwards compatability we still have the overloads which call this
public static GetOrCreateItem ( ICreateItem iCreateItem, bool &itemCreated ) : ID
iCreateItem ICreateItem The i create item.
itemCreated bool if set to true [item created].
리턴 ID

GetOrCreateItem() 공개 정적인 메소드

Checks to see if an item already exists under a parent. If it exists return the item, otherwise create and return the new item. This defaults to using the master db.
public static GetOrCreateItem ( Item parentItem, string itemName, TemplateItem template ) : Item
parentItem Item The parent item.
itemName string Name of the item.
template TemplateItem The template.
리턴 Item

GetOrCreateItem() 공개 정적인 메소드

Overriden without the itemCreated parameter to allow existing code to continue working
public static GetOrCreateItem ( Item parentItem, string itemName, TemplateItem template, Database db ) : Item
parentItem Item The parent item.
itemName string Name of the item.
template TemplateItem The template.
db Database The db to use.
리턴 Item

GetOrCreateItem() 공개 정적인 메소드

Checks to see if an item already exists under a parent. If it exists return the item, otherwise create and return the new item.
This has been updated to call the testable method. Remaining logic is the item name cleaning.
public static GetOrCreateItem ( Item parentItem, string itemName, TemplateItem template, Database db, bool &itemCreated ) : Item
parentItem Item The parent item.
itemName string Name of the item.
template TemplateItem The template.
db Database The db to use.
itemCreated bool if set to true [item created].
리턴 Item

GetOrCreateItem() 공개 정적인 메소드

Checks to see if an item already exists under a parent. If it exists return the item, otherwise create and return the new item. This defaults to using the master db. Added the override option to determine if the item was created or not. the out value of itemCreated will return true if item has been created, false if the item already exists in sitecore and was found (and returned)
public static GetOrCreateItem ( Item parentItem, string itemName, TemplateItem template, bool &itemCreated ) : Item
parentItem Item The parent item.
itemName string Name of the item.
template TemplateItem The template.
itemCreated bool
리턴 Item

ItemNameCleaner() 공개 정적인 메소드

Cleans the Item Name - Changes & to "And", and removes disallowed characters
public static ItemNameCleaner ( string itemName ) : string
itemName string The proposed item name
리턴 string

프로퍼티 상세

alphabetFolderNames 공개적으로 정적으로 프로퍼티

public static string[] alphabetFolderNames
리턴 string[]