예제 #1
0
        internal void Build(SettingsModule settings, List <ContentItem> items)
        {
            List <DomainViewModel>        list      = new List <DomainViewModel>();
            List <DomainPathMapViewModel> additions = new List <DomainPathMapViewModel>();

            foreach (var domain in settings.Settings.Domains)
            {
                var item = Items.FirstOrDefault(p => p.Id.Equals(domain.Id, StringComparison.OrdinalIgnoreCase));
                if (item == null)
                {
                    item = new DomainPathMapViewModel(new DomainPathMap()
                    {
                        Id      = domain.Id,
                        Display = domain.Name,
                        Slug    = domain.Name.ToLower(),
                        Path    = domain.Name.ToLower(),
                        Items   = new List <PathNode>().Default()
                    });
                    additions.Add(item);
                }
                list.Add(new DomainViewModel(domain, item));
            }
            additions.ForEach(x => { Items.Add(x); });
            Build(items);
            settings.Initialize(list);
        }
예제 #2
0
        public WorkspaceViewModel(Workspace model)
        {
            // first time setting we don't want
            // 'setup lazy loaded modules to fire
            _DataServiceStrategy = model.DataServiceStrategy;

            DataServices.Add(new XmlDataService());
            DataServices.Add(new JsonDataService());

            var found = DataServices.FirstOrDefault(x => x.Key.Equals(model.DataServiceStrategy));

            if (found != null)
            {
                _DataService = found;
            }

            Overlay.RegisterOverlay(AppConstants.OverlayContent, ShowContentOverlay);
            Settings = new SettingsModule(DataService);
            Settings.Setup();

            Tasks = new TasksModule(DataService, Settings);
            Tasks.Setup();

            Paths = new VirtualPathModule(DataService);
            Paths.Setup();

            Mimes = new MimeModule(DataService);
            Mimes.Setup();

            Indexer = new IndexerModule(DataService, Settings);
            Indexer.Setup();

            Schema = new SchemaModule(DataService, Settings);
            Schema.Setup();

            Content = new ContentModule(DataService, Settings, Indexer, Paths, Schema);
            Content.Setup(Mimes);

            Credentials = new CredentialsModule(DataService)
            {
            };
            Credentials.Setup();

            Rolodex = new RolodexModule(DataService);
            Rolodex.Setup();

            Datatool = new DatatoolModule(DataService);
            Datatool.Setup();

            Workflow = new WorkflowModule();
        }
예제 #3
0
 public ContentModule(IDataService dataService,
                      SettingsModule settings,
                      IndexerModule indexer,
                      VirtualPathModule paths,
                      SchemaModule schema)
 {
     DataService                = dataService;
     Settings                   = settings;
     settings.DomainSelected    = HandleDomainSelected;
     settings.DomainAdded       = HandleDomainAdded;
     settings.TagHelpersChanged = HandleTagHelpersChanged;
     HandleTagHelpersChanged(Settings.TagHelpers);
     settings.EnableContentSchema = HandleEnableContentSchemas;
     Input.IsEnableContentSchemas = settings.IsEnableContentSchemas;
     UserPreferences       = Settings.UserPreferences;
     Indexer               = indexer.Indexer;
     Languages             = indexer.Languages;
     indexer.LanguageAdded = HandleLanguageAdded;
     Paths          = paths;
     JsonSchemas    = schema.JsonSchemas;
     ContentManager = new ContentManager(Path.Combine(AppConstants.ContentDirectory, AppConstants.ContentFiles));
 }
예제 #4
0
        public SchemaModule(IDataService dataService, SettingsModule settings)
        {
            DataService = dataService;

            Settings = settings;
        }