use of org.alfresco.repo.admin.patch.AppliedPatch in project acs-community-packaging by Alfresco.
the class UIRepositoryProperties method getDebugData.
/**
* @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();
Descriptor installedRepoDescriptor = descriptorService.getInstalledRepositoryDescriptor();
properties.put("Installed Version", installedRepoDescriptor.getVersion());
properties.put("Installed Schema", installedRepoDescriptor.getSchema());
Descriptor systemDescriptor = descriptorService.getServerDescriptor();
properties.put("Server Version", systemDescriptor.getVersion());
properties.put("Server Schema", systemDescriptor.getSchema());
WebApplicationContext cx = FacesContextUtils.getRequiredWebApplicationContext(fc);
PatchService patchService = (PatchService) cx.getBean("PatchService");
List<AppliedPatch> patches = patchService.getPatches(null, null);
for (AppliedPatch 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;
}
Aggregations