. 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:
Kevin Roast
2006-02-17 11:41:23 +00:00
parent 3af09722de
commit 9cfa618c76
24 changed files with 240 additions and 84 deletions

View File

@@ -553,6 +553,9 @@ http_session_state=HTTP Session State
http_request_state=HTTP Request State
http_request_params=HTTP Request Parameters
http_request_headers=HTTP Request Headers
repository_props=Repository Properties
repository_patch_succeeded=Succeeded
repository_patch_failed=FAILED
system_props=System Properties
hide_details=Hide Details
show_details=Show Details

View File

@@ -1499,22 +1499,22 @@ public class AdvancedSearchBean
private static final String NO_SELECTION = "NONE";
/** The NodeService to be used by the bean */
private NodeService nodeService;
protected NodeService nodeService;
/** The NamespaceService to be used by the bean */
private NamespaceService namespaceService;
protected NamespaceService namespaceService;
/** The NavigationBean reference */
private NavigationBean navigator;
protected NavigationBean navigator;
/** SearchService bean reference */
private SearchService searchService;
protected SearchService searchService;
/** PermissionService */
private PermissionService permissionService;
protected PermissionService permissionService;
/** Client Config reference */
private AdvancedSearchConfigElement searchConfigElement = null;
protected AdvancedSearchConfigElement searchConfigElement = null;
/** Progressive panel UI state */
private Map<String, Boolean> panels = new HashMap(5, 1.0f);

View File

@@ -1566,32 +1566,32 @@ public class BrowseBean implements IContextListener
private static Logger logger = Logger.getLogger(BrowseBean.class);
/** The NodeService to be used by the bean */
private NodeService nodeService;
protected NodeService nodeService;
/** The SearchService to be used by the bean */
private SearchService searchService;
protected SearchService searchService;
/** The LockService to be used by the bean */
private LockService lockService;
protected LockService lockService;
/** The NavigationBean bean reference */
private NavigationBean navigator;
protected NavigationBean navigator;
/** The DictionaryService bean reference */
private DictionaryService dictionaryService;
protected DictionaryService dictionaryService;
/** The file folder service */
private FileFolderService fileFolderService;
protected FileFolderService fileFolderService;
/** Views configuration object */
private ViewsConfigElement viewsConfig = null;
protected ViewsConfigElement viewsConfig = null;
/** Listeners for Node events */
private Set<NodeEventListener> nodeEventListeners = null;
/** Component references */
private UIRichList spacesRichList;
private UIRichList contentRichList;
protected UIRichList spacesRichList;
protected UIRichList contentRichList;
private UIStatusMessage statusMessage;
/** Transient lists of container and content nodes for display */

View File

@@ -66,12 +66,12 @@ public class CategoriesBean implements IContextListener
private static Logger logger = Logger.getLogger(CategoriesBean.class);
/** The NodeService to be used by the bean */
private NodeService nodeService;
protected NodeService nodeService;
private CategoryService categoryService;
protected CategoryService categoryService;
/** Component references */
private UIRichList categoriesRichList;
protected UIRichList categoriesRichList;
/** Currently visible category Node*/
private Node category = null;

View File

@@ -938,14 +938,14 @@ public class CheckinCheckoutBean
private NodeRef selectedSpaceId = null;
/** The BrowseBean to be used by the bean */
private BrowseBean browseBean;
protected BrowseBean browseBean;
/** The NodeService to be used by the bean */
private NodeService nodeService;
protected NodeService nodeService;
/** The VersionOperationsService to be used by the bean */
private CheckOutCheckInService versionOperationsService;
protected CheckOutCheckInService versionOperationsService;
/** The ContentService to be used by the bean */
private ContentService contentService;
protected ContentService contentService;
}

View File

@@ -80,13 +80,13 @@ public class DocumentDetailsBean
private static Logger logger = Logger.getLogger(DocumentDetailsBean.class);
private BrowseBean browseBean;
private NodeService nodeService;
private LockService lockService;
private CopyService copyService;
private VersionService versionService;
private OwnableService ownableService;
private NavigationBean navigator;
protected BrowseBean browseBean;
protected NodeService nodeService;
protected LockService lockService;
protected CopyService copyService;
protected VersionService versionService;
protected OwnableService ownableService;
protected NavigationBean navigator;
private Map<String, Boolean> panels = new HashMap<String, Boolean>(5, 1.0f);

View File

@@ -63,10 +63,10 @@ public class DocumentPropertiesBean
{
private static final String TEMP_PROP_MIMETYPE = "mimetype";
private NodeService nodeService;
private FileFolderService fileFolderService;
private DictionaryService dictionaryService;
private BrowseBean browseBean;
protected NodeService nodeService;
protected FileFolderService fileFolderService;
protected DictionaryService dictionaryService;
protected BrowseBean browseBean;
private List<SelectItem> contentTypes;
private Node editableNode;
private Boolean hasOtherProperties;

View File

@@ -52,9 +52,9 @@ public class ExportBean
private static final String MSG_ERROR = "error_export";
private BrowseBean browseBean;
private NodeService nodeService;
private ActionService actionService;
protected BrowseBean browseBean;
protected NodeService nodeService;
protected ActionService actionService;
private String packageName;
private String encoding = "UTF-8";

View File

@@ -84,33 +84,33 @@ public class ForumsBean implements IContextListener, NodeEventListener
private static final String PAGE_NAME_TOPIC = "topic";
/** The NodeService to be used by the bean */
private NodeService nodeService;
protected NodeService nodeService;
/** The ContentService to be used by the bean */
private ContentService contentService;
protected ContentService contentService;
/** The DictionaryService bean reference */
private DictionaryService dictionaryService;
protected DictionaryService dictionaryService;
/** The SearchService bean reference. */
private SearchService searchService;
protected SearchService searchService;
/** The NamespaceService bean reference. */
private NamespaceService namespaceService;
protected NamespaceService namespaceService;
/** The browse bean */
private BrowseBean browseBean;
protected BrowseBean browseBean;
/** The NavigationBean bean reference */
private NavigationBean navigator;
protected NavigationBean navigator;
/** Views configuration object */
private ViewsConfigElement viewsConfig = null;
protected ViewsConfigElement viewsConfig = null;
/** Component references */
private UIRichList forumsRichList;
private UIRichList forumRichList;
private UIRichList topicRichList;
protected UIRichList forumsRichList;
protected UIRichList forumRichList;
protected UIRichList topicRichList;
/** Node lists */
private List<Node> forums;

View File

@@ -59,10 +59,10 @@ public class ImportBean
private static final String MSG_ERROR_NO_FILE = "error_import_no_file";
private static final String MSG_ERROR_EMPTY_FILE = "error_import_empty_file";
private BrowseBean browseBean;
private NodeService nodeService;
private ActionService actionService;
private ContentService contentService;
protected BrowseBean browseBean;
protected NodeService nodeService;
protected ActionService actionService;
protected ContentService contentService;
private File file;
private String fileName;

View File

@@ -408,17 +408,17 @@ public class LoginBean
private String language = null;
/** PersonService bean reference */
private PersonService personService;
protected PersonService personService;
/** AuthenticationService bean reference */
private AuthenticationService authenticationService;
protected AuthenticationService authenticationService;
/** NodeService bean reference */
private NodeService nodeService;
protected NodeService nodeService;
/** The BrowseBean reference */
private BrowseBean browseBean;
protected BrowseBean browseBean;
/** The NavigationBean bean reference */
private NavigationBean navigator;
protected NavigationBean navigator;
}

View File

@@ -644,22 +644,22 @@ public class NavigationBean
private static final String ERROR_DELETED_FOLDER = "error_deleted_folder";
/** The NodeService to be used by the bean */
private NodeService nodeService;
protected NodeService nodeService;
/** The SearchService to be used by the bean */
private SearchService searchService;
protected SearchService searchService;
/** NamespaceService bean reference */
private NamespaceService namespaceService;
protected NamespaceService namespaceService;
/** CIFSServer bean reference */
private CIFSServer cifsServer;
protected CIFSServer cifsServer;
/** CIFS content disk driver bean reference */
private ContentDiskInterface contentDiskDriver;
protected ContentDiskInterface contentDiskDriver;
/** Client configuration object */
private ClientConfigElement clientConfig = null;
protected ClientConfigElement clientConfig = null;
/** Cached path to our CIFS server and top level node DIR */
private String cifsServerPath;

View File

@@ -48,10 +48,10 @@ public class RecentSpacesBean implements IContextListener
private static Logger logger = Logger.getLogger(RecentSpacesBean.class);
/** The NavigationBean reference */
private NavigationBean navigator;
protected NavigationBean navigator;
/** The BrowseBean reference */
private BrowseBean browseBean;
protected BrowseBean browseBean;
/** Maximum number of recent spaces to show */
private Integer maxRecentSpaces = null;

View File

@@ -53,8 +53,8 @@ public class RulesBean
private static Log logger = LogFactory.getLog(RulesBean.class);
private String viewMode = INHERITED;
private BrowseBean browseBean;
private RuleService ruleService;
protected BrowseBean browseBean;
protected RuleService ruleService;
private List<WrappedRule> rules;
private Rule currentRule;
private UIRichList richList;

View File

@@ -60,19 +60,19 @@ public class SpaceDetailsBean
private static final String OUTCOME_RETURN = "showSpaceDetails";
/** BrowseBean instance */
private BrowseBean browseBean;
protected BrowseBean browseBean;
/** The NavigationBean bean reference */
private NavigationBean navigator;
protected NavigationBean navigator;
/** PermissionService bean reference */
private PermissionService permissionService;
protected PermissionService permissionService;
/** OwnableService bean reference */
private OwnableService ownableService;
protected OwnableService ownableService;
/** NodeServuce bean reference */
private NodeService nodeService;
protected NodeService nodeService;
/** Selected template Id */
private String template;

View File

@@ -52,10 +52,10 @@ public class UserShortcutsBean
private static Logger logger = Logger.getLogger(UserShortcutsBean.class);
/** The NodeService to be used by the bean */
private NodeService nodeService;
protected NodeService nodeService;
/** The BrowseBean reference */
private BrowseBean browseBean;
protected BrowseBean browseBean;
/** List of shortcut nodes */
private List<Node> shortcuts = null;

View File

@@ -323,13 +323,13 @@ public class ClipboardBean
private static final String MSG_ERROR_PASTE = "error_paste";
/** The NodeService to be used by the bean */
private NodeService nodeService;
protected NodeService nodeService;
/** The NodeOperationsService to be used by the bean */
private CopyService nodeOperationsService;
protected CopyService nodeOperationsService;
/** The NavigationBean reference */
private NavigationBean navigator;
protected NavigationBean navigator;
/** Current state of the clipboard items */
private List<ClipboardItem> items = new ArrayList<ClipboardItem>(4);

View File

@@ -61,19 +61,19 @@ public class UsersBean implements IContextListener
private static final String DEFAULT_OUTCOME = "manageUsers";
/** NodeService bean reference */
private NodeService nodeService;
protected NodeService nodeService;
/** SearchService bean reference */
private SearchService searchService;
protected SearchService searchService;
/** AuthenticationService bean reference */
private AuthenticationService authenticationService;
protected AuthenticationService authenticationService;
/** PersonService bean reference */
private PersonService personService;
protected PersonService personService;
/** Component reference for Users RichList control */
private UIRichList usersRichList;
protected UIRichList usersRichList;
/** action context */
private Node person = null;

View File

@@ -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);

View File

@@ -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;
}
}

View File

@@ -0,0 +1,34 @@
/*
* 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.tag.debug;
/**
* Tag implementation used to place the Repository properties component on a page.
*
* @author kevinr
*/
public class RepositoryPropertiesTag extends BaseDebugTag
{
/**
* @see javax.faces.webapp.UIComponentTag#getComponentType()
*/
public String getComponentType()
{
return "org.alfresco.faces.debug.RepositoryProperties";
}
}

View File

@@ -1521,6 +1521,31 @@
</attribute>
</tag>
<tag>
<name>repositoryProperties</name>
<tag-class>org.alfresco.web.ui.common.tag.debug.RepositoryPropertiesTag</tag-class>
<body-content>JSP</body-content>
<description>Displays the Alfresco Repository properties in a table</description>
<attribute>
<name>id</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>rendered</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>title</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
<tag>
<name>genericPicker</name>
<tag-class>org.alfresco.web.ui.common.tag.GenericPickerTag</tag-class>

View File

@@ -124,6 +124,11 @@
<component-class>org.alfresco.web.ui.common.component.debug.UISystemProperties</component-class>
</component>
<component>
<component-type>org.alfresco.faces.debug.RepositoryProperties</component-type>
<component-class>org.alfresco.web.ui.common.component.debug.UIRepositoryProperties</component-class>
</component>
<component>
<component-type>org.alfresco.faces.GenericPicker</component-type>
<component-class>org.alfresco.web.ui.common.component.UIGenericPicker</component-class>

View File

@@ -129,6 +129,12 @@
<a:httpRequestHeaders id="hrh" />
</a:panel>
<br/>
<a:panel label="#{msg.repository_props}" id="repo-props" border="white" bgcolor="white"
titleBorder="blue" titleBgcolor="#D3E6FE" progressive="true" styleClass="mainSubTitle"
expanded="false">
<a:repositoryProperties id="rp" />
</a:panel>
<br/>
<a:panel label="#{msg.system_props}" id="system-props" border="white" bgcolor="white"
titleBorder="blue" titleBgcolor="#D3E6FE" progressive="true" styleClass="mainSubTitle"
expanded="false">