Examples of DCDate


Examples of org.dspace.content.DCDate

        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

Examples of org.dspace.content.DCDate

    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

Examples of org.dspace.content.DCDate

      
    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

Examples of org.dspace.content.DCDate

      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

Examples of org.dspace.content.DCDate

                            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

Examples of org.dspace.content.DCDate

                    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

Examples of org.dspace.content.DCDate

                    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

Examples of org.dspace.content.DCDate

    //item.setHarvestDate(new Date());
    hi.setHarvestDate(new Date());

                 // Add provenance that this item was harvested via OAI
                String provenanceMsg = "Item created via OAI harvest from source: "
                                        + this.harvestRow.getOaiSource() + " on " new DCDate(hi.getHarvestDate())
                                        + " (GMT).  Item's OAI Record identifier: " + hi.getOaiID();
                item.addMetadata("dc", "description", "provenance", "en", provenanceMsg);

    item.update();
    hi.update();
View Full Code Here

Examples of org.dspace.content.DCDate

                // get dc:date.accessioned to be set as first version date...
                Metadatum[] values = item.getMetadata("dc", "date", "accessioned", Item.ANY);
                Date versionDate = new Date();
                if(values!=null && values.length > 0){
                    String date = values[0].value;
                    versionDate = new DCDate(date).toDate();
                }
                createVersion(c, vh, item, "", versionDate);
            }
            // Create new Item
            Item itemNew = provider.createNewItemAndAddItInWorkspace(c, item);
View Full Code Here

Examples of org.dspace.content.DCDate

            try {
                boolean includeAll = ConfigurationManager.getBooleanProperty("harvest.includerestricted.subscription", true);

                // we harvest all the changed item from yesterday until now
                List<HarvestedItemInfo> itemInfos = Harvest.harvest(context, c, new DCDate(midnightYesterday).toString(), null, 0, // Limit
                                                                                    // and
                                                                                    // offset
                                                                                    // zero,
                                                                                    // get
                                                                                    // everything
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.