All Rights Reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+package com.arsdigita.ui.sitemap;
+
+import com.arsdigita.bebop.BoxPanel;
+import com.arsdigita.bebop.Page;
+import com.arsdigita.bebop.PageFactory;
+import com.arsdigita.bebop.SingleSelectionModel;
+import com.arsdigita.bebop.SplitPanel;
+import com.arsdigita.bebop.TabbedPane;
+import com.arsdigita.dispatcher.AccessDeniedException;
+import com.arsdigita.dispatcher.DispatcherHelper;
+import com.arsdigita.kernel.Kernel;
+import com.arsdigita.kernel.Party;
+import com.arsdigita.kernel.permissions.PermissionDescriptor;
+import com.arsdigita.kernel.permissions.PermissionService;
+import com.arsdigita.kernel.permissions.PrivilegeDescriptor;
+import com.arsdigita.templating.PresentationManager;
+import com.arsdigita.templating.Templating;
+import com.arsdigita.util.Assert;
+import com.arsdigita.web.Application;
+import com.arsdigita.web.BaseApplicationServlet;
+import com.arsdigita.web.LoginSignal;
+import com.arsdigita.xml.Document;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Core admin SiteMap Application Servlet class, central entry point to
+ * create and process the applications UI.
+ *
+ * We should have subclassed BebopApplicationServlet but couldn't overwrite
+ * doService() method to add permission checking. So we use our own page
+ * mapping. The general logic is the same as for BebopApplicationServlet.
+ * {@see com.arsdigita.bebop.page.BebopApplicationServlet}
+ *
+ * @author pb
+ */
+public class SiteMapServlet extends BaseApplicationServlet {
+
+ private static final Logger s_log = Logger.getLogger(
+ SiteMapServlet.class.getName());
+
+ /** URL (pathinfo) -> Page object mapping. Based on it (and the http
+ * request url) the doService method to selects a page to display */
+ private final Map m_pages = new HashMap();
+
+
+ /**
+ * User extension point, overwrite this method to setup a URL - page mapping
+ *
+ * @throws ServletException
+ */
+ @Override
+ public void doInit() throws ServletException {
+
+ addPage("/", buildAdminIndexPage()); // index page at address ~/ds
+ // addPage("/index.jsp", buildIndexPage()); // index page at address ~/ds
+
+ // addPage("/log4j", buildLog4jPage()); // Logger Adjuster at addr. ~/ds/log4j
+ // addPage("/config", buildConfigPage()); // config browser @ ~/ds/config
+ // cache table browser @ ~/ds/cache-table
+ // addPage("/cache-table", buildCacheTablePage());
+
+ // XXXX!!
+ // QueryLog is a class of its own in webdevsupport, based upon
+ // dispatcher.Disp and prints out all queries in a request
+ // put("query-log", new QueryLog());
+
+ // addPage("/request-info", buildRequestInfoPage());
+ // addPage("/query-info", buildQueryInfoPage());
+ // addPage("/query-plan", buildQueryPlanPage());
+
+ }
+ /**
+ * Central service method, checks for required permission, determines the
+ * requested page and passes the page object to PresentationManager.
+ */
+ public final void doService(HttpServletRequest sreq,
+ HttpServletResponse sresp,
+ Application app)
+ throws ServletException, IOException {
+
+
+
+ // /////// Some preparational steps ///////////////
+
+ /* Determine access privilege: only logged in users may access DS */
+ Party party = Kernel.getContext().getParty();
+ if (party == null) {
+ throw new LoginSignal(sreq);
+ }
+ /* Determine access privilege: Admin privileges must be granted */
+ PermissionDescriptor admin = new PermissionDescriptor
+ (PrivilegeDescriptor.ADMIN, app, party);
+ if (!PermissionService.checkPermission(admin)) {
+ throw new AccessDeniedException("User is not an administrator");
+ }
+ /* Want admin to always show the latest stuff... */
+ DispatcherHelper.cacheDisable(sresp);
+
+
+ // /////// Everything OK here - DO IT ///////////////
+
+ String pathInfo = sreq.getPathInfo();
+ Assert.exists(pathInfo, "String pathInfo");
+ if (pathInfo.length() > 1 && pathInfo.endsWith("/")) {
+ /* NOTE: ServletAPI specifies, pathInfo may be empty or will
+ * start with a '/' character. It currently carries a
+ * trailing '/' if a "virtual" page, i.e. not a real jsp, but
+ * result of a servlet mapping. But Application requires url
+ * NOT to end with a trailing '/' for legacy free applications. */
+ pathInfo = pathInfo.substring(0, pathInfo.length()-1);
+ }
+
+ final Page page = (Page) m_pages.get(pathInfo);
+
+ if (page != null) {
+
+ final Document doc = page.buildDocument(sreq, sresp);
+
+ PresentationManager pm = Templating.getPresentationManager();
+ pm.servePage(doc, sreq, sresp);
+
+ } else {
+
+ sresp.sendError(404, "No such page for path " + pathInfo);
+
+ }
+
+ }
+
+ /**
+ * Adds one Url-Page mapping to the internal mapping table.
+ *
+ * @param pathInfo url stub for a page to display
+ * @param page Page object to display
+ */
+ private void addPage(final String pathInfo, final Page page) {
+
+ Assert.exists(pathInfo, String.class);
+ Assert.exists(page, Page.class);
+ // Current Implementation requires pathInfo to start with a leading '/'
+ // SUN Servlet API specifies: "PathInfo *may be empty* or will start
+ // with a '/' character."
+ Assert.isTrue(pathInfo.startsWith("/"), "path starts not with '/'");
+
+ m_pages.put(pathInfo, page);
+ }
+
+
+ /**
+ * Index Page for the SiteMap application
+ * @return
+ */
+ private Page buildAdminIndexPage() {
+
+ Page p = PageFactory.buildPage("admin", "Sitemap Administration");
+
+ SiteListing listing = new SiteListing();
+ listing.setClassAttr("navbar");
+
+ SingleSelectionModel m = listing.getTree().getSelectionModel();
+ SiteMapAdminPane details = new SiteMapAdminPane(m, listing.getCFGLink());
+
+ BoxPanel box = new BoxPanel();
+ box.setClassAttr("main");
+ box.add(details);
+
+ SplitPanel panel = new SplitPanel();
+ panel.setClassAttr("sidebarNavPanel");
+ panel.setLeftComponent(listing);
+ panel.setRightComponent(box);
+
+ p.add(panel);
+ p.lock();
+
+ return p;
+ }
+
+
+}
diff --git a/ccm-core/src/com/arsdigita/web/BaseApplicationServlet.java b/ccm-core/src/com/arsdigita/web/BaseApplicationServlet.java
index 148600bfc..4177c0298 100755
--- a/ccm-core/src/com/arsdigita/web/BaseApplicationServlet.java
+++ b/ccm-core/src/com/arsdigita/web/BaseApplicationServlet.java
@@ -65,8 +65,7 @@ import org.apache.log4j.Logger;
*/
public abstract class BaseApplicationServlet extends BaseServlet {
- private static Logger s_log = Logger.getLogger
- (BaseApplicationServlet.class);
+ private static Logger s_log = Logger.getLogger(BaseApplicationServlet.class);
/**
* The ID of the application whose service is requested. This
diff --git a/ccm-core/src/com/arsdigita/webdevsupport/Dispatcher.java b/ccm-core/src/com/arsdigita/webdevsupport/Dispatcher.java.nolongerInUse
similarity index 97%
rename from ccm-core/src/com/arsdigita/webdevsupport/Dispatcher.java
rename to ccm-core/src/com/arsdigita/webdevsupport/Dispatcher.java.nolongerInUse
index 9c448a961..0ee283f4d 100755
--- a/ccm-core/src/com/arsdigita/webdevsupport/Dispatcher.java
+++ b/ccm-core/src/com/arsdigita/webdevsupport/Dispatcher.java.nolongerInUse
@@ -61,8 +61,8 @@ import com.arsdigita.web.LoginSignal;
import com.arsdigita.web.ParameterMap;
import com.arsdigita.web.RedirectSignal;
import com.arsdigita.web.URL;
-import com.arsdigita.webdevsupport.log4j.CategoryPanel;
-import com.arsdigita.webdevsupport.config.ConfigList;
+import com.arsdigita.webdevsupport.ui.CategoryPanel;
+import com.arsdigita.webdevsupport.ui.ConfigParameterList;
import com.arsdigita.xml.Element;
import java.io.IOException;
@@ -270,7 +270,7 @@ public class Dispatcher extends BebopMapDispatcher {
*/
private Page buildConfigPage() {
Page p = PageFactory.buildPage(APP_NAME, "Registry Config");
- p.add(new ConfigList());
+ p.add(new ConfigParameterList());
p.lock();
return p;
}
@@ -810,27 +810,3 @@ public class Dispatcher extends BebopMapDispatcher {
}
}
-
-class NonEscapedTableCellRenderer implements TableCellRenderer {
- private boolean m_controlLink;
- public NonEscapedTableCellRenderer(boolean controlLink) {
- super();
- m_controlLink = controlLink;
- }
- public NonEscapedTableCellRenderer() {
- this(true);
- }
-
- public Component getComponent(Table table, PageState state, Object value,
- boolean isSelected, Object key,
- int row, int column) {
- SimpleContainer c = new SimpleContainer();
- Label l = new Label((String)value);
- l.setOutputEscaping(false);
- c.add(l);
- if (m_controlLink) {
- c.add(new ControlLink("download"));
- }
- return c;
- }
-}
diff --git a/ccm-core/src/com/arsdigita/webdevsupport/LegacyInitializer.java.nolongerInUse b/ccm-core/src/com/arsdigita/webdevsupport/LegacyInitializer.java.nolongerInUse
deleted file mode 100755
index 33918ffb2..000000000
--- a/ccm-core/src/com/arsdigita/webdevsupport/LegacyInitializer.java.nolongerInUse
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-package com.arsdigita.webdevsupport;
-
-import com.arsdigita.kernel.BaseInitializer;
-import com.arsdigita.initializer.Configuration;
-import com.arsdigita.initializer.InitializationException;
-
-import com.arsdigita.developersupport.DeveloperSupport;
-import org.apache.log4j.Logger;
-
-
-// ///////////////////////////////////////////////////////////
-//
-// Moved to core initializer
-//
-// ///////////////////////////////////////////////////////////
-
-
-/**
- * Initializer
- *
- * @version $Revision: #17 $ $Date: 2004/08/16 $
- */
-
-public class LegacyInitializer extends BaseInitializer {
-
- private Configuration m_conf = new Configuration();
-
- public final static String ACTIVE = "active";
-
- private static final Logger s_log =
- Logger.getLogger(LegacyInitializer.class);
-
- public LegacyInitializer() throws InitializationException {
- m_conf.initParameter(ACTIVE,
- "Flag to turn on/off developer support",
- Boolean.class);
- }
-
- /**
- * Returns the configuration object used by this initializer.
- **/
- public Configuration getConfiguration() {
- return m_conf;
- }
-
-
- /**
- * Called on startup.
- **/
- protected void doStartup() {
- Boolean active = (Boolean)m_conf.getParameter(ACTIVE);
- if (Boolean.TRUE.equals(active)) {
- s_log.debug("Registering webdev listener");
- DeveloperSupport.addListener(WebDevSupport.getInstance());
- }
- }
-
- /**
- * Called on shutdown. It's probably not a good idea to depend on this
- * being called.
- **/
- protected void doShutdown() { }
-
-
-}
diff --git a/ccm-core/src/com/arsdigita/webdevsupport/WebDevSupportServlet.java b/ccm-core/src/com/arsdigita/webdevsupport/WebDevSupportServlet.java
index 9ea7b9ee9..9e321caba 100644
--- a/ccm-core/src/com/arsdigita/webdevsupport/WebDevSupportServlet.java
+++ b/ccm-core/src/com/arsdigita/webdevsupport/WebDevSupportServlet.java
@@ -32,6 +32,7 @@ import com.arsdigita.bebop.Page;
import com.arsdigita.bebop.PageFactory;
import com.arsdigita.bebop.PageState;
import com.arsdigita.bebop.RequestLocal;
+import com.arsdigita.bebop.SimpleContainer;
import com.arsdigita.bebop.Table;
import com.arsdigita.bebop.event.ActionEvent;
import com.arsdigita.bebop.event.ActionListener;
@@ -41,11 +42,13 @@ import com.arsdigita.bebop.parameters.IntegerParameter;
import com.arsdigita.bebop.parameters.ParameterModel;
import com.arsdigita.bebop.table.AbstractTableModelBuilder;
import com.arsdigita.bebop.table.DefaultTableCellRenderer;
+import com.arsdigita.bebop.table.TableCellRenderer;
import com.arsdigita.bebop.table.TableModel;
import com.arsdigita.bebop.table.TableModelBuilder;
import com.arsdigita.developersupport.DeveloperSupport;
import com.arsdigita.dispatcher.AccessDeniedException;
import com.arsdigita.dispatcher.DispatcherHelper;
+import com.arsdigita.dispatcher.RequestContext;
import com.arsdigita.kernel.Kernel;
import com.arsdigita.kernel.Party;
import com.arsdigita.kernel.permissions.PermissionDescriptor;
@@ -61,8 +64,8 @@ import com.arsdigita.web.LoginSignal;
import com.arsdigita.web.ParameterMap;
import com.arsdigita.web.RedirectSignal;
import com.arsdigita.web.URL;
-import com.arsdigita.webdevsupport.config.ConfigList;
-import com.arsdigita.webdevsupport.log4j.CategoryPanel;
+import com.arsdigita.webdevsupport.ui.ConfigParameterList;
+import com.arsdigita.webdevsupport.ui.CategoryPanel;
import com.arsdigita.xml.Document;
import com.arsdigita.xml.Element;
@@ -74,9 +77,9 @@ import java.util.ListIterator;
import java.util.Map;
import javax.servlet.ServletException;
-
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+
import org.apache.log4j.Logger;
/**
@@ -92,8 +95,8 @@ import org.apache.log4j.Logger;
*/
public class WebDevSupportServlet extends BaseApplicationServlet {
- private static final Logger s_log =
- Logger.getLogger(Dispatcher.class.getName());
+ private static final Logger s_log = Logger.getLogger(
+ WebDevSupportServlet.class.getName());
public static final String APP_NAME = "ds";
@@ -119,12 +122,12 @@ public class WebDevSupportServlet extends BaseApplicationServlet {
// cache table browser @ ~/ds/cache-table
addPage("/cache-table", buildCacheTablePage());
-// XXXX!!
-// QueryLog is a class of its own in webdevsupport, based upon dispatcher.Disp
-// and prints out all queries in a request
-// put("query-log", new QueryLog());
+ // XXXX!!
+ // QueryLog is a class of its own in webdevsupport, based upon
+ // dispatcher.Disp and prints out all queries in a request
+ // put("query-log", new QueryLog());
- addPage("/request-info", buildInfoPage());
+ addPage("/request-info", buildRequestInfoPage());
addPage("/query-info", buildQueryInfoPage());
addPage("/query-plan", buildQueryPlanPage());
@@ -180,8 +183,19 @@ public class WebDevSupportServlet extends BaseApplicationServlet {
pm.servePage(doc, sreq, sresp);
} else {
- sresp.sendError(404, "No such page for path " + pathInfo);
- // throw new IllegalStateException("No such page for path " + pathInfo);
+ if (pathInfo.equals("/query-log")) {
+
+ // special solution for query log to continue to use the
+ // dispatcher based creation of a new page.
+ // Should be refactored asap to use a PageFactory instead!
+ RequestContext ctx = DispatcherHelper.getRequestContext(sreq);
+ new QueryLog().dispatch(sreq, sresp, ctx);
+
+ } else {
+
+ sresp.sendError(404, "No such page for path " + pathInfo);
+
+ }
}
}
@@ -213,12 +227,21 @@ public class WebDevSupportServlet extends BaseApplicationServlet {
Page p = PageFactory.buildPage(APP_NAME, "Web Developer Support");
+
+ // Create a group of 4 permanent links, the first 3 to additional pages
+ // which handle status of logger instances, config properties and cache
+ // tables 1 or 2 to add additional information about requests to this
+ // page.
BoxPanel links = new BoxPanel(BoxPanel.VERTICAL);
links.add(new Link("Log4j Logger Adjuster", "/ds/log4j"));
links.add(new Link("Config Browser", "/ds/config"));
links.add(new Link("Cache Table Browser", "/ds/cache-table"));
+
+ // Creates an (page internal) action link to toggle reqest logging
+ // on/off. If ON additional page content is generated: a list of
+ // available requests (table view)
ActionLink enable = new ActionLink("Enable request logging") {
@Override
public boolean isVisible(PageState state) {
@@ -235,7 +258,7 @@ public class WebDevSupportServlet extends BaseApplicationServlet {
}
});
- links.add(enable);
+ links.add(enable); // add ActionLink to the link group
ActionLink disable = new ActionLink("Disable request logging") {
@Override
@@ -245,7 +268,6 @@ public class WebDevSupportServlet extends BaseApplicationServlet {
&& super.isVisible(state);
}
};
-
disable.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
DeveloperSupport.removeListener(WebDevSupportListener.getInstance());
@@ -254,8 +276,14 @@ public class WebDevSupportServlet extends BaseApplicationServlet {
null), true);
}
});
- links.add(disable);
+ links.add(disable); // add ActionLink to the link group, only visible
+ // if link enable is toggled ON and no longer visible!
+
+
+ // Create a box panel to show additional information about requests
+ // on a on demand base (must ge toggled ON by a link on the link panel)
+ // Visibility depends on the toggle
BoxPanel logs = new BoxPanel(BoxPanel.VERTICAL) {
@Override
public boolean isVisible(PageState state) {
@@ -265,6 +293,7 @@ public class WebDevSupportServlet extends BaseApplicationServlet {
}
};
+ // Adding info line about number of requests to store and show
logs.add(new Label("") {
@Override
public String getLabel(PageState ps) {
@@ -274,6 +303,7 @@ public class WebDevSupportServlet extends BaseApplicationServlet {
}
});
+ // Add aditional toggle whether or not to include hits to ds
Label toggle = new Label("") {
@Override
public String getLabel(PageState ps) {
@@ -292,46 +322,154 @@ public class WebDevSupportServlet extends BaseApplicationServlet {
}
};
-
+ // Add created widgets / controls to the log pannel
logs.add(cl);
logs.add(new Label("
Available Request Information
", false));
logs.add(makeRequestTable());
+ // Add all panels to the page and lock
p.add(links);
p.add(logs);
p.lock();
- return p;
+
+ return p; // page ready to display
}
/**
+ * Create a separate page to show logger instances and its state.
+ * Controlled by the 1. Link on the web developer support index page.
*
* @return log4j Page object
*/
private Page buildLog4jPage() {
+
Page p = PageFactory.buildPage(APP_NAME, "Log4j Logger Adjuster");
+
p.add(new CategoryPanel());
p.lock();
+
return p;
}
/**
+ * Create a separate page to show the status of configuration parameters
+ * for every installed package (module).
+ * Controlled by the 2. Link on the web developer support index page.
*
* @return config Page object
*/
private Page buildConfigPage() {
+
Page p = PageFactory.buildPage(APP_NAME, "Registry Config");
- p.add(new ConfigList());
+
+ p.add(new ConfigParameterList());
p.lock();
+
return p;
}
+ /**
+ * Create a separate page to show all cache tables in use.
+ * Controlled by the 3. Link on the web developer support page.
+ * @return
+ */
private Page buildCacheTablePage() {
+
Page p = PageFactory.buildPage(APP_NAME, "Cache Table Browser");
+
p.add(new CacheTableBrowser());
p.lock();
+
return p;
}
+
+ /**
+ * Create an additional component for the web developer support index page.
+ * Controlled by the 4. link (a toggle) to show request information.
+ *
+ * @return
+ */
+ private Table makeRequestTable() {
+ final String[] headers = { "Time", "Duration", "Queries", "IP",
+ "Request", "Extra" };
+
+ TableModelBuilder b = new AbstractTableModelBuilder() {
+ public TableModel makeModel(Table t, PageState s) {
+ return new TableModel() {
+ ListIterator iter =
+ WebDevSupportListener.getInstance().getRequestsReverse();
+ private RequestInfo current = null;
+
+ public int getColumnCount() {
+ return 6;
+ }
+
+ public boolean nextRow() {
+ while (iter.hasPrevious()) {
+ current = (RequestInfo) iter.previous();
+ boolean isdevsupp = current.isDevSupportRequest();
+ if (s_showDSPages || !isdevsupp) {
+ return true;
+ }
+ }
+ return false;
+ }
+ static final int MAXSTR = 35;
+ public Object getElementAt(int columnIndex) {
+ switch (columnIndex) {
+ case 0: return current.getTime();
+ case 1: return current.getDuration();
+ case 2: return current.getNumQueries()+"";
+ case 3: return current.getIP();
+ case 4: {
+ String req = current.getRequest();
+ if (req.length() > MAXSTR) {
+ return req.substring(0, MAXSTR)+"...";
+ } else {
+ return req;
+ }
+ }
+ case 5:
+ return "[query log]";
+ default: return null;
+ }
+ }
+
+ public Object getKeyAt(int columnIndex) {
+ return new Integer(current.getID());
+ }
+ };
+ }
+ };
+
+ Table result = new Table(b, headers);
+ result.getColumn(4).setCellRenderer(new
+ DefaultTableCellRenderer(true));
+ result.getColumn(5).setCellRenderer(new
+ DefaultTableCellRenderer(true));
+ result.addTableActionListener(new TableActionAdapter() {
+ @Override
+ public void cellSelected(TableActionEvent e) {
+ final ParameterMap params = new ParameterMap();
+ params.setParameter("request_id", e.getRowKey());
+
+ if (e.getColumn().intValue() == 4) {
+ throw new RedirectSignal(URL.getDispatcherPath() +
+ "/ds/request-info" + params, true);
+ } else if (e.getColumn().intValue() == 5) {
+ throw new RedirectSignal(URL.getDispatcherPath() +
+ "/ds/query-log" + params, true);
+ }
+ }
+ });
+ Label l = new Label("None");
+ l.setFontWeight(Label.ITALIC);
+ l.setStyleAttr("padding-left: 3em");
+ result.setEmptyView(l);
+ result.setWidth("100%");
+ return result;
+ }
private ParameterModel m_request_id = new IntegerParameter("request_id");
@@ -340,12 +478,15 @@ public class WebDevSupportServlet extends BaseApplicationServlet {
*
* @return info Page object
*/
- private Page buildInfoPage() {
+ private Page buildRequestInfoPage() {
+
Page p = PageFactory.buildPage(APP_NAME, "Request Information");
+
p.addGlobalStateParam(m_request_id);
- // p.add(new RequestInfoComponent());
+ p.add(new RequestInfoOverviewHeaderComponent());
p.add(makeDatabaseRequestComponent());
p.lock();
+
return p;
}
@@ -577,88 +718,6 @@ public class WebDevSupportServlet extends BaseApplicationServlet {
return panel;
}
-
- private Table makeRequestTable() {
- final String[] headers = { "Time", "Duration", "Queries", "IP",
- "Request", "Extra" };
-
- TableModelBuilder b = new AbstractTableModelBuilder() {
- public TableModel makeModel(Table t, PageState s) {
- return new TableModel() {
- ListIterator iter =
- WebDevSupportListener.getInstance().getRequestsReverse();
- private RequestInfo current = null;
-
- public int getColumnCount() {
- return 6;
- }
-
- public boolean nextRow() {
- while (iter.hasPrevious()) {
- current = (RequestInfo) iter.previous();
- boolean isdevsupp = current.isDevSupportRequest();
- if (s_showDSPages || !isdevsupp) {
- return true;
- }
- }
- return false;
- }
- static final int MAXSTR = 35;
- public Object getElementAt(int columnIndex) {
- switch (columnIndex) {
- case 0: return current.getTime();
- case 1: return current.getDuration();
- case 2: return current.getNumQueries()+"";
- case 3: return current.getIP();
- case 4: {
- String req = current.getRequest();
- if (req.length() > MAXSTR) {
- return req.substring(0, MAXSTR)+"...";
- } else {
- return req;
- }
- }
- case 5:
- return "[query log]";
- default: return null;
- }
- }
-
- public Object getKeyAt(int columnIndex) {
- return new Integer(current.getID());
- }
- };
- }
- };
-
- Table result = new Table(b, headers);
- result.getColumn(4).setCellRenderer(new
- DefaultTableCellRenderer(true));
- result.getColumn(5).setCellRenderer(new
- DefaultTableCellRenderer(true));
- result.addTableActionListener(new TableActionAdapter() {
- @Override
- public void cellSelected(TableActionEvent e) {
- final ParameterMap params = new ParameterMap();
- params.setParameter("request_id", e.getRowKey());
-
- if (e.getColumn().intValue() == 4) {
- throw new RedirectSignal(URL.getDispatcherPath() +
- "/ds/request-info" + params, true);
- } else if (e.getColumn().intValue() == 5) {
- throw new RedirectSignal(URL.getDispatcherPath() +
- "/ds/query-log" + params, true);
- }
- }
- });
- Label l = new Label("None");
- l.setFontWeight(Label.ITALIC);
- l.setStyleAttr("padding-left: 3em");
- result.setEmptyView(l);
- result.setWidth("100%");
- return result;
- }
-
String dashes(int depth) {
StringBuilder sb = new StringBuilder();
while (depth-- > 0) sb.append("--");
@@ -681,14 +740,17 @@ public class WebDevSupportServlet extends BaseApplicationServlet {
}
/**
- *
+ * Internal class to create a page component to display summerized
+ * information about a request. It is displayed as a header / summary
+ * paragraph in the top part of the "request Information" page, build by
+ * buildRequestInfoPage method.
*/
- class RequestInfoComponent extends com.arsdigita.bebop.SimpleComponent {
+ class RequestInfoOverviewHeaderComponent extends com.arsdigita.bebop.SimpleComponent {
/**
* Constructor
*/
- public RequestInfoComponent() {
+ public RequestInfoOverviewHeaderComponent() {
super();
}
@@ -868,9 +930,36 @@ public class WebDevSupportServlet extends BaseApplicationServlet {
}
+}
+
// We need NonEscapedTableCellRenderer
// Currently part of (thisPackage) Dispatcher.java
// When the class will we deleted we must copy first!
+/**
+ * Public class
+ *
+ */
+class NonEscapedTableCellRenderer implements TableCellRenderer {
+ private boolean m_controlLink;
+ public NonEscapedTableCellRenderer(boolean controlLink) {
+ super();
+ m_controlLink = controlLink;
+ }
+ public NonEscapedTableCellRenderer() {
+ this(true);
+ }
+ public Component getComponent(Table table, PageState state, Object value,
+ boolean isSelected, Object key,
+ int row, int column) {
+ SimpleContainer c = new SimpleContainer();
+ Label l = new Label((String)value);
+ l.setOutputEscaping(false);
+ c.add(l);
+ if (m_controlLink) {
+ c.add(new ControlLink("download"));
+ }
+ return c;
+ }
}
diff --git a/ccm-core/src/com/arsdigita/webdevsupport/log4j/CategoryForm.java b/ccm-core/src/com/arsdigita/webdevsupport/ui/CategoryForm.java
similarity index 98%
rename from ccm-core/src/com/arsdigita/webdevsupport/log4j/CategoryForm.java
rename to ccm-core/src/com/arsdigita/webdevsupport/ui/CategoryForm.java
index 3c23571c6..1aaf3d4b1 100755
--- a/ccm-core/src/com/arsdigita/webdevsupport/log4j/CategoryForm.java
+++ b/ccm-core/src/com/arsdigita/webdevsupport/ui/CategoryForm.java
@@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-package com.arsdigita.webdevsupport.log4j;
+package com.arsdigita.webdevsupport.ui;
import com.arsdigita.bebop.form.SingleSelect;
import com.arsdigita.bebop.form.Option;
diff --git a/ccm-core/src/com/arsdigita/webdevsupport/log4j/CategoryPanel.java b/ccm-core/src/com/arsdigita/webdevsupport/ui/CategoryPanel.java
similarity index 98%
rename from ccm-core/src/com/arsdigita/webdevsupport/log4j/CategoryPanel.java
rename to ccm-core/src/com/arsdigita/webdevsupport/ui/CategoryPanel.java
index b38729402..07e5af75a 100755
--- a/ccm-core/src/com/arsdigita/webdevsupport/log4j/CategoryPanel.java
+++ b/ccm-core/src/com/arsdigita/webdevsupport/ui/CategoryPanel.java
@@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-package com.arsdigita.webdevsupport.log4j;
+package com.arsdigita.webdevsupport.ui;
import com.arsdigita.bebop.FormProcessException;
import com.arsdigita.bebop.SimpleContainer;
diff --git a/ccm-core/src/com/arsdigita/webdevsupport/log4j/CategoryTable.java b/ccm-core/src/com/arsdigita/webdevsupport/ui/CategoryTable.java
similarity index 98%
rename from ccm-core/src/com/arsdigita/webdevsupport/log4j/CategoryTable.java
rename to ccm-core/src/com/arsdigita/webdevsupport/ui/CategoryTable.java
index 5ad6a3775..c9e612698 100755
--- a/ccm-core/src/com/arsdigita/webdevsupport/log4j/CategoryTable.java
+++ b/ccm-core/src/com/arsdigita/webdevsupport/ui/CategoryTable.java
@@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-package com.arsdigita.webdevsupport.log4j;
+package com.arsdigita.webdevsupport.ui;
import com.arsdigita.util.LockableImpl;
import com.arsdigita.bebop.ControlLink;
diff --git a/ccm-core/src/com/arsdigita/webdevsupport/config/ConfigList.java b/ccm-core/src/com/arsdigita/webdevsupport/ui/ConfigParameterList.java
similarity index 96%
rename from ccm-core/src/com/arsdigita/webdevsupport/config/ConfigList.java
rename to ccm-core/src/com/arsdigita/webdevsupport/ui/ConfigParameterList.java
index 63d1841f5..614de5a26 100755
--- a/ccm-core/src/com/arsdigita/webdevsupport/config/ConfigList.java
+++ b/ccm-core/src/com/arsdigita/webdevsupport/ui/ConfigParameterList.java
@@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-package com.arsdigita.webdevsupport.config;
+package com.arsdigita.webdevsupport.ui;
import com.arsdigita.bebop.SimpleContainer;
import com.arsdigita.bebop.PageState;
@@ -40,14 +40,18 @@ import java.util.ArrayList;
import org.apache.log4j.Logger;
-public class ConfigList extends SimpleContainer {
+/**
+ *
+ *
+ */
+public class ConfigParameterList extends SimpleContainer {
- private static final Logger s_log = Logger.getLogger(ConfigList.class);
+ private static final Logger s_log = Logger.getLogger(ConfigParameterList.class);
public static final String XML_NS = "http://xmlns.redhat.com/waf/webdevsupport/1.0";
- public ConfigList() {
+ public ConfigParameterList() {
super("devsup:configList",
XML_NS);
}
diff --git a/ccm-core/src/com/arsdigita/webdevsupport/log4j/package.html b/ccm-core/src/com/arsdigita/webdevsupport/ui/package.html
similarity index 100%
rename from ccm-core/src/com/arsdigita/webdevsupport/log4j/package.html
rename to ccm-core/src/com/arsdigita/webdevsupport/ui/package.html
diff --git a/ccm-core/web/assets/xinha/plugins/DefinitionList/lang/de.js b/ccm-core/web/assets/xinha/plugins/DefinitionList/lang/de.js
new file mode 100644
index 000000000..130153d73
--- /dev/null
+++ b/ccm-core/web/assets/xinha/plugins/DefinitionList/lang/de.js
@@ -0,0 +1,8 @@
+// I18N constants
+// LANG: "de", ENCODING: UTF-8
+// Author: Peter Boy, pboy@zes.uni-bremen.de
+{
+ "definition list": "Definitionsliste",
+ "definition term": "Begriff",
+ "definition description": "Definition"
+}
diff --git a/ccm-core/web/themes/heirloom/apps/sitemap/xsl/index.xsl b/ccm-core/web/themes/heirloom/apps/sitemap/xsl/index.xsl
index 461568ab5..9f7fc545e 100644
--- a/ccm-core/web/themes/heirloom/apps/sitemap/xsl/index.xsl
+++ b/ccm-core/web/themes/heirloom/apps/sitemap/xsl/index.xsl
@@ -4,6 +4,6 @@
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
-
+
diff --git a/ccm-ldn-terms/sql/ccm-ldn-terms/default/upgrade/6.6.1-6.6.2/remove_legacy_entries.sql b/ccm-ldn-terms/sql/ccm-ldn-terms/default/upgrade/6.6.1-6.6.2/remove_legacy_entries.sql
index f364587b3..f8ac17f7c 100644
--- a/ccm-ldn-terms/sql/ccm-ldn-terms/default/upgrade/6.6.1-6.6.2/remove_legacy_entries.sql
+++ b/ccm-ldn-terms/sql/ccm-ldn-terms/default/upgrade/6.6.1-6.6.2/remove_legacy_entries.sql
@@ -26,7 +26,7 @@
-- delete from object_context all entries referring to node_id in site_nodes
delete from object_context
where object_id in
- (select node_id from site_nodes object_id where object_id in
+ (select node_id from site_nodes where object_id in
( select package_id from applications where application_type_id =
(select application_type_id from application_types
where object_type
diff --git a/ccm-rssfeed/sql/ccm-rssfeed/upgrade/default/6.6.0-6.6.1/remove_legacy_entries.sql b/ccm-rssfeed/sql/ccm-rssfeed/upgrade/default/6.6.0-6.6.1/remove_legacy_entries.sql
index cec906aae..160c57235 100644
--- a/ccm-rssfeed/sql/ccm-rssfeed/upgrade/default/6.6.0-6.6.1/remove_legacy_entries.sql
+++ b/ccm-rssfeed/sql/ccm-rssfeed/upgrade/default/6.6.0-6.6.1/remove_legacy_entries.sql
@@ -26,7 +26,7 @@
-- delete from object_context all entries referring to node_id in site_nodes
delete from object_context
where object_id in
- (select node_id from site_nodes object_id where object_id in
+ (select node_id from site_nodes where object_id in
( select package_id from applications where application_type_id =
(select application_type_id from application_types
where object_type
diff --git a/ccm-sci-bundle/bundles/demo/cfg/web-sci.xml b/ccm-sci-bundle/bundles/demo/cfg/web-sci.xml
index 74f9d554a..f6b04e92f 100644
--- a/ccm-sci-bundle/bundles/demo/cfg/web-sci.xml
+++ b/ccm-sci-bundle/bundles/demo/cfg/web-sci.xml
@@ -122,6 +122,26 @@
com.arsdigita.versioning.VersioningServlet