Exemplo n.º 1
0
        private void InitializeDynamicTypeFunctions()
        {
            _standardDynamicTypeFunctions = new List <IFunction>();

            // pages
            _standardDynamicTypeFunctions.Add(new Pages.SitemapXmlFunction(_entityTokenFactory));
            _standardDynamicTypeFunctions.Add(new Pages.SitemapFunction(_entityTokenFactory));
            _standardDynamicTypeFunctions.Add(new Pages.GetPageIdFunction(_entityTokenFactory));
            _standardDynamicTypeFunctions.Add(new Pages.GetForeignPageInfoFunction(_entityTokenFactory));

            // data.filter
            List <Type> dataInterfaces = DataFacade.GetAllKnownInterfaces(UserType.Developer);

            object[] args = new object[] { _entityTokenFactory };

            _standardDynamicTypeFunctions.AddRange(
                from t in dataInterfaces
                where DataAssociationRegistry.IsAssociationType(t)
                select(IFunction) Activator.CreateInstance(typeof(ActivePageReferenceFilter <>).MakeGenericType(t), args));

            _standardDynamicTypeFunctions.AddRange(
                from t in dataInterfaces
                select(IFunction) Activator.CreateInstance(typeof(FieldPredicatesFilter <>).MakeGenericType(t), args));

            _standardDynamicTypeFunctions.AddRange(
                from t in dataInterfaces
                select(IFunction) Activator.CreateInstance(typeof(CompoundFilter <>).MakeGenericType(t), args));

            _standardDynamicTypeFunctions.AddRange(
                from t in dataInterfaces
                select(IFunction) Activator.CreateInstance(typeof(DataReferenceFilter <>).MakeGenericType(t), args));

            _standardDynamicTypeFunctions.AddRange(
                from t in dataInterfaces
                select(IFunction) Activator.CreateInstance(typeof(GetXml <>).MakeGenericType(t), args));

            _standardDynamicTypeFunctions.AddRange(
                from t in dataInterfaces
                where DataAttributeFacade.GetKeyPropertyNames(t).Count == 1
                select(IFunction) Activator.CreateInstance(typeof(GetDataReference <>).MakeGenericType(t), args));

            _standardDynamicTypeFunctions.AddRange(
                from t in dataInterfaces
                where DataAttributeFacade.GetKeyPropertyNames(t).Count == 1
                select(IFunction) Activator.CreateInstance(typeof(GetNullableDataReference <>).MakeGenericType(t), args));

            _standardDynamicTypeFunctions.AddRange(
                from t in dataInterfaces
                select(IFunction) Activator.CreateInstance(typeof(AddDataInstance <>).MakeGenericType(t), args));

            _standardDynamicTypeFunctions.AddRange(
                from t in dataInterfaces
                select(IFunction) Activator.CreateInstance(typeof(UpdateDataInstance <>).MakeGenericType(t), args));

            _standardDynamicTypeFunctions.AddRange(
                from t in dataInterfaces
                select(IFunction) Activator.CreateInstance(typeof(DeleteDataInstance <>).MakeGenericType(t), args));
        }
Exemplo n.º 2
0
        private static void DoInitialize()
        {
            int startTime = Environment.TickCount;

            Guid installationId = InstallationInformationFacade.InstallationId;

            Log.LogVerbose(LogTitle, "Initializing the system core - installation id = " + installationId);

            using (new LogExecutionTime(LogTitle, "Initialization of the static data types"))
            {
                DataProviderRegistry.InitializeDataTypes();
            }


            using (new LogExecutionTime(LogTitle, "Auto update of static data types"))
            {
                bool typesUpdated = AutoUpdateStaticDataTypes();
                if (typesUpdated)
                {
                    using (new LogExecutionTime(LogTitle, "Reinitialization of the static data types"))
                    {
                        SqlTableInformationStore.Flush();
                        DataProviderRegistry.Flush();
                        DataProviderPluginFacade.Flush();


                        DataProviderRegistry.InitializeDataTypes();
                    }

                    CodeGenerationManager.GenerateCompositeGeneratedAssembly(true);
                }
            }


            using (new LogExecutionTime(LogTitle, "Ensure data stores"))
            {
                bool dataStoresCreated = DataStoreExistenceVerifier.EnsureDataStores();

                if (dataStoresCreated)
                {
                    Log.LogVerbose(LogTitle, "Initialization of the system was halted, performing a flush");
                    _initializing = false;
                    GlobalEventSystemFacade.FlushTheSystem();
                    return;
                }
            }



            using (new LogExecutionTime(LogTitle, "Initializing data process controllers"))
            {
                ProcessControllerFacade.Initialize_PostDataTypes();
            }


            using (new LogExecutionTime(LogTitle, "Initializing data type references"))
            {
                DataReferenceRegistry.Initialize_PostDataTypes();
            }


            using (new LogExecutionTime(LogTitle, "Initializing data type associations"))
            {
                DataAssociationRegistry.Initialize_PostDataTypes();
            }


            using (new LogExecutionTime(LogTitle, "Initializing internal urls"))
            {
                InternalUrls.Initialize_PostDataTypes();
            }


            using (new LogExecutionTime(LogTitle, "Initializing functions"))
            {
                MetaFunctionProviderRegistry.Initialize_PostDataTypes();
            }


            Log.LogVerbose(LogTitle, "Starting initialization of administrative secondaries");


            if (SystemSetupFacade.IsSystemFirstTimeInitialized && !SystemSetupFacade.SetupIsRunning)
            {
                using (new LogExecutionTime(LogTitle, "Initializing workflow runtime"))
                {
                    WorkflowFacade.EnsureInitialization();
                }
            }


            if (!RuntimeInformation.IsUnittest)
            {
                using (new LogExecutionTime(LogTitle, "Initializing flow system"))
                {
                    FlowControllerFacade.Initialize();
                }

                using (new LogExecutionTime(LogTitle, "Initializing console system"))
                {
                    ConsoleFacade.Initialize();
                }
            }


            using (new LogExecutionTime(LogTitle, "Auto installing packages"))
            {
                DoAutoInstallPackages();
            }


            using (new LogExecutionTime(LogTitle, "Loading element providers"))
            {
                ElementProviderLoader.LoadAllProviders();
            }


            int executionTime = Environment.TickCount - startTime;

            Log.LogVerbose(LogTitle, "Done initializing of the system core. ({0} ms)".FormatWith(executionTime));
        }
 /// <summary>
 /// Returns all possible meta data types. This is NOT types that only have been defined on any pages or page type
 /// </summary>
 /// <returns></returns>
 public static IEnumerable <Type> GetAllMetaDataTypes()
 {
     return(DataAssociationRegistry.GetAssociationTypes(typeof(IPage), DataAssociationType.Composition));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Returns all possible page folder types. This is NOT all types that only have been defined on any pages
 /// </summary>
 /// <returns></returns>
 public static IEnumerable <Type> GetAllFolderTypes()
 {
     return(DataAssociationRegistry.GetAssociationTypes(typeof(IPage), DataAssociationType.Aggregation));
 }
Exemplo n.º 5
0
        static ActivePageReferenceFilter()
        {
            PropertyInfo foreignKeyPropertyInfo = DataAssociationRegistry.GetForeignKeyPropertyInfo(typeof(IPage), typeof(T));

            _foreignKeyPropertyExpression = Expression.Property(_parameterExpression, foreignKeyPropertyInfo);
        }