use of org.apache.syncope.client.console.resources.WorkflowDefGETResource in project syncope by apache.
the class SyncopeConsoleApplication method init.
@Override
protected void init() {
super.init();
// read console.properties
Properties props = PropertyUtils.read(getClass(), CONSOLE_PROPERTIES, "console.directory").getLeft();
site = props.getProperty("site");
Args.notNull(site, "<site>");
anonymousUser = props.getProperty("anonymousUser");
Args.notNull(anonymousUser, "<anonymousUser>");
anonymousKey = props.getProperty("anonymousKey");
Args.notNull(anonymousKey, "<anonymousKey>");
scheme = props.getProperty("scheme");
Args.notNull(scheme, "<scheme>");
host = props.getProperty("host");
Args.notNull(host, "<host>");
port = props.getProperty("port");
Args.notNull(port, "<port>");
rootPath = props.getProperty("rootPath");
Args.notNull(rootPath, "<rootPath>");
useGZIPCompression = props.getProperty("useGZIPCompression");
Args.notNull(useGZIPCompression, "<useGZIPCompression>");
maxUploadFileSizeMB = props.getProperty("maxUploadFileSizeMB") == null ? null : Integer.valueOf(props.getProperty("maxUploadFileSizeMB"));
maxWaitTime = Integer.valueOf(props.getProperty("maxWaitTimeOnApplyChanges", "30"));
String csrf = props.getProperty("csrf");
// process page properties
pageClasses = new HashMap<>();
populatePageClasses(props);
pageClasses = Collections.unmodifiableMap(pageClasses);
// Application settings
IBootstrapSettings settings = new BootstrapSettings();
// set theme provider
settings.setThemeProvider(new SingleThemeProvider(new AdminLTE()));
// install application settings
Bootstrap.install(this, settings);
getResourceSettings().setUseMinifiedResources(true);
getResourceSettings().setThrowExceptionOnMissingResource(true);
getJavaScriptLibrarySettings().setJQueryReference(new DynamicJQueryResourceReference());
getSecuritySettings().setAuthorizationStrategy(new MetaDataRoleAuthorizationStrategy(this));
ClassPathScanImplementationLookup lookup = (ClassPathScanImplementationLookup) getServletContext().getAttribute(ConsoleInitializer.CLASSPATH_LOOKUP);
lookup.getPageClasses().forEach(cls -> MetaDataRoleAuthorizationStrategy.authorize(cls, SyncopeConsoleSession.AUTHENTICATED));
getMarkupSettings().setStripWicketTags(true);
getMarkupSettings().setCompressWhitespace(true);
if (BooleanUtils.toBoolean(csrf)) {
getRequestCycleListeners().add(new CsrfPreventionRequestCycleListener());
}
getRequestCycleListeners().add(new SyncopeConsoleRequestCycleListener());
mountPage("/login", getSignInPageClass());
flowableModelerDirectory = props.getProperty("flowableModelerDirectory");
Args.notNull(flowableModelerDirectory, "<flowableModelerDirectory>");
try {
reconciliationReportKey = props.getProperty("reconciliationReportKey");
} catch (NumberFormatException e) {
LOG.error("While parsing reconciliationReportKey", e);
}
Args.notNull(reconciliationReportKey, "<reconciliationReportKey>");
mountResource("/" + FLOWABLE_MODELER_CONTEXT, new ResourceReference(FLOWABLE_MODELER_CONTEXT) {
private static final long serialVersionUID = -128426276529456602L;
@Override
public IResource getResource() {
return new FilesystemResource(FLOWABLE_MODELER_CONTEXT, flowableModelerDirectory);
}
});
mountResource("/workflowDefGET", new ResourceReference("workflowDefGET") {
private static final long serialVersionUID = -128426276529456602L;
@Override
public IResource getResource() {
return new WorkflowDefGETResource();
}
});
mountResource("/workflowDefPUT", new ResourceReference("workflowDefPUT") {
private static final long serialVersionUID = -128426276529456602L;
@Override
public IResource getResource() {
return new WorkflowDefPUTResource();
}
});
// enable component path
if (getDebugSettings().isAjaxDebugModeEnabled()) {
getDebugSettings().setComponentPathAttributeName("syncope-path");
}
}
Aggregations