コード例 #1
0
 /// <summary>
 /// This method return all files in a collection.
 /// </summary>
 /// <param name="parentID">string</param>
 /// <returns>ContentObjectList</returns>
 public static ContentObjectList GetFilesInCollection(string parentID)
 {
     ContentObjectList contentObjList = new ContentObjectList();
     ResourceIndexClient resIndClient = new ResourceIndexClient();
     contentObjList = resIndClient.getSetChildrenObjects(parentID, false);
     return contentObjList;
 }
コード例 #2
0
        /// <summary>
        /// This method return files in an Object
        /// </summary>
        /// <param name="ObjectPID">string</param>
        /// <returns></returns>
        public ContentObjectList GetFiles(string ObjectPID)
        {
            string _parentId = ObjectPID;

            ResourceIndexClient ObjRIC = new ResourceIndexClient();
            ContentObjectList ObjCOL = new ContentObjectList();
            ObjCOL = ObjRIC.getSetChildrenObjects(_parentId,false);
            return ObjCOL;
        }
コード例 #3
0
        /// <summary>
        /// This method returns repository data in XML format.
        /// </summary>
        /// <param name="ObjectPID">string</param>
        /// <returns>XMLDocument</returns>
        public XmlDocument GetData(string ObjectPID)
        {
            string _parentId = ObjectPID;

            ResourceIndexClient ObjRIC = new ResourceIndexClient();
            ContentObjectList ObjCOL = new ContentObjectList();
            ObjCOL = ObjRIC.getSetChildrenObjects(_parentId, true);

            //Converting data to XML format
            XmlSerializer ObjXmlSerializer = new XmlSerializer(ObjCOL.GetType());

            StringWriter ObjStringWriter = new StringWriter();
            ObjXmlSerializer.Serialize(ObjStringWriter, ObjCOL);

            XmlDocument ObjXmldocument = new XmlDocument();
            ObjXmldocument.LoadXml(ObjStringWriter.ToString());
            return ObjXmldocument;
        }
コード例 #4
0
        /// <summary>
        /// <para>DeleteObject deletes a singular or a set of objects
        /// from Fedora. If we choose to Delete a parent set, the 
        /// children set objets will also be deleted</para>
        /// 
        /// </summary>
        /// <param name="objectPid">ObjectPid to be deleted</param>
        /// <param name="isCollection">isCollection bool (if it is a set or not)</param>
        public void DeleteObject(string objectPID, bool isCollection)
        {
            _fedoraManagement = new FedoraManagementSOAPImpl(_fedoraServer);

            //First we need to determine if it is a collection
            if (isCollection)
            {
                //Instantiates the ResourceIndexClient
                _riClient = new ResourceIndexClient();
                _contentObjList = _riClient.getRecursiveSetChildrenObjects(objectPID); //Gets all set children recursively...

                int noOfChildren = _contentObjList.Count;

                //For each contentObj in the contentObjList
                foreach (ContentObject contentObj in _contentObjList)
                {
                    if (contentObj.IsCollection)
                    {
                        //If the contentObj is a collection/set then we only need to delete the object dr
                        using (OperationContextScope scope = new OperationContextScope(_fedoraManagement.FedoraManagementProxy.InnerChannel))
                        {
                            //Purge the set object, and force it.
                            _fedoraManagement.purgeObject(contentObj.ObjectPID, "Object deleted by .NET Client", false, scope);
                        }
                    }

                    else
                    {
                        DeleteExternalContent(contentObj.ObjectPID, "content");

                        using (OperationContextScope scope = new OperationContextScope(_fedoraManagement.FedoraManagementProxy.InnerChannel))
                        {
                            //Purge the set object, and force it.
                            _fedoraManagement.purgeObject(contentObj.ObjectPID, "Object deleted by .NET Client", false, scope);
                        }
                    }
                }
                //We then need to get a list of 'all' the child objects...

                //Once we have list of the all the child objects, we need to delete them one by one..
            }
            else
            {
                DeleteExternalContent(objectPID, "content");

                using (OperationContextScope scope = new OperationContextScope(_fedoraManagement.FedoraManagementProxy.InnerChannel))
                {
                    //Purge the set object, and force it.
                    _fedoraManagement.purgeObject(objectPID, "Object deleted by .NET Client", false, scope);
                }
            }
        }
コード例 #5
0
        public ContentObjectList ListContentObjects(String parentId)
        {
            _riClient = new ResourceIndexClient();
            _contentObjList = _riClient.getSetChildrenObjects(parentId);

            return _contentObjList;
        }