/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.dspace.app.xmlui.aspect.journal.landing;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;

import org.apache.avalon.framework.parameters.Parameters;
import org.apache.cocoon.acting.AbstractAction;
import org.apache.cocoon.environment.Redirector;
import org.apache.cocoon.environment.SourceResolver;

import org.apache.log4j.Logger;

import static org.dspace.app.xmlui.aspect.journal.landing.Const.*;
import org.dspace.submit.utils.DryadJournalSubmissionUtils;
import org.datadryad.api.DryadJournal;
import org.dspace.app.xmlui.utils.ContextUtil;
import org.dspace.core.Context;

/**
 *
 * @author Nathan Day
 */
public class ValidateRequest extends AbstractAction {

    private static final Logger log = Logger.getLogger(ValidateRequest.class);

    @Override
    public Map act(Redirector redirector, SourceResolver resolver, Map objectModel,
                    String source, Parameters parameters) throws Exception
    {
        String journalName = parameters.getParameter(PARAM_JOURNAL_NAME);
        if (journalName == null || journalName.length() == 0) return null;

        // verify we have an accurate journal
        String journalAbbr = DryadJournalSubmissionUtils.findKeyByFullname(journalName);
        if (journalAbbr != null && journalAbbr.length() != 0) {
            Map map = new HashMap();
            map.put(PARAM_JOURNAL_NAME, journalName);
            map.put(PARAM_JOURNAL_ABBR, journalAbbr);
            return map;
        }
        return null;
    }
}
@@ -248,150 +248,42 @@
 ava.
-sql.SQLException;%0Aimport java.util.ArrayList;%0Aimport java.util.Map;%0Aimport java.util.HashMap;%0Aimport java.util.Iterator;%0Aimport java.util.List
+util.Map;%0Aimport java.util.HashMap
 ;%0A%0Ai
@@ -653,126 +653,8 @@
 ils;
-%0Aimport org.datadryad.api.DryadJournal;%0Aimport org.dspace.app.xmlui.utils.ContextUtil;%0Aimport org.dspace.core.Context;
 %0A%0A/*

remove unneeded imports