Package org.dspace.content

Examples of org.dspace.content.DCDate.toDate()


            while (tri.hasNext())
            {
                TableRow row = tri.next();
                DCDate d = new DCDate(row.getStringColumn("withdrawal_date"));
                row.setColumn("last_modified", d.toDate());
                DatabaseManager.update(context, row);
            }
            tri.close();

            // Next, update those items with a date.available
View Full Code Here


                DCDate d = new DCDate(resultRow.getStringColumn("text_value"));

                // Can't update the row, have to do a separate query
                TableRow itemRow = DatabaseManager.find(context, "item",
                        resultRow.getIntColumn("item_id"));
                itemRow.setColumn("last_modified", d.toDate());
                DatabaseManager.update(context, itemRow);
            }
            tri.close();

            // Finally, for all items that have no date.available or withdrawal
View Full Code Here

        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

            // 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

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.