This page describes the API enhancements bundled in DotNetNuke 6.2.3+.
ContentController
Additional Retrieval Methods
Additional ways have been added that permit developers to retrieve content stored in the Content Items data store. These queries can be done by
Module ID.
Tab ID, by tag, by Vocabulary ID (all content items tagged with a Term from that Taxonomy Vocabulary) or by Content Type. The methods are defined in the IContentController interface.
The ContentController controller does not implement the TestableController pattern yet, so the way to use it is to instantiate a ContentController object directly.
Query by Tag
IQueryable GetContentItemsByTerm(string term);
IQueryable GetContentItemsByTerm(Term term);
These two overloads are used to search for ContentItems that have been tagged with the specified Taxonomy Term ("Taxonomy" is the DotNetNuke system for tagging). You can search either by Term object (retrieved from
TermController
) or by a string containing the tag.
Query by Multiple Tags
IQueryable GetContentItemsByTerms(IList terms);
IQueryable GetContentItemsByTerms(string[] terms);
These two methods allow you to search for Content Items that have been tagged with
all of the specified tags.
Query by Content Type
IQueryable GetContentItemsByContentType(int contentTypeId);
IQueryable GetContentItemsByContentType(ContentType contentType);
These overloads allow you to search for Content Items that are of the specified Content Type (which can be retrieved from
ContentTypeController
).
Query by Module ID
IQueryable GetContentItemsByModuleId(int moduleId);
Query for Content Items that are associated with the specified Module ID (remember, Module ID is the unique ID of a particular instantiation of a module, not a representation of Desktop Module (which is common to all instantiations)
Query by Tab ID
IQueryable GetContentItemsByTabId(int tabId);
Retrieve a set of Content Items that are associoated with the specified DotNetNuke tab (page).
Query by Vocabulary ID
IQueryable GetContentItemsByVocabularyId(int vocabularyId);
Retrieve all Content Items that are tagged with Taxonomy Terms from the specified Taxonomy Vocabulary. A Vocabulary is sort of like a category for terms (one of which is "Tags").
Additional Properties
Additional properties were added in order to handle common meta data often associated with site content. These properties required no changes to the data store and utilize MetaData for retrieving and storing all properties. It is also worth noting that the Content List module (which displays search results based on taxonomy and folksonomy) is now updated to display "Title" when available.
ContentTitle
public string ContentTitle;
The
ContentTitle
property is a textual description of the Content Item it is attached to.
It is stored in the Content Item
MetaData
dictionary.
Attachments
There are 3 properties on
ContentItem
that can be used to store attachments to files registered in the DotNetNuke Filesystem API. However,
it is recommended that you instead use the AttachmentController
controller to manage Content Item attachments.Videos
Any video files that are attached to the Content Item.
There are no restrictions on file extension for video files—they can be anything.
Images
Any image files, in any format, that are attached to the Content Item. There are no restrictions on the file extension of attached images. There are, at the time of writing, no validation steps to ensure that the file is a real image.
Files
Any files, of any format or type, that are attached to the Content Item. There is no validation or verification of individual files.
AttachmentController
The
AttachmentController
has methods that allow you to attach files from the DotNetNuke Filesystem to a particular Content Item, and methods that allow you to retrieve all the existing attachments. There are permutations of these create and get methods for each of the attachment types (videos, images, files).
More complicated operations that are not available on AttachmentController need to be done by manipulating the
Files
,
Images
and
'Videos
properties on {{ContentItem}..