/* $This file is distributed under the terms of the license in /doc/license.txt$ */

package edu.cornell.mannlib.vitro.webapp.controller.freemarker;

import java.util.HashMap;
import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import edu.cornell.mannlib.vedit.beans.LoginStatusBean;
import edu.cornell.mannlib.vitro.webapp.beans.Portal;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.FreemarkerHttpServlet.ResponseValues;
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.FreemarkerHttpServlet.Template;
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.FreemarkerHttpServlet.TemplateResponseValues;

public class HomePageController extends FreemarkerHttpServlet {

    private static final long serialVersionUID = 1L;
    private static final Log log = LogFactory.getLog(HomePageController.class);
    private static final String PAGE_TEMPLATE = "page-home.ftl";
    private static final String BODY_TEMPLATE = "home.ftl";

    @Override
    protected ResponseValues processRequest(VitroRequest vreq) { 
        
        // This is a temporary hack to get the login form to work directly from the
        // home page, without redirecting to the dedicated login page (NIHVIVO-1296). 
        // We should either eliminate the need for this, or if it cannot be eliminated, 
        // move it to the  login widget controller so that any page that includes the 
        // login widget will also get the necessary code.
        vreq.getSession(false); 
        
        Map<String, Object> body = new HashMap<String, Object>();        
        // Add home page data to body here         
        return new TemplateResponseValues(BODY_TEMPLATE, body);
    }

    @Override
    protected String getTitle(String siteName) {
        return siteName;
    }

    @Override
    protected String getPageTemplateName() {
        return PAGE_TEMPLATE;
    }
}

@@ -282,64 +282,8 @@
 y;%0A%0A
-import edu.cornell.mannlib.vedit.beans.LoginStatusBean;%0A
 impo
@@ -1117,455 +1117,8 @@
    %0A
-        // This is a temporary hack to get the login form to work directly from the%0A        // home page, without redirecting to the dedicated login page (NIHVIVO-1296). %0A        // We should either eliminate the need for this, or if it cannot be eliminated, %0A        // move it to the  login widget controller so that any page that includes the %0A        // login widget will also get the necessary code.%0A        vreq.getSession(false); %0A        %0A
     

Revert changes from revisions 6300, 6301, 6303. Didn't fix the login issue, and not a good solution anyway.