mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-18 07:23:08 +00:00
Fix for SF bug [1730606] Restricted Items metadata exposed via OAI
git-svn-id: http://scm.dspace.org/svn/repo/branches/dspace-1_5_x@3346 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -389,6 +389,7 @@ public class Subscribe
|
|||||||
Collection c = (Collection) collections.get(i);
|
Collection c = (Collection) collections.get(i);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
boolean includeAll = ConfigurationManager.getBooleanProperty("harvest.includerestricted.subscription", true);
|
||||||
List itemInfos = Harvest.harvest(context, c, startDate, endDate, 0, // Limit
|
List itemInfos = Harvest.harvest(context, c, startDate, endDate, 0, // Limit
|
||||||
// and
|
// and
|
||||||
// offset
|
// offset
|
||||||
@@ -397,7 +398,8 @@ public class Subscribe
|
|||||||
// everything
|
// everything
|
||||||
0, true, // Need item objects
|
0, true, // Need item objects
|
||||||
false, // But not containers
|
false, // But not containers
|
||||||
false); // Or withdrawals
|
false, // Or withdrawals
|
||||||
|
includeAll);
|
||||||
|
|
||||||
if (ConfigurationManager.getBooleanProperty("eperson.subscription.onlynew", false))
|
if (ConfigurationManager.getBooleanProperty("eperson.subscription.onlynew", false))
|
||||||
{
|
{
|
||||||
|
@@ -60,6 +60,8 @@ import org.dspace.handle.HandleManager;
|
|||||||
import org.dspace.storage.rdbms.DatabaseManager;
|
import org.dspace.storage.rdbms.DatabaseManager;
|
||||||
import org.dspace.storage.rdbms.TableRow;
|
import org.dspace.storage.rdbms.TableRow;
|
||||||
import org.dspace.storage.rdbms.TableRowIterator;
|
import org.dspace.storage.rdbms.TableRowIterator;
|
||||||
|
import org.dspace.authorize.AuthorizeManager;
|
||||||
|
import org.dspace.eperson.Group;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Utility class for extracting information about items, possibly just within a
|
* Utility class for extracting information about items, possibly just within a
|
||||||
@@ -111,14 +113,16 @@ public class Harvest
|
|||||||
* @param withdrawn
|
* @param withdrawn
|
||||||
* If <code>true</code>, information about withdrawn items is
|
* If <code>true</code>, information about withdrawn items is
|
||||||
* included
|
* included
|
||||||
|
* @param nonAnon
|
||||||
|
* If items without anonymous access should be included or not
|
||||||
* @return List of <code>HarvestedItemInfo</code> objects
|
* @return List of <code>HarvestedItemInfo</code> objects
|
||||||
* @throws SQLException
|
* @throws SQLException
|
||||||
* @throws ParseException If the date is not in a supported format
|
* @throws ParseException If the date is not in a supported format
|
||||||
*/
|
*/
|
||||||
public static List harvest(Context context, DSpaceObject scope,
|
public static List harvest(Context context, DSpaceObject scope,
|
||||||
String startDate, String endDate, int offset, int limit,
|
String startDate, String endDate, int offset, int limit,
|
||||||
boolean items, boolean collections, boolean withdrawn)
|
boolean items, boolean collections, boolean withdrawn,
|
||||||
throws SQLException, ParseException
|
boolean nonAnon) throws SQLException, ParseException
|
||||||
{
|
{
|
||||||
|
|
||||||
// Put together our query. Note there is no need for an
|
// Put together our query. Note there is no need for an
|
||||||
@@ -261,7 +265,22 @@ public class Harvest
|
|||||||
itemInfo.item = Item.find(context, itemInfo.itemID);
|
itemInfo.item = Item.find(context, itemInfo.itemID);
|
||||||
}
|
}
|
||||||
|
|
||||||
infoObjects.add(itemInfo);
|
if (nonAnon)
|
||||||
|
{
|
||||||
|
infoObjects.add(itemInfo);
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
Group[] authorizedGroups = AuthorizeManager.getAuthorizedGroups(context, itemInfo.item, Constants.READ);
|
||||||
|
boolean added = false;
|
||||||
|
for (int i = 0; i < authorizedGroups.length; i++)
|
||||||
|
{
|
||||||
|
if ((authorizedGroups[i].getID() == 0) && (!added))
|
||||||
|
{
|
||||||
|
infoObjects.add(itemInfo);
|
||||||
|
added = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
index++;
|
index++;
|
||||||
|
@@ -277,8 +277,9 @@ public class FeedServlet extends DSpaceServlet
|
|||||||
|
|
||||||
// this invocation should return a non-empty list if even 1 item has changed
|
// this invocation should return a non-empty list if even 1 item has changed
|
||||||
try {
|
try {
|
||||||
|
boolean includeAll = ConfigurationManager.getBooleanProperty("harvest.includerestricted.rss", true);
|
||||||
return (Harvest.harvest(context, dso, startDate, endDate,
|
return (Harvest.harvest(context, dso, startDate, endDate,
|
||||||
0, 1, false, false, false).size() > 0);
|
0, 1, false, false, false, includeAll).size() > 0);
|
||||||
}
|
}
|
||||||
catch (ParseException pe)
|
catch (ParseException pe)
|
||||||
{
|
{
|
||||||
|
@@ -236,10 +236,11 @@ public class DSpaceOAICatalog extends AbstractCatalog
|
|||||||
|
|
||||||
// Get the relevant OAIItemInfo objects to make headers
|
// Get the relevant OAIItemInfo objects to make headers
|
||||||
DSpaceObject scope = resolveSet(context, set);
|
DSpaceObject scope = resolveSet(context, set);
|
||||||
|
boolean includeAll = ConfigurationManager.getBooleanProperty("harvest.includerestricted.oai", true);
|
||||||
List itemInfos = Harvest.harvest(context, scope, from, until, 0, 0, // Everything
|
List itemInfos = Harvest.harvest(context, scope, from, until, 0, 0, // Everything
|
||||||
// for
|
// for
|
||||||
// now
|
// now
|
||||||
false, true, true);
|
false, true, true, includeAll);
|
||||||
|
|
||||||
// No Item objects, but we need to know collections they're in and
|
// No Item objects, but we need to know collections they're in and
|
||||||
// withdrawn items
|
// withdrawn items
|
||||||
@@ -559,10 +560,11 @@ public class DSpaceOAICatalog extends AbstractCatalog
|
|||||||
|
|
||||||
// Get the relevant HarvestedItemInfo objects to make headers
|
// Get the relevant HarvestedItemInfo objects to make headers
|
||||||
DSpaceObject scope = resolveSet(context, set);
|
DSpaceObject scope = resolveSet(context, set);
|
||||||
|
boolean includeAll = ConfigurationManager.getBooleanProperty("harvest.includerestricted.oai", true);
|
||||||
List itemInfos = Harvest.harvest(context, scope, from, until,
|
List itemInfos = Harvest.harvest(context, scope, from, until,
|
||||||
offset, MAX_RECORDS, // Limit amount returned from one
|
offset, MAX_RECORDS, // Limit amount returned from one
|
||||||
// request
|
// request
|
||||||
true, true, true); // Need items, containers + withdrawals
|
true, true, true, includeAll); // Need items, containers + withdrawals
|
||||||
|
|
||||||
// Build list of XML records from item info objects
|
// Build list of XML records from item info objects
|
||||||
Iterator i = itemInfos.iterator();
|
Iterator i = itemInfos.iterator();
|
||||||
|
@@ -5,6 +5,7 @@
|
|||||||
- Fix for SF bug [2343281] XHTML Head Dissimination Crosswalk exposes provenance info
|
- Fix for SF bug [2343281] XHTML Head Dissimination Crosswalk exposes provenance info
|
||||||
- Fix for SF bug [1896225] HTML tags not stripped in statistics display
|
- Fix for SF bug [1896225] HTML tags not stripped in statistics display
|
||||||
- Fix for SF bug [1951859] DSpace Home link style in breadcrumb trail
|
- Fix for SF bug [1951859] DSpace Home link style in breadcrumb trail
|
||||||
|
- Fix for SF bug [1730606] Restricted Items metadata exposed via OAI
|
||||||
|
|
||||||
(Stuart Lewis / Chris Yates / Flavio Botelho / Alex Barbieri / Reuben Pasquini)
|
(Stuart Lewis / Chris Yates / Flavio Botelho / Alex Barbieri / Reuben Pasquini)
|
||||||
- [2057378] Hierarchical LDAP support
|
- [2057378] Hierarchical LDAP support
|
||||||
|
@@ -469,6 +469,17 @@ webui.ldap.autoregister = true
|
|||||||
#ldap.netid_email_domain = @example.com
|
#ldap.netid_email_domain = @example.com
|
||||||
|
|
||||||
|
|
||||||
|
#### Restricted item visibilty settings ###
|
||||||
|
# By default RSS feeds, OAI-PMH and subscription emails will include ALL items
|
||||||
|
# regardless of permissions set on them.
|
||||||
|
#
|
||||||
|
# If you wish to only expose items through these channels where the ANONYMOUS
|
||||||
|
# user is granted READ permission, then set the following options to false
|
||||||
|
#harvest.includerestricted.rss = true
|
||||||
|
#harvest.includerestricted.oai = true
|
||||||
|
#harvest.includerestricted.subscription = true
|
||||||
|
|
||||||
|
|
||||||
#### Proxy Settings ######
|
#### Proxy Settings ######
|
||||||
# uncomment and specify both properties if proxy server required
|
# uncomment and specify both properties if proxy server required
|
||||||
# proxy server for external http requests - use regular hostname without port number
|
# proxy server for external http requests - use regular hostname without port number
|
||||||
|
Reference in New Issue
Block a user