X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=source%2Fmircoders%2Fservlet%2FServletModuleAdmin.java;h=ac41a31601f6929eee627195b38a4c4fb088eca6;hb=4451d4c8c25d46e9c405e966ff6bd016a1512f4f;hp=eb4ae4d93dbbad98e839845c6db64ea6a5dcc09b;hpb=77b8f79d3873d20aa10bb775e03047cd6a9de0bf;p=mir.git diff --git a/source/mircoders/servlet/ServletModuleAdmin.java b/source/mircoders/servlet/ServletModuleAdmin.java index eb4ae4d9..ac41a316 100755 --- a/source/mircoders/servlet/ServletModuleAdmin.java +++ b/source/mircoders/servlet/ServletModuleAdmin.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001, 2002 The Mir-coders group + * Copyright (C) 2001, 2002 The Mir-coders group * * This file is part of Mir. * @@ -18,28 +18,30 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * In addition, as a special exception, The Mir-coders gives permission to link - * the code of this program with the com.oreilly.servlet library, any library - * licensed under the Apache Software License, The Sun (tm) Java Advanced - * Imaging library (JAI), The Sun JIMI library (or with modified versions of - * the above that use the same license as the above), and distribute linked - * combinations including the two. You must obey the GNU General Public - * License in all respects for all of the code used other than the above - * mentioned libraries. If you modify this file, you may extend this exception - * to your version of the file, but you are not obligated to do so. If you do - * not wish to do so, delete this exception statement from your version. + * the code of this program with any library licensed under the Apache Software License, + * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library + * (or with modified versions of the above that use the same license as the above), + * and distribute linked combinations including the two. You must obey the + * GNU General Public License in all respects for all of the code used other than + * the above mentioned libraries. If you modify this file, you may extend this + * exception to your version of the file, but you are not obligated to do so. + * If you do not wish to do so, delete this exception statement from your version. */ - package mircoders.servlet; +import java.util.Locale; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import mir.entity.adapter.EntityIteratorAdapter; import mir.log.LoggerWrapper; import mir.servlet.ServletModule; import mir.servlet.ServletModuleFailure; +import mir.util.CachingRewindableIterator; import mir.util.URLBuilder; +import mircoders.global.MirGlobal; public class ServletModuleAdmin extends ServletModule { @@ -48,7 +50,7 @@ public class ServletModuleAdmin extends ServletModule private ServletModuleAdmin() { logger = new LoggerWrapper("ServletModule.Admin"); - defaultAction = "showSuperUserMenu"; + defaultAction = "start"; } public void superusermenu(HttpServletRequest aRequest, HttpServletResponse aResponse) { @@ -56,7 +58,7 @@ public class ServletModuleAdmin extends ServletModule int count; try { - Map responseData = ServletHelper.makeGenerationData(getLocale(aRequest)); + Map responseData = ServletHelper.makeGenerationData(aRequest, aResponse, new Locale[] { getLocale(aRequest), getFallbackLocale(aRequest)}); urlBuilder.setValue("module", "Admin"); urlBuilder.setValue("do", "superusermenu"); @@ -68,4 +70,35 @@ public class ServletModuleAdmin extends ServletModule throw new ServletModuleFailure(e); } } + + public void start(HttpServletRequest aRequest, HttpServletResponse aResponse) { + String startTemplate = configuration.getString("Mir.StartTemplate"); + String sessionUrl = aResponse.encodeURL(""); + + try { + Map mergeData = ServletHelper.makeGenerationData(aRequest, aResponse, new Locale[] {getLocale(aRequest), getFallbackLocale(aRequest)} + , "bundles.admin", "bundles.adminlocal"); + mergeData.put("messages", + new CachingRewindableIterator( + new EntityIteratorAdapter("", "webdb_create desc", 10, + MirGlobal.localizer().dataModel().adapterModel(), "internalMessage", 10, 0))); + + mergeData.put("fileeditentries", ( (ServletModuleFileEdit) ServletModuleFileEdit.getInstance()).getEntries()); + mergeData.put("administeroperations", ( (ServletModuleLocalizer) ServletModuleLocalizer.getInstance()).getAdministerOperations()); + + mergeData.put("searchvalue", null); + mergeData.put("searchfield", null); + mergeData.put("searchispublished", null); + mergeData.put("searcharticletype", null); + mergeData.put("searchorder", null); + mergeData.put("selectarticleurl", null); + mergeData.put("recipes", MirGlobal.localizer().producers().getRecipeNames()); + + ServletHelper.generateResponse(aResponse.getWriter(), mergeData, startTemplate); + } + catch (Exception e) { + throw new ServletModuleFailure(e); + } + } + }