コード例 #1
0
        static void Main(string[] args)
        {
            var env = args.Length == 0 ? EnvironmentManager.GetDefault() : EnvironmentManager.Get(args[0]);

            CoreserviceClientFactory.SetEnvironment(env);
            var client     = CoreserviceClientFactory.GetClient();
            var references = new List <Reference>();

            var sourceIds = StorageFactory.GetItemsToExport();

            foreach (var sourceId in sourceIds)
            {
                var item       = client.Read(sourceId, new ReadOptions());
                var importItem = ModelFactory.CreateImportItem(item);
                StorageFactory.StoreImportItem(importItem);
                foreach (var childId in sourceIds.Where(s => s != sourceId))
                {
                    if (importItem.Content.Contains(childId))
                    {
                        references.Add(new Reference(sourceId, childId));
                    }
                }
            }
            StorageFactory.StoreReferences(references);
        }
コード例 #2
0
        public InstallPackageCreator(IInstallerConfiguration configuration)
        {
            Configuration = configuration;
            var env = EnvironmentManager.Get(Configuration.Environment);

            CoreserviceClientFactory.SetEnvironment(env);
            Client = CoreserviceClientFactory.GetClient();
            DefaultConfigurationSetter.ApplyDefaults(configuration);
            StorageFactory.SetLocation(Configuration.InstallPackagePath);
        }
コード例 #3
0
        private static void ExportModels(ModelOptions opts)
        {
            var env = EnvironmentManager.Get(opts.Environment);

            if (env == null)
            {
                Console.WriteLine(
                    "you must create an environment before you can generate models or views - try dyndle help add-environment");
                return;
            }
            CoreserviceClientFactory.SetEnvironment(env);
            var module = new ModelGenerator(opts);

            var packagePath = module.Run();

            Console.WriteLine("output created at " + packagePath);
        }
コード例 #4
0
        private static void Install(InstallerOptions opts)
        {
            var env = EnvironmentManager.Get(opts.Environment);

            if (env == null)
            {
                Console.WriteLine(
                    "you must create an environment first - try dyndle help add-environment");
                return;
            }
            CoreserviceClientFactory.SetEnvironment(env);

            var module = new Installer.Installer(opts);

            var output = module.Run();

            Console.WriteLine(output);
        }