Ejemplo n.º 1
0
        private async Task <string> RunSearchAsync(string formattedQuery, int page)
        {
            var requestUrl       = String.Format("search?page={0}&{1}", page, formattedQuery);
            var searchResultText = await ArchivesSpaceService.GetApiDataAsync(requestUrl);

            return(searchResultText);
        }
Ejemplo n.º 2
0
        public virtual async Task <Resource> GetResourceByIdAsync(int id)
        {
            var uriSegment     = String.Format("/resources/{0}", id);
            var resourceString = await ArchivesSpaceService.GetApiDataAsync(uriSegment);

            var resource = JsonConvert.DeserializeObject <Resource>(resourceString, new JsonAspaceNoteConverter(), new JsonAspaceNoteItemConverter());

            return(resource);
        }
Ejemplo n.º 3
0
        public virtual async Task <List <int> > GetAllResourceIdsAsync()
        {
            var uriSegment         = "/resources?all_ids=true";
            var allResourcesString = await ArchivesSpaceService.GetApiDataAsync(uriSegment);

            var allResources = JsonConvert.DeserializeObject <List <int> >(allResourcesString);

            return(allResources);
        }
Ejemplo n.º 4
0
        private async Task <SmallTree> GetSmallResourceTreeActionAsync(int resourceId)
        {
            var uriSegment       = String.Format("/resources/{0}/small_tree", resourceId);
            var recordTreeString = await ArchivesSpaceService.GetApiDataAsync(uriSegment);

            var recordTree = JsonConvert.DeserializeObject <SmallTree>(recordTreeString);

            return(recordTree);
        }
        private async Task <List <int> > GetAllTopContainerIdsActionAsync()
        {
            var uriSegment   = "/top_containers?all_ids=true";
            var allTcsString = await ArchivesSpaceService.GetApiDataAsync(uriSegment);

            var alTcs = JsonConvert.DeserializeObject <List <int> >(allTcsString);

            return(alTcs);
        }
        private async Task <TopContainer> GetTopContainerByIdActionAsync(int id)
        {
            var uriSegment = String.Format("/top_containers/{0}", id);
            var tcString   = await ArchivesSpaceService.GetApiDataAsync(uriSegment);

            var tc = JsonConvert.DeserializeObject <TopContainer>(tcString, new JsonAspaceNoteConverter(), new JsonAspaceNoteItemConverter());

            return(tc);
        }
Ejemplo n.º 7
0
        public async Task <Accession> GetAccessionByIdAsync(int id)
        {
            var uriSegment      = String.Format("/accessions/{0}", id);
            var accessionString = await ArchivesSpaceService.GetApiDataAsync(uriSegment);

            var accession = JsonConvert.DeserializeObject <Accession>(accessionString);

            return(accession);
        }
Ejemplo n.º 8
0
        public async Task <List <int> > GetAllAccessionIdsAsync()
        {
            var uriSegment          = "/accessions?all_ids=true";
            var allAccessionsString = await ArchivesSpaceService.GetApiDataAsync(uriSegment);

            var allAccessions = JsonConvert.DeserializeObject <List <int> >(allAccessionsString);

            return(allAccessions);
        }
Ejemplo n.º 9
0
        private async Task <ArchivalObject> GetArchivalObjectByIdActionAsync(int id)
        {
            var uriSegment           = String.Format("/archival_objects/{0}", id);
            var archivalObjectString = await ArchivesSpaceService.GetApiDataAsync(uriSegment);

            var archivalObject = JsonConvert.DeserializeObject <ArchivalObject>(archivalObjectString, new JsonAspaceNoteConverter(), new JsonAspaceNoteItemConverter());

            return(archivalObject);
        }
Ejemplo n.º 10
0
        private async Task <ICollection <ArchivalObject> > GetArchivalObjectChildrenActionAsync(int id)
        {
            var uriSegment = String.Format("/archival_objects/{0}/children", id);
            var archivalObjectCollectionString = await ArchivesSpaceService.GetApiDataAsync(uriSegment);

            var archivalObjectCollection = JsonConvert.DeserializeObject <List <ArchivalObject> >(archivalObjectCollectionString, new JsonAspaceNoteConverter(), new JsonAspaceNoteItemConverter());

            return(archivalObjectCollection);
        }
Ejemplo n.º 11
0
        private async Task <RecordTreeResource> GetRecordTreeActionAsync(int resourceId, bool firstLevelOnly)
        {
            var limitParameter   = firstLevelOnly ? "?limit_to=root" : "";
            var uriSegment       = String.Format("/resources/{0}/tree{1}", resourceId, limitParameter);
            var recordTreeString = await ArchivesSpaceService.GetApiDataAsync(uriSegment);

            var recordTree = JsonConvert.DeserializeObject <RecordTreeResource>(recordTreeString);

            return(recordTree);
        }