public SchemaInfoDto(VersionDto versionDto) { this.id = versionDto.getId(); this.version = versionDto.getVersion(); }
private List<SchemaInfoDto> toConfigurationSchemaInfos(List<VersionDto> schemas, EndpointGroupDto endpointGroup) throws KaaAdminServiceException, IOException { List<SchemaInfoDto> schemaInfos = new ArrayList<>(); for (VersionDto schemaDto : schemas) { ConfigurationSchemaDto configSchema = this.getConfigurationSchema(schemaDto.getId()); String rawSchema = endpointGroup.getWeight() == 0 ? configSchema.getBaseSchema() : configSchema.getOverrideSchema(); Schema schema = new Schema.Parser().parse(rawSchema); SchemaInfoDto schemaInfo = new SchemaInfoDto(schemaDto); RecordField schemaForm = FormAvroConverter.createRecordFieldFromSchema(schema); schemaInfo.setSchemaForm(schemaForm); schemaInfos.add(schemaInfo); } return schemaInfos; } }
@Override public void onClick(ClickEvent clickEvent) { ServerProfileSchemaPlace serverProfSchemaPlace = new ServerProfileSchemaPlace( place.getApplicationId(), entity.getServerProfileSchemaVersion().getId()); serverProfSchemaPlace.setPreviousPlace(place); goTo(serverProfSchemaPlace); } }));
@Override public void onClick(ClickEvent clickEvent) { ProfileSchemaPlace endpointProfSchemaPlace = new ProfileSchemaPlace( place.getApplicationId(), entity.getProfileSchemaVersion().getId()); endpointProfSchemaPlace.setPreviousPlace(place); goTo(endpointProfSchemaPlace); } }));
@Override public Collection<ConfigurationRecordDto> findAllConfigurationRecordsByEndpointGroupId( String endpointGroupId, boolean includeDeprecated) { Collection<ConfigurationDto> configurations = convertDtoList( configurationDao.findActualByEndpointGroupId(endpointGroupId)); List<ConfigurationRecordDto> records = ConfigurationRecordDto.convertToConfigurationRecords(configurations); if (includeDeprecated) { List<VersionDto> schemas = findVacantSchemasByEndpointGroupId(endpointGroupId); for (VersionDto schema : schemas) { ConfigurationDto deprecatedConfiguration = getDto( configurationDao.findLatestDeprecated(schema.getId(), endpointGroupId)); if (deprecatedConfiguration != null) { ConfigurationRecordDto record = new ConfigurationRecordDto(); record.setActiveStructureDto(deprecatedConfiguration); records.add(record); } } } Collections.sort(records); return records; }
public void onClick(ClickEvent event) { String profileSchemaId; String serverProfileSchemaId; if (create) { profileSchemaId = recordView.getEndpointProfileSchema().getValue().getId(); serverProfileSchemaId = recordView.getServerProfileSchema().getValue().getId(); } else { profileSchemaId = record.getEndpointProfileSchemaId(); serverProfileSchemaId = record.getServerProfileSchemaId(); } String filterBody = recordView.getRecordPanel().getBody().getValue(); TestProfileFilterDialog.showTestProfileFilterDialog( new TestProfileFilterDialog.TestProfileFilterDialogListener() { @Override public void onClose(String filterBody) { recordView.getRecordPanel().getBody().setValue(filterBody, true); } }, profileSchemaId, serverProfileSchemaId, filterBody); } }));
@Override protected void doSave(final EventBus eventBus) { ProfileFilterDto inactiveStruct = record.getInactiveStructureDto(); if (create) { endpointProfileSchemaId = recordView.getEndpointProfileSchema().getValue().getId(); serverProfileSchemaId = recordView.getServerProfileSchema().getValue().getId(); inactiveStruct.setEndpointProfileSchemaId(endpointProfileSchemaId); inactiveStruct.setServerProfileSchemaId(serverProfileSchemaId); Integer versionEnd = recordView.getEndpointProfileSchema().getValue().getVersion(); int versionSer = recordView.getServerProfileSchema().getValue().getVersion(); Integer endpointProfileSchemaVersion = versionEnd > -1 ? new Integer(versionEnd) : null; Integer serverProfileSchemaVersion = versionSer > -1 ? new Integer(versionSer) : null; inactiveStruct.setEndpointProfileSchemaVersion(endpointProfileSchemaVersion); inactiveStruct.setServerProfileSchemaVersion(serverProfileSchemaVersion); } inactiveStruct.setDescription(recordView.getRecordPanel().getDescription().getValue()); inactiveStruct.setBody(recordView.getRecordPanel().getBody().getValue()); editProfileFilter(inactiveStruct, new BusyAsyncCallback<ProfileFilterDto>() { public void onSuccessImpl(ProfileFilterDto result) { goTo(getRecordPlace(applicationId, endpointGroupId, false, false, Math.random())); } public void onFailureImpl(Throwable caught) { Utils.handleException(caught, recordView, ProfileFilterActivity.this); } }); }
@Override protected void doSave(final EventBus eventBus) { ConfigurationRecordFormDto inactiveStruct = record.getInactiveStructureDto(); if (create) { schemaId = recordView.getSchema().getValue().getId(); inactiveStruct.setSchemaId(schemaId); inactiveStruct.setSchemaVersion(recordView.getSchema().getValue().getVersion()); } inactiveStruct.setDescription(recordView.getRecordPanel().getDescription().getValue()); inactiveStruct.setConfigurationRecord(recordView.getRecordPanel().getBody().getValue()); editConfiguration(inactiveStruct, new BusyAsyncCallback<ConfigurationRecordFormDto>() { public void onSuccessImpl(ConfigurationRecordFormDto result) { goTo(getRecordPlace(applicationId, endpointGroupId, false, false, Math.random())); } public void onFailureImpl(Throwable caught) { Utils.handleException(caught, recordView, ConfigurationActivity.this); } }); }