private void AddExtension(DeploymentContainer container, Extension ext, HashSet <string> folders) { string[] tokens = ext.ExtensionTypeString.Split(','.ToSingleArray()); string assemblyName = tokens[1].Trim(); if (assemblyName == "Thunderdome") { return; } string location = Path.GetDirectoryName(ext.Location); location = Path.Combine(location, assemblyName + ".dll"); if (!CheckExtension(location)) { return; } // make sure we don't add an entry more than once if (folders.Contains(location)) { return; } folders.Add(location); string name = System.IO.Path.GetFileName(location); string folder = System.IO.Path.GetDirectoryName(location); container.DeploymentItems.Add(new DeploymentFolder(folder, name)); }
public override DeploymentContainer DetectItems() { DeploymentContainer container = new DeploymentContainer("DECO Files", Key); try { string decoFolder = ExtensionLoader.DefaultExtensionsFolder; decoFolder = System.IO.Path.Combine(decoFolder, "Deco"); string decoSettingsPath = System.IO.Path.Combine(decoFolder, "Settings.xml"); if (System.IO.File.Exists(decoSettingsPath)) { container.DeploymentItems.Add(new DeploymentFile(decoSettingsPath, "DECO settings")); } string decoControlsPath = System.IO.Path.Combine(decoFolder, "Controls"); if (System.IO.Directory.Exists(decoControlsPath)) { string[] controlPaths = System.IO.Directory.GetFiles(decoControlsPath); if (controlPaths != null) { foreach (string controlPath in controlPaths) { string name = "Deco File: " + System.IO.Path.GetFileName(controlPath); container.DeploymentItems.Add(new DeploymentFile(controlPath, name)); } } } } catch { } return(container); }
public override DeploymentContainer DetectItems() { DeploymentContainer container = new DeploymentContainer("Saved Searches", Key); try { Uri uri = new Uri(m_conn.WebServiceManager.AuthService.Url); string localSettingFolder = Util.GetCurrentVaultCommonFolder(uri.Host, m_vaultName); string searchesPath = System.IO.Path.Combine(localSettingFolder, "Searches"); if (System.IO.Directory.Exists(searchesPath)) { string[] searchPaths = System.IO.Directory.GetFiles(searchesPath); foreach (string searchPath in searchPaths) { string name = "Saved Search: " + System.IO.Path.GetFileName(searchPath); container.DeploymentItems.Add(new DeploymentFile(searchPath, name)); } } } catch (Exception ex) { System.Windows.Forms.MessageBox.Show("Error: " + ex.ToString()); } return(container); }
public override DeploymentContainer DetectItems() { DeploymentContainer container = new DeploymentContainer("Plug-ins", Key); try { ExtensionLoader loader = new ExtensionLoader(); HashSet <string> folders = new HashSet <string>(); ICollection <Extension <Autodesk.Connectivity.Explorer.Extensibility.IExplorerExtension> > extensions1 = loader.FindExtensions <Autodesk.Connectivity.Explorer.Extensibility.IExplorerExtension>(); foreach (Extension ext in extensions1) { AddExtension(container, ext, folders); } ICollection <Extension <Autodesk.Connectivity.WebServices.IWebServiceExtension> > extensions2 = loader.FindExtensions <Autodesk.Connectivity.WebServices.IWebServiceExtension>(); foreach (Extension ext in extensions2) { AddExtension(container, ext, folders); } ICollection <Extension <Autodesk.Connectivity.JobProcessor.Extensibility.IJobHandler> > extensions3 = loader.FindExtensions <Autodesk.Connectivity.JobProcessor.Extensibility.IJobHandler>(); foreach (Extension ext in extensions3) { AddExtension(container, ext, folders); } } catch { } return(container); }
public override DeploymentContainer DetectItems() { DeploymentContainer container = new DeploymentContainer("Configuration Files", Key); try { Uri uri = new Uri(m_conn.WebServiceManager.AuthService.Url); string localSettingFolder = Util.GetCurrentVaultCommonFolder(uri.Host, m_vaultName); string shortcutsPath = System.IO.Path.Combine(localSettingFolder, "Objects", "Shortcuts.xml"); if (System.IO.File.Exists(shortcutsPath)) { container.DeploymentItems.Add(new DeploymentFile(shortcutsPath, "Shortcuts")); } localSettingFolder = Util.GetCurrentVaultCommonFolder2(uri.Host, m_vaultName); string workingFolder = System.IO.Path.Combine(localSettingFolder, "Objects", "WorkingFolders.xml"); if (System.IO.File.Exists(workingFolder)) { container.DeploymentItems.Add(new DeploymentFile(workingFolder, "Working Folders")); } localSettingFolder = Util.GetCurrentVaultSettingsFolder(uri.Host, m_vaultName); string filterConfigPath = System.IO.Path.Combine(localSettingFolder, "FilterConfig.xml"); if (System.IO.File.Exists(filterConfigPath)) { container.DeploymentItems.Add(new DeploymentFile(filterConfigPath, "Filter Configuration")); } string gridConfigPath = System.IO.Path.Combine(localSettingFolder, "GridConfiguration.xml"); if (System.IO.File.Exists(gridConfigPath)) { container.DeploymentItems.Add(new DeploymentFile(gridConfigPath, "Grid Configuration")); } string gridStatePath = System.IO.Path.Combine(localSettingFolder, "Objects", "GridState.xml"); if (System.IO.File.Exists(gridStatePath)) { container.DeploymentItems.Add(new DeploymentFile(gridStatePath, "Grid State")); } string viewStylesPath = System.IO.Path.Combine(localSettingFolder, "Objects", "ViewStyles.xml"); if (System.IO.File.Exists(viewStylesPath)) { container.DeploymentItems.Add(new DeploymentFile(viewStylesPath, "View Styles")); } } catch { } return(container); }
public override void Zip(ZipFile zip, DeploymentContainer container) { string zipPath; if (SubFolder == null) { zipPath = container.Key + "/" + System.IO.Path.GetFileName(Path); } else { zipPath = container.Key + "/" + SubFolder + "/" + System.IO.Path.GetFileName(Path); } zip.Add(new FileDataSource(Path), zipPath); }
/// <summary> /// Build a data model based on the selected nodes /// </summary> public DeploymentModel GetSelectedDataModel() { DeploymentModel model = new DeploymentModel(); model.Containers = new List <DeploymentContainer>(); foreach (TreeNode containerNode in m_deploymentTreeView.Nodes) { DeploymentContainer container = containerNode.Tag as DeploymentContainer; if (container == null) { continue; } DeploymentContainer newContainer = new DeploymentContainer(container.DisplayName, container.Key); foreach (TreeNode itemNode in containerNode.Nodes) { if (!itemNode.Checked) { continue; } DeploymentItem item = itemNode.Tag as DeploymentItem; if (item == null) { continue; } newContainer.DeploymentItems.Add(item); } if (newContainer.DeploymentItems.Any()) { model.Containers.Add(newContainer); } } return(model); }
private void ZipFolder(ZipFile zip, DeploymentContainer container, string currentPath) { string [] files = Directory.GetFiles(currentPath); string folderName = System.IO.Path.GetFileName(Path); if (files != null) { foreach (string file in files) { string subPath = System.IO.Path.GetDirectoryName(file); subPath = subPath.Remove(0, Path.Length); subPath = subPath.Replace('\\', '/'); subPath = subPath.TrimStart('/'.ToSingleArray()); string zipPath; if (subPath.Length > 0) { zipPath = container.Key + "/" + folderName + "/" + subPath + "/" + System.IO.Path.GetFileName(file); } else { zipPath = container.Key + "/" + folderName + "/" + System.IO.Path.GetFileName(file); } zip.Add(new FileDataSource(file), zipPath); } } string[] folders = Directory.GetDirectories(currentPath); if (folders != null) { foreach (string folder in folders) { ZipFolder(zip, container, folder); } } }
private void InitTree(string vaultName) { MasterController mc = new MasterController(m_conn, vaultName); foreach (DeploymentContainerController controller in mc.ContainerControllers) { DeploymentContainer container = controller.DetectItems(); DeploymentContainer selectedContainer = m_deploymentModel.Containers.FirstOrDefault( n => n.Key == container.Key); if (selectedContainer == null) { selectedContainer = new DeploymentContainer() { DeploymentItems = new List <DeploymentItem>() } } ; if (container.DeploymentItems.Any()) { TreeNode node = m_deploymentTreeView.Nodes.Add(container.DisplayName); node.Tag = container; foreach (DeploymentItem item in container.DeploymentItems) { TreeNode subNode = node.Nodes.Add(item.DisplayName); subNode.Tag = item; if (selectedContainer.DeploymentItems.Any(n => n.DisplayName == item.DisplayName)) { subNode.Checked = true; node.Checked = true; } } } } }
public override DeploymentContainer DetectItems() { DeploymentContainer container = new DeploymentContainer("Data Standard Customizations", Key); try { string dsFolder = ExtensionLoader.DefaultExtensionsFolder; dsFolder = System.IO.Path.Combine(dsFolder, "DataStandard"); string[] folders = System.IO.Directory.GetDirectories(dsFolder); Regex regex1 = new Regex(@"^\w\w-\w\w$"); Regex regex2 = new Regex(@"^\w\w$"); foreach (string folder in folders) { string folderName = System.IO.Path.GetFileName(folder); if (folderName.Equals("Vault", StringComparison.InvariantCultureIgnoreCase)) { container.DeploymentItems.Add(new DeploymentFolder(folder, "Vault")); } else if (folderName.Equals("CAD", StringComparison.InvariantCultureIgnoreCase)) { container.DeploymentItems.Add(new DeploymentFolder(folder, "CAD")); } else if (regex1.IsMatch(folderName) || regex2.IsMatch(folderName)) { container.DeploymentItems.Add(new DeploymentFolder(folder, folderName + " (localization strings)")); } } } catch { } return(container); }
public override void Zip(ZipFile zip, DeploymentContainer container) { ZipFolder(zip, container, Path); }
public abstract void Zip(ZipFile zip, DeploymentContainer container);