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); }
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); }
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); }
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); }