C# Class Sitecore.Sharedsource.Tasks.NewsMover

Afficher le fichier Open project: Sitecore/NewsMover

Méthodes publiques

Méthode Description
AddTemplateConfiguration ( XmlNode configNode ) : void

Adds a configured template to be organized

NewsMover ( ) : System
OnItemSaved ( object sender, EventArgs args ) : void

Called when [item saved].

Méthodes protégées

Méthode Description
EnsureAndGetDate ( System.Item item, string dateFieldName ) : System.DateTime

Initializes the date field to the current date if there is no value.

GetItem ( EventArgs args ) : System.Item

Gets the item from the event args.

GetOrCreateChild ( System.Item parent, TemplateItem template, string childName, SortOrder subItemSorting ) : System.Item

Gets the or create child.

GetRoot ( System.Item item, TemplateConfiguration config ) : System.Item

Gets the root of where we start organization. i.e. the parent of the 'year' node

LoadLegacySettings ( ) : void

Loads the legacy settings.

OrganizeItem ( System.Item item, TemplateConfiguration config, System.DateTime articleDate ) : void

Organizes the item in the configurd year, [month], [day] structure. It will also remove any empty folders

Private Methods

Méthode Description
IsItemYearMonthOrDay ( System.Item item, TemplateConfiguration config ) : bool

Determines whether the item is a year, month or day item.

Method Details

AddTemplateConfiguration() public méthode

Adds a configured template to be organized
public AddTemplateConfiguration ( XmlNode configNode ) : void
configNode System.Xml.XmlNode The XML configuration node.
Résultat void

EnsureAndGetDate() protected méthode

Initializes the date field to the current date if there is no value.
protected EnsureAndGetDate ( System.Item item, string dateFieldName ) : System.DateTime
item System.Item The article.
dateFieldName string Name of the date field.
Résultat System.DateTime

GetItem() protected méthode

Gets the item from the event args.
protected GetItem ( EventArgs args ) : System.Item
args System.EventArgs The instance containing the event data.
Résultat System.Item

GetOrCreateChild() protected méthode

Gets the or create child.
protected GetOrCreateChild ( System.Item parent, TemplateItem template, string childName, SortOrder subItemSorting ) : System.Item
parent System.Item The parent.
template TemplateItem The template.
childName string Name of the child.
subItemSorting SortOrder
Résultat System.Item

GetRoot() protected méthode

Gets the root of where we start organization. i.e. the parent of the 'year' node
protected GetRoot ( System.Item item, TemplateConfiguration config ) : System.Item
item System.Item The item.
config TemplateConfiguration The config.
Résultat System.Item

LoadLegacySettings() protected méthode

Loads the legacy settings.
protected LoadLegacySettings ( ) : void
Résultat void

NewsMover() public méthode

public NewsMover ( ) : System
Résultat System

OnItemSaved() public méthode

Called when [item saved].
public OnItemSaved ( object sender, EventArgs args ) : void
sender object The sender.
args System.EventArgs The instance containing the event data.
Résultat void

OrganizeItem() protected méthode

Organizes the item in the configurd year, [month], [day] structure. It will also remove any empty folders
protected OrganizeItem ( System.Item item, TemplateConfiguration config, System.DateTime articleDate ) : void
item System.Item The item.
config TemplateConfiguration The config.
articleDate System.DateTime The article date.
Résultat void