Class TermController
The Main Business layer of Taxonomy.
Inheritance
System.Object
TermController
Implements
Namespace: DotNetNuke.Entities.Content.Taxonomy
Assembly: DotNetNuke.dll
Syntax
public class TermController : object, ITermController
Examples
internal static List<Term> GetTerms(this Vocabulary voc, int vocabularyId)
{
ITermController ctl = Util.GetTermController();
return ctl.GetTermsByVocabulary(vocabularyId).ToList();
}
Constructors
| Improve this Doc View SourceTermController()
Initializes a new instance of the TermController class.
Declaration
public TermController()
TermController(IDataService)
Initializes a new instance of the TermController class.
Declaration
public TermController(IDataService dataService)
Parameters
Type | Name | Description |
---|---|---|
IDataService | dataService |
Methods
| Improve this Doc View SourceAddTerm(Term)
Adds the term.
Declaration
public int AddTerm(Term term)
Parameters
Type | Name | Description |
---|---|---|
Term | term | The term. |
Returns
Type | Description |
---|---|
System.Int32 | term id. |
AddTermToContent(Term, ContentItem)
Adds the content of the term to.
Declaration
public void AddTermToContent(Term term, ContentItem contentItem)
Parameters
Type | Name | Description |
---|---|---|
Term | term | The term. |
ContentItem | contentItem | The content item. |
DeleteTerm(Term)
Deletes the term.
Declaration
public void DeleteTerm(Term term)
Parameters
Type | Name | Description |
---|---|---|
Term | term | The term. |
GetTerm(Int32)
Gets the term.
Declaration
public Term GetTerm(int termId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | termId | The term id. |
Returns
Type | Description |
---|---|
Term | specific term. |
GetTermsByContent(Int32)
Gets the content of the terms by content item id.
Declaration
public IQueryable<Term> GetTermsByContent(int contentItemId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | contentItemId | The content item id. |
Returns
Type | Description |
---|---|
IQueryable<Term> | term collection. |
GetTermsByVocabulary(Int32)
Gets the terms by vocabulary id.
Declaration
public IQueryable<Term> GetTermsByVocabulary(int vocabularyId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | vocabularyId | The vocabulary id. |
Returns
Type | Description |
---|---|
IQueryable<Term> | term collection. |
GetTermsByVocabulary(String)
Gets the terms by vocabulary name.
Declaration
public IQueryable<Term> GetTermsByVocabulary(string vocabularyName)
Parameters
Type | Name | Description |
---|---|---|
System.String | vocabularyName | Name of the vocabulary. |
Returns
Type | Description |
---|---|
IQueryable<Term> | term collection. |
GetTermUsage(Int32)
Retrieve usage data for the specified term ID.
Declaration
public TermUsage GetTermUsage(int termId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | termId | Term ID in question. |
Returns
Type | Description |
---|---|
TermUsage | A TermUsage instance or null. |
RemoveTermsFromContent(ContentItem)
Removes all terms from content item.
Declaration
public void RemoveTermsFromContent(ContentItem contentItem)
Parameters
Type | Name | Description |
---|---|---|
ContentItem | contentItem | The content item. |
UpdateTerm(Term)
Updates the term.
Declaration
public void UpdateTerm(Term term)
Parameters
Type | Name | Description |
---|---|---|
Term | term | The term. |