private void buildAvailableSchemas(final String key) { List<String> configurationSchemas = new ConfRestClient().list().stream(). map(Attr::getSchema).collect(Collectors.toList()); new AnyTypeClassRestClient().list().stream(). filter(item -> key == null || !item.getKey().equals(key)). forEach(item -> { availablePlainSchemas.removeAll(item.getPlainSchemas()); availableDerSchemas.removeAll(item.getDerSchemas()); availableVirSchemas.removeAll(item.getVirSchemas()); }); availablePlainSchemas.removeAll(configurationSchemas); availablePlainSchemas.removeAll(LAYOUT_PARAMETERS); } }
@Override public AnyTypeClassTO getAnyTypeClassTO(final AnyTypeClass anyTypeClass) { AnyTypeClassTO anyTypeClassTO = new AnyTypeClassTO(); anyTypeClassTO.setKey(anyTypeClass.getKey()); anyTypeClassTO.getInUseByTypes().addAll( anyTypeDAO.findByTypeClass(anyTypeClass).stream().map(Entity::getKey).collect(Collectors.toList())); anyTypeClassTO.getPlainSchemas().addAll( anyTypeClass.getPlainSchemas().stream().map(Entity::getKey).collect(Collectors.toList())); anyTypeClassTO.getDerSchemas().addAll( anyTypeClass.getDerSchemas().stream().map(Entity::getKey).collect(Collectors.toList())); anyTypeClassTO.getVirSchemas().addAll( anyTypeClass.getVirSchemas().stream().map(Entity::getKey).collect(Collectors.toList())); return anyTypeClassTO; }
choices.addAll(anyTypeClassTO.getPlainSchemas()); choices.addAll(anyTypeClassTO.getDerSchemas()); choices.addAll(anyTypeClassTO.getVirSchemas()); });
anyTypeClassTO.getVirSchemas().forEach(schemaName -> { VirSchema schema = virSchemaDAO.find(schemaName); if (schema == null || schema.getAnyTypeClass() != null) {
allowedSchemas.getDerSchemas().addAll(anyTypeClass.getDerSchemas().stream(). map(Entity::getKey).collect(Collectors.toList())); allowedSchemas.getVirSchemas().addAll(anyTypeClass.getVirSchemas().stream(). map(Entity::getKey).collect(Collectors.toList())); });
allowedSchemas.getDerSchemas().addAll(anyTypeClass.getDerSchemas().stream(). map(Entity::getKey).collect(Collectors.toList())); allowedSchemas.getVirSchemas().addAll(anyTypeClass.getVirSchemas().stream(). map(Entity::getKey).collect(Collectors.toList())); });
allowed = allowedSchemas.getVirSchemas().contains(intAttrName.getSchemaName()); break;
allowed = allowedSchemas.getVirSchemas().contains(intAttrName.getSchemaName()); break;
allowedSchemas.getDerSchemas().addAll(anyTypeClass.getDerSchemas().stream(). map(Entity::getKey).collect(Collectors.toList())); allowedSchemas.getVirSchemas().addAll(anyTypeClass.getVirSchemas().stream(). map(Entity::getKey).collect(Collectors.toList()));
allowed = allowedSchemas.getVirSchemas().contains(intAttrName.getSchemaName()); break;