C# Class MongoDataProvider.MongoDataProvider

Provides item data from a Mongo database (www.mongodb.org). Configure this through MongoDataProvider.config.
Inheritance: DataProvider
Datei anzeigen Open project: hermanussen/MongoDataProvider

Protected Properties

Property Type Description
PrefetchCacheLock object

Private Properties

Property Type Description
EnsureNotEmpty void
GetPrefetchData PrefetchData

Public Methods

Method Description
AddVersion ( ItemDefinition itemDefinition, VersionUri baseVersion, CallContext context ) : int

Creates a new version for a content item in a particular language.

BlobStreamExists ( System.Guid blobId, CallContext context ) : bool

Check if a blob with the ID that is passed exists in MongoDB.

CreateItem ( ID itemID, string itemName, ID templateID, ItemDefinition parent, CallContext context ) : bool

Create a new item as a child of another item. Note that this does not create any versions or field values.

DeleteItem ( ItemDefinition itemDefinition, CallContext context ) : bool

Removes an item from the database completely.

GetBlobStream ( System.Guid blobId, CallContext context ) : System.IO.Stream

Get a blob from MongoDB with the ID that is passed.

GetChildIDs ( ItemDefinition itemDefinition, CallContext context ) : IDList

Determines what items are children of the item and returns a list of their IDs.

GetItemDefinition ( ID itemId, CallContext context ) : ItemDefinition

Returns a definition containing the id, name, template id, branch id and parent id of the Item that corresponds with the itemId parameter.

GetItemFields ( ItemDefinition itemDefinition, VersionUri versionUri, CallContext context ) : FieldList

Get a list of all the item's fields and their values.

GetItemVersions ( ItemDefinition itemDefinition, CallContext context ) : VersionUriList

Get a list of all available versions in different languages.

GetParentID ( ItemDefinition itemDefinition, CallContext context ) : ID

Get the ID of the parent of an item.

GetRootID ( CallContext context ) : ID
GetTemplateItemIds ( CallContext context ) : IdCollection
MongoDataProvider ( string joinParentId, string mongoConnectionString, string databaseName, string safeMode ) : System
SaveItem ( ItemDefinition itemDefinition, Sitecore changes, CallContext context ) : bool

Save changes that were made to an item to the database.

SetBlobStream ( System stream, System.Guid blobId, CallContext context ) : bool

Upload a file to GridFS in MongoDB.

Private Methods

Method Description
EnsureNotEmpty ( ) : void

Prefills the database with a root item, if it is not available.

GetPrefetchData ( ID itemId ) : PrefetchData

Method Details

AddVersion() public method

Creates a new version for a content item in a particular language.
public AddVersion ( ItemDefinition itemDefinition, VersionUri baseVersion, CallContext context ) : int
itemDefinition ItemDefinition Used to identify the particular item
baseVersion VersionUri The version to copy off of
context CallContext
return int

BlobStreamExists() public method

Check if a blob with the ID that is passed exists in MongoDB.
public BlobStreamExists ( System.Guid blobId, CallContext context ) : bool
blobId System.Guid
context CallContext
return bool

CreateItem() public method

Create a new item as a child of another item. Note that this does not create any versions or field values.
public CreateItem ( ID itemID, string itemName, ID templateID, ItemDefinition parent, CallContext context ) : bool
itemID ID The item ID (not the parent's)
itemName string The name of the new item
templateID ID The ID of the content item that represents its template
parent ItemDefinition The parent item's definition
context CallContext
return bool

DeleteItem() public method

Removes an item from the database completely.
public DeleteItem ( ItemDefinition itemDefinition, CallContext context ) : bool
itemDefinition ItemDefinition Used to identify the particular item
context CallContext
return bool

GetBlobStream() public method

Get a blob from MongoDB with the ID that is passed.
public GetBlobStream ( System.Guid blobId, CallContext context ) : System.IO.Stream
blobId System.Guid
context CallContext
return System.IO.Stream

GetChildIDs() public method

Determines what items are children of the item and returns a list of their IDs.
public GetChildIDs ( ItemDefinition itemDefinition, CallContext context ) : IDList
itemDefinition ItemDefinition Used to identify the particular item
context CallContext
return IDList

GetItemDefinition() public method

Returns a definition containing the id, name, template id, branch id and parent id of the Item that corresponds with the itemId parameter.
public GetItemDefinition ( ID itemId, CallContext context ) : ItemDefinition
itemId ID The item id to search for
context CallContext
return ItemDefinition

GetItemFields() public method

Get a list of all the item's fields and their values.
public GetItemFields ( ItemDefinition itemDefinition, VersionUri versionUri, CallContext context ) : FieldList
itemDefinition ItemDefinition Used to identify the particular item
versionUri VersionUri The language and version of the item to get field values for
context CallContext
return FieldList

GetItemVersions() public method

Get a list of all available versions in different languages.
public GetItemVersions ( ItemDefinition itemDefinition, CallContext context ) : VersionUriList
itemDefinition ItemDefinition Used to identify the particular item
context CallContext
return VersionUriList

GetParentID() public method

Get the ID of the parent of an item.
public GetParentID ( ItemDefinition itemDefinition, CallContext context ) : ID
itemDefinition ItemDefinition Used to identify the particular item
context CallContext
return ID

GetRootID() public method

public GetRootID ( CallContext context ) : ID
context CallContext
return ID

GetTemplateItemIds() public method

public GetTemplateItemIds ( CallContext context ) : IdCollection
context CallContext
return IdCollection

MongoDataProvider() public method

public MongoDataProvider ( string joinParentId, string mongoConnectionString, string databaseName, string safeMode ) : System
joinParentId string
mongoConnectionString string
databaseName string
safeMode string
return System

SaveItem() public method

Save changes that were made to an item to the database.
public SaveItem ( ItemDefinition itemDefinition, Sitecore changes, CallContext context ) : bool
itemDefinition ItemDefinition Used to identify the particular item
changes Sitecore A holder object that keeps track of the changes
context CallContext
return bool

SetBlobStream() public method

Upload a file to GridFS in MongoDB.
public SetBlobStream ( System stream, System.Guid blobId, CallContext context ) : bool
stream System
blobId System.Guid
context CallContext
return bool

Property Details

PrefetchCacheLock protected_oe property

protected object PrefetchCacheLock
return object