예제 #1
0
 private String getItemid(final String filename, final SoftwareModule softwareModule) {
   return new StringBuilder(filename)
       .append(
           HawkbitCommonUtil.getFormattedNameVersion(
               softwareModule.getName(), softwareModule.getVersion()))
       .toString();
 }
예제 #2
0
 private void restoreState() {
   final Indexed container = grid.getContainerDataSource();
   if (container.getItemIds().isEmpty()) {
     container.removeAllItems();
     for (final UploadStatusObject statusObject :
         artifactUploadState.getUploadedFileStatusList()) {
       final Item item =
           container.addItem(
               getItemid(statusObject.getFilename(), statusObject.getSelectedSoftwareModule()));
       item.getItemProperty(REASON)
           .setValue(statusObject.getReason() != null ? statusObject.getReason() : "");
       if (statusObject.getStatus() != null) {
         item.getItemProperty(STATUS).setValue(statusObject.getStatus());
       }
       if (statusObject.getProgress() != null) {
         item.getItemProperty(PROGRESS).setValue(statusObject.getProgress());
       }
       item.getItemProperty(FILE_NAME).setValue(statusObject.getFilename());
       final SoftwareModule sw = statusObject.getSelectedSoftwareModule();
       item.getItemProperty(SPUILabelDefinitions.NAME_VERSION)
           .setValue(HawkbitCommonUtil.getFormattedNameVersion(sw.getName(), sw.getVersion()));
     }
     if (artifactUploadState.isUploadCompleted()) {
       minimizeButton.setEnabled(false);
     }
   }
 }
예제 #3
0
 @SuppressWarnings("unchecked")
 private void uploadRecevied(final String filename, final SoftwareModule softwareModule) {
   final Item item = uploads.addItem(getItemid(filename, softwareModule));
   if (item != null) {
     item.getItemProperty(FILE_NAME).setValue(filename);
     item.getItemProperty(SPUILabelDefinitions.NAME_VERSION)
         .setValue(
             HawkbitCommonUtil.getFormattedNameVersion(
                 softwareModule.getName(), softwareModule.getVersion()));
     final UploadStatusObject uploadStatus = new UploadStatusObject(filename, softwareModule);
     uploadStatus.setStatus("Active");
     artifactUploadState.getUploadedFileStatusList().add(uploadStatus);
   }
 }
 @Override
 protected String getName() {
   return HawkbitCommonUtil.getFormattedNameVersion(
       getSelectedBaseEntity().getName(), getSelectedBaseEntity().getVersion());
 }