Package org.dspace.content

Examples of org.dspace.content.Metadatum


                    }
                    else
                    {
                        for (int idx = 0; idx < values.length; idx++)
                        {
                            Metadatum v = values[idx];
                            Metadatum sl = slCache[idx];
                            // FIXME gestire authority e possibilita' multiple:
                            // match non sicuri, affiliation, etc.
                            if (!v.value.equals(sl.value))
                            {
                                error = true;
View Full Code Here


        return dcvs;
    }

    private Metadatum createDCValue(String element, String qualifier, String value) {
        Metadatum dcv = new Metadatum();
        dcv.schema = "dc";
        dcv.element = element;
        dcv.qualifier = qualifier;
        dcv.value = value;
        return dcv;
View Full Code Here

    {
        String raw = ConfigurationManager.getProperty("swordv2-server", "metadata.replaceable");
        String[] parts = raw.split(",");
        for (String part : parts)
        {
            Metadatum dcv = this.makeDCValue(part.trim(), null);
            item.clearMetadata(dcv.schema, dcv.element, dcv.qualifier, Item.ANY);
        }
    }
View Full Code Here

    if (title != null)
    {
      String titleField = this.dcMap.get("title");
      if (titleField != null)
      {
        Metadatum dcv = this.makeDCValue(titleField, title);
                this.addUniqueMetadata(dcv, item);
      }
    }
    if (summary != null)
    {
      String abstractField = this.dcMap.get("abstract");
      if (abstractField != null)
      {
        Metadatum dcv = this.makeDCValue(abstractField, summary);
                this.addUniqueMetadata(dcv, item);
      }
    }

    Map<String, List<String>> dc = se.getDublinCore();
    for (String term : dc.keySet())
    {
      String dsTerm = this.dcMap.get(term);
      if (dsTerm == null)
      {
        // ignore anything we don't understand
        continue;
      }

      // now add all the metadata terms
            Metadatum dcv = this.makeDCValue(dsTerm, null);
      for (String value : dc.get(term))
      {
                dcv.value = value;
                this.addUniqueMetadata(dcv, item);
      }
View Full Code Here

    }

    public Metadatum makeDCValue(String field, String value)
            throws DSpaceSwordException
    {
        Metadatum dcv = new Metadatum();
        String[] bits = field.split("\\.");
        if (bits.length < 2 || bits.length > 3)
        {
            throw new DSpaceSwordException("invalid DC value: " + field);
        }
View Full Code Here

    if (field == null || "".equals(field))
    {
      throw new DSpaceSwordException("No configuration, or configuration is invalid for: sword.updated.field");
    }

    Metadatum dc = this.makeDCValue(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

    if (field == null || "".equals(field))
    {
      throw new DSpaceSwordException("No configuration, or configuration is invalid for: sword.slug.field");
    }

    Metadatum dc = this.makeDCValue(field, null);
    item.clearMetadata(dc.schema, dc.element, dc.qualifier, Item.ANY);
    item.addMetadata(dc.schema, dc.element, dc.qualifier, null, slugVal);

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

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

    if (field == null || "".equals(field))
    {
      throw new DSpaceSWORDException("No configuration, or configuration is invalid for: sword.slug.field");
    }
   
    Metadatum 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 Metadatum configToDC(String config, String def)
  {
    Metadatum dcv = new Metadatum();
    dcv.schema = def;
    dcv.element= def;
    dcv.qualifier = def;
   
    StringTokenizer stz = new StringTokenizer(config, ".");
View Full Code Here

TOP

Related Classes of org.dspace.content.Metadatum

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.