-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
218 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
using Fedora.Storage; | ||
using Fedora.Storage.Ocfl; | ||
|
||
namespace Fedora; | ||
|
||
public interface IStorageMapper | ||
{ | ||
Task<StorageMap> GetStorageMap(Uri archivalGroupUri, string? version = null); | ||
|
||
Task<Inventory?> GetInventory(Uri archivalGroupUri); | ||
|
||
string? GetArchivalGroupOrigin(Uri archivalGroupUri); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
LeedsExperiment/Preservation.API/Controllers/OcflController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using Fedora; | ||
using Fedora.Storage.Ocfl; | ||
using Microsoft.AspNetCore.Http; | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace Preservation.API.Controllers | ||
{ | ||
[Route("api/[controller]")] | ||
[ApiController] | ||
public class OcflController : Controller | ||
{ | ||
private readonly IStorageMapper storageMapper; | ||
private readonly IFedora fedora; | ||
|
||
public OcflController(IStorageMapper storageMapper, IFedora fedora) | ||
{ | ||
this.storageMapper = storageMapper; | ||
this.fedora = fedora; | ||
} | ||
|
||
[HttpGet(Name = "Inventory")] | ||
[Route("{*path}")] | ||
public async Task<Inventory?> Index(string path) | ||
{ | ||
var uri = fedora.GetUri(path); | ||
var inventory = await storageMapper.GetInventory(uri); | ||
return inventory; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.