diff --git a/config/alfresco/messages/webclient.properties b/config/alfresco/messages/webclient.properties index fdd91390de..df6cc54427 100644 --- a/config/alfresco/messages/webclient.properties +++ b/config/alfresco/messages/webclient.properties @@ -1509,6 +1509,17 @@ configadmin_last_command=Last command: configadmin_duration=Duration: configadmin_duration_ms=ms + +# Repository Admin Console messages +title_repoadmin_console=Repository Admin Console +repoadmin_context=Context +repoadmin_command=Command (type help for help) +repoadmin_command_submit=Submit +repoadmin_last_command=Last command: +repoadmin_duration=Duration: +repoadmin_duration_ms=ms + + # OpenSearch messages show=Show opensearch=OpenSearch diff --git a/source/java/org/alfresco/web/bean/repository/admin/RepoAdminConsoleBean.java b/source/java/org/alfresco/web/bean/repository/admin/RepoAdminConsoleBean.java new file mode 100755 index 0000000000..aa9318ddf9 --- /dev/null +++ b/source/java/org/alfresco/web/bean/repository/admin/RepoAdminConsoleBean.java @@ -0,0 +1,185 @@ +/* + * Copyright (C) 2005-2007 Alfresco Software Limited. + * + * This program 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 2 + * of the License, or (at your option) any later version. + + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + * As a special exception to the terms and conditions of version 2.0 of + * the GPL, you may redistribute this Program in connection with Free/Libre + * and Open Source Software ("FLOSS") applications as described in Alfresco's + * FLOSS exception. You should have recieved a copy of the text describing + * the FLOSS exception, and it is also available here: + * http://www.alfresco.com/legal/licensing" + */ +package org.alfresco.web.bean.repository.admin; + +import java.io.PrintWriter; +import java.io.StringWriter; + +import org.alfresco.repo.admin.RepoAdminInterpreter; + + +/** + * Backing bean to support the Repository Admin Console + */ +public class RepoAdminConsoleBean +{ + // command + private String command = ""; + private String submittedCommand = "none"; + private long duration = 0L; + private String result = null; + + // supporting repository services + private RepoAdminInterpreter repoAdminInterpreter; + + + /** + * @param repoAdminInterpreter repo admin interpreter + */ + public void setRepoAdminInterpreter(RepoAdminInterpreter repoAdminInterpreter) + { + this.repoAdminInterpreter = repoAdminInterpreter; + } + + /** + * Gets the command result + * + * @return result + */ + public String getResult() + { + if (result == null) + { + interpretCommand("help"); + } + return result; + } + + /** + * Sets the command result + * + * @param result + */ + public void setResult(String result) + { + this.result = result; + } + + /** + * Gets the current query + * + * @return query statement + */ + public String getCommand() + { + return command; + } + + /** + * Set the current command + * + * @param command command + */ + public void setCommand(String command) + { + this.command = command; + } + + /** + * Gets the submitted command + * + * @return submitted command + */ + public String getSubmittedCommand() + { + return submittedCommand; + } + + /** + * Set the submitted command + * + * @param submittedCommand The submitted command + */ + public void setSubmittedCommand(String submittedCommand) + { + this.submittedCommand = submittedCommand; + } + + /** + * Gets the last command duration + * + * @return command duration + */ + public long getDuration() + { + return duration; + } + + /** + * Set the duration + * + * @param duration The duration + */ + public void setDuration(long duration) + { + this.duration = duration; + } + + /** + * Action to submit command + * + * @return next action + */ + public String submitCommand() + { + interpretCommand(command); + return "success"; + } + + /** + * Gets the current user name + * + * @return user name + */ + public String getCurrentUserName() + { + return repoAdminInterpreter.getCurrentUserName(); + } + + /** + * Interpret repo admin console command + * + * @param command command + */ + private void interpretCommand(String command) + { + try + { + long startms = System.currentTimeMillis(); + String result = repoAdminInterpreter.interpretCommand(command); + setDuration(System.currentTimeMillis() - startms); + setResult(result); + setCommand(""); + setSubmittedCommand(command); + } + catch (Exception e) + { + StringWriter stackTrace = new StringWriter(); + e.printStackTrace(new PrintWriter(stackTrace)); + setResult(stackTrace.toString()); + } + } + +} diff --git a/source/web/WEB-INF/faces-config-beans.xml b/source/web/WEB-INF/faces-config-beans.xml index cb461b3c28..5ae57f27ac 100644 --- a/source/web/WEB-INF/faces-config-beans.xml +++ b/source/web/WEB-INF/faces-config-beans.xml @@ -2348,18 +2348,29 @@ workflowInterpreter #{workflowInterpreter} - - + + + + Backing bean used for the Web Client Config Admin Console + ConfigAdminConsoleBean + org.alfresco.web.bean.ConfigAdminConsoleBean + session + + configAdminInterpreter + #{webClientConfigAdminInterpreter} + + + - Backing bean used for the Web Client Config Admin Console - ConfigAdminConsoleBean - org.alfresco.web.bean.ConfigAdminConsoleBean + Backing bean used for the Repository Admin Console + RepoAdminConsoleBean + org.alfresco.web.bean.repository.admin.RepoAdminConsoleBean session - configAdminInterpreter - #{webClientConfigAdminInterpreter} + repoAdminInterpreter + #{repoAdminInterpreter} - + diff --git a/source/web/jsp/admin/repoadmin-console.jsp b/source/web/jsp/admin/repoadmin-console.jsp new file mode 100755 index 0000000000..03973f2941 --- /dev/null +++ b/source/web/jsp/admin/repoadmin-console.jsp @@ -0,0 +1,107 @@ +<%-- + * Copyright (C) 2005-2007 Alfresco Software Limited. + + * This program 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 2 + * of the License, or (at your option) any later version. + + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + * As a special exception to the terms and conditions of version 2.0 of + * the GPL, you may redistribute this Program in connection with Free/Libre + * and Open Source Software ("FLOSS") applications as described in Alfresco's + * FLOSS exception. You should have recieved a copy of the text describing + * the FLOSS exception, and it is also available here: + * http://www.alfresco.com/legal/licensing" +--%> +<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> +<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> + +<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %> +<%@ page isELIgnored="false" %> +<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> + + + + + + <%-- load a bundle of properties with I18N strings --%> + + + + + + + + + + +
+ + + + + +
+ +
+ +
+ + + + + + + +
User:
+ +
+ + + + + + + + + +
+ + + +
+
+ + + + + + + + +
+
+
+ ----- +
+
+
+ +
+ +
+ +