mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
Output policy data to METSRIGHTS only if a policy is effect (by date)
Test cases 1. No date present 2. Start date and end date present 3. Start date only present 4. End date only present
This commit is contained in:
@@ -158,6 +158,24 @@ public class METSRightsCrosswalk
|
||||
//For each DSpace policy
|
||||
for(ResourcePolicy policy : policies)
|
||||
{
|
||||
// As of DSpace 3.0, policies may have an effective date range, check if a policy is effective
|
||||
Date now = new Date();
|
||||
if (policy.getStartDate() != null)
|
||||
{
|
||||
if (policy.getStartDate().after(now))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (policy.getEndDate() != null)
|
||||
{
|
||||
if (policy.getEndDate().before(now))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// DSpace Policies can either reference a Group or an Individual, but not both!
|
||||
Group group = policy.getGroup();
|
||||
EPerson person = policy.getEPerson();
|
||||
|
Reference in New Issue
Block a user