Package org.dspace.content

Examples of org.dspace.content.DCValue


     */
    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()))
        {
View Full Code Here


    // return flase on success, true if there was fatal exception.
    private static boolean processOneItem(Context context, Item item, CommandLine line, Date now)
        throws Exception
    {
        boolean status = false;
        DCValue lift[] = item.getMetadata(lift_schema, lift_element, lift_qualifier, Item.ANY);

        if (lift.length > 0)
        {
            // need to survive any failure on a single item, go on to process the rest.
            try
View Full Code Here

            value = String.valueOf(this.item.isWithdrawn());
        }
        else if (elementsEqualIsh(property, displaynameProperty))
        {
            // displayname - title or handle.
            DCValue titleDc[] = this.item.getDC("title", Item.ANY, Item.ANY);
            value = titleDc.length > 0 ? titleDc[0].value : this.item.getHandle();
        }
        else if (elementsEqualIsh(property, handleProperty))
        {
            value = canonicalizeHandle(this.item.getHandle());
View Full Code Here

  /**
   * Compare two metadata element's name so that they may be sorted.
   */
  class DCValueComparator implements Comparator{
    public int compare(Object arg0, Object arg1) {
      final DCValue o1 = (DCValue)arg0;
      final DCValue o2 = (DCValue)arg1;
      final String s1 = o1.schema + o1.element + (o1.qualifier==null?"":("." + o1.qualifier));
      final  String s2 = o2.schema + o2.element + (o2.qualifier==null?"":("." + o2.qualifier));
      return s1.compareTo(s2);
    }
View Full Code Here

    if (field == null || "".equals(field))
    {
      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

    if (field == null || "".equals(field))
    {
      throw new DSpaceSWORDException("No configuration, or configuration is invalid for: sword.slug.field");
    }
   
    DCValue dc = this.configToDC(field, null);
    item.clearMetadata(dc.schema, dc.element, dc.qualifier, Item.ANY);
    item.addMetadata(dc.schema, dc.element, dc.qualifier, null, slugVal);

    swordService.message("Slug value set in response where available");
  }
View Full Code Here

   * @param def
   * @return
   */
  private DCValue configToDC(String config, String def)
  {
    DCValue dcv = new DCValue();
    dcv.schema = def;
    dcv.element= def;
    dcv.qualifier = def;
   
    StringTokenizer stz = new StringTokenizer(config, ".");
View Full Code Here

  /**
   * Compare two metadata element's name so that they may be sorted.
   */
  class DCValueComparator implements Comparator{
    public int compare(Object arg0, Object arg1) {
      final DCValue o1 = (DCValue)arg0;
      final DCValue o2 = (DCValue)arg1;
      final String s1 = o1.schema + o1.element + (o1.qualifier==null?"":("." + o1.qualifier));
      final  String s2 = o2.schema + o2.element + (o2.qualifier==null?"":("." + o2.qualifier));
      return s1.compareTo(s2);
    }
View Full Code Here

        /**
         * Compare two metadata element's name so that they may be sorted.
         */
        class DCValueComparator implements Comparator{
                public int compare(Object arg0, Object arg1) {
                        final DCValue o1 = (DCValue)arg0;
                        final DCValue o2 = (DCValue)arg1;
                        final String s1 = o1.schema + o1.element + (o1.qualifier==null?"":("." + o1.qualifier));
                        final  String s2 = o2.schema + o2.element + (o2.qualifier==null?"":("." + o2.qualifier));
                        return s1.compareTo(s2);
                }
View Full Code Here

TOP

Related Classes of org.dspace.content.DCValue

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.