当前位置: 首页>>代码示例>>C#>>正文


C# Modules.ModuleInfo类代码示例

本文整理汇总了C#中DotNetNuke.Entities.Modules.ModuleInfo的典型用法代码示例。如果您正苦于以下问题:C# ModuleInfo类的具体用法?C# ModuleInfo怎么用?C# ModuleInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ModuleInfo类属于DotNetNuke.Entities.Modules命名空间,在下文中一共展示了ModuleInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetModifiedSearchDocuments

        // feel free to remove any interfaces that you don't wish to use
        // (requires that you also update the .dnn manifest file)

        #region Optional Interfaces

        /// <summary>
        /// Gets the modified search documents for the DNN search engine indexer.
        /// </summary>
        /// <param name="moduleInfo">The module information.</param>
        /// <param name="beginDate">The begin date.</param>
        /// <returns></returns>
        public override IList<SearchDocument> GetModifiedSearchDocuments(ModuleInfo moduleInfo, DateTime beginDate)
        {
            var searchDocuments = new List<SearchDocument>();
            var controller = new ItemController();
            var items = controller.GetItems(moduleInfo.ModuleID);

            foreach (var item in items)
            {
                if (item.LastModifiedOnDate.ToUniversalTime() <= beginDate.ToUniversalTime() ||
                    item.LastModifiedOnDate.ToUniversalTime() >= DateTime.UtcNow)
                    continue;

                var content = string.Format("{0}<br />{1}", item.ItemName, item.ItemDescription);

                var searchDocumnet = new SearchDocument
                {
                    UniqueKey = string.Format("Items:{0}:{1}", moduleInfo.ModuleID, item.ItemId),  // any unique identifier to be able to query for your individual record
                    PortalId = moduleInfo.PortalID,  // the PortalID
                    TabId = moduleInfo.TabID, // the TabID
                    AuthorUserId = item.LastModifiedByUserId, // the person who created the content
                    Title = moduleInfo.ModuleTitle,  // the title of the content, but should be the module title
                    Description = moduleInfo.DesktopModule.Description,  // the description or summary of the content
                    Body = content,  // the long form of your content
                    ModifiedTimeUtc = item.LastModifiedOnDate.ToUniversalTime(),  // a time stamp for the search results page
                    CultureCode = moduleInfo.CultureCode, // the current culture code
                    IsActive = true  // allows you to remove the item from the search index (great for soft deletes)
                };

                searchDocuments.Add(searchDocumnet);
            }

            return searchDocuments;
        }
开发者ID:scottw12,项目名称:DNNTemplates,代码行数:44,代码来源:FeatureController.cs

示例2: GetModifiedSearchDocuments

		public override IList<SearchDocument> GetModifiedSearchDocuments (ModuleInfo modInfo, DateTime beginDate)
		{
			var searchDocs = new List<SearchDocument> ();
			var settings = new EmployeeListSettings (modInfo);
		
			var	employees = GetObjects<EmployeeInfo> (CommandType.StoredProcedure, 
				                (settings.IncludeSubdivisions) ? // which SP to use
				"University_GetRecursiveEmployeesByDivisionID" : "University_GetEmployeesByDivisionID", 
				                settings.DivisionID, settings.SortType, false
			                );

            foreach (var employee in employees)
			{
				if (employee.LastModifiedOnDate.ToUniversalTime () > beginDate.ToUniversalTime ())
				{
					var aboutEmployee = employee.SearchDocumentText;
					var sd = new SearchDocument () {
						PortalId = modInfo.PortalID,
						AuthorUserId = employee.LastModifiedByUserID,
						Title = employee.FullName,
						// Description = HtmlUtils.Shorten (aboutEmployee, 255, "..."),
						Body = aboutEmployee,
						ModifiedTimeUtc = employee.LastModifiedOnDate.ToUniversalTime (),
						UniqueKey = string.Format ("University_Employee_{0}", employee.EmployeeID),
                        Url = string.Format ("/Default.aspx?tabid={0}#{1}", modInfo.TabID, modInfo.ModuleID),
						IsActive = employee.IsPublished
					};

					searchDocs.Add (sd);
				}
			}
			return searchDocs;
		}
开发者ID:gitter-badger,项目名称:R7.University,代码行数:33,代码来源:EmployeeListController.cs

示例3: ClearModuleSettings

 private void ClearModuleSettings(ModuleInfo objModule)
 {
     if (objModule.ModuleDefinition.FriendlyName == "Text/HTML")
     {
         ModuleController.Instance.DeleteModuleSetting(objModule.ModuleID, "WorkFlowID");
     }
 }
开发者ID:VegasoftTI,项目名称:Dnn.Platform,代码行数:7,代码来源:HtmlTextController.cs

示例4: canUserAccessModule

        /// <param name="moduleId"></param>
        /// <param name="tabId"></param>
        /// <param name="permissionKey">You can use the constants, but for modules there are only
        /// those two</param>
        /// <returns></returns>
        public static bool canUserAccessModule(UserInfo user, int portalId, int tabId, ModuleInfo moduleInfo, string permissionKey)
        {
            var retVal = false;
            string permissionsString = null;
            if (moduleInfo.InheritViewPermissions)
            {
                var tabPermissionController = new TabPermissionController();
                var tabPermissionCollection =
                    tabPermissionController.GetTabPermissionsCollectionByTabID(tabId, portalId);
                permissionsString = tabPermissionController.GetTabPermissions(tabPermissionCollection, permissionKey);
            }
            else
            {
                var modulePermissionController = new ModulePermissionController();
                var permissionCollection =
                    modulePermissionController.GetModulePermissionsCollectionByModuleID(moduleInfo.ModuleID, tabId);
                permissionsString = modulePermissionController.GetModulePermissions(permissionCollection, permissionKey);
            }

            char[] splitter = { ';' };
            var roles = permissionsString.Split(splitter);
            foreach (var role in roles)
            {
                if (role.Length > 0)
                {
                    if (user != null && user.IsInRole(role))
                        retVal = true;
                    else if (user == null && role.ToLower().Equals("all users"))
                        retVal = true;
                }
                
            }
            return retVal;
        }
开发者ID:BravoSierra,项目名称:2sxc,代码行数:39,代码来源:SecurityContext.cs

示例5: GetModifiedSearchDocuments

		public override IList<SearchDocument> GetModifiedSearchDocuments (ModuleInfo modInfo, DateTime beginDate)
		{
			var searchDocs = new List<SearchDocument> ();
			var settings = new EmployeeSettings (modInfo);
			var employee = Get<EmployeeInfo> (settings.EmployeeID);
		
			if (employee != null && employee.LastModifiedOnDate.ToUniversalTime () > beginDate.ToUniversalTime ())
			{
				var aboutEmployee = employee.SearchDocumentText;
				var sd = new SearchDocument () {
					PortalId = modInfo.PortalID,
					AuthorUserId = employee.LastModifiedByUserID,
					Title = employee.FullName,
					// Description = HtmlUtils.Shorten (aboutEmployee, 255, "..."),
					Body = aboutEmployee,
					ModifiedTimeUtc = employee.LastModifiedOnDate.ToUniversalTime (),
					UniqueKey = string.Format ("University_Employee_{0}", employee.EmployeeID),
                    Url = string.Format ("/Default.aspx?tabid={0}#{1}", modInfo.TabID, modInfo.ModuleID),
					IsActive = employee.IsPublished
				};
	
				searchDocs.Add (sd);
			}
			return searchDocs;
		}
开发者ID:hassangas2003,项目名称:R7.University,代码行数:25,代码来源:EmployeeController.cs

示例6: PermissionController

 /// <summary>
 /// Initialize this object so it can then give information regarding the permissions of an entity.
 /// Uses a GUID as identifier because that survives export/import. 
 /// </summary>
 /// <param name="zoneId">EAV Zone</param>
 /// <param name="appId">EAV APP</param>
 /// <param name="typeGuid">Entity GUID to check permissions against</param>
 /// <param name="module">DNN Module - necessary for SecurityAccessLevel checks</param>
 public PermissionController(int zoneId, int appId, Guid typeGuid, ModuleInfo module = null)
 {
     ZoneId = zoneId;
     AppId = appId;
     TypeGuid = typeGuid;
     Module = module;
 }
开发者ID:2sic,项目名称:2sxc,代码行数:15,代码来源:PermissionController.cs

示例7: ModuleSecurity

        public ModuleSecurity(ModuleInfo moduleInfo)
        {
            var modulePermissionCollection = moduleInfo.ModulePermissions;
            _hasEditTemplatePermission = ModulePermissionController.HasModulePermission(modulePermissionCollection,
                                                                                   PermissionName.HasEditTemplatePermission);

        }
开发者ID:schotman,项目名称:DNN.Announcements,代码行数:7,代码来源:ModuleSecurity.cs

示例8: GetModifiedSearchDocuments

        public override IList<SearchDocument> GetModifiedSearchDocuments (ModuleInfo modInfo, DateTime beginDate)
        {
            var searchDocs = new List<SearchDocument> ();
            var settings = new DivisionSettingsRepository ().GetSettings (modInfo);

            using (var modelContext = new UniversityModelContext ()) {

                var division = modelContext.Get<DivisionInfo> (settings.DivisionID);
                if (division != null && division.LastModifiedOnDate.ToUniversalTime () > beginDate.ToUniversalTime ()) {
                    var aboutDivision = division.SearchDocumentText;
                    var sd = new SearchDocument ()
                    {
                        PortalId = modInfo.PortalID,
                        AuthorUserId = division.LastModifiedByUserID,
                        Title = division.Title,
                        // Description = HtmlUtils.Shorten (aboutDivision, 255, "..."),
                        Body = aboutDivision,
                        ModifiedTimeUtc = division.LastModifiedOnDate.ToUniversalTime (),
                        UniqueKey = string.Format ("University_Division_{0}", division.DivisionID),
                        Url = string.Format ("/Default.aspx?tabid={0}#{1}", modInfo.TabID, modInfo.ModuleID),
                        IsActive = division.IsPublished (DateTime.Now)
                    };
	
                    searchDocs.Add (sd);
                }
			
                return searchDocs;
            }
        }
开发者ID:roman-yagodin,项目名称:R7.University,代码行数:29,代码来源:DivisionController.cs

示例9: Init

        public void Init(Template template, App app, ModuleInfo hostingModule, IDataSource dataSource, InstancePurposes instancePurposes, SxcInstance sexy)
        {
            var templatePath = VirtualPathUtility.Combine(Internal.TemplateManager.GetTemplatePathRoot(template.Location, app) + "/", template.Path);

            // Throw Exception if Template does not exist
            if (!File.Exists(HostingEnvironment.MapPath(templatePath)))
                // todo: rendering exception
                throw new SexyContentException("The template file '" + templatePath + "' does not exist.");

            Template = template;
            TemplatePath = templatePath;
            App = app;
            ModuleInfo = hostingModule;
            DataSource = dataSource;
            InstancePurposes = instancePurposes;
            Sexy = sexy;

            // check common errors
            CheckExpectedTemplateErrors();

            // check access permissions - before initializing or running data-code in the template
            CheckTemplatePermissions(sexy.AppPortalSettings);

            // Run engine-internal init stuff
            Init();

            // call engine internal feature to optionally change what data is actually used or prepared for search...
            CustomizeData();

            // check if rendering is possible, or throw exceptions...
            CheckExpectedNoRenderConditions();

            if(PreRenderStatus == RenderStatusType.Unknown)
                PreRenderStatus = RenderStatusType.Ok;
        }
开发者ID:2sic,项目名称:2sxc,代码行数:35,代码来源:EngineBase.cs

示例10: GetModifiedSearchDocuments

        public override IList<SearchDocument> GetModifiedSearchDocuments (ModuleInfo moduleInfo, DateTime beginDate)
        {
            var searchDocs = new List<SearchDocument> ();
			
            var documents = DocumentsDataProvider.Instance.GetDocuments (moduleInfo.ModuleID, moduleInfo.PortalID);

            foreach (var document in documents ?? Enumerable.Empty<DocumentInfo> ()) {
                if (document.ModifiedDate.ToUniversalTime () > beginDate.ToUniversalTime ()) {
                    var documentText = TextUtils.FormatList (" ", document.Title, document.Description);

                    var sd = new SearchDocument () {
                        PortalId = moduleInfo.PortalID,
                        AuthorUserId = document.ModifiedByUserId,
                        Title = document.Title,
                        Description = HtmlUtils.Shorten (documentText, 255, "..."),
                        Body = documentText,
                        ModifiedTimeUtc = document.ModifiedDate.ToUniversalTime (),
                        UniqueKey = string.Format ("Documents_Document_{0}", document.ItemId),
                        IsActive = document.IsPublished,
                        Url = string.Format ("/Default.aspx?tabid={0}#{1}", moduleInfo.TabID, moduleInfo.ModuleID)

                        // FIXME: This one produce null reference exception
                        // Url = Globals.LinkClick (document.Url, moduleInfo.TabID, moduleInfo.ModuleID, document.TrackClicks, document.ForceDownload)
                    };
					
                    searchDocs.Add (sd);
                }
            }
            return searchDocs;
        }
开发者ID:roman-yagodin,项目名称:R7.Documents,代码行数:30,代码来源:DocumentsController.cs

示例11: GetModifiedSearchDocuments

        public override IList<SearchDocument> GetModifiedSearchDocuments (ModuleInfo modInfo, DateTime beginDate)
        {
            var searchDocs = new List<SearchDocument> ();
            var settings = new EmployeeListSettingsRepository ().GetSettings (modInfo);

            IEnumerable<EmployeeInfo> employees = null;

            using (var modelContext = new UniversityModelContext ()) {
                employees = new EmployeeQuery (modelContext).ListByDivisionId (
                    settings.DivisionID, settings.IncludeSubdivisions, settings.SortType);
            }

            var now = DateTime.Now;
            foreach (var employee in employees) {
                if (employee.LastModifiedOnDate.ToUniversalTime () > beginDate.ToUniversalTime ()) {
                    var aboutEmployee = employee.SearchDocumentText;
                    var sd = new SearchDocument ()
                    {
                        PortalId = modInfo.PortalID,
                        AuthorUserId = employee.LastModifiedByUserID,
                        Title = employee.FullName,
                        // Description = HtmlUtils.Shorten (aboutEmployee, 255, "..."),
                        Body = aboutEmployee,
                        ModifiedTimeUtc = employee.LastModifiedOnDate.ToUniversalTime (),
                        UniqueKey = string.Format ("University_Employee_{0}", employee.EmployeeID),
                        Url = string.Format ("/Default.aspx?tabid={0}#{1}", modInfo.TabID, modInfo.ModuleID),
                        IsActive = employee.IsPublished (now)
                    };

                    searchDocs.Add (sd);
                }
            }
            return searchDocs;
        }
开发者ID:roman-yagodin,项目名称:R7.University,代码行数:34,代码来源:EmployeeListController.cs

示例12: AddModuleInternal

        private void AddModuleInternal(ModuleInfo module)
        {
            var eventLogController = new EventLogController();
            // add module
            if (Null.IsNull(module.ModuleID))
            {
                CreateContentItem(module);

                //Add Module
                module.ModuleID = dataProvider.AddModule(module.ContentItemId,
                                                            module.PortalID,
                                                            module.ModuleDefID,
                                                            module.AllTabs,
                                                            module.StartDate,
                                                            module.EndDate,
                                                            module.InheritViewPermissions,
                                                            module.IsDeleted,
                                                            UserController.GetCurrentUserInfo().UserID);

                //Now we have the ModuleID - update the contentItem
                var contentController = Util.GetContentController();
                contentController.UpdateContentItem(module);

                eventLogController.AddLog(module, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", EventLogController.EventLogType.MODULE_CREATED);

                // set module permissions
                ModulePermissionController.SaveModulePermissions(module);
            }

            //Save ModuleSettings
            UpdateModuleSettings(module);
        }
开发者ID:biganth,项目名称:Curt,代码行数:32,代码来源:ModuleController.cs

示例13: SetAppIdForModule

        public static void SetAppIdForModule(ModuleInfo module, int? appId)
        {
            // Reset temporary template
            ContentGroupManager.DeletePreviewTemplateId(module.ModuleID);

            // ToDo: Should throw exception if a real ContentGroup exists

            var zoneId = ZoneHelpers.GetZoneID(module.OwnerPortalID);

            if (appId == 0 || !appId.HasValue)
                DnnStuffToRefactor.UpdateModuleSettingForAllLanguages(module.ModuleID, Settings.AppNameString, null);
            else
            {
                var appName = ((BaseCache)DataSource.GetCache(0, 0)).ZoneApps[zoneId.Value].Apps[appId.Value];
                DnnStuffToRefactor.UpdateModuleSettingForAllLanguages(module.ModuleID, Settings.AppNameString, appName);
            }

            // Change to 1. available template if app has been set
            if (appId.HasValue)
            {
                var app = new App(zoneId.Value, appId.Value, PortalSettings.Current);
                var templates = app.TemplateManager.GetAvailableTemplatesForSelector(module.ModuleID, app.ContentGroupManager).ToList();
                if (templates.Any())
                    app.ContentGroupManager.SetModulePreviewTemplateId(module.ModuleID, templates.First().Guid /* .TemplateId */);
            }
        }
开发者ID:2sic,项目名称:2sxc,代码行数:26,代码来源:AppHelpers.cs

示例14: AddContent

        static void AddContent(XmlNode nodeModule, ModuleInfo module, int maxNumberOfRecords)
        {
            if (module.DesktopModule.BusinessControllerClass != "" && module.DesktopModule.IsPortable)
            {
                try
                {
                    var businessController = Reflection.CreateObject(module.DesktopModule.BusinessControllerClass,
                                                                     module.DesktopModule.BusinessControllerClass);

                    var content = string.Empty;
                    if (businessController is IPortable2)
                    {
                        content =
                            Convert.ToString(((IPortable2) businessController).ExportModule(module.ModuleID,
                                                                                            module.TabID,
                                                                                            maxNumberOfRecords));
                    }
                    else if (businessController is IPortable)
                    {
                        content = Convert.ToString(((IPortable) businessController).ExportModule(module.ModuleID));
                    }

                    if (content != "")
                    {
                        // add attributes to XML document
// ReSharper disable PossibleNullReferenceException
                        XmlNode newnode = nodeModule.OwnerDocument.CreateElement("content");

                        var xmlattr = nodeModule.OwnerDocument.CreateAttribute("type");
                        xmlattr.Value = Globals.CleanName(module.DesktopModule.ModuleName);
                        newnode.Attributes.Append(xmlattr);
                        xmlattr = nodeModule.OwnerDocument.CreateAttribute("version");
                        xmlattr.Value = module.DesktopModule.Version;
                        newnode.Attributes.Append(xmlattr);

                        try
                        {
                            var doc = new XmlDocument();
                            doc.LoadXml(content);
// ReSharper disable AssignNullToNotNullAttribute
                            newnode.AppendChild(newnode.OwnerDocument.ImportNode(doc.DocumentElement, true));
// ReSharper restore AssignNullToNotNullAttribute
                        }
                            // ReSharper restore PossibleNullReferenceException
                        catch (Exception)
                        {
                            //only for invalid xhtml
                            content = HttpContext.Current.Server.HtmlEncode(content);
                            newnode.InnerXml = XmlUtils.XMLEncode(content);
                        }
                        nodeModule.AppendChild(newnode);
                    }
                }
                catch
                {
                    //ignore errors
                }
            }
        }
开发者ID:DNNCommunity,项目名称:DNN.FormAndList,代码行数:59,代码来源:ModuleSerializationController.cs

示例15: ClearModuleSettings

 private void ClearModuleSettings(ModuleInfo objModule)
 {
     var moduleController = new ModuleController();
     if (objModule.ModuleDefinition.FriendlyName == "Text/HTML")
     {
         moduleController.DeleteModuleSetting(objModule.ModuleID, "WorkFlowID");
     }
 }
开发者ID:rut5949,项目名称:Dnn.Platform,代码行数:8,代码来源:HtmlTextController.cs


注:本文中的DotNetNuke.Entities.Modules.ModuleInfo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。