if (dso.getType() != Constants.ITEM) throw new CrosswalkObjectNotSupported("MODSDisseminationCrosswalk can only crosswalk an Item."); Item item = (Item)dso; initMap();  DCValue[] dc = item.getMetadata(Item.ANY, Item.ANY, Item.ANY, Item.ANY); List result = new ArrayList(dc.length); for (int i = 0; i < dc.length; i++) {   String qdc = dc[i].schema+"."+ ((dc[i].qualifier == null) ? dc[i].element : (dc[i].element + "." + dc[i].qualifier));  modsTriple trip = (modsTriple)modsMap.get(qdc); if (trip == null) log.warn("WARNING: "+getPluginInstanceName()+": No MODS mapping for \"" + qdc+"\""); else { try { Element me = (Element)trip.xml.clone(); Iterator ni = trip.xpath.selectNodes(me).iterator(); if (!ni.hasNext()) log.warn("XPath \""+trip.xpath.getXPath()+ "\" found no elements in \""+ outputUgly.outputString(me)+ "\", qdc="+qdc); while (ni.hasNext()) { Object what = ni.next(); if (what instanceof Element) ((Element)what).setText(dc[i].value); else if (what instanceof Attribute) ((Attribute)what).setValue(dc[i].value); else if (what instanceof Text) ((Text)what).setText(dc[i].value); else log.warn("Got unknown object from XPath, class="+what.getClass().getName()); } result.add(me); } catch (JDOMException je) { log.error("Error following XPath in modsTriple: context="+ outputUgly.outputString(trip.xml)+ ", xpath="+trip.xpath.getXPath()+", exception="+ je.toString()); } } } return result;
return disseminateListInternal(dso, true);
    public List disseminateList(DSpaceObject dso)        throws CrosswalkException,               IOException, SQLException, AuthorizeException    {        if (dso.getType() != Constants.ITEM)            throw new CrosswalkObjectNotSupported("MODSDisseminationCrosswalk can only crosswalk an Item.");        Item item = (Item)dso;        initMap();        DCValue[] dc = item.getMetadata(Item.ANY, Item.ANY, Item.ANY, Item.ANY);        List result = new ArrayList(dc.length);        for (int i = 0; i < dc.length; i++)        {            // Compose qualified DC name - schema.element[.qualifier]            // e.g. "dc.title", "dc.subject.lcc", "lom.Classification.Keyword"            String qdc = dc[i].schema+"."+                         ((dc[i].qualifier == null) ? dc[i].element                            : (dc[i].element + "." + dc[i].qualifier));            modsTriple trip = (modsTriple)modsMap.get(qdc);            if (trip == null)                log.warn("WARNING: "+getPluginInstanceName()+": No MODS mapping for \"" + qdc+"\"");            else            {                try                {                    Element me = (Element)trip.xml.clone();                    Iterator ni = trip.xpath.selectNodes(me).iterator();                    if (!ni.hasNext())                        log.warn("XPath \""+trip.xpath.getXPath()+                          "\" found no elements in \""+                          outputUgly.outputString(me)+                          "\", qdc="+qdc);                    while (ni.hasNext())                    {                        Object what = ni.next();                        if (what instanceof Element)                            ((Element)what).setText(dc[i].value);                        else if (what instanceof Attribute)                            ((Attribute)what).setValue(dc[i].value);                        else if (what instanceof Text)                            ((Text)what).setText(dc[i].value);                        else                            log.warn("Got unknown object from XPath, class="+what.getClass().getName());                    }                    result.add(me);                }                catch (JDOMException je)                {                    log.error("Error following XPath in modsTriple: context="+                        outputUgly.outputString(trip.xml)+                        ", xpath="+trip.xpath.getXPath()+", exception="+                        je.toString());                }            }        }        return result;    }