Old Release

This documentation relates to an old version of DSpace, version 6.x. Looking for another version? See all documentation.

Support for DSpace 6 ended on July 1, 2023.  See Support for DSpace 5 and 6 is ending in 2023

The administrative control panel with DS-2625 makes it easier to craft new (potentially repository specific) content available to administrators only. If your admins need to see logs (but you don't want to give access to the whole machine), if they need to see environment variables, some specific queries, or just need a place for links to content harvesters/quality control; consider putting it together as a control panel tab. You'll need at least some Java knowledge...

Below you'll find details about the control panel configuration and an example of a "minimal" tab.


The control panel is configured in dspace/config/modules/controlpanel.cfg. This file contains a list of named plugins (see PluginManager) implementing the ControlPanelTab interface. Then there is a list of enabled tabs, these will be visible in the actual control panel; this list is called simply controlpanel.tabs. The names given in the list are used as i18n message keys together with "xmlui.administrative.ControlPanel.tabs." as a prefix, ie. when you name a tab "Java Information" the message key is "xmlui.administrative.ControlPanel.tabs.Java Information". The message value is what you see in the control panel.

Currently the configured tabs are the same tabs that were present in the previous non-configurable version. You can remove any of them by removing/commenting the appropriate line. 


Creating new tabs

New tabs should extend AbstractControlPanelTab and implement addBody method.

A new tab is a matter of few lines:

--- /dev/null
+++ b/dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/administrative/controlpanel/TestTab.java
@@ -0,0 +1,27 @@
+package org.dspace.app.xmlui.aspect.administrative.controlpanel;
+import java.sql.SQLException;
+import java.util.Map;
+import org.dspace.app.xmlui.wing.WingException;
+import org.dspace.app.xmlui.wing.element.Division;
+import org.dspace.app.xmlui.wing.element.Para;
+public class TestTab extends AbstractControlPanelTab {
+	@Override
+	public void addBody(Map objectModel, Division div) throws WingException {
+		Para para = div.addPara();
+		para.addContent("I am your new tab. You can reach me via ");
+		para.addXref(this.web_link, this.web_link);
+	}

Notice the link to the tab itself (ie. contextPath + "/admin/panel?tab=" + tab_name) is obtained with this.web_link. That comes in handy when the tab accepts parameters.


Now add the new tab to the configuration:

--- a/dspace/config/modules/controlpanel.cfg
+++ b/dspace/config/modules/controlpanel.cfg
@@ -10,6 +10,7 @@ controlpanel.tabs = Configuration
 controlpanel.tabs = SystemWide Alerts
 controlpanel.tabs = Harvesting
 controlpanel.tabs = Current Activity
+controlpanel.tabs = Test Tab
 ### Define Control Panel Tab Plugins / Names (one per line)
 ### These define the names of each Control Panel Tab plugin (names are used to enable/disable the tabs above)
@@ -19,3 +20,4 @@ plugin.named.org.dspace.app.xmlui.aspect.administrative.controlpanel.ControlPane
 plugin.named.org.dspace.app.xmlui.aspect.administrative.controlpanel.ControlPanelTab = org.dspace.app.xmlui.aspect.administrative.controlpanel.ControlPanelAlertsTab = SystemWide Alerts
 plugin.named.org.dspace.app.xmlui.aspect.administrative.controlpanel.ControlPanelTab = org.dspace.app.xmlui.aspect.administrative.controlpanel.ControlPanelHarvestingTab = Harvesting
 plugin.named.org.dspace.app.xmlui.aspect.administrative.controlpanel.ControlPanelTab = org.dspace.app.xmlui.aspect.administrative.controlpanel.ControlPanelCurrentActivityTab = Current Activity
+plugin.named.org.dspace.app.xmlui.aspect.administrative.controlpanel.ControlPanelTab = org.dspace.app.xmlui.aspect.administrative.controlpanel.TestTab = Test Tab
And finally the message key:
--- a/dspace-xmlui/src/main/webapp/i18n/messages.xml
+++ b/dspace-xmlui/src/main/webapp/i18n/messages.xml
@@ -2030,6 +2030,7 @@
 	<message key="xmlui.administrative.ControlPanel.tabs.SystemWide Alerts">SystemWide Alerts</message>
 	<message key="xmlui.administrative.ControlPanel.tabs.Harvesting">Harvesting</message>
 	<message key="xmlui.administrative.ControlPanel.tabs.Current Activity">Current Activity</message>
+	<message key="xmlui.administrative.ControlPanel.tabs.Test Tab">1..2..3 TEST</message>
 	<!-- org.dspace.app.xmlui.administrative.SystemwideAlerts -->
 	<message key="xmlui.administrative.SystemwideAlerts.countdown"><strong>In {0} minutes</strong>: </message>


For more elaborate examples refer to the already configured Tabs or see the ControlPanel* classes in https://github.com/ufal/lindat-dspace/tree/lindat/dspace-xmlui/src/main/java/cz/cuni/mff/ufal/dspace/app/xmlui/aspect/administrative

  • No labels