mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
. Added Repository and Patch system properties to System Info admin page in the web-client
. For extensibility - changed all service references in appropriate JSF Managed beans from "private" to "protected" git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2426 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -52,7 +52,7 @@ public abstract class BaseDebugComponent extends SelfRenderingComponent
|
||||
}
|
||||
|
||||
ResponseWriter out = context.getResponseWriter();
|
||||
out.write("<table cellpadding='3' cellspacing='3' border='1'>");
|
||||
out.write("<table cellpadding='2' cellspacing='2' border='0' style='border: 1px solid #aaaaaa;border-collapse: collapse;border-spacing: 0px;'>");
|
||||
|
||||
if (this.getTitle() != null)
|
||||
{
|
||||
@@ -61,12 +61,12 @@ public abstract class BaseDebugComponent extends SelfRenderingComponent
|
||||
out.write("</td></tr>");
|
||||
}
|
||||
|
||||
out.write("<tr><th align='left'>Property</th><th align='left'>Value</th></tr>");
|
||||
out.write("<tr style='border: 1px solid #dddddd;'><th align='left'>Property</th><th align='left'>Value</th></tr>");
|
||||
|
||||
Map session = getDebugData();
|
||||
for (Object key : session.keySet())
|
||||
{
|
||||
out.write("<tr><td>");
|
||||
out.write("<tr style='border: 1px solid #dddddd;'><td>");
|
||||
out.write(key.toString());
|
||||
out.write("</td><td>");
|
||||
Object obj = session.get(key);
|
||||
|
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* Copyright (C) 2005 Alfresco, Inc.
|
||||
*
|
||||
* Licensed under the Mozilla Public License version 1.1
|
||||
* with a permitted attribution clause. You may obtain a
|
||||
* copy of the License at
|
||||
*
|
||||
* http://www.alfresco.org/legal/license.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific
|
||||
* language governing permissions and limitations under the
|
||||
* License.
|
||||
*/
|
||||
package org.alfresco.web.ui.common.component.debug;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
|
||||
import org.alfresco.repo.admin.patch.PatchInfo;
|
||||
import org.alfresco.repo.admin.patch.PatchService;
|
||||
import org.alfresco.service.ServiceRegistry;
|
||||
import org.alfresco.service.descriptor.DescriptorService;
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.bean.repository.Repository;
|
||||
import org.springframework.web.context.WebApplicationContext;
|
||||
import org.springframework.web.jsf.FacesContextUtils;
|
||||
|
||||
/**
|
||||
* Component which displays the Alfresco Repository properties
|
||||
*
|
||||
* @author kevinr
|
||||
*/
|
||||
public class UIRepositoryProperties extends BaseDebugComponent
|
||||
{
|
||||
/**
|
||||
* @see javax.faces.component.UIComponent#getFamily()
|
||||
*/
|
||||
public String getFamily()
|
||||
{
|
||||
return "org.alfresco.faces.debug.RepositoryProperties";
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.web.ui.common.component.debug.BaseDebugComponent#getDebugData()
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public Map getDebugData()
|
||||
{
|
||||
// note: sort properties
|
||||
Map properties = new TreeMap();
|
||||
|
||||
FacesContext fc = FacesContext.getCurrentInstance();
|
||||
ServiceRegistry services = Repository.getServiceRegistry(fc);
|
||||
DescriptorService descriptorService = services.getDescriptorService();
|
||||
|
||||
properties.put("version", descriptorService.getRepositoryDescriptor().getVersion());
|
||||
properties.put("schema", descriptorService.getRepositoryDescriptor().getSchema());
|
||||
|
||||
WebApplicationContext cx = FacesContextUtils.getRequiredWebApplicationContext(fc);
|
||||
PatchService patchService = (PatchService)cx.getBean("PatchService");
|
||||
List<PatchInfo> patches = patchService.getPatches(null, null);
|
||||
for (PatchInfo patch : patches)
|
||||
{
|
||||
StringBuilder data = new StringBuilder(256);
|
||||
data.append(patch.getAppliedOnDate())
|
||||
.append(" - ")
|
||||
.append(patch.getDescription())
|
||||
.append(" - ")
|
||||
.append(patch.getSucceeded() == true ?
|
||||
Application.getMessage(fc, "repository_patch_succeeded") :
|
||||
Application.getMessage(fc, "repository_patch_failed"));
|
||||
properties.put(patch.getId(), data);
|
||||
}
|
||||
|
||||
return properties;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user