Exemplo n.º 1
0
        public void BuildCommand()
        {
            if (string.IsNullOrWhiteSpace(Name) || Name.Contains(" "))
            {
                throw new Exception("Name is required and must have no spaces.");
            }
            if (string.IsNullOrWhiteSpace(BuildController))
            {
                throw new Exception("Build Controller is required.");
            }
            if (string.IsNullOrWhiteSpace(CollectionURL))
            {
                throw new Exception("Collection URL is required.");
            }
            if (string.IsNullOrWhiteSpace(DropFolder) || !DropFolder.StartsWith("\\"))
            {
                throw new Exception("Drop Folder must be a UNC path beginning with \\\\.");
            }
            if (string.IsNullOrWhiteSpace(ProjectName))
            {
                throw new Exception("Project name is required.");
            }

            Script = string.Format("Add-Pipeline -Project '{0}' -Collection '{1}' -Controller '{2}' -DropFolder '{3}' -Template '{4}' -Name {5}",
                                   ProjectName, CollectionURL, BuildController, DropFolder, Template, Name);
        }
Exemplo n.º 2
0
        public override void Open()
        {
            base.Open();

            if (DropFolder.IsNotNullOrWhiteSpace() && System.IO.Directory.Exists(DropFolder))
            {
                m_Smtp =
                    new SmtpClient
                {
                    DeliveryMethod          = SmtpDeliveryMethod.SpecifiedPickupDirectory,
                    PickupDirectoryLocation = DropFolder
                };
            }
            else
            {
                m_Smtp =
                    new SmtpClient
                {
                    Host                  = this.SmtpHost,
                    Port                  = this.SmtpPort,
                    EnableSsl             = this.SmtpSSL,
                    DeliveryMethod        = SmtpDeliveryMethod.Network,
                    UseDefaultCredentials = false,
                    Credentials           = new NetworkCredential(this.CredentialsID, this.CredentialsPassword)
                };
            }
        }
Exemplo n.º 3
0
    // Create file into Photo and Movie Folder .
    public void Drop()
    {
        DropFolder  = false;
        DropFileRef = gameObject.transform.parent.transform.parent.GetComponent <DropFolder> ();



        if (DropFileRef.VideoFilter == true)
        {
            for (int i = 0; i < FileVideoname.Count; i++)
            {
                GameObject temPhoto = GameObject.Instantiate(PhotoPrfb);
                temPhoto.transform.parent        = PhotoContainer.transform;
                temPhoto.transform.localPosition = new Vector3(0, 0, 0);
                temPhoto.transform.localScale    = new Vector3(1, 1, 1);
                temPhoto.transform.GetChild(2).GetComponent <RectTransform>().sizeDelta = new Vector2(50, 50);
                Debug.Log("Video");
                temPhoto.transform.GetChild(1).gameObject.SetActive(true);
                temPhoto.transform.GetChild(0).GetComponent <InputField> ().text = FileVideoname [i];
                temPhoto.transform.GetChild(0).GetComponent <InputField> ().textComponent.fontSize = 16;
                temPhoto.transform.GetChild(0).GetComponent <RectTransform> ().localPosition       = new Vector3(0, -35, 0);
                temPhoto.transform.GetChild(0).GetComponent <RectTransform> ().sizeDelta           = new Vector2(200, 40);
                temPhoto.transform.GetComponent <SelectFiles> ().inPhotoViewer = true;
            }
        }
        if (DropFileRef.PhotoesFilter == true)
        {
            for (int i = 0; i < photoes.Count; i++)
            {
                GameObject temPhoto = GameObject.Instantiate(PhotoPrfb);
                temPhoto.transform.parent        = PhotoContainer.transform;
                temPhoto.transform.localPosition = new Vector3(0, 0, 0);
                temPhoto.transform.localScale    = new Vector3(1, 1, 1);
                temPhoto.transform.GetChild(2).GetComponent <RectTransform>().sizeDelta = new Vector2(50, 50);
                Debug.Log("Photos");
                temPhoto.GetComponent <RawImage> ().texture = photoes [i];
                temPhoto.transform.GetChild(0).GetComponent <InputField> ().text = Filename [i];

                temPhoto.transform.GetChild(0).GetComponent <InputField> ().textComponent.fontSize = 16;
                temPhoto.transform.GetChild(0).GetComponent <RectTransform> ().localPosition       = new Vector3(0, -35, 0);
                temPhoto.transform.GetChild(0).GetComponent <RectTransform> ().sizeDelta           = new Vector2(200, 40);
                temPhoto.transform.GetComponent <SelectFiles> ().inPhotoViewer      = true;
                temPhoto.transform.GetComponent <SelectFiles> ().scene.ImageURLPath = ImageUrlPath [i];
            }
            ImageUrlPath.Clear();
        }

        DropFolder = true;
    }
Exemplo n.º 4
0
        // If your activity returns a value, derive from CodeActivity<TResult>
        // and return the value from the Execute method.
        protected override void Execute(CodeActivityContext context)
        {
            var dropFolder               = DropFolder.Get(context);
            var sourcesFolder            = SourcesFolder.Get(context);
            var binariesFolder           = BinariesFolder.Get(context);
            var powerShellScriptFilepath = PowerShellScriptFilepath.Get(context);
            var nuGetPrePackageFolder    = NuGetPrePackageFolder.Get(context);

            context.WriteBuildMessage(string.Format("powerShellScriptFilepath: {0}", powerShellScriptFilepath), BuildMessageImportance.High);
            context.WriteBuildMessage(string.Format("dropFolder: {0}", dropFolder), BuildMessageImportance.High);
            context.WriteBuildMessage(string.Format("binariesFolder: {0}", binariesFolder), BuildMessageImportance.High);
            context.WriteBuildMessage(string.Format("sourcesFolder: {0}", sourcesFolder), BuildMessageImportance.High);

            // Call the PowerShell script
            var result = ExecutePowerShellScript(powerShellScriptFilepath, dropFolder, binariesFolder, sourcesFolder, nuGetPrePackageFolder);

            // Return the value back to the workflow
            context.SetValue(Result, result);
        }
Exemplo n.º 5
0
        protected override void DoStart()
        {
            m_Smtp = new SmtpClient();

            if (DropFolder.IsNotNullOrWhiteSpace() && System.IO.Directory.Exists(DropFolder))
            {
                m_Smtp.DeliveryMethod          = SmtpDeliveryMethod.SpecifiedPickupDirectory;
                m_Smtp.PickupDirectoryLocation = DropFolder;
            }
            else
            {
                if (SmtpHost.IsNullOrWhiteSpace())
                {
                    throw new WebException(StringConsts.MAILER_SINK_SMTP_IS_NOT_CONFIGURED_ERROR + "SmtpHost==null|empty|0");
                }

                m_Smtp.Host                  = this.SmtpHost;
                m_Smtp.Port                  = this.SmtpPort;
                m_Smtp.EnableSsl             = this.SmtpSSL;
                m_Smtp.DeliveryMethod        = SmtpDeliveryMethod.Network;
                m_Smtp.UseDefaultCredentials = false;
                m_Smtp.Credentials           = new NetworkCredential(this.CredentialsID, this.CredentialsPassword);
            }
        }
Exemplo n.º 6
0
 public static DropFolderUpdateRequestBuilder Update(int dropFolderId, DropFolder dropFolder)
 {
     return(new DropFolderUpdateRequestBuilder(dropFolderId, dropFolder));
 }
Exemplo n.º 7
0
 public static DropFolderAddRequestBuilder Add(DropFolder dropFolder)
 {
     return(new DropFolderAddRequestBuilder(dropFolder));
 }
Exemplo n.º 8
0
        public static void Run()
        {
            log.Info("Begin ACS4 ingestion process...");


            int             numFilesDropped   = 0;
            int             numFilesIngested  = 0;
            ACS4ApiResponse builtInCatalogRaw = null;
            Dictionary <string, ACS4CatalogResourceMapItem> mapBuiltInCatalog = null;
            IEnumerable <ACS4Catalog> builtInCatalog = null;
            ACS4ApiResponse           eCtbCatalogRaw = null;
            Dictionary <string, ACS4CatalogResourceMapItem> eCtbCatalogMap = null;
            IEnumerable <ACS4Catalog> eCtbCatalog  = null;
            List <HCPFileInfo>        fetchedFiles = null;
            List <List <HCPACS4.FileIO.HCPFileInfo> > allDroppedFiles = new List <List <HCPACS4.FileIO.HCPFileInfo> >();


            var dbRunLog = new ACS4Ingest.RunLog();

            dbRunLog.StartTimeUtc = System.DateTime.UtcNow;
            dbRunLog.BatchSize    = HCPACS4.AdobeConfig.BATCH_SIZE;
            dbRunLog.Insert();
            log.Info(String.Format("RunLogId {0}", dbRunLog.Id));

            // check for any files on drop folders
            var dropFolders = ACS4Ingest.ConfigFtpDropFolder.Query("SELECT * FROM ConfigFtpDropFolder WHERE Enabled = 1");

            foreach (var dropFolder in dropFolders)
            {
                try
                {
                    log.Info(String.Format("List dropped epubs for {0} from {1}{2}", dropFolder.Alias, dropFolder.FtpHost, dropFolder.FtpRemotePath));

                    var ftpDrop      = new DropFolder(dropFolder.Id, dropFolder.Alias, dropFolder.FtpHost, dropFolder.FtpUser, dropFolder.FtpPassword, dropFolder.FtpRemotePath, dropFolder.Enabled);
                    var droppedFiles = ftpDrop.ListFiles(".epub");
                    var dbFileStats  = new ACS4Ingest.DropFolderStat();
                    dbFileStats.RunLogId     = dbRunLog.Id;
                    dbFileStats.DropFolderId = dropFolder.Id;
                    dbFileStats.EpubCount    = droppedFiles.Count;
                    dbFileStats.Insert();

                    numFilesDropped += droppedFiles.Count;
                    log.Info(String.Format("{0} epubs found at {1}{2}", droppedFiles.Count, dropFolder.FtpHost, dropFolder.FtpRemotePath));
                }
                catch (Exception ex)
                {
                    log.Error(String.Format("Exception listing files for {0} from {1}{2}", dropFolder.Alias, dropFolder.FtpHost, dropFolder.FtpRemotePath), ex);
                }
            }
            dbRunLog.NumFilesDropped = numFilesDropped;
            dbRunLog.Update();

            if (numFilesDropped == 0)
            {
                log.Info(String.Format("No epubs to process, exiting job."));
                return;
            }
            //TODO: Currently batch size is applied to each folder individually
            //      Should apply batch size to the total # of files from all drops


            /** Get ACS4 catalogs **/
            try
            {
                // Get ACS4 Built In Distributor catalog to know if an asset already exists in ACS4 system
                log.Info(String.Format("Fetching ACS4 Built In Distributor catalog..."));
                builtInCatalogRaw = eCTB.FetchCatalog(HCPACS4.AdobeConfig.ACS_ECTB_BUILTIN_DISTRIBUTORID, HCPACS4.AdobeConfig.ACS_ECTB_BUILTIN_SECRET_KEY);
                if (!builtInCatalogRaw.IsError())
                {
                    builtInCatalog    = HCPUtils.ParseACS4Catalog(builtInCatalogRaw.ResponseBody);
                    mapBuiltInCatalog = HCPUtils.MapIsbnToACS4Resource(builtInCatalog);
                    log.Info(String.Format("ACS4 Built In Distributor fetched successfully with {0} records", builtInCatalog.Count()));
                }
                else
                {
                    log.Error(String.Format("Error Fetching ACS4 Built In Distributor : {0} - {1}", builtInCatalogRaw.ErrorCode, builtInCatalogRaw.ErrorMessage));
                }

                // Get eCTB catalog - to know if epub has already been assigned distribution rights within eCTB distributor
                log.Info(String.Format("Fetching eCtb Distributor catalog..."));
                eCtbCatalogRaw = eCTB.FetchCatalog(HCPACS4.AdobeConfig.ACS_ECTB_DISTRIBUTORID, HCPACS4.AdobeConfig.ACS_ECTB_SECRET_KEY);
                if (!eCtbCatalogRaw.IsError())
                {
                    eCtbCatalog    = HCPUtils.ParseACS4Catalog(eCtbCatalogRaw.ResponseBody);
                    eCtbCatalogMap = HCPUtils.MapIsbnToACS4Resource(eCtbCatalog);
                    log.Info(String.Format("eCtb Distributor fetched successfully with {0} records", eCtbCatalog.Count()));
                }
                else
                {
                    log.Error(String.Format("Error Fetching eCtb Distributor : {0} - {1}", eCtbCatalogRaw.ErrorCode, eCtbCatalogRaw.ErrorMessage));
                }
                dbRunLog.InitialCountBuiltInCatalog = builtInCatalog.Count();
                dbRunLog.InitialCounteCtbCatalog    = eCtbCatalog.Count();
                dbRunLog.Update();
            }
            catch (Exception ex)
            {
                log.Error("Exception fetching ACS4 catalog(s)", ex);
            }

            /** Get the files and begin processing **/
            if (!builtInCatalogRaw.IsError() && !eCtbCatalogRaw.IsError() && numFilesDropped > 0)
            {
                // Download the files from FTP
                //List<HCPFileInfo> fetchedFiles = new List<HCPFileInfo>();
                fetchedFiles = new List <HCPFileInfo>();
                foreach (var dropFolder in dropFolders)
                {
                    log.Info(String.Format("Downloading files from {0}{1} ...", dropFolder.FtpHost, dropFolder.FtpRemotePath));
                    string savePath = String.Format(@"{0}\{1}", HCPACS4.AdobeConfig.LOCAL_STAGING_PATH.TrimEnd('\\'), dropFolder.Alias);
                    var    ftpDrop  = new DropFolder(dropFolder.Id, dropFolder.Alias, dropFolder.FtpHost, dropFolder.FtpUser, dropFolder.FtpPassword, dropFolder.FtpRemotePath, dropFolder.Enabled);
                    var    files    = ftpDrop.DownloadFiles(".epub", savePath, HCPACS4.AdobeConfig.BATCH_SIZE, HCPACS4.AdobeConfig.DELETE_FROM_FTP);
                    log.Info(String.Format("Downloaded {0} files from {1}{2} ...", files.Count, dropFolder.FtpHost, dropFolder.FtpRemotePath));
                    foreach (var f in files)
                    {
                        f.DropFolderAlias = dropFolder.Alias;
                        f.DropFolderId    = dropFolder.Id;
                    }
                    fetchedFiles.AddRange(files);
                }

                // load / analyze / package epub files
                foreach (var f in fetchedFiles)
                {
                    bool existsBuiltInCatalog                 = false;
                    bool existsEctbDistributionRights         = false;
                    bool galleyAttemptingToOverwriteNonGalley = false;

                    Epub epub  = new Epub(f.FullName, f.DropFolderAlias);
                    var  dbLog = new ACS4Ingest.IngestionLog();
                    dbLog.RunLogId         = dbRunLog.Id;
                    dbLog.EpubFileName     = f.FileName;
                    dbLog.Isbn             = epub.Isbn;
                    dbLog.FileSize         = epub.FileSizeBytes;
                    dbLog.ArchivePath      = f.FileArchivePath;
                    dbLog.DropFolderId     = f.DropFolderId;
                    dbLog.IsbnFromFileName = epub.IsbnFromFileName;
                    dbLog.IsbnFromOpf      = epub.IsbnFromOpf;
                    dbLog.OpfIdentifier    = epub.OpfIdentifier;
                    dbLog.IsCorrupt        = epub.CorruptFile;
                    dbLog.EnteredDateUtc   = System.DateTime.UtcNow;
                    dbLog.Insert();


                    /** PreFlight Checks **/

                    /** TODO:
                     *      Needs some refactoring:
                     *             move to function
                     *             log to IngestionErrors table accomodate 1 to many to multiple to table
                     **/
                    if (epub.CorruptFile)
                    {
                        log.Info(String.Format("FailedPreFlightCheck {0} : {1}", "CorruptFile", epub.FullName));
                        dbLog.Ingested        = false;
                        dbLog.IsValidPreCheck = false;
                        dbLog.PreCheckError   = "CorruptFile";
                        dbLog.Update();
                        continue;
                    }

                    if (epub.IsbnFromFileName != epub.IsbnFromOpf)
                    {
                        log.Info(String.Format("FailedPreFlightCheck {0} : {1}", "IsbnMismatchFileNameOpf", epub.FullName));
                        dbLog.IsbnFromOpf     = epub.IsbnFromOpf;
                        dbLog.Ingested        = false;
                        dbLog.IsValidPreCheck = false;
                        dbLog.PreCheckError   = "IsbnMismatchFileNameOpf";
                        dbLog.Update();
                        continue;
                    }

                    if (epub.InvalidDocType)
                    {
                        log.Info(String.Format("FailedPreFlightCheck {0} : {1}", "InvalidDocType", epub.FullName));
                        dbLog.Ingested        = false;
                        dbLog.IsValidPreCheck = false;
                        dbLog.PreCheckError   = "InvalidDocType";
                        dbLog.Update();
                        continue;
                    }

                    // TODO: Zero in on this size restriction - 50 MB for now
                    if (epub.FileSizeBytes > HCPACS4.AdobeConfig.MAX_FILE_SIZE)
                    {
                        log.Info(String.Format("FailedPreFlightCheck {0} : {1}", "FileTooLarge", epub.FullName));
                        dbLog.Ingested        = false;
                        dbLog.IsValidPreCheck = false;
                        dbLog.PreCheckError   = "FileTooLarge";
                        dbLog.Update();
                        continue;
                    }



                    // lookup to see if isbn exists in Built In Catalog
                    // ACS4 does not work on isbn13, it will happily ingest the same isbn several times
                    ACS4CatalogResourceMapItem mappedBuiltInCatalog;
                    //TODO: using Isbn //if (mapBuiltInCatalog.TryGetValue(epub.IsbnFromOpf, out mappedBuiltInCatalog))
                    if (mapBuiltInCatalog.TryGetValue(epub.Isbn, out mappedBuiltInCatalog))
                    {
                        epub.ACS4Guid        = mappedBuiltInCatalog.Guid;
                        existsBuiltInCatalog = true;

                        if (epub.IsGalley && !mappedBuiltInCatalog.IsGalley)
                        {
                            galleyAttemptingToOverwriteNonGalley = true;
                        }
                    }

                    // See if book is already assigned to eCTB Distributor
                    if (eCtbCatalog.Any(i => i.resource == epub.ACS4Guid))
                    {
                        existsEctbDistributionRights = true;
                    }

                    dbLog.IsValidPreCheck = true;
                    dbLog.IngestType      = existsBuiltInCatalog ? "update" : "add";



                    /* Abort ingest if this file is a galley and existing is a non Galley */
                    if (galleyAttemptingToOverwriteNonGalley)
                    {
                        log.Info(String.Format("IngestAborted {0} : {1}", "GalleyCannotOverwriteNonGalley", epub.FullName));
                        dbLog.Ingested        = false;
                        dbLog.IsValidPreCheck = false;
                        dbLog.PreCheckError   = "GalleyCannotOverwriteNonGalley";
                        dbLog.Update();
                        continue;
                    }



                    PackageRequest         package         = new PackageRequest(epub);
                    PackageRequestResponse packageResponse = package.SendRequest();

                    log.Info(String.Format("{0} : {1} : {2}", (bool)packageResponse.Ingested ? "INGESTED" : "NOT INGESTED", epub.FullName, packageResponse.Ingested ? null : String.Format("{0} : {1}", packageResponse.ErrorCode, packageResponse.ErrorMessage)));

                    // assign to eCTB distributor if does not already exists
                    ACS4ApiResponse rightsReqResponse = null;
                    if ((bool)packageResponse.Ingested)
                    {
                        numFilesIngested++;
                        if (!existsEctbDistributionRights)
                        {
                            // assign the book to the eCTB distributor
                            ManageDistributionRights rightsReq = new ManageDistributionRights(HCPACS4.AdobeConfig.ACS_ECTB_DISTRIBUTORID, packageResponse.ACS4Guid);
                            rightsReqResponse = rightsReq.AssignRights();
                            rightsReq         = null;
                        }
                    }



                    dbLog.PackageHttpResponseCode = (int)packageResponse.HttpStatusCode;
                    dbLog.Ingested         = (bool)packageResponse.Ingested;
                    dbLog.ACS4Guid         = packageResponse.ACS4Guid;
                    dbLog.FileSize         = epub.FileSizeBytes;
                    dbLog.PackageResponse  = packageResponse.ResponseBody;
                    dbLog.PackageErrorCode = packageResponse.IsError() ? packageResponse.ErrorCode : null;
                    //TODO: Ensure we truncate to 256 dbLog.PackageErrorMessage = packageResponse.IsError() ? String.IsNullOrEmpty(packageResponse.ErrorMessage) ? null : packageResponse.ErrorMessage.Substring(0, 256) : null;
                    dbLog.PackageErrorMessage = packageResponse.IsError() ? packageResponse.ErrorMessage : null;
                    if (rightsReqResponse != null)
                    {
                        dbLog.DistributionRightsAssigned  = !rightsReqResponse.IsError();
                        dbLog.DistributionRightsErrorCode = rightsReqResponse.IsError() ? rightsReqResponse.ErrorCode : null;
                        //TODO: Ensure we truncate to 256 dbLog.DistributionRightsErrorMessage = rightsReqResponse.IsError() ? String.IsNullOrEmpty(rightsReqResponse.ErrorMessage) ? rightsReqResponse.ErrorMessage.Substring(0, 256) : null : null;
                        dbLog.DistributionRightsErrorMessage = rightsReqResponse.IsError() ? rightsReqResponse.ErrorMessage : null;
                    }
                    dbLog.EnteredDateUtc = System.DateTime.UtcNow;
                    //dbLog.Insert();
                    dbLog.Update();

                    dbLog             = null;
                    package           = null;
                    packageResponse   = null;
                    rightsReqResponse = null;
                }
            }
            else
            {
                log.Info(String.Format("Nothing to do, exiting job."));
            }


            dbRunLog.NumFilesIngested = numFilesIngested;
            dbRunLog.EndTimeUtc       = System.DateTime.UtcNow;
            dbRunLog.Update();

            log.Info(String.Format("Total files ingested {0}", numFilesIngested));
            log.Info("End ACS4 ingestion process");

            Cleanup(fetchedFiles);
        }
Exemplo n.º 9
0
 // Use this for initialization
 void Start()
 {
     DropFolder = gameObject.transform.parent.transform.parent.transform.parent.transform.parent.gameObject.GetComponent <DropFolder> ();
 }
Exemplo n.º 10
0
 // Use this for initialization
 void Start()
 {
     transform.localPosition = new Vector3(transform.localPosition.x, transform.localPosition.y, 0);
     DropFileRef             = transform.parent.transform.parent.gameObject.GetComponent <DropFolder>();
     FootageDragAndDrop      = FindObjectOfType <FootageDragAndDrop>().gameObject;
 }
Exemplo n.º 11
0
    // Update is called once per frame
    void Update()
    {
        if (Arrow == null)
        {
            //	Arrow = gameObject.transform.GetChild (0).transform.GetChild (1).gameObject;
        }

        FindContantRowSize();

        // We are creater tree view . of Imported 360 Image files
        if (ImportPhotoesFolder)
        {
            if (PhotoFileCount != FootageDragAndDrop.GetComponent <FootageDragAndDrop>().PhotoFiles.Count)
            {
                for (int i = 0; i < FootageDragAndDrop.GetComponent <FootageDragAndDrop>().PhotoFiles.Count; i++)
                {
                    GameObject temPhoto = GameObject.Instantiate(PhotoPrfb);
                    temPhoto.transform.GetComponent <SelectFiles>().Image = true;
                    temPhoto.transform.parent                  = PhotoContainer.transform;
                    temPhoto.transform.localPosition           = new Vector3(0, 0, 0);
                    temPhoto.transform.localScale              = new Vector3(1, 1, 1);
                    temPhoto.GetComponent <RawImage>().texture = FootageDragAndDrop.GetComponent <FootageDragAndDrop>().PhotoFiles[i].GetComponent <RawImage>().mainTexture;
                    temPhoto.transform.GetChild(0).GetComponent <InputField>().text = FootageDragAndDrop.GetComponent <FootageDragAndDrop>().PhotoFiles[i].transform.GetChild(0).GetComponent <InputField>().text;
                    temPhoto.transform.GetChild(0).GetComponent <InputField>().textComponent.fontSize = 16;
                    temPhoto.transform.GetChild(0).GetComponent <RectTransform>().localPosition       = new Vector3(0, -35, 0);
                    temPhoto.transform.GetComponent <SelectFiles>().inPhotoViewer           = false;
                    temPhoto.transform.GetComponent <SelectFiles>().scene.ImageURLPath      = FootageDragAndDrop.GetComponent <FootageDragAndDrop>().PhotoFiles[i].GetComponent <SelectFiles>().scene.ImageURLPath;
                    temPhoto.transform.GetChild(0).GetComponent <RectTransform>().sizeDelta = new Vector2(200, 40);
                    temPhoto.transform.GetChild(2).GetComponent <RectTransform>().sizeDelta = new Vector2(50, 50);
                    Debug.Log(temPhoto.transform.GetChild(2).gameObject.name + " SelectionBaseAttribute Filename ");
                    temp = i;
                }
                PhotoFileCount = FootageDragAndDrop.GetComponent <FootageDragAndDrop>().PhotoFiles.Count;
                Debug.Log("Calling ");

                if (PhotoFileCount == temp)
                {
                    Arrow.GetComponent <ArrowViewControl>().OnArrow();
                    temp = 0;
                }
            }
            else
            {
                FootageDragAndDrop.GetComponent <FootageDragAndDrop>().PhotoFiles.Clear();
            }
        }

        // We are creater tree view . of Imported Moviw files
        if (ImportMovieFolder)
        {
            Debug.Log("Import Movie Folder !!!!!");
            if (MovieFileCount != FootageDragAndDrop.GetComponent <FootageDragAndDrop>().MovieFiles.Count)
            {
                Debug.Log(FootageDragAndDrop.GetComponent <FootageDragAndDrop>().MovieFiles.Count);

                for (int i = 0; i < FootageDragAndDrop.GetComponent <FootageDragAndDrop>().MovieFiles.Count; i++)
                {
                    GameObject temPhoto = GameObject.Instantiate(PhotoPrfb);
                    temPhoto.transform.parent        = PhotoContainer.transform;
                    temPhoto.transform.localPosition = new Vector3(0, 0, 0);
                    temPhoto.transform.localScale    = new Vector3(1, 1, 1);
                    temPhoto.transform.GetComponent <SelectFiles>().inPhotoViewer = true;
                    temPhoto.transform.GetComponent <SelectFiles>().Video         = true;
                    temPhoto.transform.GetComponent <SelectFiles>().MediaFile     = FootageDragAndDrop.GetComponent <FootageDragAndDrop>().MovieFiles[i].GetComponent <SelectFiles>().MediaFile;
                    //temPhoto.GetComponent<RawImage> ().texture = FootageDragAndDrop.GetComponent<FootageDragAndDrop> ().MovieFiles [i].GetComponent<RawImage> ().mainTexture;
                    temPhoto.transform.GetChild(0).GetComponent <InputField>().text = FootageDragAndDrop.GetComponent <FootageDragAndDrop>().MovieFiles[i].transform.GetChild(0).GetComponent <InputField>().text;
                    temPhoto.transform.GetChild(0).GetComponent <InputField>().textComponent.fontSize = 16;
                    temPhoto.transform.GetChild(0).GetComponent <RectTransform>().localPosition       = new Vector3(0, -35, 0);
                    temPhoto.transform.GetChild(0).GetComponent <RectTransform>().sizeDelta           = new Vector2(200, 40);

                    temPhoto.transform.GetChild(2).GetComponent <RectTransform>().sizeDelta = new Vector2(50, 50);
                    temPhoto.transform.GetChild(1).gameObject.SetActive(true);
                    FootageDragAndDrop.GetComponent <FootageDragAndDrop>().MovieFiles.RemoveAt(i);
                }
                MovieFileCount = FootageDragAndDrop.GetComponent <FootageDragAndDrop>().MovieFiles.Count;
                DropFolder TemDropFolder = Arrow.GetComponent <ArrowViewControl>().DropFolder;
                TemDropFolder.setScroll = true;
            }
            else
            {
                FootageDragAndDrop.GetComponent <FootageDragAndDrop>().MovieFiles.Clear();
                // Arrow.GetComponent<ArrowViewControl>().OnArrow();
            }
        }


        // We are creater tree view . of Imported Unity files
        if (ImportUnityFolder)
        {
            Debug.Log("Import Unity Folder");
            if (UnityFilesCount != FootageDragAndDrop.GetComponent <FootageDragAndDrop> ().UnityFiles.Count)
            {
                UnityFilesCount = FootageDragAndDrop.GetComponent <FootageDragAndDrop> ().UnityFiles.Count;

                for (int i = 0; i < FootageDragAndDrop.GetComponent <FootageDragAndDrop> ().UnityFiles.Count; i++)
                {
                    GameObject temPhoto = GameObject.Instantiate(PhotoPrfb);
                    temPhoto.transform.GetComponent <SelectFiles> ().UnityObject = true;
                    temPhoto.transform.parent                               = PhotoContainer.transform;
                    temPhoto.transform.localPosition                        = new Vector3(0, 0, 0);
                    temPhoto.transform.localScale                           = new Vector3(1, 1, 1);
                    temPhoto.GetComponent <RawImage> ().texture             = FootageDragAndDrop.GetComponent <FootageDragAndDrop> ().UnityFiles [i].GetComponent <Image> ().mainTexture;
                    temPhoto.GetComponent <SelectFiles> ().UnityAssetBundle = FootageDragAndDrop.GetComponent <FootageDragAndDrop> ().UnityFiles [i];
                    temPhoto.GetComponent <SelectFiles>().UnityAssetPath    = FootageDragAndDrop.GetComponent <FootageDragAndDrop>().UnityAssetPath[i];


                    temPhoto.transform.GetChild(0).GetComponent <InputField> ().text = FootageDragAndDrop.GetComponent <FootageDragAndDrop> ().UnityFiles [i].transform.GetChild(0).GetComponent <Text> ().text;
                    temPhoto.transform.GetChild(0).GetComponent <InputField> ().textComponent.fontSize = 16;
                    temPhoto.transform.GetChild(0).GetComponent <RectTransform> ().localPosition       = new Vector3(0, -35, 0);
                    temPhoto.transform.GetChild(0).GetComponent <RectTransform> ().sizeDelta           = new Vector2(200, 40);

                    temPhoto.transform.GetChild(2).GetComponent <RectTransform> ().sizeDelta = new Vector2(50, 50);
                }
                Debug.Log("Models Filees " + FootageDragAndDrop.GetComponent <FootageDragAndDrop> ().ModelsFiles.Count);
            }

            if (ModelFilesCount != FootageDragAndDrop.GetComponent <FootageDragAndDrop>().ModelsFiles.Count)
            {
                for (int j = 0; j < PhotoContainer.transform.childCount; j++)
                {
                    GameObject.Destroy(PhotoContainer.transform.GetChild(j).gameObject);
                    UnityFilesCount = 0;
                }
                Debug.Log("Models Filees " + FootageDragAndDrop.GetComponent <FootageDragAndDrop>().ModelsFiles.Count);

                for (int i = 0; i < FootageDragAndDrop.GetComponent <FootageDragAndDrop>().ModelsFiles.Count; i++)
                {
                    GameObject temPhoto = GameObject.Instantiate(PhotoPrfb);
                    temPhoto.transform.parent = PhotoContainer.transform;
                    temPhoto.transform.GetComponent <SelectFiles>().UnityObject = true;
                    temPhoto.transform.localPosition = new Vector3(0, 0, 0);
                    temPhoto.transform.localScale    = new Vector3(1, 1, 1);
                    Debug.Log("****" + i + "*****" + FootageDragAndDrop.GetComponent <FootageDragAndDrop>().ModelsFilesImage.Count);
                    temPhoto.GetComponent <RawImage>().texture             = FootageDragAndDrop.GetComponent <FootageDragAndDrop>().ModelsFilesImage[i];
                    temPhoto.GetComponent <SelectFiles>().UnityAssetBundle = FootageDragAndDrop.GetComponent <FootageDragAndDrop>().ModelsFiles[i];

                    temPhoto.transform.GetChild(0).GetComponent <InputField>().text = FootageDragAndDrop.GetComponent <FootageDragAndDrop>().ModelsFiles[i].gameObject.name;
                    temPhoto.GetComponent <SelectFiles>().UnityAssetPath            = FootageDragAndDrop.GetComponent <FootageDragAndDrop>().UnityAssetPath[i];
                    temPhoto.transform.GetChild(0).GetComponent <InputField>().textComponent.fontSize = 16;
                    temPhoto.transform.GetChild(0).GetComponent <RectTransform>().localPosition       = new Vector3(0, -35, 0);
                    temPhoto.transform.GetChild(0).GetComponent <RectTransform>().sizeDelta           = new Vector2(200, 40);

                    temPhoto.transform.GetChild(2).GetComponent <RectTransform>().sizeDelta = new Vector2(50, 50);
                }
                ModelFilesCount = FootageDragAndDrop.GetComponent <FootageDragAndDrop>().ModelsFiles.Count;
            }
            else
            {
                FootageDragAndDrop.GetComponent <FootageDragAndDrop>().UnityFiles.Clear();
                //   Arrow.GetComponent<ArrowViewControl>().OnArrow();
            }
        }

        // Creating Folder from Drag and drop and Extend the tree view.
        if (DropFolder)
        {
            DropFolder = false;
            //	gameObject.transform.localPosition = new Vector3 (-160, 50, 0);
        }
        if (Extend)
        {
            if (Done == false)
            {
                transform.GetComponent <RectTransform> ().sizeDelta = new Vector2(380, 350);
                Done = true;
            }
        }
        else if (Extend == false)

        {
            if (Done == true)
            {
                transform.GetComponent <RectTransform> ().sizeDelta = new Vector2(0, 0);
                Done = false;
            }
        }
    }