@Override protected String getDeletedEntityName(final Long entityId) { final Optional<SoftwareModule> softwareModule = softwareModuleManagement.get(entityId); if (softwareModule.isPresent()) { return softwareModule.get().getName() + ":" + softwareModule.get().getVersion(); } return ""; }
@Override protected String getDeletedEntityName(final Long entityId) { final Optional<SoftwareModule> softwareModule = softwareModuleManagement.get(entityId); if (softwareModule.isPresent()) { return softwareModule.get().getName() + ":" + softwareModule.get().getVersion(); } return ""; }
@Override protected String getDeletedEntityName(final Long entityId) { final Optional<SoftwareModule> softwareModule = softwareModuleManagement.get(entityId); if (softwareModule.isPresent()) { return softwareModule.get().getName() + ":" + softwareModule.get().getVersion(); } return ""; }
@Override protected String getDeletedEntityName(final Long entityId) { final Optional<SoftwareModule> softwareModule = softwareModuleManagement.get(entityId); if (softwareModule.isPresent()) { return softwareModule.get().getName() + ":" + softwareModule.get().getVersion(); } return ""; }
/** * Create Label for SW Module. * * @param labelName * as Name * @param swModule * as Module (JVM|OS|AH) * @return Label as UI */ private static Label getSWModlabel(final String labelName, final SoftwareModule swModule) { return SPUIComponentProvider.createNameValueLabel(labelName + " : ", swModule.getName(), swModule.getVersion()); }
/** * Constructor. * * @param softwareModule * the softwareModule */ public SoftwareModuleIdName(final SoftwareModule softwareModule) { this(softwareModule.getId(), softwareModule.getName(), softwareModule.getVersion()); }
/** * Create Label for SW Module. * * @param labelName * as Name * @param swModule * as Module (JVM|OS|AH) * @return Label as UI */ private static Label getSWModlabel(final String labelName, final SoftwareModule swModule) { return SPUIComponentProvider.createNameValueLabel(labelName + " : ", swModule.getName(), swModule.getVersion()); }
/** * Constructor. * * @param softwareModule * the softwareModule */ public SoftwareModuleIdName(final SoftwareModule softwareModule) { this(softwareModule.getId(), softwareModule.getName(), softwareModule.getVersion()); }
/** * Create Label for SW Module. * * @param labelName * as Name * @param swModule * as Module (JVM|OS|AH) * @return Label as UI */ private Label getSWModlabel(final String labelName, final SoftwareModule swModule) { return SPUIComponentProvider.createNameValueLabel(labelName + " : ", swModule.getName(), swModule.getVersion()); } }
/** * Create Label for SW Module. * * @param labelName * as Name * @param swModule * as Module (JVM|OS|AH) * @return Label as UI */ private Label getSWModlabel(final String labelName, final SoftwareModule swModule) { return SPUIComponentProvider.createNameValueLabel(labelName + " : ", swModule.getName(), swModule.getVersion()); } }
/** * Creates a new {@link FileUploadId} instance. * * @param filename * the name of the file * @param softwareModule * the {@link SoftwareModule} for which the file is uploaded */ public FileUploadId(final String filename, final SoftwareModule softwareModule) { this.filename = filename; this.softwareModuleName = softwareModule.getName(); this.softwareModuleVersion = softwareModule.getVersion(); this.softwareModuleId = softwareModule.getId(); this.id = createFileUploadIdString(filename, softwareModuleName, softwareModuleVersion); }
static List<DdiChunk> createChunks(final Target target, final Action uAction, final ArtifactUrlHandler artifactUrlHandler, final SystemManagement systemManagement, final HttpRequest request, final ControllerManagement controllerManagement) { final Map<Long, List<SoftwareModuleMetadata>> metadata = controllerManagement .findTargetVisibleMetaDataBySoftwareModuleId(uAction.getDistributionSet().getModules().stream() .map(SoftwareModule::getId).collect(Collectors.toList())); return uAction.getDistributionSet().getModules().stream() .map(module -> new DdiChunk(mapChunkLegacyKeys(module.getType().getKey()), module.getVersion(), module.getName(), createArtifacts(target, module, artifactUrlHandler, systemManagement, request), mapMetadata(metadata.get(module.getId())))) .collect(Collectors.toList()); }
static List<DdiChunk> createChunks(final Target target, final Action uAction, final ArtifactUrlHandler artifactUrlHandler, final SystemManagement systemManagement, final HttpRequest request, final ControllerManagement controllerManagement) { final Map<Long, List<SoftwareModuleMetadata>> metadata = controllerManagement .findTargetVisibleMetaDataBySoftwareModuleId(uAction.getDistributionSet().getModules().stream() .map(SoftwareModule::getId).collect(Collectors.toList())); return new ResponseList<>(uAction.getDistributionSet().getModules().stream() .map(module -> new DdiChunk(mapChunkLegacyKeys(module.getType().getKey()), module.getVersion(), module.getName(), createArtifacts(target, module, artifactUrlHandler, systemManagement, request), mapMetadata(metadata.get(module.getId())))) .collect(Collectors.toList())); }
@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); }
/** * updates a softwareModule */ private void updateSwModule() { final SoftwareModule newSWModule = softwareModuleManagement.update(entityFactory.softwareModule() .update(baseSwModuleId).description(descTextArea.getValue()).vendor(vendorTextField.getValue())); if (newSWModule != null) { uiNotifcation.displaySuccess(i18n.getMessage("message.save.success", newSWModule.getName() + ":" + newSWModule.getVersion())); eventBus.publish(this, new SoftwareModuleEvent(BaseEntityEventType.UPDATED_ENTITY, newSWModule)); } }
/** * updates a softwareModule */ private void updateSwModule() { final SoftwareModule newSWModule = softwareModuleManagement.update(entityFactory.softwareModule() .update(baseSwModuleId).description(descTextArea.getValue()).vendor(vendorTextField.getValue())); if (newSWModule != null) { uiNotifcation.displaySuccess(i18n.getMessage("message.save.success", new Object[] { newSWModule.getName() + ":" + newSWModule.getVersion() })); eventBus.publish(this, new SoftwareModuleEvent(BaseEntityEventType.UPDATED_ENTITY, newSWModule)); } } }
@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); }
@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 unassignSW(final ClickEvent event, final DistributionSet distributionSet, final Set<SoftwareModule> alreadyAssignedSwModules) { final SoftwareModule unAssignedSw = getSoftwareModule(event.getButton().getId(), alreadyAssignedSwModules); if (distributionSetManagement.isInUse(distributionSet.getId())) { uiNotification.displayValidationError(i18n.getMessage("message.error.notification.ds.target.assigned", distributionSet.getName(), distributionSet.getVersion())); } else { final DistributionSet newDistributionSet = distributionSetManagement .unassignSoftwareModule(distributionSet.getId(), unAssignedSw.getId()); manageDistUIState.setLastSelectedEntityId(newDistributionSet.getId()); eventBus.publish(this, new DistributionTableEvent(BaseEntityEventType.SELECTED_ENTITY, newDistributionSet)); eventBus.publish(this, DistributionsUIEvent.ORDER_BY_DISTRIBUTION); uiNotification.displaySuccess(i18n.getMessage("message.sw.unassigned", unAssignedSw.getName())); } }