throws OAIInternalServerError, NoSetHierarchyException, CannotDisseminateFormatException
throws OAIInternalServerError, NoSetHierarchyException, CannotDisseminateFormatException, NoItemsMatchException
    public Map listRecords(String from, String until, String set, String metadataPrefix)        throws OAIInternalServerError, NoSetHierarchyException, CannotDisseminateFormatException    {        Context context = null;        String schemaURL = getCrosswalks().getSchemaURL(metadataPrefix);        if (schemaURL == null)        {            throw new CannotDisseminateFormatException(metadataPrefix);        }        // List to put results in        List records = new LinkedList();        try        {            context = new Context();            // Get the relevant HarvestedItemInfo objects to make headers            DSpaceObject scope = resolveSet(context, set);            List itemInfos = Harvest.harvest(context, scope, from, until,                true, true, true);  // Need items, containers + withdrawals            // Build list of XML records from item info objects            Iterator i = itemInfos.iterator();            while (i.hasNext())            {                HarvestedItemInfo itemInfo = (HarvestedItemInfo) i.next();                /*                 * FIXME: I've a feeling a "CannotDisseminateFormatException"                 * should be caught and discarded here - it's OK if some                 * records in the requested date range don't have the                 * requested metadata format available                 */                String recordXML = getRecordFactory().create(                    itemInfo, schemaURL, metadataPrefix);                records.add(recordXML);            }        }        catch (SQLException se)        {            // Log the error            log.warn(LogManager.getHeader(context,                "database_error",                ""), se);            throw new OAIInternalServerError(se.toString());        }        finally        {            if (context != null)            {                context.abort();            }        }                // Put results in form needed to return        Map results = new HashMap();        results.put("records", records.iterator());        return results;    }