org.dspace.app.webui.cris.controller.admin.AdminController.java Source code

Java tutorial

Introduction

Here is the source code for org.dspace.app.webui.cris.controller.admin.AdminController.java

Source

/**
 * The contents of this file are subject to the license and copyright
 * detailed in the LICENSE and NOTICE files at the root of the source
 * tree and available online at
 *
 * https://github.com/CILEA/dspace-cris/wiki/License
 */
package org.dspace.app.webui.cris.controller.admin;

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

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.dspace.app.cris.model.jdyna.DynamicObjectType;
import org.dspace.app.cris.service.ApplicationService;
import org.dspace.app.webui.cris.dto.ResearcherPageDTO;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.ParameterizableViewController;

/**
 * This SpringMVC controller is used to render administrator cris web page
 * 
 * @author pascarelli
 * 
 */
public class AdminController extends ParameterizableViewController {

    protected ApplicationService applicationService;

    @Override
    public ModelAndView handleRequest(HttpServletRequest arg0, HttpServletResponse arg1) throws Exception {
        Map<String, Object> model = new HashMap<String, Object>();
        model.put("researchobjects", applicationService.getList(DynamicObjectType.class));
        return new ModelAndView(getViewName(), model);
    }

    public ApplicationService getApplicationService() {
        return applicationService;
    }

    public void setApplicationService(ApplicationService applicationService) {
        this.applicationService = applicationService;
    }
}