mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-14 13:33:08 +00:00
Repaired finally statements and community.
Repaired all finally statements. It was rewrited from context.abort to if condition with check if context is valid. In community was changed back name of subcommunities.
This commit is contained in:
@@ -120,8 +120,12 @@ public class BitstreamResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return bitstream;
|
return bitstream;
|
||||||
}
|
}
|
||||||
@@ -181,8 +185,12 @@ public class BitstreamResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return policies.toArray(new ResourcePolicy[0]);
|
return policies.toArray(new ResourcePolicy[0]);
|
||||||
}
|
}
|
||||||
@@ -261,8 +269,12 @@ public class BitstreamResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return bitstreams.toArray(new Bitstream[0]);
|
return bitstreams.toArray(new Bitstream[0]);
|
||||||
}
|
}
|
||||||
@@ -339,8 +351,12 @@ public class BitstreamResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -419,8 +435,12 @@ public class BitstreamResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return Response.status(Status.OK).build();
|
return Response.status(Status.OK).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -547,8 +567,12 @@ public class BitstreamResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
log.info("Bitstream metadata(id=" + bitstreamId + ") were successfully updated.");
|
log.info("Bitstream metadata(id=" + bitstreamId + ") were successfully updated.");
|
||||||
return Response.ok().build();
|
return Response.ok().build();
|
||||||
@@ -634,8 +658,12 @@ public class BitstreamResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
log.info("Bitstream(id=" + bitstreamId + ") data was successfully updated.");
|
log.info("Bitstream(id=" + bitstreamId + ") data was successfully updated.");
|
||||||
return Response.ok().build();
|
return Response.ok().build();
|
||||||
@@ -709,8 +737,12 @@ public class BitstreamResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
log.info("Bitstream(id=" + bitstreamId + ") was successfully deleted.");
|
log.info("Bitstream(id=" + bitstreamId + ") was successfully deleted.");
|
||||||
return Response.ok().build();
|
return Response.ok().build();
|
||||||
@@ -783,8 +815,13 @@ public class BitstreamResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return Response.status(Status.OK).build();
|
return Response.status(Status.OK).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -116,8 +116,12 @@ public class CollectionsResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
log.trace("Collection(id=" + collectionId + ") has been successfully read.");
|
log.trace("Collection(id=" + collectionId + ") has been successfully read.");
|
||||||
return collection;
|
return collection;
|
||||||
@@ -204,8 +208,12 @@ public class CollectionsResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
log.trace("All collections were successfully read.");
|
log.trace("All collections were successfully read.");
|
||||||
return collections.toArray(new org.dspace.rest.common.Collection[0]);
|
return collections.toArray(new org.dspace.rest.common.Collection[0]);
|
||||||
@@ -292,8 +300,12 @@ public class CollectionsResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
log.trace("All items in collection(id=" + collectionId + ") were successfully read.");
|
log.trace("All items in collection(id=" + collectionId + ") were successfully read.");
|
||||||
return null;
|
return null;
|
||||||
@@ -398,8 +410,12 @@ public class CollectionsResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
log.info("Item successfully created in collection(id=" + collectionId + "). Item handle=" + returnItem.getHandle());
|
log.info("Item successfully created in collection(id=" + collectionId + "). Item handle=" + returnItem.getHandle());
|
||||||
return returnItem;
|
return returnItem;
|
||||||
@@ -472,8 +488,12 @@ public class CollectionsResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
log.info("Collection(id=" + collectionId + ") successfully updated.");
|
log.info("Collection(id=" + collectionId + ") successfully updated.");
|
||||||
return Response.ok().build();
|
return Response.ok().build();
|
||||||
@@ -542,8 +562,12 @@ public class CollectionsResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
log.info("Collection(id=" + collectionId + ") was successfully deleted.");
|
log.info("Collection(id=" + collectionId + ") was successfully deleted.");
|
||||||
return Response.ok().build();
|
return Response.ok().build();
|
||||||
@@ -648,8 +672,12 @@ public class CollectionsResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
log.info("Item(id=" + itemId + ") in collection(id=" + collectionId + ") was successfully deleted.");
|
log.info("Item(id=" + itemId + ") in collection(id=" + collectionId + ") was successfully deleted.");
|
||||||
return Response.ok().build();
|
return Response.ok().build();
|
||||||
@@ -712,8 +740,12 @@ public class CollectionsResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (collection == null)
|
if (collection == null)
|
||||||
{
|
{
|
||||||
|
@@ -104,8 +104,13 @@ public class CommunitiesResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
log.trace("Community(id=" + communityId + ") was successfully read.");
|
log.trace("Community(id=" + communityId + ") was successfully read.");
|
||||||
return community;
|
return community;
|
||||||
@@ -186,8 +191,13 @@ public class CommunitiesResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -270,8 +280,13 @@ public class CommunitiesResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -358,8 +373,13 @@ public class CommunitiesResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -447,8 +467,13 @@ public class CommunitiesResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -524,8 +549,13 @@ public class CommunitiesResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
log.info("Community at top level has been successfully created. Handle:" + retCommunity.getHandle());
|
log.info("Community at top level has been successfully created. Handle:" + retCommunity.getHandle());
|
||||||
return retCommunity;
|
return retCommunity;
|
||||||
@@ -605,8 +635,13 @@ public class CommunitiesResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
log.info("Collection was successfully added into community(id=" + communityId + "). Collection handle="
|
log.info("Collection was successfully added into community(id=" + communityId + "). Collection handle="
|
||||||
+ retCollection.getHandle());
|
+ retCollection.getHandle());
|
||||||
@@ -685,8 +720,13 @@ public class CommunitiesResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
log.info("Subcommunity was successfully added in community(id=" + communityId + ").");
|
log.info("Subcommunity was successfully added in community(id=" + communityId + ").");
|
||||||
return retCommunity;
|
return retCommunity;
|
||||||
@@ -757,8 +797,13 @@ public class CommunitiesResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
log.info("Community(id=" + communityId + ") has been successfully updated.");
|
log.info("Community(id=" + communityId + ") has been successfully updated.");
|
||||||
return Response.ok().build();
|
return Response.ok().build();
|
||||||
@@ -822,8 +867,13 @@ public class CommunitiesResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
log.info("Community(id=" + communityId + ") was successfully deleted.");
|
log.info("Community(id=" + communityId + ") was successfully deleted.");
|
||||||
return Response.status(Response.Status.OK).build();
|
return Response.status(Response.Status.OK).build();
|
||||||
@@ -927,8 +977,13 @@ public class CommunitiesResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
log.info("Collection(id=" + collectionId + ") in community(id=" + communityId + ") was successfully deleted.");
|
log.info("Collection(id=" + collectionId + ") in community(id=" + communityId + ") was successfully deleted.");
|
||||||
return Response.status(Response.Status.OK).build();
|
return Response.status(Response.Status.OK).build();
|
||||||
@@ -1032,8 +1087,13 @@ public class CommunitiesResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
log.info("Subcommunity(id=" + subcommunityId + ") from community(id=" + parentCommunityId + ") was successfully deleted.");
|
log.info("Subcommunity(id=" + subcommunityId + ") from community(id=" + parentCommunityId + ") was successfully deleted.");
|
||||||
return Response.status(Response.Status.OK).build();
|
return Response.status(Response.Status.OK).build();
|
||||||
|
@@ -121,8 +121,12 @@ public class ItemsResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
@@ -202,8 +206,12 @@ public class ItemsResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -261,8 +269,12 @@ public class ItemsResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -334,8 +346,12 @@ public class ItemsResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -409,8 +425,12 @@ public class ItemsResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
log.info("Metadata to item(id=" + itemId + ") were successfully added.");
|
log.info("Metadata to item(id=" + itemId + ") were successfully added.");
|
||||||
return Response.status(Status.OK).build();
|
return Response.status(Status.OK).build();
|
||||||
@@ -580,8 +600,12 @@ public class ItemsResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
log.info("Bitstream(id=" + bitstream.getId() + ") was successfully added into item(id=" + itemId + ").");
|
log.info("Bitstream(id=" + bitstream.getId() + ") was successfully added into item(id=" + itemId + ").");
|
||||||
return bitstream;
|
return bitstream;
|
||||||
@@ -666,8 +690,12 @@ public class ItemsResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
log.info("Metadata of item(id=" + itemId + ") were successfully updated.");
|
log.info("Metadata of item(id=" + itemId + ") were successfully updated.");
|
||||||
return Response.status(Status.OK).build();
|
return Response.status(Status.OK).build();
|
||||||
@@ -735,8 +763,12 @@ public class ItemsResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
log.info("Item(id=" + itemId + ") was successfully deleted.");
|
log.info("Item(id=" + itemId + ") was successfully deleted.");
|
||||||
return Response.status(Status.OK).build();
|
return Response.status(Status.OK).build();
|
||||||
@@ -813,8 +845,12 @@ public class ItemsResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
log.info("Item(id=" + itemId + ") metadata were successfully deleted.");
|
log.info("Item(id=" + itemId + ") metadata were successfully deleted.");
|
||||||
return Response.status(Status.OK).build();
|
return Response.status(Status.OK).build();
|
||||||
@@ -909,8 +945,12 @@ public class ItemsResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
log.info("Bitstream(id=" + bitstreamId + ") from item(id=" + itemId + ") was successfuly deleted .");
|
log.info("Bitstream(id=" + bitstreamId + ") from item(id=" + itemId + ") was successfuly deleted .");
|
||||||
return Response.status(Status.OK).build();
|
return Response.status(Status.OK).build();
|
||||||
@@ -1031,8 +1071,12 @@ public class ItemsResource extends Resource
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (items.size() == 0)
|
if (items.size() == 0)
|
||||||
{
|
{
|
||||||
|
@@ -77,11 +77,14 @@ public class Resource
|
|||||||
}
|
}
|
||||||
|
|
||||||
return context;
|
return context;
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (SQLException e)
|
catch (SQLException e)
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
|
}
|
||||||
throw new ContextException("Could not create context, SQLException. Message: " + e, e);
|
throw new ContextException("Could not create context, SQLException. Message: " + e, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -129,12 +132,12 @@ public class Resource
|
|||||||
}
|
}
|
||||||
catch (SQLException e)
|
catch (SQLException e)
|
||||||
{
|
{
|
||||||
processException("Could not write usageEvent, SQLException. Message: " + e, context);
|
processException("Could not write usageEvent, SQLException. Message: " + e, null); // Write statistic should not abort context.
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (ContextException e)
|
catch (ContextException e)
|
||||||
{
|
{
|
||||||
processException("Could not write usageEvent, ContextException. Message: " + e.getMessage(), context);
|
processException("Could not write usageEvent, ContextException. Message: " + e.getMessage(), null); // Write statistic should not abort context.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -95,8 +95,12 @@ public class TokenHolder
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if((context != null) && (context.isValid()))
|
||||||
|
{
|
||||||
|
log.error("Something get wrong. Aborting context in finally statement.");
|
||||||
context.abort();
|
context.abort();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return token;
|
return token;
|
||||||
}
|
}
|
||||||
|
@@ -39,8 +39,8 @@ public class Community extends DSpaceObject{
|
|||||||
private Integer countItems;
|
private Integer countItems;
|
||||||
|
|
||||||
// Renamed because of xml annotation exception with this attribute and getSubCommunities.
|
// Renamed because of xml annotation exception with this attribute and getSubCommunities.
|
||||||
@XmlElement(name = "subcommunities2", required = true)
|
@XmlElement(name = "subcommunities", required = true)
|
||||||
private List<Community> subCommunities2 = new ArrayList<Community>();
|
private List<Community> subcommunities = new ArrayList<Community>();
|
||||||
|
|
||||||
private List<Collection> collections = new ArrayList<Collection>();
|
private List<Collection> collections = new ArrayList<Collection>();
|
||||||
|
|
||||||
@@ -88,10 +88,10 @@ public class Community extends DSpaceObject{
|
|||||||
|
|
||||||
if(expandFields.contains("subCommunities") || expandFields.contains("all")) {
|
if(expandFields.contains("subCommunities") || expandFields.contains("all")) {
|
||||||
org.dspace.content.Community[] communityArray = community.getSubcommunities();
|
org.dspace.content.Community[] communityArray = community.getSubcommunities();
|
||||||
subCommunities2 = new ArrayList<Community>();
|
subcommunities = new ArrayList<Community>();
|
||||||
for(org.dspace.content.Community subCommunity : communityArray) {
|
for(org.dspace.content.Community subCommunity : communityArray) {
|
||||||
if(AuthorizeManager.authorizeActionBoolean(context, subCommunity, org.dspace.core.Constants.READ)) {
|
if(AuthorizeManager.authorizeActionBoolean(context, subCommunity, org.dspace.core.Constants.READ)) {
|
||||||
subCommunities2.add(new Community(subCommunity, null, context));
|
subcommunities.add(new Community(subCommunity, null, context));
|
||||||
} else {
|
} else {
|
||||||
log.info("Omitted restricted subCommunity: " + subCommunity.getID() + " _ " + subCommunity.getName());
|
log.info("Omitted restricted subCommunity: " + subCommunity.getID() + " _ " + subCommunity.getName());
|
||||||
}
|
}
|
||||||
@@ -173,12 +173,12 @@ public class Community extends DSpaceObject{
|
|||||||
return logo;
|
return logo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Community> getSubCommunities() {
|
public List<Community> getSubcommunities() {
|
||||||
return subCommunities2;
|
return subcommunities;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSubCommunities(List<Community> subCommunities) {
|
public void setSubcommunities(List<Community> subcommunities) {
|
||||||
this.subCommunities2 = subCommunities;
|
this.subcommunities = subcommunities;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user