swModuleNames.append(swModule.getName()); swModuleNames.append(" , "); swModuleVendors.append(swModule.getVendor()); swModuleVendors.append(" , "); });
swModuleNames.append(swModule.getName()); swModuleNames.append(" , "); swModuleVendors.append(swModule.getVendor()); swModuleVendors.append(" , "); });
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(); }
@SuppressWarnings("unchecked") @Override protected void updateEntity(final SoftwareModule baseEntity, final Item item) { final String swNameVersion = HawkbitCommonUtil.concatStrings(":", baseEntity.getName(), baseEntity.getVersion()); item.getItemProperty(SPUILabelDefinitions.NAME_VERSION).setValue(swNameVersion); item.getItemProperty("swId").setValue(baseEntity.getId()); item.getItemProperty(SPUILabelDefinitions.VAR_VENDOR).setValue(baseEntity.getVendor()); super.updateEntity(baseEntity, item); }
@SuppressWarnings("unchecked") @Override protected void updateEntity(final SoftwareModule baseEntity, final Item item) { final String swNameVersion = HawkbitCommonUtil.concatStrings(":", baseEntity.getName(), baseEntity.getVersion()); item.getItemProperty(SPUILabelDefinitions.NAME_VERSION).setValue(swNameVersion); item.getItemProperty("swId").setValue(baseEntity.getId()); item.getItemProperty(SPUILabelDefinitions.VAR_VENDOR).setValue(baseEntity.getVendor()); super.updateEntity(baseEntity, item); }
/** * 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(); }); }
@Override @SuppressWarnings("unchecked") protected void updateEntity(final SoftwareModule baseEntity, final Item item) { final String swNameVersion = HawkbitCommonUtil.concatStrings(":", baseEntity.getName(), baseEntity.getVersion()); item.getItemProperty(SPUILabelDefinitions.NAME_VERSION).setValue(swNameVersion); item.getItemProperty(SPUILabelDefinitions.VAR_SWM_ID).setValue(baseEntity.getId()); item.getItemProperty(SPUILabelDefinitions.VAR_VENDOR).setValue(baseEntity.getVendor()); item.getItemProperty(SPUILabelDefinitions.VAR_COLOR).setValue(baseEntity.getType().getColour()); super.updateEntity(baseEntity, item); }
private void populateDetails() { if (getSelectedBaseEntity() != null) { String maxAssign; if (getSelectedBaseEntity().getType().getMaxAssignments() == 1) { maxAssign = getI18n().getMessage("label.singleAssign.type"); } else { maxAssign = getI18n().getMessage("label.multiAssign.type"); } updateSoftwareModuleDetailsLayout(getSelectedBaseEntity().getType().getName(), getSelectedBaseEntity().getVendor(), maxAssign); } else { updateSoftwareModuleDetailsLayout("", "", ""); } }
private void populateDetails() { if (getSelectedBaseEntity() != null) { String maxAssign; if (getSelectedBaseEntity().getType().getMaxAssignments() == 1) { maxAssign = getI18n().getMessage("label.singleAssign.type"); } else { maxAssign = getI18n().getMessage("label.multiAssign.type"); } updateSoftwareModuleDetailsLayout(getSelectedBaseEntity().getType().getName(), getSelectedBaseEntity().getVendor(), maxAssign); } else { updateSoftwareModuleDetailsLayout("", "", ""); } }
@Override @SuppressWarnings("unchecked") protected void updateEntity(final SoftwareModule baseEntity, final Item item) { final String swNameVersion = HawkbitCommonUtil.concatStrings(":", baseEntity.getName(), baseEntity.getVersion()); item.getItemProperty(SPUILabelDefinitions.NAME_VERSION).setValue(swNameVersion); item.getItemProperty(SPUILabelDefinitions.VAR_SWM_ID).setValue(baseEntity.getId()); item.getItemProperty(SPUILabelDefinitions.VAR_VENDOR).setValue(baseEntity.getVendor()); item.getItemProperty(SPUILabelDefinitions.VAR_COLOR).setValue(baseEntity.getType().getColour()); super.updateEntity(baseEntity, item); }
static MgmtSoftwareModule toResponse(final SoftwareModule softwareModule) { if (softwareModule == null) { return null; } final MgmtSoftwareModule response = new MgmtSoftwareModule(); MgmtRestModelMapper.mapNamedToNamed(response, softwareModule); response.setModuleId(softwareModule.getId()); response.setVersion(softwareModule.getVersion()); response.setType(softwareModule.getType().getKey()); response.setVendor(softwareModule.getVendor()); response.setDeleted(softwareModule.isDeleted()); response.add(linkTo(methodOn(MgmtSoftwareModuleRestApi.class).getSoftwareModule(response.getModuleId())) .withSelfRel()); return response; }
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; }