コード例 #1
0
        /// <summary>
        /// Get a list of persistent Objects
        /// </summary>
        /// <param name="type"></param>
        /// <param name="folder"></param>
        /// <param name="closeDate"></param>
        /// <returns>List</returns>
        public List <PersistentObject> CloseFolderAndStartRetention(RecordType type, Folder folder, DateTime closeDate)
        {
            FeedGetOptions opts = new FeedGetOptions {
                Inline = true, Links = true
            };

            Folder recordFolder = GetFolderByPath("/SystemA File Plan/INC/" + type.ToString());

            string[] folderIds = folder.GetRepeatingValuesAsString("i_folder_id", ",").Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
            if (!folderIds.Contains(recordFolder.GetPropertyValue("r_object_id").ToString()))
            {
                Folder     linkFolder  = recordFolder.CreateHrefObject <Folder>();
                FolderLink folderLink2 = folder.LinkToFolder(linkFolder, null);
            }

            Feed <PersistentObject> feed = UpdateCloseDate(folder.GetPropertyValue("r_object_id").ToString(), closeDate);

            return(feed != null?ObjectUtil.getFeedAsList(feed, true) : null);
        }
コード例 #2
0
        /// <summary>
        /// Move a document from origin location to destination location
        /// </summary>
        /// <param name="doc"></param>
        /// <param name="origin"></param>
        /// <param name="destination"></param>
        /// <returns>Bool</returns>
        public bool MoveDocument(Document doc, Folder origin, Folder destination)
        {
            bool ret = true;

            try
            {
                Feed <FolderLink> links = doc.GetFolderLinks(new FeedGetOptions {
                    Inline = true, Links = true
                });
                FolderLink folderLink3     = links.FindInlineEntryBySummary((string)origin.GetPropertyValue("r_object_id"));
                Folder     moveTo          = destination.CreateHrefObject <Folder>();
                FolderLink movedFolderLink = folderLink3.MoveTo(moveTo, null);
                // movedFolderLink.Remove();
            }
            catch (Exception e)
            {
                Console.WriteLine("Unable to move RestDocument: " + doc.GetPropertyValue("object_name")
                                  + "from " + origin.GetPropertyValue("object_name") + " to "
                                  + destination.GetPropertyValue("object_name") + "\n" + e.StackTrace);
            }
            return(ret);
        }