/*
 * 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.io.IOException;
import java.sql.SQLException;
import org.apache.cocoon.environment.ObjectModelHelper;
import org.apache.cocoon.environment.Request;
import org.dspace.app.xmlui.cocoon.AbstractDSpaceTransformer;
import org.dspace.app.xmlui.utils.UIException;
import org.dspace.app.xmlui.wing.WingException;
import org.dspace.app.xmlui.wing.element.Options;
import org.dspace.app.xmlui.wing.element.PageMeta;
import org.dspace.authorize.AuthorizeException;
import org.dspace.core.ConfigurationManager;
import org.xml.sax.SAXException;

/**
 *
 * @author Nathan Day
 */
   
public class Navigation extends AbstractDSpaceTransformer {

    public void addOptions(Options options) throws SAXException, WingException,
            UIException, SQLException, IOException, AuthorizeException
    {
        options.addList("DryadSubmitData");
        options.addList("DryadSearch");
        options.addList("DryadConnect");
        options.addList("DryadMail");
    }

    /**
     * Insure that the context path is added to the page meta.
     * @param pageMeta
     * @throws org.xml.sax.SAXException
     * @throws org.dspace.app.xmlui.wing.WingException
     * @throws org.dspace.app.xmlui.utils.UIException
     * @throws java.sql.SQLException
     * @throws java.io.IOException
     */
    @Override
    public void addPageMeta(PageMeta pageMeta) throws SAXException,
            WingException, UIException, SQLException, IOException,
            AuthorizeException
    {
    	Request request = ObjectModelHelper.getRequest(objectModel);
        pageMeta.addMetadata("contextPath").addContent(contextPath);
        pageMeta.addMetadata("request","queryString").addContent(request.getQueryString());
        pageMeta.addMetadata("request","scheme").addContent(request.getScheme());
        pageMeta.addMetadata("request","serverPort").addContent(request.getServerPort());
        pageMeta.addMetadata("request","serverName").addContent(request.getServerName());
        pageMeta.addMetadata("request","URI").addContent(request.getSitemapURI());

        // Get realPort and nodeName
        String port = ConfigurationManager.getProperty("dspace.port");
        String nodeName = ConfigurationManager.getProperty("dryad.home");

        // If we're using Apache, we may not have the real port in serverPort
        if (port != null) {
            pageMeta.addMetadata("request", "realServerPort").addContent(port);
        }
        else {
            pageMeta.addMetadata("request", "realServerPort").addContent("80");
        }
        if (nodeName != null) {
            pageMeta.addMetadata("dryad", "node").addContent(nodeName);
        }
    }
}
@@ -268,31 +268,125 @@
 import java.
-sql.SQL
+net.URLEncoder;%0Aimport java.sql.SQLException;%0Aimport org.apache.avalon.framework.parameters.Parameter
 Exception;%0Ai
@@ -486,16 +486,115 @@
 equest;%0A
+import org.apache.log4j.Logger;%0Aimport static org.dspace.app.xmlui.aspect.journal.landing.Const.*;%0A
 import o
@@ -932,24 +932,84 @@
 ionManager;%0A
+import org.dspace.submit.utils.DryadJournalSubmissionUtils;%0A
 import org.x
@@ -1126,16 +1126,147 @@
 former %7B
+%0A    %0A    private static final Logger log = Logger.getLogger(Navigation.class);%0A    private static final String ENCODING = %22UTF-8%22;
 %0A%0A    pu
@@ -2091,24 +2091,51 @@
 ption%0A    %7B%0A
+        // standard values%0A
     %09Request
@@ -3203,32 +3203,32 @@
 Name != null) %7B%0A
-
             page
@@ -3289,19 +3289,611 @@
 ;%0A        %7D%0A
+        // journal landing page values%0A        String journalName = null;%0A        String journalAbbr = null;%0A        try %7B%0A            journalName = parameters.getParameter(PARAM_JOURNAL_NAME);%0A            journalAbbr = parameters.getParameter(PARAM_JOURNAL_ABBR);%0A        %7D catch (ParameterException ex) %7B%0A            log.error(ex);%0A        %7D%0A        if (journalName != null && journalName.length() != 0) %7B%0A            pageMeta.addMetadata(%22request%22,%22journalName%22).addContent(journalName);%0A            pageMeta.addMetadata(%22request%22,%22journalAbbr%22).addContent(journalAbbr);        %0A        %7D%0A
     %7D%0A%7D

fix merge error