@Override public void onClick(final AjaxRequestTarget target) { SyncopeConsoleSession.get().setAttribute(Constants.MENU_COLLAPSE, SyncopeConsoleSession.get().getAttribute(Constants.MENU_COLLAPSE) == null ? true : !(Boolean) SyncopeConsoleSession.get().getAttribute(Constants.MENU_COLLAPSE)); } });
public void setList(final Request request, final Response response, final Map<String, List<String>> prefs) { set(request, response, prefs); } }
@Override protected int getLatestAlertsSize() { return SyncopeConsoleSession.get().owns(StandardEntitlement.REMEDIATION_LIST) && SyncopeConsoleSession.get().owns(StandardEntitlement.REMEDIATION_READ) ? restClient.countRemediations() : 0; }
protected DateFieldPanel(final String id, final String name, final IModel<Date> model, final String datePattern) { super(id, name, model); fmt = datePattern == null ? SyncopeConsoleSession.get().getDateFormat() : FastDateFormat.getInstance(datePattern); }
protected static <E extends JAXRSService, T> T getObject( final E service, final URI location, final Class<T> resultClass) { WebClient webClient = WebClient.fromClient(WebClient.client(service)); webClient.accept(SyncopeConsoleSession.get().getMediaType()).to(location.toASCIIString(), false); return webClient. header(RESTHeaders.DOMAIN, SyncopeConsoleSession.get().getDomain()). header(HttpHeaders.AUTHORIZATION, "Bearer " + SyncopeConsoleSession.get().getJWT()). get(resultClass); }
public static <T extends BasePage> BookmarkablePageLink<T> build( final String key, final String id, final Class<T> defaultPageClass) { @SuppressWarnings("unchecked") Class<T> pageClass = (Class<T>) SyncopeWebApplication.get().getPageClass(key); return new BookmarkablePageLink<>( id, pageClass == null ? defaultPageClass : pageClass); }
protected static <T> T getService(final Class<T> serviceClass) { return SyncopeConsoleSession.get().getService(serviceClass); }
protected static <T> void resetClient(final Class<T> serviceClass) { SyncopeConsoleSession.get().resetClient(serviceClass); }
@Override protected List<String> load() { return SyncopeWebApplication.get().getResourceProvider().get(); } };
@Override protected AbstractLink getEventsLink(final String linkid) { BookmarkablePageLink<Remediations> remediations = BookmarkablePageLinkBuilder.build(linkid, Remediations.class); MetaDataRoleAuthorizationStrategy.authorize(remediations, WebPage.ENABLE, StandardEntitlement.REMEDIATION_LIST); return remediations; }
public FastDateFormat getDateFormat() { return FastDateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, getLocale()); } }
@Override public boolean authenticate(final String username, final String password) { boolean authenticated = false; try { client = clientFactory.setDomain(getDomain()).create(username, password); refreshAuth(username); authenticated = true; } catch (Exception e) { LOG.error("Authentication failed", e); } return authenticated; }
@Override public boolean isVisible() { return SyncopeWebApplication.get().getSecuritySettings().getAuthorizationStrategy(). isActionAuthorized(this, RENDER); } });
public <T> T getService(final Class<T> serviceClass) { return getCachedService(serviceClass); }
@Override public String getObject() { return model.getObject() == null ? "" : SyncopeConsoleSession.get().getDateFormat().format((Date) model.getObject()); }
protected static <T> T getService(final String etag, final Class<T> serviceClass) { return SyncopeConsoleSession.get().getService(etag, serviceClass); }
public void setList(final Request request, final Response response, final String key, final List<String> values) { set(request, response, key, StringUtils.join(values, ";")); }