예제 #1
0
        internal static void RemoveAppInTenantAndEav(IZoneMapper zoneMapper, int zoneId, int appId, ITenant tenant, int userId, Log parentLog)
        {
            // check portal assignment and that it's not the default app
            if (zoneId != zoneMapper.GetZoneId(tenant.Id))
            {
                throw new Exception("This app does not belong to portal " + tenant.Id);
            }

            if (appId == new ZoneRuntime(zoneId, parentLog).DefaultAppId)
            {
                throw new Exception("The default app of a zone cannot be removed.");
            }

            // Prepare to Delete folder in dnn - this must be done, before deleting the app in the DB
            var sexyApp  = App.LightWithoutData(tenant, zoneId, appId, null);
            var folder   = sexyApp.Folder;
            var physPath = sexyApp.PhysicalPath;

            // now remove from DB. This sometimes fails, so we do this before trying to clean the files
            // as the db part should be in a transaction, and if it fails, everything should stay as is
            new ZoneManager(zoneId, parentLog).DeleteApp(appId);

            // now really delete the files - if the DB didn't end up throwing an error
            if (!IsNullOrEmpty(folder) && Directory.Exists(physPath))
            {
                Directory.Delete(physPath, true);
            }
        }
예제 #2
0
 public ImportApp(IZoneMapper zoneMapper, IServerPaths serverPaths, IEnvironmentLogger envLogger, ZipImport zipImport, IGlobalConfiguration globalConfiguration) : base("Bck.Export")
 {
     _zoneMapper          = zoneMapper;
     _serverPaths         = serverPaths;
     _envLogger           = envLogger;
     _zipImport           = zipImport;
     _globalConfiguration = globalConfiguration;
 }
예제 #3
0
 public ResetApp(IZoneMapper zoneMapper,
                 Lazy <XmlImportWithFiles> xmlImportWithFilesLazy,
                 ImpExpHelpers impExpHelpers,
                 CmsZones cmsZones) : base("Bck.Export")
 {
     _zoneMapper             = zoneMapper;
     _xmlImportWithFilesLazy = xmlImportWithFilesLazy;
     _impExpHelpers          = impExpHelpers;
     _cmsZones = cmsZones;
 }
예제 #4
0
 public ImportContent(IZoneMapper zoneMapper,
                      IServerPaths serverPaths,
                      IEnvironmentLogger envLogger,
                      Lazy <Import> importerLazy,
                      Lazy <XmlImportWithFiles> xmlImportWithFilesLazy,
                      ZipImport zipImport,
                      Lazy <JsonSerializer> jsonSerializerLazy,
                      IGlobalConfiguration globalConfiguration) : base("Bck.Export")
 {
     _zoneMapper             = zoneMapper;
     _serverPaths            = serverPaths;
     _envLogger              = envLogger;
     _importerLazy           = importerLazy;
     _xmlImportWithFilesLazy = xmlImportWithFilesLazy;
     _zipImport              = zipImport;
     _jsonSerializerLazy     = jsonSerializerLazy;
     _globalConfiguration    = globalConfiguration;
 }
예제 #5
0
 public StatefulControllerDependencies(IZoneMapper zoneMapper,
                                       ITenantResolver tenantResolver,
                                       IUserResolver userResolver,
                                       //IModuleDefinitionRepository moduleDefinitionRepository,
                                       IModuleRepository moduleRepository,
                                       //ISettingRepository settingRepository,
                                       //OqtaneContainer oqtaneContainer,
                                       OqtTempInstanceContext oqtTempInstanceContext,
                                       IServiceProvider serviceProvider,
                                       IContextResolver ctxResolver
                                       )
 {
     ServiceProvider = serviceProvider;
     CtxResolver     = ctxResolver;
     ZoneMapper      = zoneMapper;
     TenantResolver  = tenantResolver;
     UserResolver    = userResolver;
     //ModuleDefinitionRepository = moduleDefinitionRepository;
     ModuleRepository = moduleRepository;
     //SettingRepository = settingRepository;
     //_oqtaneContainer = oqtaneContainer;
     OqtTempInstanceContext = oqtTempInstanceContext;
 }
예제 #6
0
        // Todo: leave this helper class/message in till 2sxc 09.00, then either extract into an own DLL
        // - we might also write some SQL to update existing pipelines, but it's not likely to have been used much...
        // - and otherwise im might be in razor-code, which we couldn't auto-update

        public DnnUserProfileDataSource(ITenant tenant, IZoneMapper zoneMapper) : base(tenant, zoneMapper)
        {
        }
예제 #7
0
 public FeaturesBackend(IServerPaths serverPaths, IZoneMapper zoneMapper, IServiceProvider serviceProvider, IGlobalConfiguration globalConfiguration) : base(serviceProvider, "Bck.Feats")
 {
     _serverPaths         = serverPaths;
     _zoneMapper          = zoneMapper;
     _globalConfiguration = globalConfiguration;
 }
예제 #8
0
 public ExportApp(IZoneMapper zoneMapper, ZipExport zipExport) : base("Bck.Export")
 {
     _zoneMapper = zoneMapper;
     _zipExport  = zipExport;
 }
예제 #9
0
 public ImportApp(IZoneMapper zoneMapper, IHttp http) : base("Bck.Export")
 {
     _zoneMapper = zoneMapper;
     _http       = http;
 }
예제 #10
0
 public LanguagesBackend(IZoneMapper zoneMapper) : base("Bck.Admin")
 {
     _zoneMapper = zoneMapper;
 }
        // Todo: leave this helper class/message in till 2sxc 09.00, then either extract into an own DLL
        // - we might also write some SQL to update existing pipelines, but it's not likely to have been used much...
        // - and otherwise im might be in razor-code, which we couldn't auto-update

        public DnnUserProfileDataSource(ISite site, IZoneMapper zoneMapper) : base(site, zoneMapper)
        {
        }
예제 #12
0
 /// <summary>
 /// Constructor for DI - you must always call Init(...) afterwards
 /// </summary>
 /// <param name="tenant">DI injected param</param>
 /// <param name="zoneMapper">DI injected param</param>
 public DnnAppFileSystemLoader(ITenant tenant, IZoneMapper zoneMapper) : base("Dnn.AppStf")
 {
     Tenant     = tenant;
     ZoneMapper = zoneMapper;
 }
예제 #13
0
 /// <summary>
 /// Empty constructor for DI
 /// </summary>
 // ReSharper disable once UnusedMember.Global
 public DnnModuleUpdater(Lazy <CmsRuntime> cmsRuntimeLazy, IZoneMapper zoneMapper) : base("Dnn.MapA2I")
 {
     _cmsRuntimeLazy = cmsRuntimeLazy;
     _zoneMapper     = zoneMapper.Init(Log);
 }
예제 #14
0
 public AppFinder(PortalSettings portal, IZoneMapper zoneMapper, HttpControllerContext controllerContext, ILog parentLog) : base("Api.FindAp", parentLog, null, "AppForApiCall")
 {
     ZoneMapper        = zoneMapper;
     Portal            = portal;
     ControllerContext = controllerContext;
 }
예제 #15
0
 public ExportContent(IZoneMapper zoneMapper, XmlExporter xmlExporter, Lazy <CmsRuntime> cmsRuntime) : base("Bck.Export")
 {
     _zoneMapper  = zoneMapper;
     _xmlExporter = xmlExporter;
     _cmsRuntime  = cmsRuntime;
 }
예제 #16
0
 /// <summary>
 /// Constructor for DI - you must always call Init(...) afterwards
 /// </summary>
 /// <param name="site">DI injected param</param>
 /// <param name="zoneMapper">DI injected param</param>
 public DnnAppFileSystemLoader(ISite site, IZoneMapper zoneMapper) : base("Dnn.AppStf")
 {
     Site       = site;
     ZoneMapper = zoneMapper;
 }
예제 #17
0
 public AppOfRequest(IHttp http, ITenant tenant, IZoneMapper zoneMapper) : base("Api.FindAp")
 {
     _http       = http;
     _tenantId   = tenant.Id;
     _zoneMapper = zoneMapper;
 }
예제 #18
0
 public ExportContent(IZoneMapper zoneMapper, XmlExporter xmlExporter) : base("Bck.Export")
 {
     _zoneMapper  = zoneMapper;
     _xmlExporter = xmlExporter;
 }
예제 #19
0
 public LanguagesBackend(IZoneMapper zoneMapper, ZoneManager zoneManager) : base("Bck.Admin")
 {
     _zoneManager = zoneManager;
     _zoneMapper  = zoneMapper.Init(Log);
 }
예제 #20
0
 public ExportApp(IZoneMapper zoneMapper, ZipExport zipExport, CmsRuntime cmsRuntime) : base("Bck.Export")
 {
     _zoneMapper = zoneMapper;
     _zipExport  = zipExport;
     _cmsRuntime = cmsRuntime;
 }
예제 #21
0
 /// <summary>
 /// Constructor for DI, you must always call Init(...) afterwards
 /// </summary>
 public DnnEnvironment(IHttp http, ITenant tenant, IPagePublishing publishing, IZoneMapper zoneMapper) : base("DNN.Enviro")
 {
     _http          = http;
     _tenant        = tenant;
     PagePublishing = publishing.Init(Log);
     ZoneMapper     = zoneMapper.Init(Log);
 }
예제 #22
0
 public FeaturesBackend(IHttp http, IZoneMapper zoneMapper) : base("Bck.Feats")
 {
     _http       = http;
     _zoneMapper = zoneMapper;
 }