mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
First-cut RepoAdmin Console for managing models & messages in the repo (cannot yet be used - pending patches for new Data Dictionary spaces)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6683 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1509,6 +1509,17 @@ configadmin_last_command=Last command:
|
|||||||
configadmin_duration=Duration:
|
configadmin_duration=Duration:
|
||||||
configadmin_duration_ms=ms
|
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
|
# OpenSearch messages
|
||||||
show=Show
|
show=Show
|
||||||
opensearch=OpenSearch
|
opensearch=OpenSearch
|
||||||
|
185
source/java/org/alfresco/web/bean/repository/admin/RepoAdminConsoleBean.java
Executable file
185
source/java/org/alfresco/web/bean/repository/admin/RepoAdminConsoleBean.java
Executable file
@@ -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());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -2348,18 +2348,29 @@
|
|||||||
<property-name>workflowInterpreter</property-name>
|
<property-name>workflowInterpreter</property-name>
|
||||||
<value>#{workflowInterpreter}</value>
|
<value>#{workflowInterpreter}</value>
|
||||||
</managed-property>
|
</managed-property>
|
||||||
</managed-bean>
|
</managed-bean>
|
||||||
|
|
||||||
|
<managed-bean>
|
||||||
|
<description>Backing bean used for the Web Client Config Admin Console</description>
|
||||||
|
<managed-bean-name>ConfigAdminConsoleBean</managed-bean-name>
|
||||||
|
<managed-bean-class>org.alfresco.web.bean.ConfigAdminConsoleBean</managed-bean-class>
|
||||||
|
<managed-bean-scope>session</managed-bean-scope>
|
||||||
|
<managed-property>
|
||||||
|
<property-name>configAdminInterpreter</property-name>
|
||||||
|
<value>#{webClientConfigAdminInterpreter}</value>
|
||||||
|
</managed-property>
|
||||||
|
</managed-bean>
|
||||||
|
|
||||||
<managed-bean>
|
<managed-bean>
|
||||||
<description>Backing bean used for the Web Client Config Admin Console</description>
|
<description>Backing bean used for the Repository Admin Console</description>
|
||||||
<managed-bean-name>ConfigAdminConsoleBean</managed-bean-name>
|
<managed-bean-name>RepoAdminConsoleBean</managed-bean-name>
|
||||||
<managed-bean-class>org.alfresco.web.bean.ConfigAdminConsoleBean</managed-bean-class>
|
<managed-bean-class>org.alfresco.web.bean.repository.admin.RepoAdminConsoleBean</managed-bean-class>
|
||||||
<managed-bean-scope>session</managed-bean-scope>
|
<managed-bean-scope>session</managed-bean-scope>
|
||||||
<managed-property>
|
<managed-property>
|
||||||
<property-name>configAdminInterpreter</property-name>
|
<property-name>repoAdminInterpreter</property-name>
|
||||||
<value>#{webClientConfigAdminInterpreter}</value>
|
<value>#{repoAdminInterpreter}</value>
|
||||||
</managed-property>
|
</managed-property>
|
||||||
</managed-bean>
|
</managed-bean>
|
||||||
|
|
||||||
<managed-bean>
|
<managed-bean>
|
||||||
<description>
|
<description>
|
||||||
|
107
source/web/jsp/admin/repoadmin-console.jsp
Executable file
107
source/web/jsp/admin/repoadmin-console.jsp
Executable file
@@ -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" %>
|
||||||
|
|
||||||
|
<r:page titleId="title_repoadmin_console">
|
||||||
|
|
||||||
|
<f:view>
|
||||||
|
|
||||||
|
<%-- load a bundle of properties with I18N strings --%>
|
||||||
|
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/>
|
||||||
|
|
||||||
|
<h:form id="RepoAdmin-console-title">
|
||||||
|
|
||||||
|
<table width="100%">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<h:graphicImage value="/images/logo/AlfrescoLogo32.png" alt="Alfresco" />
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<nobr><h:outputText id="titleRepoAdminConsole" styleClass="mainTitle" value="#{msg.title_repoadmin_console}"/></nobr>
|
||||||
|
</td>
|
||||||
|
<td width="100%" align="right">
|
||||||
|
<h:commandButton value="#{msg.close}" action="adminConsole" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</h:form>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<h:outputText id="contextTitle" styleClass="mainTitle" value="#{msg.repoadmin_context}"/>
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td><b>User:</b></td><td><h:outputText id="userName" value="#{RepoAdminConsoleBean.currentUserName}"/></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<h:outputText id="commandTitle" styleClass="mainTitle" value="#{msg.repoadmin_command}"/>
|
||||||
|
|
||||||
|
<h:form id="searchForm">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<h:inputText id="command" size="100" value="#{RepoAdminConsoleBean.command}"/>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<h:commandButton id="submitCommand" action="#{RepoAdminConsoleBean.submitCommand}" value="#{msg.repoadmin_command_submit}"/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</h:form>
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<h:outputText id="submittedCommandLabel" value="#{msg.repoadmin_last_command}"/> <h:outputText id="submittedCommand" value="#{RepoAdminConsoleBean.submittedCommand}"/><br>
|
||||||
|
<h:outputText id="durationLabel" value="#{msg.repoadmin_duration}"/> <h:outputText id="duration" value="#{RepoAdminConsoleBean.duration}"/><h:outputText id="durationMsLabel" value="#{msg.repoadmin_duration_ms}"/><br>
|
||||||
|
-----
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<pre><h:outputText id="result" value="#{RepoAdminConsoleBean.result}"/></pre>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</f:view>
|
||||||
|
|
||||||
|
</r:page>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.getElementById("searchForm:command").focus();
|
||||||
|
</script>
|
Reference in New Issue
Block a user