stringBuilder.append(HTML_LI_OPEN_TAG); stringBuilder.append(" Required Migration step : ") .append(distributionSet.isRequiredMigrationStep() ? "Yes" : "No"); stringBuilder.append(HTML_LI_CLOSE_TAG); stringBuilder.append(HTML_LI_OPEN_TAG);
stringBuilder.append(HTML_LI_OPEN_TAG); stringBuilder.append(" Required Migration step : ") .append(distributionSet.isRequiredMigrationStep() ? "Yes" : "No"); stringBuilder.append(HTML_LI_CLOSE_TAG); stringBuilder.append(HTML_LI_OPEN_TAG);
public static String distributionSetUpdateValidFieldsOnly(final DistributionSet set) throws JSONException { set.getModules().stream().map(module -> { try { return new JSONObject().put("id", module.getId()); } catch (final JSONException e) { e.printStackTrace(); return null; } }).collect(Collectors.toList()); return new JSONObject().put("name", set.getName()).put("description", set.getDescription()) .put("version", set.getVersion()).put("requiredMigrationStep", set.isRequiredMigrationStep()) .toString(); }
private void populateValuesOfDistribution(final Long editDistId) { final Optional<DistributionSet> distSet = distributionSetManagement.getWithDetails(editDistId); if (!distSet.isPresent()) { return; } distNameTextField.setValue(distSet.get().getName()); distVersionTextField.setValue(distSet.get().getVersion()); if (distSet.get().getType().isDeleted()) { distsetTypeNameComboBox.addItem(distSet.get().getType().getId()); } distsetTypeNameComboBox.setValue(distSet.get().getType().getId()); distsetTypeNameComboBox.setEnabled(false); reqMigStepCheckbox.setValue(distSet.get().isRequiredMigrationStep()); descTextArea.setValue(distSet.get().getDescription()); }
public static JSONObject distributionSetCreateValidFieldsOnly(final DistributionSet set) throws JSONException { final List<JSONObject> modules = set.getModules().stream().map(module -> { try { return new JSONObject().put("id", module.getId()); } catch (final JSONException e) { e.printStackTrace(); return null; } }).collect(Collectors.toList()); return new JSONObject().put("name", set.getName()).put("description", set.getDescription()) .put("type", set.getType() == null ? null : set.getType().getKey()).put("version", set.getVersion()) .put("requiredMigrationStep", set.isRequiredMigrationStep()).put("modules", new JSONArray(modules)); }
private void populateValuesOfDistribution(final Long editDistId) { final Optional<DistributionSet> distSet = distributionSetManagement.getWithDetails(editDistId); if (!distSet.isPresent()) { return; } distNameTextField.setValue(distSet.get().getName()); distVersionTextField.setValue(distSet.get().getVersion()); if (distSet.get().getType().isDeleted()) { distsetTypeNameComboBox.addItem(distSet.get().getType().getId()); } distsetTypeNameComboBox.setValue(distSet.get().getType().getId()); distsetTypeNameComboBox.setEnabled(false); reqMigStepCheckbox.setValue(distSet.get().isRequiredMigrationStep()); descTextArea.setValue(distSet.get().getDescription()); }
public static JSONObject distributionSet(final DistributionSet set) throws JSONException { final List<JSONObject> modules = set.getModules().stream().map(module -> { try { return new JSONObject().put("id", module.getId()); } catch (final JSONException e) { e.printStackTrace(); return null; } }).collect(Collectors.toList()); return new JSONObject().put("name", set.getName()).put("description", set.getDescription()) .put("type", set.getType() == null ? null : set.getType().getKey()).put("id", Long.MAX_VALUE) .put("version", set.getVersion()).put("createdAt", "0").put("updatedAt", "0") .put("createdBy", "fghdfkjghdfkjh").put("updatedBy", "fghdfkjghdfkjh") .put("requiredMigrationStep", set.isRequiredMigrationStep()).put("modules", new JSONArray(modules)); }
protected void populateDetails() { if (getSelectedBaseEntity() != null) { updateDistributionSetDetailsLayout(getSelectedBaseEntity().getType().getName(), getSelectedBaseEntity().isRequiredMigrationStep()); } else { updateDistributionSetDetailsLayout(null, null); } }
protected void populateDetails() { if (getSelectedBaseEntity() != null) { updateDistributionSetDetailsLayout(getSelectedBaseEntity().getType().getName(), getSelectedBaseEntity().isRequiredMigrationStep()); } else { updateDistributionSetDetailsLayout(null, null); } }
static MgmtDistributionSet toResponse(final DistributionSet distributionSet) { if (distributionSet == null) { return null; } final MgmtDistributionSet response = new MgmtDistributionSet(); MgmtRestModelMapper.mapNamedToNamed(response, distributionSet); response.setDsId(distributionSet.getId()); response.setVersion(distributionSet.getVersion()); response.setComplete(distributionSet.isComplete()); response.setType(distributionSet.getType().getKey()); response.setDeleted(distributionSet.isDeleted()); distributionSet.getModules() .forEach(module -> response.getModules().add(MgmtSoftwareModuleMapper.toResponse(module))); response.setRequiredMigrationStep(distributionSet.isRequiredMigrationStep()); response.add(linkTo(methodOn(MgmtDistributionSetRestApi.class).getDistributionSet(response.getDsId())) .withSelfRel()); return response; }