Skip to content

Commits on Source 3

......@@ -5,7 +5,7 @@ include:
stages:
- build
- test
# - test
- publish
variables:
......@@ -17,8 +17,8 @@ build-branch:
build-nuget-release:
extends: .build-nuget-release
test:
extends: .test
#test:
# extends: .test
publish-branch-prerelease:
extends: .publish-branch-prerelease
......
......@@ -4,7 +4,7 @@
<RootNamespace>Coscine.ProxyApi.Tests</RootNamespace>
<AssemblyName>Coscine.ProxyApi.Tests</AssemblyName>
<TargetFramework>net6.0</TargetFramework>
<Version>3.0.1</Version></PropertyGroup>
<Version>3.0.2</Version></PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\ProxyApi\ProxyApi.csproj" />
</ItemGroup>
......
......@@ -4,7 +4,7 @@
<RootNamespace>Coscine.ProxyApi</RootNamespace>
<AssemblyName>Coscine.ProxyApi</AssemblyName>
<TargetFramework>net6.0</TargetFramework>
<Version>3.0.1</Version>
<Version>3.0.2</Version>
</PropertyGroup>
<PropertyGroup>
<Authors>RWTH Aachen University</Authors>
......
using Microsoft.AspNetCore.WebUtilities;
using Microsoft.AspNetCore.WebUtilities;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
......@@ -68,7 +68,7 @@ namespace Coscine.ProxyApi.Utils
return Update(suffix, payload);
}
public IEnumerable<EpicData> Search(string searchUrl, int limit = 0)
public IEnumerable<EpicData> Search(string searchUrl, int limit = 0, int page = 0)
{
var pidList = new List<EpicData>();
......@@ -82,6 +82,10 @@ namespace Coscine.ProxyApi.Utils
{
parameters.Add("limit", limit.ToString());
}
if (page > 0)
{
parameters.Add("page", page.ToString());
}
// Build the request URL
var url = new Uri(QueryHelpers.AddQueryString(ServiceEndpoint, parameters));
// Execute the request
......@@ -94,6 +98,21 @@ namespace Coscine.ProxyApi.Utils
return pidList;
}
public IEnumerable<EpicData> SearchAll(string searchUrl, int limit = 1000, int startPage = 1)
{
var pidList = new List<EpicData>();
var tempList = Search(searchUrl, limit, startPage);
while (tempList.Any())
{
pidList.AddRange(tempList);
startPage++;
tempList = Search(searchUrl, limit, startPage);
}
return pidList;
}
public IEnumerable<EpicData> List(int limit = 0, int page = 0)
{
var pidList = new List<EpicData>();
......