Item item = Item.find(context, itemID);
if (item == null)
{
return;
}
SHERPAResponse shresp = sherpaSubmitService.searchRelatedJournals(
context, item);
if (shresp.isError())
{
request.setAttribute("error", new Boolean(true));
}
else
{
List<SHERPAJournal> journals = shresp.getJournals();
if (journals != null)
{
Object[][] results = new Object[journals.size()][];
if (journals.size() > 0)
{
Iterator<SHERPAJournal> ijourn = journals.iterator();
int idx = 0;
while (ijourn.hasNext())
{
SHERPAJournal journ = ijourn.next();
List<SHERPAPublisher> publishers = shresp
.getPublishers();
results[idx] = new Object[] {
journ,
publishers != null && publishers.size() > 0 ? publishers
.get(0) : null };