public AssociatedDataElementProviderHelper(ElementProviderContext elementProviderContext, EntityToken rootEntityToken, bool addVisualFunctionActions)
        {
            if (elementProviderContext == null)
            {
                throw new ArgumentNullException("elementProviderContext");
            }
            if (rootEntityToken == null)
            {
                throw new ArgumentNullException("rootEntityToken");
            }

            _elementProviderContext   = elementProviderContext;
            _rootEntityToken          = rootEntityToken;
            _addVisualFunctionActions = addVisualFunctionActions;

            _dataGroupingProviderHelper = new DataGroupingProviderHelper.DataGroupingProviderHelper(elementProviderContext)
            {
                OnOwnsType = type => typeof(IPageFolderData).IsAssignableFrom(type) ||
                             typeof(IPageDataFolder).IsAssignableFrom(type),
                OnCreateLeafElement         = this.CreateElement,
                OnCreateDisabledLeafElement = data => ShowForeignElement(data, false),
                OnCreateGhostedLeafElement  = data => ShowForeignElement(data, true),
                OnGetRootParentEntityToken  = this.GetParentEntityToken,
                OnGetLeafsFilter            = this.GetLeafsFilter,
                OnGetPayload = this.GetPayload
            };

            AuxiliarySecurityAncestorFacade.AddAuxiliaryAncestorProvider <DataEntityToken>(this);
        }
Esempio n. 2
0
 /// <exclude />
 public BaseFunctionProviderElementProvider()
 {
     foreach (Type entityTokenType in OnGetEntityTokenTypes())
     {
         AuxiliarySecurityAncestorFacade.AddAuxiliaryAncestorProvider(entityTokenType, this);
     }
 }
Esempio n. 3
0
        public static void OnInitialized()
        {
            AuxiliarySecurityAncestorFacade.AddAuxiliaryAncestorProvider <MyRootEntityToken>(
                new MyRootEntityTokenAuxiliarySecurityAncestorProvider());

            AuxiliarySecurityAncestorFacade.AddAuxiliaryAncestorProvider <DataEntityToken>(
                new MyDataEntityTokenAuxiliarySecurityAncestorProvider());
        }
Esempio n. 4
0
        public static void ReloadDataElementInConsole(DataEntityToken dataEntityToken)
        {
            var parentEntityTokens = AuxiliarySecurityAncestorFacade.GetParents(dataEntityToken);

            foreach (var parentEntityToken in parentEntityTokens)
            {
                ConsoleMessageQueueFacade.Enqueue(new RefreshTreeMessageQueueItem {
                    EntityToken = parentEntityToken
                }, null);
            }
        }
        public DeveloperApplicationProvider()
        {
            AuxiliarySecurityAncestorFacade.AddAuxiliaryAncestorProvider <DeveloperApplicationProviderEntityToken>(this);

            foreach (string treeDefinitionFilename in this.TreeDefinitionFilenames)
            {
                string filename = Path.GetFileName(treeDefinitionFilename);

                DeveloperApplicationProviderEntityToken entityToken = new DeveloperApplicationProviderEntityToken(DeveloperApplicationProviderEntityToken.TreeDefinitionId, filename);

                TreeFacade.AddCustomAttachmentPoint(filename, entityToken);
            }
        }
        protected override void OnContextSetted()
        {
            string providerName = GetContext().ProviderName;

            if (_providerType == FunctionsProviderType)
            {
                AuxiliarySecurityAncestorFacade.AddAuxiliaryAncestorProvider(typeof(StandardFunctionProviderEntityToken), new StandardFunctionAuxiliarySecurityAncestorProvider(providerName));
            }
            else
            {
                AuxiliarySecurityAncestorFacade.AddAuxiliaryAncestorProvider(typeof(StandardWidgetFunctionProviderEntityToken), new StandardFunctionAuxiliarySecurityAncestorProvider(providerName));
            }
        }
Esempio n. 7
0
        public PageTemplateFeatureElementProvider()
        {
            AuxiliarySecurityAncestorFacade.AddAuxiliaryAncestorProvider <PageTemplateFeatureEntityToken>(this);

            foreach (string pageTemplateFeratureFilename in this.PageTemplateFeatureFilenames)
            {
                string filename = Path.GetFileName(pageTemplateFeratureFilename);

                PageTemplateFeatureEntityToken entityToken = new PageTemplateFeatureEntityToken(PageTemplateFeatureEntityToken.FeatureId, filename);

                TreeFacade.AddCustomAttachmentPoint(filename, entityToken);
            }
        }
        public DataGroupingProviderHelper(ElementProviderContext elementProviderContext)
        {
            _elementProviderContext = elementProviderContext;
            _undefinedLabelValue    = StringResourceSystemFacade.GetString("Composite.Plugins.GeneratedDataTypesElementProvider", "UndefinedLabelTemplate");

            this.FolderOpenIcon   = GetIconHandle("datagroupinghelper-folder-open");
            this.FolderClosedIcon = GetIconHandle("datagroupinghelper-folder-closed");

            this.OnCreateLeafElement      = d => new Element(_elementProviderContext.CreateElementHandle(d.GetDataEntityToken()));
            this.OnGetDataScopeIdentifier = t => DataScopeIdentifier.Administrated;
            this.OnAddActions             = (e, p) => e;

            AuxiliarySecurityAncestorFacade.AddAuxiliaryAncestorProvider <DataEntityToken>(this);
            AuxiliarySecurityAncestorFacade.AddAuxiliaryAncestorProvider <DataGroupingProviderHelperEntityToken>(this);
        }
        public void Initialize()
        {
            using (_resourceLocker.Locker)
            {
                var resources = _resourceLocker.Resources;

                if (!GlobalInitializerFacade.IsReinitializingTheSystem)
                {
                    DataEvents <IDataItemTreeAttachmentPoint> .OnAfterAdd     += OnUpdateTreeAttachmentPoints;
                    DataEvents <IDataItemTreeAttachmentPoint> .OnDeleted      += OnUpdateTreeAttachmentPoints;
                    DataEvents <IDataItemTreeAttachmentPoint> .OnStoreChanged += OnTreeAttachmentPointsStoreChange;

                    GeneratedTypesFacade.SubscribeToUpdateTypeEvent(OnDataTypeChanged);

                    var treeAuxiliaryAncestorProvider = new TreeAuxiliaryAncestorProvider();
                    var entityTokenTypes = new[]
                    {
                        typeof(TreeSimpleElementEntityToken),
                        typeof(TreeFunctionElementGeneratorEntityToken),
                        typeof(TreeDataFieldGroupingElementEntityToken),
                        typeof(DataEntityToken),
                        typeof(TreePerspectiveEntityToken)
                    };

                    entityTokenTypes.ForEach(type => AuxiliarySecurityAncestorFacade
                                             .AddAuxiliaryAncestorProvider(type, treeAuxiliaryAncestorProvider, true));

                    resources.PersistentAttachmentPoints = new Dictionary <string, List <IAttachmentPoint> >();

                    LoadAllTrees();
                    InitializeTreeAttachmentPoints();
                    TreeSharedRootsFacade.Clear();

                    var fileWatcher = new C1FileSystemWatcher(TreeDefinitionsFolder, "*.xml");
                    fileWatcher.Created            += OnReloadTrees;
                    fileWatcher.Deleted            += OnReloadTrees;
                    fileWatcher.Changed            += OnReloadTrees;
                    fileWatcher.Renamed            += OnReloadTrees;
                    fileWatcher.EnableRaisingEvents = true;

                    resources.FileSystemWatcher = fileWatcher;

                    resources.RootEntityToken = ElementFacade.GetRootsWithNoSecurity().First().ElementHandle.EntityToken;
                }
            }
        }
        public static void ReloadDataElementInConsole(DataEntityToken dataEntityToken)
        {
            if (dataEntityToken == null)
            {
                throw new ArgumentNullException(nameof(dataEntityToken));
            }

            var parentEntityTokens = AuxiliarySecurityAncestorFacade.GetParents(dataEntityToken);

            if (parentEntityTokens != null)
            {
                foreach (var parentEntityToken in parentEntityTokens)
                {
                    ConsoleMessageQueueFacade.Enqueue(new RefreshTreeMessageQueueItem {
                        EntityToken = parentEntityToken
                    }, null);
                }
            }
        }
Esempio n. 11
0
        public DataGroupingProviderHelper(ElementProviderContext elementProviderContext)
        {
            _elementProviderContext = elementProviderContext;
            _undefinedLabelValue    = StringResourceSystemFacade.GetString("Composite.Plugins.GeneratedDataTypesElementProvider", "UndefinedLabelTemplate");

            this.FolderOpenIcon   = GetIconHandle("datagroupinghelper-folder-open");
            this.FolderClosedIcon = GetIconHandle("datagroupinghelper-folder-closed");

            this.OnCreateLeafElement      = d => new Element(_elementProviderContext.CreateElementHandle(d.GetDataEntityToken()));
            this.OnGetDataScopeIdentifier = t => DataScopeIdentifier.Administrated;
            this.OnAddActions             = (e, p) => e;

            AuxiliarySecurityAncestorFacade.AddAuxiliaryAncestorProvider <DataEntityToken>(this);
            AuxiliarySecurityAncestorFacade.AddAuxiliaryAncestorProvider <DataGroupingProviderHelperEntityToken>(this);

            DataEventSystemFacade.SubscribeToDataAfterUpdate(typeof(IData), (sender, args) =>
            {
                if (!OnOwnsType(args.DataType))
                {
                    return;
                }

                var dataTypeDescriptor = DynamicTypeManager.GetDataTypeDescriptor(args.DataType);

                IEnumerable <DataFieldDescriptor> groupingDataFieldDescriptors =
                    from dfd in dataTypeDescriptor.Fields
                    where dfd.GroupByPriority != 0
                    orderby dfd.GroupByPriority
                    select dfd;

                if (groupingDataFieldDescriptors.Any())
                {
                    EntityTokenCacheFacade.ClearCache(args.Data.GetDataEntityToken());
                }
            }, false);
        }
Esempio n. 12
0
 public PageElementProvider()
 {
     AuxiliarySecurityAncestorFacade.AddAuxiliaryAncestorProvider <DataEntityToken>(this);
 }
Esempio n. 13
0
 public PageElementProvider()
 {
     AuxiliarySecurityAncestorFacade.AddAuxiliaryAncestorProvider <DataEntityToken>(this);
     DataEvents <IPageType> .OnStoreChanged += DataEvents_IPageType_OnStoreChanged;
 }
 public ScheduledTasksElementProvider()
 {
     AuxiliarySecurityAncestorFacade.AddAuxiliaryAncestorProvider <DataEntityToken>(this);
 }
 public LocalizationElementProvider() : base("Localization")
 {
     AuxiliarySecurityAncestorFacade.AddAuxiliaryAncestorProvider <DataEntityToken>(this);
 }