Package org.dspace.content

Examples of org.dspace.content.DCDate


      if (terms != null && terms.length() > 0)
      {
        if (termsOpen.equals(terms))
                return EmbargoManager.FOREVER;
            else
                return new DCDate(terms);
      }
        return null;
    }
View Full Code Here


      if (terms != null && terms.length() > 0)
      {
          if (termsOpen.equals(terms))
                return EmbargoManager.FOREVER;
            else
                return new DCDate(terms);
      }
        return null;
    }
View Full Code Here

    public static DCDate getEmbargoDate(Context context, Item item)
        throws SQLException, AuthorizeException, IOException
    {
        init();
        DCValue terms[] = item.getMetadata(terms_schema, terms_element, terms_qualifier, Item.ANY);
        DCDate result = setter.parseTerms(context, item, terms.length > 0 ? terms[0].value : null);

        // sanity check: do not allow an embargo lift date in the past.
        if (result != null && result.toDate().before(new Date()))
        {
            throw new IllegalArgumentException("Embargo lift date must be in the future, but this is in the past: "+result.toString());
        }
        return result;
    }
View Full Code Here

        if (lift.length > 0)
        {
            // need to survive any failure on a single item, go on to process the rest.
            try
            {
                DCDate liftDate = new DCDate(lift[0].value);
                log.debug("Testing embargo on item="+item.getHandle()+", date="+liftDate.toString());
                if (liftDate.toDate().before(now))
                {
                    if (line.hasOption('v'))
                        System.err.println("Lifting embargo from Item handle="+item.getHandle()+", lift date="+lift[0].value);
                    if (line.hasOption('n'))
                    {
View Full Code Here

    DCValue[] dcv = item.getMetadata(config);
    if (dcv != null)
    {
      if (dcv.length == 1)
      {
        DCDate dcd = new DCDate(dcv[0].value);
        entry.setUpdated(dcd.toString());
      }
    }
  }
View Full Code Here

      
    private boolean itemsChanged(Context context, DSpaceObject dso, long timeStamp)
            throws SQLException
    {
        // construct start and end dates
        DCDate dcStartDate = new DCDate( new Date(timeStamp) );
        DCDate dcEndDate = new DCDate( new Date(System.currentTimeMillis()) );

        // convert dates to ISO 8601, stripping the time
        String startDate = dcStartDate.toString().substring(0, 10);
        String endDate = dcEndDate.toString().substring(0, 10);
       
        // this invocation should return a non-empty list if even 1 item has changed
        try {
            return (Harvest.harvest(context, dso, startDate, endDate,
                            0, 1, !includeAll, false, false, includeAll).size() > 0);
View Full Code Here

      throw new DSpaceSWORDException("No configuration, or configuration is invalid for: sword.updated.field");
    }
   
    DCValue dc = this.configToDC(field, null);
    item.clearMetadata(dc.schema, dc.element, dc.qualifier, Item.ANY);
    DCDate date = new DCDate(new Date());
    item.addMetadata(dc.schema, dc.element, dc.qualifier, null, date.toString());

    swordService.message("Updated date added to response from item metadata where available");
  }
View Full Code Here

                            out.print("<a href=\"" + values[j].value + "\">"
                                    + Utils.addEntities(values[j].value) + "</a>");
                        }
                        else if (isDate)
                        {
                            DCDate dd = new DCDate(values[j].value);

                            // Parse the date
                            out.print(UIUtil.displayDate(dd, false, false, (HttpServletRequest)pageContext.getRequest()));
                        }
                        else if (isResolver)
View Full Code Here

                    else if (metadataArray.length > 0)
                    {
                        // format the date field correctly
                        if (isDate[colIdx])
                        {
                            DCDate dd = new DCDate(metadataArray[0].value);
                            metadata = UIUtil.displayDate(dd, false, false, hrq);
                        }
                        // format the title field correctly for withdrawn items (ie. don't link)
                        else if (field.equals(titleField) && items[i].isWithdrawn())
                        {
View Full Code Here

                    if (metadataArray.length > 0)
                    {
                        // format the date field correctly
                        if (isDate[colIdx])
                        {
                            DCDate dd = new DCDate(metadataArray[0].value);
                            metadata = UIUtil.displayDate(dd, false, false, hrq);
                        }
                        // format the title field correctly for withdrawn items (ie. don't link)
                        else if (field.equals(titleField) && items[i].isWithdrawn())
                        {
View Full Code Here

TOP

Related Classes of org.dspace.content.DCDate

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.