Permalink
Browse files

OAI fix SetSpecFilter DB to extract handle properly

&set=col_123456789_2920
yields handle: 123456789/2920
  • Loading branch information...
peterdietz committed Aug 20, 2014
1 parent 366ace8 commit b125c48d196b09d852007349aeda0b6e443e43b6
Showing with 5 additions and 4 deletions.
  1. +5 −4 dspace-oai/src/main/java/org/dspace/xoai/filter/DspaceSetSpecFilter.java
@@ -43,8 +43,9 @@ public DatabaseFilterResult getWhere(Context context)
{
try
{
- DSpaceObject dso = HandleManager.resolveToObject(context,
- _setSpec.replace("col_", ""));
+ //&set=col_123456789_2920
+ String handleString = _setSpec.replace("col_", "").replaceFirst("_", "/");
+ DSpaceObject dso = HandleManager.resolveToObject(context, handleString);
return new DatabaseFilterResult(
"EXISTS (SELECT tmp.* FROM collection2item tmp WHERE tmp.item_id=i.item_id AND collection_id = ?)",
dso.getID());
@@ -58,8 +59,8 @@ else if (_setSpec.startsWith("com_"))
{
try
{
- DSpaceObject dso = HandleManager.resolveToObject(context,
- _setSpec.replace("com_", ""));
+ String handleString = _setSpec.replace("com_", "").replaceFirst("_", "/");
+ DSpaceObject dso = HandleManager.resolveToObject(context, handleString);
List<Integer> list = XOAIDatabaseManager.getAllSubCollections(
context, dso.getID());
String subCollections = StringUtils.join(list.iterator(), ",");

0 comments on commit b125c48

Please sign in to comment.