Package org.dspace.content

Examples of org.dspace.content.DCDate


  {
    String config = ConfigurationManager.getProperty("sword-server", "updated.field");
    Metadatum[] dcv = item.getMetadataByMetadataString(config);
    if (dcv != null && dcv.length == 1)
        {
            DCDate dcd = new DCDate(dcv[0].value);
            entry.setUpdated(dcd.toString());
        }
  }
View Full Code Here


      throw new DSpaceSWORDException("No configuration, or configuration is invalid for: sword.updated.field");
    }
   
    Metadatum 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

          row.addCell().addContent(version.getVersionNumber());
                addItemIdentifier(row.addCell(), version.getItem());

                EPerson editor = version.getEperson();
                row.addCell().addXref("mailto:" + editor.getEmail(), editor.getFullName());
                row.addCell().addContent(new DCDate(version.getVersionDate()).toString());
                row.addCell().addContent(version.getSummary());
            }
    }

    }
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

      
    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

                    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 and private items (ie. don't link)
                        else if (field.equals(titleField) && items[i].isWithdrawn())
                        {
View Full Code Here

      throw new DSpaceSwordException("No configuration, or configuration is invalid for: sword.updated.field");
    }

    Metadatum 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());

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

                for (Metadatum value : values)
                {
                    String displayValue = null;
                    if (inputType.equals("date"))
                    {
                        DCDate date = new DCDate(value.value);
                        displayValue = date.toString();
                    }
                    else if (inputType.equals("dropdown"))
                    {
                        displayValue = input.getDisplayString(pairsName,value.value);
                    }
View Full Code Here

                // Setup the field's values
                if (dcInput.isRepeatable() || dcValues.length > 1)
                {
                        for (Metadatum dcValue : dcValues)
                        {
                                DCDate dcDate = new DCDate(dcValue.value);

                                year.addInstance().setValue(String.valueOf(dcDate.getYear()));
                                month.addInstance().setOptionSelected(dcDate.getMonth());
                                day.addInstance().setValue(String.valueOf(dcDate.getDay()));
                                fullDate.addInstance().setValue(dcDate.toString());
                        }
                }
                else if (dcValues.length == 1)
                {
                        DCDate dcDate = new DCDate(dcValues[0].value);

                        year.setValue(String.valueOf(dcDate.getYear()));
                        month.setOptionSelected(dcDate.getMonth());
                       
                        // Check if the day field is not specified, if so then just
                        // put a blank value in instead of the weird looking -1.
                        if (dcDate.getDay() == -1)
                        {
                            day.setValue("");
                        }
                        else
                        {
                            day.setValue(String.valueOf(dcDate.getDay()));
                        }
                }
        }
View Full Code Here

        Version version = versioningService.getVersion(context, Integer.parseInt(id));

        Row row = table.addRow();
        row.addCell().addContent(version.getVersionNumber());
        row.addCell().addContent(version.getEperson().getEmail());
        row.addCell().addContent(new DCDate(version.getVersionDate()).toString());
        row.addCell().addContent(version.getSummary());


        List fields = main.addList("fields", List.TYPE_FORM);
        Composite addComposite = fields.addItem().addComposite("summary");
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.