/**Copyright 2010 Research Studios Austria Forschungsgesellschaft mBH
*
* This file is part of easyrec.
*
* easyrec is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* easyrec is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with easyrec. If not, see <http://www.gnu.org/licenses/>.
*/
package org.easyrec.controller;
import org.easyrec.store.dao.web.RemoteTenantDAO;
import org.easyrec.util.core.Security;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.multiaction.MultiActionController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* This Controller manages to import and export rules, items and actions.
* <p/>
* <p><b>Company: </b>
* SAT, Research Studios Austria</p>
* <p/>
* <p><b>Copyright: </b>
* (c) 2007</p>
* <p/>
* <p><b>last modified:</b><br/>
* $Author: fsalcher $<br/>
* $Date: 2012-03-19 14:22:17 +0100 (Mo, 19 Mär 2012) $<br/>
* $Revision: 18781 $</p>
*
* @author phlavac
* @version 1.0
* @since 1.0
*/
public class ImportController extends MultiActionController {
private RemoteTenantDAO remoteTenantDAO;
public void setRemoteTenantDAO(RemoteTenantDAO remoteTenantDAO) {
this.remoteTenantDAO = remoteTenantDAO;
}
public ModelAndView importer(HttpServletRequest request, HttpServletResponse response) {
if (Security.isDeveloper(request)) {
ModelAndView mav = new ModelAndView("page");
mav.addObject("title", "easyrec :: import");
mav.addObject("page", "upload");
mav.addObject("remoteTenants", remoteTenantDAO.getAllTenants());
return mav;
}
return null;
}
}