@Override public void onClick(final AjaxRequestTarget target, final ImplementationTO ignore) { try { restClient.delete(model.getObject().getType(), model.getObject().getKey()); SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED)); target.add(container); } catch (SyncopeClientException e) { LOG.error("While deleting object {}", model.getObject().getKey(), e); SyncopeConsoleSession.get().error( StringUtils.isBlank(e.getMessage()) ? e.getClass().getName() : e.getMessage()); } ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target); } }, ActionLink.ActionType.DELETE, StandardEntitlement.IMPLEMENTATION_DELETE, true);
@Override protected void onEvent(final AjaxRequestTarget target) { Class<?> clazz = null; switch (implementation.getType()) { case REPORTLET: clazz = lookup.getReportletConfs().get(jsonClass.getModelObject());
this.viewMode = implementation.getEngine() == ImplementationEngine.GROOVY ? ViewMode.GROOVY_BODY : implementation.getType() == ImplementationType.REPORTLET || implementation.getType() == ImplementationType.ACCOUNT_RULE || implementation.getType() == ImplementationType.PASSWORD_RULE || implementation.getType() == ImplementationType.PULL_CORRELATION_RULE || implementation.getType() == ImplementationType.PUSH_CORRELATION_RULE ? ViewMode.JSON_BODY : ViewMode.JAVA_CLASS; if (viewMode == ViewMode.JAVA_CLASS) { Optional<JavaImplInfo> javaClasses = SyncopeConsoleSession.get().getPlatformInfo(). getJavaImplInfo(implementation.getType()); classes = javaClasses.isPresent() ? new ArrayList<>(javaClasses.get().getClasses()) : new ArrayList<>(); } else if (viewMode == ViewMode.JSON_BODY) { switch (implementation.getType()) { case REPORTLET: classes = lookup.getReportletConfs().keySet().stream(). switch (implementation.getType()) { case REPORTLET: templateClassName = "MyReportlet"; } catch (IOException e) { LOG.error("Could not load the expected Groovy template {} for {}", templateClassName, implementation.getType(), e);
SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.InvalidImplementation); if (implementation.getType() != null && implementation.getType() != implementationTO.getType()) { sce.getElements().add("ImplementationType cannot be changed"); throw sce; implementation.setType(implementationTO.getType()); implementation.setBody(implementationTO.getBody());