Class DataService
Persistent data of content with DataProvider instance.
Inheritance
Implements
Namespace: DotNetNuke.Entities.Content.Data
Assembly: DotNetNuke.dll
Syntax
public class DataService : object, IDataService
Remarks
It's better to use GetDataService() instead of create new instance directly.
Examples
public ContentController() : this(Util.GetDataService())
{
}
public ContentController(IDataService dataService)
{
_dataService = dataService;
}
Methods
| Improve this Doc View SourceAddContentItem(ContentItem, Int32)
Adds the content item.
Declaration
public int AddContentItem(ContentItem contentItem, int createdByUserId)
Parameters
Type | Name | Description |
---|---|---|
ContentItem | contentItem | The content item. |
System.Int32 | createdByUserId | The created by user id. |
Returns
Type | Description |
---|---|
System.Int32 | content item id. |
Remarks
It's better to use GetDataService() instead of create new instance directly.
AddContentType(ContentType)
Adds the type of the content.
Declaration
public int AddContentType(ContentType contentType)
Parameters
Type | Name | Description |
---|---|---|
ContentType | contentType | Type of the content. |
Returns
Type | Description |
---|---|
System.Int32 | content type id. |
Remarks
It's better to use GetDataService() instead of create new instance directly.
AddHeirarchicalTerm(Term, Int32)
Adds the hierarchical term.
Declaration
public int AddHeirarchicalTerm(Term term, int createdByUserId)
Parameters
Type | Name | Description |
---|---|---|
Term | term | The term. |
System.Int32 | createdByUserId | The created by user id. |
Returns
Type | Description |
---|---|
System.Int32 | term id. |
Remarks
It's better to use GetDataService() instead of create new instance directly.
AddMetaData(ContentItem, String, String)
Adds the meta data.
Declaration
public void AddMetaData(ContentItem contentItem, string name, string value)
Parameters
Type | Name | Description |
---|---|---|
ContentItem | contentItem | The content item. |
System.String | name | The name. |
System.String | value | The value. |
Remarks
It's better to use GetDataService() instead of create new instance directly.
AddScopeType(ScopeType)
Adds the type of the scope.
Declaration
public int AddScopeType(ScopeType scopeType)
Parameters
Type | Name | Description |
---|---|---|
ScopeType | scopeType | Type of the scope. |
Returns
Type | Description |
---|---|
System.Int32 | scope type id. |
Remarks
It's better to use GetDataService() instead of create new instance directly.
AddSimpleTerm(Term, Int32)
Adds the simple term.
Declaration
public int AddSimpleTerm(Term term, int createdByUserId)
Parameters
Type | Name | Description |
---|---|---|
Term | term | The term. |
System.Int32 | createdByUserId | The created by user id. |
Returns
Type | Description |
---|---|
System.Int32 | term id. |
Remarks
It's better to use GetDataService() instead of create new instance directly.
AddTermToContent(Term, ContentItem)
Persistent data of content with DataProvider instance.
Declaration
public void AddTermToContent(Term term, ContentItem contentItem)
Parameters
Type | Name | Description |
---|---|---|
Term | term | |
ContentItem | contentItem |
Remarks
It's better to use GetDataService() instead of create new instance directly.
AddVocabulary(Vocabulary, Int32)
Adds the vocabulary.
Declaration
public int AddVocabulary(Vocabulary vocabulary, int createdByUserId)
Parameters
Type | Name | Description |
---|---|---|
Vocabulary | vocabulary | The vocabulary. |
System.Int32 | createdByUserId | The created by user id. |
Returns
Type | Description |
---|---|
System.Int32 | Vocabulary id. |
Remarks
It's better to use GetDataService() instead of create new instance directly.
DeleteContentItem(Int32)
Deletes the content item.
Declaration
public void DeleteContentItem(int contentItemId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | contentItemId | The content item ID. |
Remarks
It's better to use GetDataService() instead of create new instance directly.
DeleteContentType(ContentType)
Persistent data of content with DataProvider instance.
Declaration
public void DeleteContentType(ContentType contentType)
Parameters
Type | Name | Description |
---|---|---|
ContentType | contentType |
Remarks
It's better to use GetDataService() instead of create new instance directly.
DeleteHeirarchicalTerm(Term)
Deletes the hierarchical term.
Declaration
public void DeleteHeirarchicalTerm(Term term)
Parameters
Type | Name | Description |
---|---|---|
Term | term | The term. |
Remarks
It's better to use GetDataService() instead of create new instance directly.
DeleteMetaData(ContentItem, String, String)
Deletes the meta data.
Declaration
public void DeleteMetaData(ContentItem contentItem, string name, string value)
Parameters
Type | Name | Description |
---|---|---|
ContentItem | contentItem | The content item. |
System.String | name | The name. |
System.String | value | The value. |
Remarks
It's better to use GetDataService() instead of create new instance directly.
DeleteScopeType(ScopeType)
Deletes the type of the scope.
Declaration
public void DeleteScopeType(ScopeType scopeType)
Parameters
Type | Name | Description |
---|---|---|
ScopeType | scopeType | Type of the scope. |
Remarks
It's better to use GetDataService() instead of create new instance directly.
DeleteSimpleTerm(Term)
Deletes the simple term.
Declaration
public void DeleteSimpleTerm(Term term)
Parameters
Type | Name | Description |
---|---|---|
Term | term | The term. |
Remarks
It's better to use GetDataService() instead of create new instance directly.
DeleteVocabulary(Vocabulary)
Deletes the vocabulary.
Declaration
public void DeleteVocabulary(Vocabulary vocabulary)
Parameters
Type | Name | Description |
---|---|---|
Vocabulary | vocabulary | The vocabulary. |
Remarks
It's better to use GetDataService() instead of create new instance directly.
GetContentItem(Int32)
Gets the content item.
Declaration
public IDataReader GetContentItem(int contentItemId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | contentItemId | The content item id. |
Returns
Type | Description |
---|---|
IDataReader | data reader. |
Remarks
It's better to use GetDataService() instead of create new instance directly.
GetContentItems(Int32, Int32, Int32)
Gets the content items.
Declaration
public IDataReader GetContentItems(int contentTypeId, int tabId, int moduleId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | contentTypeId | The Id of the Content Type. |
System.Int32 | tabId | The Id of the Tab. |
System.Int32 | moduleId | The Id of the Module. |
Returns
Type | Description |
---|---|
IDataReader | data reader. |
Remarks
It's better to use GetDataService() instead of create new instance directly.
GetContentItemsByContentType(Int32)
Get a list of content items of the specified content type, contentTypeId
.
Declaration
public IDataReader GetContentItemsByContentType(int contentTypeId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | contentTypeId | The type of content items you are searching for. |
Returns
Type | Description |
---|---|
IDataReader | A data reader containing the content items. |
Remarks
It's better to use GetDataService() instead of create new instance directly.
GetContentItemsByModuleId(Int32)
Retrieve all content items associated with a articular Module ID, moduleId
.
Declaration
public IDataReader GetContentItemsByModuleId(int moduleId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | moduleId |
Returns
Type | Description |
---|---|
IDataReader | A data reader containing the content items. |
Remarks
It's better to use GetDataService() instead of create new instance directly.
GetContentItemsByTabId(Int32)
Get a list of content items based on TabID (PageID).
Declaration
public IDataReader GetContentItemsByTabId(int tabId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | tabId | The TabID (or "Page ID") that the content items are associated with. |
Returns
Type | Description |
---|---|
IDataReader | A data reader containing the content items. |
Remarks
It's better to use GetDataService() instead of create new instance directly.
GetContentItemsByTerm(String)
Gets the content items by term.
Declaration
public IDataReader GetContentItemsByTerm(string term)
Parameters
Type | Name | Description |
---|---|---|
System.String | term | The term. |
Returns
Type | Description |
---|---|
IDataReader | data reader. |
Remarks
It's better to use GetDataService() instead of create new instance directly.
GetContentItemsByVocabularyId(Int32)
Retrieve a list of content items containing terms from the specified Vocabulary ID.
Declaration
public IDataReader GetContentItemsByVocabularyId(int vocabularyId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | vocabularyId |
Returns
Type | Description |
---|---|
IDataReader | A data reader containing the content items. |
Remarks
It's better to use GetDataService() instead of create new instance directly.
GetContentTypes()
Gets the content types.
Declaration
public IDataReader GetContentTypes()
Returns
Type | Description |
---|---|
IDataReader | data reader. |
Remarks
It's better to use GetDataService() instead of create new instance directly.
GetMetaData(Int32)
Gets the meta data.
Declaration
public IDataReader GetMetaData(int contentItemId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | contentItemId | The content item id. |
Returns
Type | Description |
---|---|
IDataReader | data reader. |
Remarks
It's better to use GetDataService() instead of create new instance directly.
GetScopeTypes()
Gets the scope types.
Declaration
public IDataReader GetScopeTypes()
Returns
Type | Description |
---|---|
IDataReader | data reader. |
Remarks
It's better to use GetDataService() instead of create new instance directly.
GetTerm(Int32)
Gets the term.
Declaration
public IDataReader GetTerm(int termId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | termId | The term id. |
Returns
Type | Description |
---|---|
IDataReader | data reader. |
Remarks
It's better to use GetDataService() instead of create new instance directly.
GetTermsByContent(Int32)
Gets the content of the terms by.
Declaration
public IDataReader GetTermsByContent(int contentItemId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | contentItemId | The content item id. |
Returns
Type | Description |
---|---|
IDataReader | data reader. |
Remarks
It's better to use GetDataService() instead of create new instance directly.
GetTermsByVocabulary(Int32)
Gets the terms by vocabulary.
Declaration
public IDataReader GetTermsByVocabulary(int vocabularyId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | vocabularyId | The vocabulary id. |
Returns
Type | Description |
---|---|
IDataReader | data reader. |
Remarks
It's better to use GetDataService() instead of create new instance directly.
GetTermUsage(Int32)
Retrieve term usage data for the specified Term ID, termId
.
Declaration
public IDataReader GetTermUsage(int termId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | termId |
Returns
Type | Description |
---|---|
IDataReader | A data reader with the term usage. |
Remarks
It's better to use GetDataService() instead of create new instance directly.
GetUnIndexedContentItems()
Gets the un indexed content items.
Declaration
public IDataReader GetUnIndexedContentItems()
Returns
Type | Description |
---|---|
IDataReader | data reader. |
Remarks
It's better to use GetDataService() instead of create new instance directly.
GetVocabularies()
Gets the vocabularies.
Declaration
public IDataReader GetVocabularies()
Returns
Type | Description |
---|---|
IDataReader | data reader. |
Remarks
It's better to use GetDataService() instead of create new instance directly.
RemoveTermsFromContent(ContentItem)
Removes the content of the terms from.
Declaration
public void RemoveTermsFromContent(ContentItem contentItem)
Parameters
Type | Name | Description |
---|---|---|
ContentItem | contentItem | The content item. |
Remarks
It's better to use GetDataService() instead of create new instance directly.
SynchronizeMetaData(ContentItem, IEnumerable<KeyValuePair<String, String>>, IEnumerable<KeyValuePair<String, String>>)
Persistent data of content with DataProvider instance.
Declaration
public void SynchronizeMetaData(ContentItem contentItem, IEnumerable<KeyValuePair<string, string>> added, IEnumerable<KeyValuePair<string, string>> deleted)
Parameters
Type | Name | Description |
---|---|---|
ContentItem | contentItem | |
IEnumerable<KeyValuePair<System.String, System.String>> | added | |
IEnumerable<KeyValuePair<System.String, System.String>> | deleted |
Remarks
It's better to use GetDataService() instead of create new instance directly.
UpdateContentItem(ContentItem, Int32)
Updates the content item.
Declaration
public void UpdateContentItem(ContentItem contentItem, int createdByUserId)
Parameters
Type | Name | Description |
---|---|---|
ContentItem | contentItem | The content item. |
System.Int32 | createdByUserId | The created by user id. |
Remarks
It's better to use GetDataService() instead of create new instance directly.
UpdateContentType(ContentType)
Updates the type of the content.
Declaration
public void UpdateContentType(ContentType contentType)
Parameters
Type | Name | Description |
---|---|---|
ContentType | contentType | Type of the content. |
Remarks
It's better to use GetDataService() instead of create new instance directly.
UpdateHeirarchicalTerm(Term, Int32)
Updates the hierarchical term.
Declaration
public void UpdateHeirarchicalTerm(Term term, int lastModifiedByUserId)
Parameters
Type | Name | Description |
---|---|---|
Term | term | The term. |
System.Int32 | lastModifiedByUserId | The last modified by user id. |
Remarks
It's better to use GetDataService() instead of create new instance directly.
UpdateScopeType(ScopeType)
Updates the type of the scope.
Declaration
public void UpdateScopeType(ScopeType scopeType)
Parameters
Type | Name | Description |
---|---|---|
ScopeType | scopeType | Type of the scope. |
Remarks
It's better to use GetDataService() instead of create new instance directly.
UpdateSimpleTerm(Term, Int32)
Updates the simple term.
Declaration
public void UpdateSimpleTerm(Term term, int lastModifiedByUserId)
Parameters
Type | Name | Description |
---|---|---|
Term | term | The term. |
System.Int32 | lastModifiedByUserId | The last modified by user id. |
Remarks
It's better to use GetDataService() instead of create new instance directly.
UpdateVocabulary(Vocabulary, Int32)
Updates the vocabulary.
Declaration
public void UpdateVocabulary(Vocabulary vocabulary, int lastModifiedByUserId)
Parameters
Type | Name | Description |
---|---|---|
Vocabulary | vocabulary | The vocabulary. |
System.Int32 | lastModifiedByUserId | The last modified by user id. |
Remarks
It's better to use GetDataService() instead of create new instance directly.