public <T extends SchemaTO> List<T> getSchemas( final SchemaType schemaType, final String keyword, final String... anyTypeClasses) { SchemaQuery.Builder builder = new SchemaQuery.Builder().type(schemaType); if (StringUtils.isNotBlank(keyword)) { builder.keyword(keyword); } if (anyTypeClasses != null && anyTypeClasses.length > 0) { builder.anyTypeClasses(anyTypeClasses); } List<T> schemas = new ArrayList<>(); try { schemas.addAll(getService(SchemaService.class).<T>search(builder.build())); } catch (SyncopeClientException e) { LOG.error("While getting all {} schemas for {}", schemaType, anyTypeClasses, e); } return schemas; }
public SyncopeEnduserSession(final Request request) { super(request); // define cookie utility to manage application cookies cookieUtils = new CookieUtils(); anonymousClient = SyncopeEnduserApplication.get().getClientFactory(). create(new AnonymousAuthenticationHandler( SyncopeEnduserApplication.get().getAnonymousUser(), SyncopeEnduserApplication.get().getAnonymousKey())); platformInfo = anonymousClient.getService(SyncopeService.class).platform(); datePlainSchemas = anonymousClient.getService(SchemaService.class). search(new SchemaQuery.Builder().type(SchemaType.PLAIN).build()); datePlainSchemas.removeAll(datePlainSchemas.stream(). filter(object -> object.getType() != AttrSchemaType.Date).collect(Collectors.toSet())); }
public SyncopeEnduserSession(final Request request) { super(request); // define cookie utility to manage application cookies cookieUtils = new CookieUtils(); anonymousClient = SyncopeWebApplication.get().getClientFactory(). create(new AnonymousAuthenticationHandler( SyncopeWebApplication.get().getAnonymousUser(), SyncopeWebApplication.get().getAnonymousKey())); platformInfo = anonymousClient.getService(SyncopeService.class).platform(); datePlainSchemas = anonymousClient.getService(SchemaService.class). search(new SchemaQuery.Builder().type(SchemaType.PLAIN).build()); datePlainSchemas.removeAll(datePlainSchemas.stream(). filter(object -> object.getType() != AttrSchemaType.Date).collect(Collectors.toSet())); }
|| customFormAttributes.get(SchemaType.PLAIN.name()) == null ? schemaService.search( new SchemaQuery.Builder().type(SchemaType.PLAIN).anyTypeClasses(classes).build()) : customTemplate.getWizard().getSteps().containsKey("plainSchemas") ? customizeSchemas(schemaService.search(new SchemaQuery.Builder().type(SchemaType.PLAIN). anyTypeClasses(classes).build()), group, customFormAttributes.get(SchemaType.PLAIN.name()).getAttributes()) || customFormAttributes.get(SchemaType.DERIVED.name()) == null ? schemaService.search( new SchemaQuery.Builder().type(SchemaType.DERIVED).anyTypeClasses(classes).build()) : customTemplate.getWizard().getSteps().containsKey("derivedSchemas") ? customizeSchemas(schemaService.search(new SchemaQuery.Builder().type(SchemaType.DERIVED). anyTypeClasses(classes).build()), group, customFormAttributes.get(SchemaType.DERIVED.name()).getAttributes()) || customFormAttributes.get(SchemaType.VIRTUAL.name()) == null ? schemaService.search( new SchemaQuery.Builder().type(SchemaType.VIRTUAL).anyTypeClasses(classes).build()) : customTemplate.getWizard().getSteps().containsKey("virtualSchemas") ? customizeSchemas(schemaService.search(new SchemaQuery.Builder().type(SchemaType.VIRTUAL). anyTypeClasses(classes).build()), group, customFormAttributes.get(SchemaType.VIRTUAL.name()).getAttributes())
|| customFormAttributes.get(SchemaType.PLAIN.name()) == null ? schemaService.search( new SchemaQuery.Builder().type(SchemaType.PLAIN).anyTypeClasses(classes).build()) : customTemplate.getWizard().getSteps().containsKey("plainSchemas") ? customizeSchemas(schemaService.search(new SchemaQuery.Builder().type(SchemaType.PLAIN). anyTypeClasses(classes).build()), group, customFormAttributes.get(SchemaType.PLAIN.name()).getAttributes()) || customFormAttributes.get(SchemaType.DERIVED.name()) == null ? schemaService.search( new SchemaQuery.Builder().type(SchemaType.DERIVED).anyTypeClasses(classes).build()) : customTemplate.getWizard().getSteps().containsKey("derivedSchemas") ? customizeSchemas(schemaService.search(new SchemaQuery.Builder().type(SchemaType.DERIVED). anyTypeClasses(classes).build()), group, customFormAttributes.get(SchemaType.DERIVED.name()).getAttributes()) || customFormAttributes.get(SchemaType.VIRTUAL.name()) == null ? schemaService.search( new SchemaQuery.Builder().type(SchemaType.VIRTUAL).anyTypeClasses(classes).build()) : customTemplate.getWizard().getSteps().containsKey("virtualSchemas") ? customizeSchemas(schemaService.search(new SchemaQuery.Builder().type(SchemaType.VIRTUAL). anyTypeClasses(classes).build()), group, customFormAttributes.get(SchemaType.VIRTUAL.name()).getAttributes())