Example #1
0
        public override void Init()
        {
            context = new ProductContext
            {
                MasterPageFile        = String.Concat(PathProvider.BaseVirtualPath, "Masters/BasicTemplate.Master"),
                DisabledIconFileName  = "product_disabled_logo.png",
                IconFileName          = "product_logo.png",
                LargeIconFileName     = "product_logolarge.png",
                DefaultSortOrder      = 30,
                SubscriptionManager   = new ProductSubscriptionManager(),
                SpaceUsageStatManager = new CRMSpaceUsageStatManager(),
                AdminOpportunities    = () => CRMCommonResource.ProductAdminOpportunities.Split('|').ToList(),
                UserOpportunities     = () => CRMCommonResource.ProductUserOpportunities.Split('|').ToList(),
            };

            if (!FilesIntegration.IsRegisteredFileSecurityProvider("crm", "crm_common"))
            {
                FilesIntegration.RegisterFileSecurityProvider("crm", "crm_common", new FileSecurityProvider());
            }
            if (!FilesIntegration.IsRegisteredFileSecurityProvider("crm", "opportunity"))
            {
                FilesIntegration.RegisterFileSecurityProvider("crm", "opportunity", new FileSecurityProvider());
            }

            SearchHandlerManager.Registry(new SearchHandler());

            GlobalConfiguration.Configuration.Routes.MapHttpRoute(
                name: "Twilio",
                routeTemplate: "twilio/{action}",
                defaults: new { controller = "Twilio", action = "index" });

            ClientScriptLocalization = new ClientLocalizationResources();
            DIHelper.Register();
        }
Example #2
0
        public override void Init(ProductContext productContext)
        {
            productContext.ThemesFolderVirtualPath = String.Concat(PathProvider.BaseVirtualPath, "App_Themes");
            productContext.ImageFolder             = "images";
            productContext.MasterPageFile          = String.Concat(PathProvider.BaseVirtualPath, "Masters/BasicTemplate.Master");
            productContext.DisabledIconFileName    = "product_disabled_logo.png";
            productContext.IconFileName            = "product_logo.png";
            productContext.LargeIconFileName       = "product_logolarge.png";
            productContext.UserActivityPublishers  = new List <IUserActivityPublisher>()
            {
                new TimeLinePublisher()
            };
            productContext.DefaultSortOrder      = 20;
            productContext.SubscriptionManager   = new ProductSubscriptionManager();
            productContext.SpaceUsageStatManager = new CRMSpaceUsageStatManager();
            productContext.AdminOpportunities    = GetAdminOpportunities;
            productContext.UserOpportunities     = GetUserOpportunities;

            if (!FilesIntegration.IsRegisteredFileSecurityProvider("crm", "crm_common"))
            {
                FilesIntegration.RegisterFileSecurityProvider("crm", "crm_common", new FileSecurityProvider());
            }

            _productContext = productContext;

            SearchHandlerManager.Registry(new SearchHandler());
        }
Example #3
0
 public void Configure()
 {
     if (!FilesIntegration.IsRegisteredFileSecurityProvider(AttachmentEngine.Module, AttachmentEngine.Bunch))
     {
         FilesIntegration.RegisterFileSecurityProvider(AttachmentEngine.Module, AttachmentEngine.Bunch, new SecurityAdapterProvider());
     }
 }
        public override void Init()
        {
            context = new ProductContext
            {
                MasterPageFile        = String.Concat(PathProvider.BaseVirtualPath, "Masters/BasicTemplate.Master"),
                DisabledIconFileName  = "product_disabled_logo.png",
                IconFileName          = "product_logo.png",
                LargeIconFileName     = "product_logolarge.png",
                DefaultSortOrder      = 30,
                SubscriptionManager   = new ProductSubscriptionManager(),
                SpaceUsageStatManager = new CRMSpaceUsageStatManager(),
                AdminOpportunities    = () => CRMCommonResource.ProductAdminOpportunities.Split('|').ToList(),
                UserOpportunities     = () => CRMCommonResource.ProductUserOpportunities.Split('|').ToList(),
            };

            if (!FilesIntegration.IsRegisteredFileSecurityProvider("crm", "crm_common"))
            {
                FilesIntegration.RegisterFileSecurityProvider("crm", "crm_common", new FileSecurityProvider());
            }
            if (!FilesIntegration.IsRegisteredFileSecurityProvider("crm", "opportunity"))
            {
                FilesIntegration.RegisterFileSecurityProvider("crm", "opportunity", new FileSecurityProvider());
            }

            SearchHandlerManager.Registry(new SearchHandler());
        }
Example #5
0
        protected void Application_Start()
        {
            log4net.Config.XmlConfigurator.Configure();
            AreaRegistration.RegisterAllAreas();
            RegisterRoutes(RouteTable.Routes);

            var iisversion = GetIISVersion();

            if (iisversion != 0 && iisversion < 7)
            {
                AddMimeMapping(".png", "image/png");
                AddMimeMapping(".svg", "image/svg+xml");
            }

            DbRegistry.Configure();

            if (ConfigurationManager.AppSettings["resources.from-db"] == "true")
            {
                AssemblyWork.UploadResourceData(AppDomain.CurrentDomain.GetAssemblies());
                AppDomain.CurrentDomain.AssemblyLoad += (sender, args) => AssemblyWork.UploadResourceData(AppDomain.CurrentDomain.GetAssemblies());
            }

            //HACK: Register CRM and Projects file integrations
            if (!FilesIntegration.IsRegisteredFileSecurityProvider("projects", "project"))
            {
                FilesIntegration.RegisterFileSecurityProvider("projects", "project", new ASC.Projects.Engine.SecurityAdapterProvider());
            }

            if (!FilesIntegration.IsRegisteredFileSecurityProvider("crm", "crm_common"))
            {
                FilesIntegration.RegisterFileSecurityProvider("crm", "crm_common", new ASC.CRM.Core.FileSecurityProvider());
            }
        }
Example #6
0
 /// <summary>
 /// </summary>
 /// <param name="context"></param>
 /// <param name="fileStorageService"></param>
 public DocumentsApi(ApiContext context, IFileStorageService fileStorageService)
 {
     _context            = context;
     _fileStorageService = fileStorageService;
     if (!FilesIntegration.IsRegisteredFileSecurityProvider("crm", "crm_common"))
     {
         FilesIntegration.RegisterFileSecurityProvider("crm", "crm_common", new FileSecurityProvider());
     }
 }
Example #7
0
        /// <summary>
        /// </summary>
        /// <param name="context"></param>
        /// <param name="fileStorageService"></param>
        public DocumentsApi(ApiContext context, IFileStorageService fileStorageService)
        {
            _context            = context;
            _fileStorageService = fileStorageService;
            //TODO: Why not to move this code to DAO???
            if (!DbRegistry.IsDatabaseRegistered(FileConstant.DatabaseId))
            {
                DbRegistry.RegisterDatabase(FileConstant.DatabaseId,
                                            WebConfigurationManager.ConnectionStrings[FileConstant.DatabaseId]);
            }

            if (!FilesIntegration.IsRegisteredFileSecurityProvider("crm", "crm_common"))
            {
                FilesIntegration.RegisterFileSecurityProvider("crm", "crm_common", new FileSecurityProvider());
            }
        }
Example #8
0
        public void Configure()
        {
            if (!DbRegistry.IsDatabaseRegistered(FileConstant.DatabaseId))
            {
                DbRegistry.RegisterDatabase(FileConstant.DatabaseId, WebConfigurationManager.ConnectionStrings[FileConstant.DatabaseId]);
            }


            if (!FilesIntegration.IsRegisteredFileSecurityProvider("crm", "crm_common"))
            {
                FilesIntegration.RegisterFileSecurityProvider("crm", "crm_common", new FileSecurityProvider());
            }

            //Register prodjects' calendar events
            CalendarManager.Instance.RegistryCalendarProvider(CRMApi.GetUserCalendars);
        }
Example #9
0
        public void Configure()
        {
            if (!FilesIntegration.IsRegisteredFileSecurityProvider("crm", "crm_common"))
            {
                FilesIntegration.RegisterFileSecurityProvider("crm", "crm_common", new FileSecurityProvider());
            }

            //Register prodjects' calendar events
            CalendarManager.Instance.RegistryCalendarProvider(userid =>
            {
                if (WebItemSecurity.IsAvailableForUser(WebItemManager.CRMProductID, userid))
                {
                    return(new List <BaseCalendar> {
                        new CRMCalendar(userid)
                    });
                }
                return(new List <BaseCalendar>());
            });
        }
Example #10
0
        public void Configure()
        {
            if (!FilesIntegration.IsRegisteredFileSecurityProvider("crm", "crm_common"))
            {
                FilesIntegration.RegisterFileSecurityProvider("crm", "crm_common", new FileSecurityProvider());
            }

            //Register prodjects' calendar events
            CalendarManager.Instance.RegistryCalendarProvider(userid =>
            {
                if (WebItemSecurity.IsAvailableForUser(WebItemManager.CRMProductID.ToString(), userid))
                {
                    var factory = new DaoFactory(CoreContext.TenantManager.GetCurrentTenant().TenantId, CRMConstants.DatabaseId);
                    return(new List <BaseCalendar> {
                        new CRMCalendar(factory, userid)
                    });
                }
                return(new List <BaseCalendar>());
            });
        }