C# Class Sitecore.SharedSource.Commons.Utilities.CreateItemUtil

Utilities for creating Sitecore items for imports
Afficher le fichier Open project: Velir/Sitecore-Commons

Méthodes publiques

Свойство Type Description
alphabetFolderNames string[]

Méthodes publiques

Méthode Description
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

Method Details

CreateAlphabetFolderStructure() public static méthode

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.
Résultat void

CreateAlphabetFolderStructure() public static méthode

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.
Résultat void

GetOrCreateItem() public static méthode

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].
Résultat ID

GetOrCreateItem() public static méthode

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.
Résultat Item

GetOrCreateItem() public static méthode

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.
Résultat Item

GetOrCreateItem() public static méthode

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].
Résultat Item

GetOrCreateItem() public static méthode

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
Résultat Item

ItemNameCleaner() public static méthode

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

Property Details

alphabetFolderNames public_oe static_oe property

public static string[] alphabetFolderNames
Résultat string[]