setupNotification();
// Workflow definition stuff
final WorkflowDefinitionTO workflowDef = wfRestClient.getDefinition();
WebMarkupContainer workflowDefContainer = new WebMarkupContainer("workflowDefContainer");
Form wfForm = new Form("workflowDefForm", new CompoundPropertyModel(workflowDef));
TextArea<WorkflowDefinitionTO> workflowDefArea = new TextArea<WorkflowDefinitionTO>("workflowDefArea",
new PropertyModel<WorkflowDefinitionTO>(workflowDef, "xmlDefinition"));
wfForm.add(workflowDefArea);
AjaxButton submit =
new ClearIndicatingAjaxButton("apply", new Model<String>(getString("submit")), getPageReference()) {
private static final long serialVersionUID = -958724007591692537L;
@Override
protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
try {
wfRestClient.updateDefinition(workflowDef);
info(getString("operation_succeeded"));
} catch (SyncopeClientCompositeErrorException scee) {
error(getString("error") + ":" + scee.getMessage());
}
target.add(feedbackPanel);
}
@Override
protected void onError(final AjaxRequestTarget target, final Form<?> form) {
target.add(feedbackPanel);
}
};
MetaDataRoleAuthorizationStrategy.authorize(submit, ENABLE, xmlRolesReader.getAllAllowedRoles("Configuration",
"workflowDefUpdate"));
wfForm.add(submit);
workflowDefContainer.add(wfForm);
MetaDataRoleAuthorizationStrategy.authorize(workflowDefContainer, ENABLE, xmlRolesReader.getAllAllowedRoles(
"Configuration", "workflowDefRead"));
add(workflowDefContainer);
// Logger stuff
PropertyListView coreLoggerList = new LoggerPropertyList(null, "corelogger", loggerRestClient.listLogs());
WebMarkupContainer coreLoggerContainer = new WebMarkupContainer("coreLoggerContainer");
coreLoggerContainer.add(coreLoggerList);
coreLoggerContainer.setOutputMarkupId(true);
MetaDataRoleAuthorizationStrategy.authorize(coreLoggerContainer, ENABLE, xmlRolesReader.getAllAllowedRoles(
"Configuration", "logList"));
add(coreLoggerContainer);
ConsoleLoggerController consoleLoggerController = new ConsoleLoggerController();
PropertyListView consoleLoggerList = new LoggerPropertyList(consoleLoggerController, "consolelogger",
consoleLoggerController.getLoggers());
WebMarkupContainer consoleLoggerContainer = new WebMarkupContainer("consoleLoggerContainer");
consoleLoggerContainer.add(consoleLoggerList);
consoleLoggerContainer.setOutputMarkupId(true);
MetaDataRoleAuthorizationStrategy.authorize(consoleLoggerContainer, ENABLE, xmlRolesReader.getAllAllowedRoles(
"Configuration", "logList"));
add(consoleLoggerContainer);
}