Package org.dspace.content

Examples of org.dspace.content.Metadatum


    public String lookup(Context context, DSpaceObject object)
            throws IdentifierNotFoundException, IdentifierNotResolvableException
    {
        log.debug("lookup {}", object);

        Metadatum found = null;
        for (Metadatum candidate : object.getMetadata(MD_SCHEMA, DOI_ELEMENT, DOI_QUALIFIER, null))
        {
            if (candidate.value.startsWith(DOI_SCHEME))
            {
                found = candidate;
View Full Code Here


        private static void addDCValue(String element, String qualifier, String value) {
            if (dcValues == null) {
                dcValues = new ArrayList<Metadatum>();
            }

            Metadatum thisValue = new Metadatum();
            thisValue.schema = "dc";
            thisValue.element = element;
            thisValue.qualifier = qualifier;
            thisValue.value = value;
View Full Code Here

            value = String.valueOf(this.item.isWithdrawn());
        }
        else if (elementsEqualIsh(property, displaynameProperty))
        {
            // displayname - title or handle.
            Metadatum 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

     */
    protected static void createMissingMetadataFields(Context context, Item item)
        throws PackageValidationException, AuthorizeException, IOException, SQLException
    {
        // Get all metadata fields/values currently added to this Item
        Metadatum allMD[] = item.getMetadata(Item.ANY, Item.ANY, Item.ANY, Item.ANY);

        // For each field, we'll check if it exists. If not, we'll create it.
        for(Metadatum md : allMD)
        {
            MetadataSchema mdSchema = null;
View Full Code Here

        String type = Constants.typeText[dso.getType()];
        dim.setAttribute("dspaceType",type);

        for (int i = 0; i < dcvs.length; i++)
        {
            Metadatum dcv = dcvs[i];
            Element field =
            createField(dcv.schema, dcv.element, dcv.qualifier,
                        dcv.language, dcv.value, dcv.authority, dcv.confidence);
            dim.addContent(field);
        }
View Full Code Here

            metas.add(e);
        }

        for (int i = 0; i < values.length; i++)
        {
            Metadatum v = values[i];

            // Work out the key for the Maps that will tell us which metadata
            // name + scheme to use
            String key = v.schema + "." + v.element
                    + (v.qualifier != null ? "." + v.qualifier : "");
View Full Code Here

     * @param item - item to test.
     */
    public static void checkItemMetadata(Item item)
        throws PackageValidationException
    {
        Metadatum t[] = item.getDC( "title", null, Item.ANY);
        if (t == null || t.length == 0)
        {
            throw new PackageValidationException("Item cannot be created without the required \"title\" DC metadata.");
        }
    }
View Full Code Here

    /**
     * Replace an item's DCValue with this authority
     */
    public void updateItem(Item currentItem, Metadatum value) {
        Metadatum newValue = value.copy();
        newValue.value = getValue();
        newValue.authority = getId();
        currentItem.replaceMetadataValue(value,newValue);
    }
View Full Code Here

            //FIXME: adding two URIs for now (site handle and URL), in case site isn't using handles
            dc.add(makeDC("identifier", "uri", "hdl:" + site.getHandle()));
            dc.add(makeDC("identifier", "uri", site.getURL()));
        }

        Metadatum result[] = (Metadatum[])dc.toArray(new Metadatum[dc.size()]);
        return XSLTDisseminationCrosswalk.createDIM(dso, result);
    }
View Full Code Here

        return XSLTDisseminationCrosswalk.createDIM(dso, result);
    }

    private static Metadatum makeDC(String element, String qualifier, String value)
    {
        Metadatum dcv = new Metadatum();
        dcv.schema = "dc";
        dcv.language = null;
        dcv.element = element;
        dcv.qualifier = qualifier;
        dcv.value = value;
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.