use of com.evolveum.midpoint.schema.LabeledString in project midpoint by Evolveum.
the class PageAbout method initLayout.
private void initLayout() {
Label branch = new Label(ID_BRANCH, createStringResource("midpoint.system.branch"));
branch.setRenderBodyOnly(true);
add(branch);
Label revision = new Label(ID_BUILD, createStringResource("midpoint.system.build"));
revision.setRenderBodyOnly(true);
add(revision);
Label build = new Label(ID_BUILD_TIMESTAMP, createStringResource("midpoint.system.buildTimestamp"));
build.setRenderBodyOnly(true);
add(build);
ListView<SystemItem> listSystemItems = new ListView<SystemItem>(ID_LIST_SYSTEM_ITEMS, getItems()) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(ListItem<SystemItem> item) {
SystemItem systemItem = item.getModelObject();
Label property = new Label(ID_PROPERTY, systemItem.getProperty());
property.setRenderBodyOnly(true);
item.add(property);
Label value = new Label(ID_VALUE, systemItem.getValue());
value.setRenderBodyOnly(true);
item.add(value);
}
};
add(listSystemItems);
addLabel(ID_IMPLEMENTATION_SHORT_NAME, "implementationShortName");
addLabel(ID_IMPLEMENTATION_DESCRIPTION, "implementationDescription");
addLabel(ID_IS_EMBEDDED, "isEmbedded");
addLabel(ID_DRIVER_SHORT_NAME, "driverShortName");
addLabel(ID_DRIVER_VERSION, "driverVersion");
addLabel(ID_REPOSITORY_URL, "repositoryUrl");
ListView<LabeledString> additionalDetails = new ListView<LabeledString>(ID_ADDITIONAL_DETAILS, new PropertyModel<>(repoDiagModel, "additionalDetails")) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(ListItem<LabeledString> item) {
LabeledString labeledString = item.getModelObject();
Label property = new Label(ID_DETAIL_NAME, labeledString.getLabel());
property.setRenderBodyOnly(true);
item.add(property);
Label value = new Label(ID_DETAIL_VALUE, labeledString.getData());
value.setRenderBodyOnly(true);
item.add(value);
}
};
add(additionalDetails);
ListView<LabeledString> provisioningAdditionalDetails = new ListView<LabeledString>(ID_PROVISIONING_ADDITIONAL_DETAILS, new PropertyModel<>(provisioningDiagModel, "additionalDetails")) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(ListItem<LabeledString> item) {
LabeledString labeledString = item.getModelObject();
Label property = new Label(ID_PROVISIONING_DETAIL_NAME, labeledString.getLabel());
property.setRenderBodyOnly(true);
item.add(property);
Label value = new Label(ID_PROVISIONING_DETAIL_VALUE, labeledString.getData());
value.setRenderBodyOnly(true);
item.add(value);
}
};
add(provisioningAdditionalDetails);
String nodeId = getTaskManager().getNodeId();
OperationResult result = new OperationResult(OPERATION_LOAD_NODE);
List<PrismObject<NodeType>> nodes = WebModelServiceUtils.searchObjects(NodeType.class, getPrismContext().queryFor(NodeType.class).item(NodeType.F_NODE_IDENTIFIER).eq(nodeId).build(), result, PageAbout.this);
if (nodes.isEmpty()) {
throw new IllegalArgumentException("Couldn't find NodeType with identifier '" + nodeId + "'");
}
if (nodes.size() > 1) {
throw new IllegalArgumentException("Found more as one NodeType with identifier '" + nodeId + "'");
}
PrismObject<NodeType> node = nodes.get(0);
if (node == null) {
throw new IllegalArgumentException("Found NodeType with identifier '" + nodeId + "' is null");
}
NodeType nodeType = node.asObjectable();
Label nodeName = new Label(ID_NODE_NAME, nodeType.getName() != null ? nodeType.getName() : "");
nodeName.setRenderBodyOnly(true);
add(nodeName);
Label nodeIdValue = new Label(ID_NODE_ID, nodeType.getNodeIdentifier());
nodeIdValue.setRenderBodyOnly(true);
add(nodeIdValue);
Label nodeUrl = new Label(ID_NODE_URL, nodeType.getUrl() != null ? nodeType.getUrl() : "");
nodeUrl.setRenderBodyOnly(true);
add(nodeUrl);
Label jvmProperties = new Label(ID_JVM_PROPERTIES, new LoadableModel<String>(false) {
private static final long serialVersionUID = 1L;
@Override
protected String load() {
try {
RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean();
List<String> arguments = runtimeMxBean.getInputArguments();
return StringUtils.join(arguments, "<br/>");
} catch (Exception ex) {
return PageAbout.this.getString("PageAbout.message.couldntObtainJvmParams");
}
}
});
jvmProperties.setEscapeModelStrings(false);
add(jvmProperties);
initButtons();
}
use of com.evolveum.midpoint.schema.LabeledString in project midpoint by Evolveum.
the class InfoRepositoryAction method execute.
@Override
public void execute() {
MidpointConfiguration config = context.getMidpointConfiguration();
System.out.println("MidPoint home: " + config.getMidpointHome());
System.out.println("Java home: " + System.getProperty("java.home"));
RepositoryService repository = context.getRepository();
OperationResult repoTestResult = new OperationResult("repo.test");
repository.repositorySelfTest(repoTestResult);
repoTestResult.close();
System.out.println("Repository test: " + repoTestResult.getStatus());
try {
RepositoryDiag repositoryDiag = repository.getRepositoryDiag();
System.out.println("Repository diag:" + "\n Type: " + repositoryDiag.getImplementationShortName() + "\n Description: " + repositoryDiag.getImplementationDescription() + "\n JDBC URL: " + repositoryDiag.getRepositoryUrl() + "\n Driver type: " + repositoryDiag.getDriverShortName() + "\n Driver version: " + repositoryDiag.getDriverVersion() + "\n Additional details:");
for (LabeledString detail : repositoryDiag.getAdditionalDetails()) {
System.out.println(" - " + detail.getLabel() + ": " + detail.getData());
}
} catch (Exception e) {
// Fatal crash during Ninja start is more likely than this, but just to be sure...
System.err.println("Unexpected problem during repo diag: " + e);
}
}
use of com.evolveum.midpoint.schema.LabeledString in project midpoint by Evolveum.
the class ProvisioningServiceImpl method getProvisioningDiag.
@Override
public ProvisioningDiag getProvisioningDiag() {
ProvisioningDiag provisioningDiag = new ProvisioningDiag();
String frameworkVersion = connectorManager.getFrameworkVersion();
if (frameworkVersion == null) {
frameworkVersion = "unknown";
}
provisioningDiag.getAdditionalDetails().add(new LabeledString(DETAILS_CONNECTOR_FRAMEWORK_VERSION, frameworkVersion));
return provisioningDiag;
}
Aggregations