コード例 #1
0
        public void writeAllInstances(String targetPath)
        {
            Boolean isHaveMetaInPackageXml = m_workflows.Count > 0;
            String  mergeDirectory;
            String  directoryMain;

            if (isHaveMetaInPackageXml)
            {
                mergeDirectory = String.Concat(targetPath, @"/", "_", MetaDirectory.getDirectory(MetaConstants.Workflow));
                directoryMain  = String.Concat(targetPath, @"/", MetaDirectory.getDirectory(MetaConstants.Workflow));


                foreach (KeyValuePair <string, Workflow> m_workflow in m_workflows)
                {
                    String directoryForObject = "";


                    String filename = String.Concat(m_workflow.Key, ".workflow");

                    if (ManageFileExists.verifyFileInDirectory(String.Concat(directoryMain, @"/", filename)))
                    {
                        directoryForObject = directoryMain;
                    }
                    else
                    {
                        directoryForObject = directoryMain;
                    }

                    ManageFileDirectory.createPackageDirectory(directoryForObject);


                    ManageXMLWorkflow.doWrite(m_workflow.Value, String.Concat(directoryForObject, @"/"), filename);
                }
            }
        }
コード例 #2
0
        public override void buildCopy(String metaname, String directoryPath, String directoryTargetFilePath)
        {
            String [] dashboard = metaname.Split("/");

            if (dashboard.Length > 0)
            {
                String folderTarget     = directoryTargetFilePath + @"/";
                String folderRepository = directoryPath + @"/";
                String path             = "";
                String pathUp           = "";

                for (int i = 0; i < dashboard.Length; i++)
                {
                    pathUp = path;
                    path   = path + @"/" + dashboard[i];

                    if (i + 1 < dashboard.Length)
                    {
                        ManageFileDirectory.createPackageDirectory(folderTarget + path);
                    }
                    ManageFileCopy.doCopy(folderRepository + pathUp, folderTarget + pathUp, dashboard[i] + "-meta.xml", true);
                    ManageFileCopy.doCopy(folderRepository + pathUp, folderTarget + pathUp, dashboard[i] + ".dashboard", true);
                }
            }
            else
            {
                ManageFileDirectory.createPackageDirectory(directoryTargetFilePath);
                ManageFileCopy.doCopy(directoryPath, directoryTargetFilePath, metaname + "-meta.xml", true);
            }
        }
コード例 #3
0
 private static void createDirectoryPathPackage(string pathDirectory)
 {
     if (ManageFileDirectory.validateDirectory(pathDirectory))
     {
         ManageFileDirectory.createPackageDirectory(pathDirectory);
     }
 }
コード例 #4
0
 public override void buildCopy(String metaname, String directoryPath, String directoryTargetFilePath)
 {
     String [] findFolderEmail = metaname.Split("/");
     ManageFileDirectory.createPackageDirectory(directoryTargetFilePath + @"/" + findFolderEmail[0]);
     ManageFileCopy.doCopy(directoryPath, directoryTargetFilePath, metaname + ".email");
     ManageFileCopy.doCopy(directoryPath, directoryTargetFilePath, metaname + ".email-meta.xml");
 }
コード例 #5
0
        public void writeAllInstances(String targetPath)
        {
            Boolean isHaveObjectInPackageXml = m_customObjects.Count > 0;
            String  mergeDirectory;
            String  directoryMain;

            if (isHaveObjectInPackageXml)
            {
                mergeDirectory = String.Concat(targetPath, @"/", "_", MetaDirectory.getDirectory(MetaConstants.CustomObject));
                directoryMain  = String.Concat(targetPath, @"/", MetaDirectory.getDirectory(MetaConstants.CustomObject));


                foreach (KeyValuePair <string, CustomObject> m_object in m_customObjects)
                {
                    String directoryForObject = "";

                    String filename = String.Concat(m_object.Key, ".object");

                    if (ManageFileExists.verifyFileInDirectory(String.Concat(mergeDirectory, @"/", filename)))
                    {
                        directoryForObject = mergeDirectory;
                    }
                    else
                    {
                        directoryForObject = mergeDirectory;
                    }

                    ManageFileDirectory.createPackageDirectory(directoryForObject);


                    ManageXMLCustomObject.doWrite(m_object.Value, String.Concat(directoryForObject, @"/"), filename);
                }
            }
        }
コード例 #6
0
        public override void buildCopy(String metaname, String directoryPath, String directoryTargetFilePath)
        {
            String [] findFolder = metaname.Split("/");
            String [] filename   = metaname.Split(".");

            // Se o item tiver extensão, p ex: .png, não acrescenta .document
            String docExtension = (filename.Length > 1) ? "" : ".document";

            ManageFileDirectory.createPackageDirectory(directoryTargetFilePath + @"/" + findFolder[0]);

            ManageFileCopy.doCopy(directoryPath, directoryTargetFilePath, metaname + docExtension);
            ManageFileCopy.doCopy(directoryPath, directoryTargetFilePath, metaname + docExtension + "-meta.xml");
        }
コード例 #7
0
        public static PackageManifest createPackageManifest(string branchName, string pathRepository)
        {
            string pathPackage = pathRepository + @"/package.xml";

            string pathtarget = Environment.CurrentDirectory + @"/package/" + branchName + @"/" + GuidService.createGuid();

            ManageFileDirectory.createPackageDirectory(pathtarget);

            return(new PackageManifest()
            {
                PackageFile = pathPackage,
                RepositorySource = pathRepository,
                DirectoryTarget = pathtarget
            });
        }
コード例 #8
0
        public static void doWrite(Config myObject)
        {
            ManageFileDirectory.createPackageDirectory(Environment.CurrentDirectory + @"/config");
            String targetPath = Environment.CurrentDirectory + @"/config/";
            String fileName   = "config.xml";

            try{
                System.Xml.Serialization.XmlSerializer writer =
                    new System.Xml.Serialization.XmlSerializer(typeof(Config));

                System.IO.FileStream file = System.IO.File.Create(targetPath + fileName);

                writer.Serialize(file, myObject);
                file.Close();
            }
            catch (Exception e)
            {
                Console.WriteLine("Could not create file:" + e.Message);
            }
        }