/* ' Copyright (c) 2015 Christoc.com ' All rights reserved. ' ' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED ' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF ' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ' DEALINGS IN THE SOFTWARE. ' */ using System.Collections.Generic; //using System.Xml; using DotNetNuke.Entities.Modules; using DotNetNuke.Services.Search; namespace <%= namespace%>.Modules.<%= moduleName %>.Components { /// ----------------------------------------------------------------------------- /// /// The Controller class for DnnMvcModule /// /// The FeatureController class is defined as the BusinessController in the manifest file (.dnn) /// DotNetNuke will poll this class to find out which Interfaces the class implements. /// /// The IPortable interface is used to import/export content from a DNN module /// /// The ISearchable interface is used by DNN to index the content of a module /// /// The IUpgradeable interface allows module developers to execute code during the upgrade /// process for a module. /// /// Below you will find stubbed out implementations of each, uncomment and populate with your own data /// /// ----------------------------------------------------------------------------- //uncomment the interfaces to add the support. public class FeatureController //: IPortable, ISearchable, IUpgradeable { #region Optional Interfaces /// ----------------------------------------------------------------------------- /// /// ExportModule implements the IPortable ExportModule Interface /// /// The Id of the module to be exported /// ----------------------------------------------------------------------------- //public string ExportModule(int ModuleID) //{ //string strXML = ""; //List colDnnMvcModules = GetDnnMvcModules(ModuleID); //if (colDnnMvcModules.Count != 0) //{ // strXML += ""; // foreach (DnnMvcModuleInfo objDnnMvcModule in colDnnMvcModules) // { // strXML += ""; // strXML += "" + DotNetNuke.Common.Utilities.XmlUtils.XMLEncode(objDnnMvcModule.Content) + ""; // strXML += ""; // } // strXML += ""; //} //return strXML; // throw new System.NotImplementedException("The method or operation is not implemented."); //} /// ----------------------------------------------------------------------------- /// /// ImportModule implements the IPortable ImportModule Interface /// /// The Id of the module to be imported /// The content to be imported /// The version of the module to be imported /// The Id of the user performing the import /// ----------------------------------------------------------------------------- //public void ImportModule(int ModuleID, string Content, string Version, int UserID) //{ //XmlNode xmlDnnMvcModules = DotNetNuke.Common.Globals.GetContent(Content, "DnnMvcModules"); //foreach (XmlNode xmlDnnMvcModule in xmlDnnMvcModules.SelectNodes("DnnMvcModule")) //{ // DnnMvcModuleInfo objDnnMvcModule = new DnnMvcModuleInfo(); // objDnnMvcModule.ModuleId = ModuleID; // objDnnMvcModule.Content = xmlDnnMvcModule.SelectSingleNode("content").InnerText; // objDnnMvcModule.CreatedByUser = UserID; // AddDnnMvcModule(objDnnMvcModule); //} // throw new System.NotImplementedException("The method or operation is not implemented."); //} /// ----------------------------------------------------------------------------- /// /// GetSearchItems implements the ISearchable Interface /// /// The ModuleInfo for the module to be Indexed /// ----------------------------------------------------------------------------- //public DotNetNuke.Services.Search.SearchItemInfoCollection GetSearchItems(DotNetNuke.Entities.Modules.ModuleInfo ModInfo) //{ //SearchItemInfoCollection SearchItemCollection = new SearchItemInfoCollection(); //List colDnnMvcModules = GetDnnMvcModules(ModInfo.ModuleID); //foreach (DnnMvcModuleInfo objDnnMvcModule in colDnnMvcModules) //{ // SearchItemInfo SearchItem = new SearchItemInfo(ModInfo.ModuleTitle, objDnnMvcModule.Content, objDnnMvcModule.CreatedByUser, objDnnMvcModule.CreatedDate, ModInfo.ModuleID, objDnnMvcModule.ItemId.ToString(), objDnnMvcModule.Content, "ItemId=" + objDnnMvcModule.ItemId.ToString()); // SearchItemCollection.Add(SearchItem); //} //return SearchItemCollection; // throw new System.NotImplementedException("The method or operation is not implemented."); //} /// ----------------------------------------------------------------------------- /// /// UpgradeModule implements the IUpgradeable Interface /// /// The current version of the module /// ----------------------------------------------------------------------------- //public string UpgradeModule(string Version) //{ // throw new System.NotImplementedException("The method or operation is not implemented."); //} #endregion } }