public static String softwareModuleUpdatableFieldsOnly(final SoftwareModule module) throws JSONException { final StringBuilder builder = new StringBuilder(); builder.append(new JSONObject().put("description", module.getDescription()).put("vendor", module.getVendor()) .toString()); return builder.toString(); }
public static String softwareModulesCreatableFieldsOnly(final List<SoftwareModule> modules) throws JSONException { final StringBuilder builder = new StringBuilder(); builder.append("["); int i = 0; for (final SoftwareModule module : modules) { builder.append(new JSONObject().put("name", module.getName()).put("description", module.getDescription()) .put("type", module.getType().getKey()).put("vendor", module.getVendor()) .put("version", module.getVersion()).toString()); if (++i < modules.size()) { builder.append(","); } } builder.append("]"); return builder.toString(); }
public static String softwareModules(final List<SoftwareModule> modules) throws JSONException { final StringBuilder builder = new StringBuilder(); builder.append("["); int i = 0; for (final SoftwareModule module : modules) { builder.append(new JSONObject().put("name", module.getName()).put("description", module.getDescription()) .put("type", module.getType().getKey()).put("id", Long.MAX_VALUE).put("vendor", module.getVendor()) .put("version", module.getVersion()).put("createdAt", "0").put("updatedAt", "0") .put("createdBy", "fghdfkjghdfkjh").put("updatedBy", "fghdfkjghdfkjh").toString()); if (++i < modules.size()) { builder.append(","); } } builder.append("]"); return builder.toString(); }
/** * fill the data of a softwareModule in the content of the window */ private void populateValuesOfSwModule() { if (baseSwModuleId == null) { return; } editSwModule = Boolean.TRUE; softwareModuleManagement.get(baseSwModuleId).ifPresent(swModule -> { nameTextField.setValue(swModule.getName()); versionTextField.setValue(swModule.getVersion()); vendorTextField.setValue(swModule.getVendor()); descTextArea.setValue(swModule.getDescription()); softwareModuleType = new LabelBuilder().name(swModule.getType().getName()).caption("Type").buildLabel(); }); }
/** * fill the data of a softwareModule in the content of the window */ private void populateValuesOfSwModule() { if (baseSwModuleId == null) { return; } editSwModule = Boolean.TRUE; softwareModuleManagement.get(baseSwModuleId).ifPresent(swModule -> { nameTextField.setValue(swModule.getName()); versionTextField.setValue(swModule.getVersion()); vendorTextField.setValue(swModule.getVendor()); descTextArea.setValue(swModule.getDescription()); softwareModuleType = new LabelBuilder().name(swModule.getType().getName()).caption("Type").buildLabel(); }); }
private ProxyBaseSoftwareModuleItem getProxyBean(final SoftwareModule bean) { final ProxyBaseSoftwareModuleItem proxy = new ProxyBaseSoftwareModuleItem(); proxy.setSwId(bean.getId()); final String swNameVersion = HawkbitCommonUtil.concatStrings(":", bean.getName(), bean.getVersion()); proxy.setNameAndVersion(swNameVersion); proxy.setCreatedDate(SPDateTimeUtil.getFormattedDate(bean.getCreatedAt())); proxy.setLastModifiedDate(SPDateTimeUtil.getFormattedDate(bean.getLastModifiedAt())); proxy.setName(bean.getName()); proxy.setVersion(bean.getVersion()); proxy.setVendor(bean.getVendor()); proxy.setDescription(bean.getDescription()); proxy.setCreatedByUser(UserDetailsFormatter.loadAndFormatCreatedBy(bean)); proxy.setModifiedByUser(UserDetailsFormatter.loadAndFormatLastModifiedBy(bean)); return proxy; }
private ProxyBaseSoftwareModuleItem getProxyBean(final SoftwareModule bean) { final ProxyBaseSoftwareModuleItem proxy = new ProxyBaseSoftwareModuleItem(); proxy.setSwId(bean.getId()); final String swNameVersion = HawkbitCommonUtil.concatStrings(":", bean.getName(), bean.getVersion()); proxy.setNameAndVersion(swNameVersion); proxy.setCreatedDate(SPDateTimeUtil.getFormattedDate(bean.getCreatedAt())); proxy.setLastModifiedDate(SPDateTimeUtil.getFormattedDate(bean.getLastModifiedAt())); proxy.setName(bean.getName()); proxy.setVersion(bean.getVersion()); proxy.setVendor(bean.getVendor()); proxy.setDescription(bean.getDescription()); proxy.setCreatedByUser(UserDetailsFormatter.loadAndFormatCreatedBy(bean)); proxy.setModifiedByUser(UserDetailsFormatter.loadAndFormatLastModifiedBy(bean)); return proxy; }
private static ProxyBaseSwModuleItem getProxyBean(final AssignedSoftwareModule customSoftwareModule) { final SoftwareModule bean = customSoftwareModule.getSoftwareModule(); final ProxyBaseSwModuleItem proxyItem = new ProxyBaseSwModuleItem(); proxyItem.setSwId(bean.getId()); final String swNameVersion = HawkbitCommonUtil.concatStrings(":", bean.getName(), bean.getVersion()); proxyItem.setNameAndVersion(swNameVersion); proxyItem.setCreatedDate(SPDateTimeUtil.getFormattedDate(bean.getCreatedAt())); proxyItem.setLastModifiedDate(SPDateTimeUtil.getFormattedDate(bean.getLastModifiedAt())); proxyItem.setName(bean.getName()); proxyItem.setVersion(bean.getVersion()); proxyItem.setVendor(bean.getVendor()); proxyItem.setDescription(bean.getDescription()); proxyItem.setCreatedByUser(UserDetailsFormatter.loadAndFormatCreatedBy(bean)); proxyItem.setModifiedByUser(UserDetailsFormatter.loadAndFormatLastModifiedBy(bean)); proxyItem.setAssigned(customSoftwareModule.isAssigned()); proxyItem.setColour(bean.getType().getColour()); proxyItem.setTypeId(bean.getType().getId()); return proxyItem; }
private static ProxyBaseSwModuleItem getProxyBean(final AssignedSoftwareModule customSoftwareModule) { final SoftwareModule bean = customSoftwareModule.getSoftwareModule(); final ProxyBaseSwModuleItem proxyItem = new ProxyBaseSwModuleItem(); proxyItem.setSwId(bean.getId()); final String swNameVersion = HawkbitCommonUtil.concatStrings(":", bean.getName(), bean.getVersion()); proxyItem.setNameAndVersion(swNameVersion); proxyItem.setCreatedDate(SPDateTimeUtil.getFormattedDate(bean.getCreatedAt())); proxyItem.setLastModifiedDate(SPDateTimeUtil.getFormattedDate(bean.getLastModifiedAt())); proxyItem.setName(bean.getName()); proxyItem.setVersion(bean.getVersion()); proxyItem.setVendor(bean.getVendor()); proxyItem.setDescription(bean.getDescription()); proxyItem.setCreatedByUser(UserDetailsFormatter.loadAndFormatCreatedBy(bean)); proxyItem.setModifiedByUser(UserDetailsFormatter.loadAndFormatLastModifiedBy(bean)); proxyItem.setAssigned(customSoftwareModule.isAssigned()); proxyItem.setColour(bean.getType().getColour()); proxyItem.setTypeId(bean.getType().getId()); return proxyItem; }