/*
- * Copyright (C) 2001, 2002 The Mir-coders group
+ * Copyright (C) 2001-2006 The Mir-coders group
*
* This file is part of Mir.
*
*
* In addition, as a special exception, The Mir-coders gives permission to link
* 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
import mir.storage.Database;
import mir.util.HTTPRequestParser;
import mir.util.URLBuilder;
+import mir.util.StringRoutines;
import mircoders.global.MirGlobal;
import mircoders.localizer.MirLocalizerExc;
import mircoders.servlet.ServletHelper;
String where = requestParser.getParameter("where");
String order = requestParser.getParameterWithDefault("order", getDefaultListOrdering());
int offset = requestParser.getIntegerWithDefault("offset", 0);
+ String mainTablePrefix = requestParser.getParameter("mainTablePrefix");
+ String extraTables = requestParser.getParameter("extraTables");
- returnList(aRequest, aResponse, where, order, offset);
+ returnList(aRequest, aResponse, where, order, offset, Collections.EMPTY_MAP, mainTablePrefix, extraTables);
}
public void returnList(HttpServletRequest aRequest, HttpServletResponse aResponse,
String aWhereClause, String anOrderByClause, int anOffset,
Map anOverridingRequestParameters) throws ServletModuleExc {
+ returnList(aRequest, aResponse, aWhereClause, anOrderByClause, anOffset, anOverridingRequestParameters, "", null);
+ }
+ public void returnList(HttpServletRequest aRequest, HttpServletResponse aResponse,
+ String aWhereClause, String anOrderByClause, int anOffset,
+ Map anOverridingRequestParameters, String aMainTablePrefix, String someExtraTables) throws ServletModuleExc {
HTTPRequestParser requestParser = new HTTPRequestParser(aRequest, anOverridingRequestParameters);
URLBuilder urlBuilder = new URLBuilder();
try {
Map responseData = ServletHelper.makeGenerationData(aRequest, aResponse, getLocales(aRequest));
+ List extraTables = null;
+ if (someExtraTables!=null && someExtraTables.length() > 0) {
+ extraTables = StringRoutines.splitString(someExtraTables, ",");
+ }
+
List list =
- EntityAdapterEngine.retrieveAdapterList(model, definition, aWhereClause, anOrderByClause, nrEntitiesPerListPage, anOffset);
+ EntityAdapterEngine.retrieveAdapterList(model, definition, aMainTablePrefix, extraTables, aWhereClause, anOrderByClause, nrEntitiesPerListPage, anOffset);
responseData.put("nexturl", null);
responseData.put("prevurl", null);
urlBuilder.setValue("do", "list");
urlBuilder.setValue("where", aWhereClause);
urlBuilder.setValue("order", anOrderByClause);
+ urlBuilder.setValue("extraTables", someExtraTables);
+ urlBuilder.setValue("mainTablePrefix", aMainTablePrefix);
urlBuilder.setValue("offset", anOffset);
responseData.put("module", getName());
responseData.put("entity", anObject);
- responseData.put("new", Boolean.valueOf(anIsNew));
+ responseData.put("new", new Boolean(anIsNew));
urlBuilder.setValue("module", getName());