Merge remote-tracking branch 'origin/master' into
fix_introduce_consistent_button_position_in_change_dialogs Conflicts: hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleAddUpdateWindow.java hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/CreateUpdateSoftwareTypeLayout.java hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/CreateUpdateDistSetTypeLayout.java hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionAddUpdateWindowLayout.java hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/CreateUpdateDistributionTagLayoutWindow.java hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetAddUpdateWindowLayout.java hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/CreateUpdateTargetTagLayout.java hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/AddUpdateRolloutWindowLayout.java Signed-off-by: Melanie Retter <melanie.retter@bosch-si.com>
This commit is contained in:
@@ -11,18 +11,18 @@ package org.eclipse.hawkbit.ui;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.hawkbit.eventbus.event.DistributionSetTagCreatedBulkEvent;
|
||||
import org.eclipse.hawkbit.eventbus.event.DistributionSetTagDeletedEvent;
|
||||
import org.eclipse.hawkbit.eventbus.event.DistributionSetTagUpdateEvent;
|
||||
import org.eclipse.hawkbit.eventbus.event.Event;
|
||||
import org.eclipse.hawkbit.eventbus.event.RolloutChangeEvent;
|
||||
import org.eclipse.hawkbit.eventbus.event.RolloutGroupChangeEvent;
|
||||
import org.eclipse.hawkbit.eventbus.event.TargetCreatedEvent;
|
||||
import org.eclipse.hawkbit.eventbus.event.TargetDeletedEvent;
|
||||
import org.eclipse.hawkbit.eventbus.event.TargetInfoUpdateEvent;
|
||||
import org.eclipse.hawkbit.eventbus.event.TargetTagCreatedBulkEvent;
|
||||
import org.eclipse.hawkbit.eventbus.event.TargetTagDeletedEvent;
|
||||
import org.eclipse.hawkbit.eventbus.event.TargetTagUpdateEvent;
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.DistributionSetTagCreatedBulkEvent;
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.DistributionSetTagDeletedEvent;
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.DistributionSetTagUpdateEvent;
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.RolloutChangeEvent;
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.RolloutGroupChangeEvent;
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.TargetCreatedEvent;
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.TargetInfoUpdateEvent;
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.TargetTagCreatedBulkEvent;
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.TargetTagDeletedEvent;
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.TargetTagUpdateEvent;
|
||||
|
||||
/**
|
||||
* The default hawkbit event provider.
|
||||
|
||||
@@ -12,6 +12,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.hawkbit.repository.ArtifactManagement;
|
||||
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||
import org.eclipse.hawkbit.repository.OffsetBasedPageRequest;
|
||||
import org.eclipse.hawkbit.repository.model.LocalArtifact;
|
||||
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
||||
@@ -37,6 +38,7 @@ public class ArtifactBeanQuery extends AbstractBeanQuery<LocalArtifact> {
|
||||
private static final long serialVersionUID = -333786310371208962L;
|
||||
private Sort sort = new Sort(Direction.DESC, "filename");
|
||||
private transient ArtifactManagement artifactManagement = null;
|
||||
private transient EntityFactory entityFactory;
|
||||
private transient Page<LocalArtifact> firstPagetArtifacts = null;
|
||||
private Long baseSwModuleId = null;
|
||||
|
||||
@@ -72,7 +74,7 @@ public class ArtifactBeanQuery extends AbstractBeanQuery<LocalArtifact> {
|
||||
|
||||
@Override
|
||||
protected LocalArtifact constructBean() {
|
||||
return new LocalArtifact();
|
||||
return entityFactory.generateLocalArtifact();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -115,4 +117,11 @@ public class ArtifactBeanQuery extends AbstractBeanQuery<LocalArtifact> {
|
||||
}
|
||||
return artifactManagement;
|
||||
}
|
||||
|
||||
private EntityFactory getEntityFactory() {
|
||||
if (entityFactory == null) {
|
||||
entityFactory = SpringContextHelper.getBean(EntityFactory.class);
|
||||
}
|
||||
return entityFactory;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,70 +1,70 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||
*
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*/
|
||||
package org.eclipse.hawkbit.ui.artifacts.event;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||
|
||||
/**
|
||||
*
|
||||
* Holds file and upload status details.Meta data sent with upload events.
|
||||
*
|
||||
*/
|
||||
public class UploadFileStatus implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -3599629192216760811L;
|
||||
|
||||
private String fileName;
|
||||
|
||||
private long contentLength;
|
||||
|
||||
private long bytesRead;
|
||||
|
||||
private String failureReason;
|
||||
|
||||
private SoftwareModule softwareModule;
|
||||
|
||||
public UploadFileStatus(String fileName) {
|
||||
this.fileName = fileName;
|
||||
}
|
||||
|
||||
public UploadFileStatus(String fileName, long bytesRead, long contentLength,SoftwareModule softwareModule) {
|
||||
this.fileName = fileName;
|
||||
this.contentLength = contentLength;
|
||||
this.bytesRead = bytesRead;
|
||||
this.softwareModule = softwareModule;
|
||||
}
|
||||
|
||||
public UploadFileStatus(String fileName, String failureReason,SoftwareModule selectedSw) {
|
||||
this.failureReason = failureReason;
|
||||
this.fileName = fileName;
|
||||
this.softwareModule = selectedSw;
|
||||
}
|
||||
|
||||
public String getFileName() {
|
||||
return fileName;
|
||||
}
|
||||
|
||||
public long getContentLength() {
|
||||
return contentLength;
|
||||
}
|
||||
|
||||
public long getBytesRead() {
|
||||
return bytesRead;
|
||||
}
|
||||
|
||||
public String getFailureReason() {
|
||||
return failureReason;
|
||||
}
|
||||
|
||||
public SoftwareModule getSoftwareModule() {
|
||||
return softwareModule;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||
*
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*/
|
||||
package org.eclipse.hawkbit.ui.artifacts.event;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||
|
||||
/**
|
||||
*
|
||||
* Holds file and upload status details.Meta data sent with upload events.
|
||||
*
|
||||
*/
|
||||
public class UploadFileStatus implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -3599629192216760811L;
|
||||
|
||||
private String fileName;
|
||||
|
||||
private long contentLength;
|
||||
|
||||
private long bytesRead;
|
||||
|
||||
private String failureReason;
|
||||
|
||||
private SoftwareModule softwareModule;
|
||||
|
||||
public UploadFileStatus(String fileName) {
|
||||
this.fileName = fileName;
|
||||
}
|
||||
|
||||
public UploadFileStatus(String fileName, long bytesRead, long contentLength,SoftwareModule softwareModule) {
|
||||
this.fileName = fileName;
|
||||
this.contentLength = contentLength;
|
||||
this.bytesRead = bytesRead;
|
||||
this.softwareModule = softwareModule;
|
||||
}
|
||||
|
||||
public UploadFileStatus(String fileName, String failureReason,SoftwareModule selectedSw) {
|
||||
this.failureReason = failureReason;
|
||||
this.fileName = fileName;
|
||||
this.softwareModule = selectedSw;
|
||||
}
|
||||
|
||||
public String getFileName() {
|
||||
return fileName;
|
||||
}
|
||||
|
||||
public long getContentLength() {
|
||||
return contentLength;
|
||||
}
|
||||
|
||||
public long getBytesRead() {
|
||||
return bytesRead;
|
||||
}
|
||||
|
||||
public String getFailureReason() {
|
||||
return failureReason;
|
||||
}
|
||||
|
||||
public SoftwareModule getSoftwareModule() {
|
||||
return softwareModule;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,42 +1,42 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||
*
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*/
|
||||
package org.eclipse.hawkbit.ui.artifacts.event;
|
||||
/**
|
||||
*
|
||||
* Holds the upload file status.
|
||||
*
|
||||
*/
|
||||
public class UploadStatusEvent {
|
||||
|
||||
public enum UploadStatusEventType {
|
||||
UPLOAD_FAILED, UPLOAD_IN_PROGRESS, UPLOAD_STARTED, UPLOAD_FINISHED, UPLOAD_SUCCESSFUL, UPLOAD_STREAMING_FAILED, UPLOAD_STREAMING_FINISHED, ABORT_UPLOAD
|
||||
}
|
||||
|
||||
private UploadStatusEventType uploadProgressEventType;
|
||||
|
||||
private UploadFileStatus uploadStatus;
|
||||
|
||||
public UploadStatusEvent(UploadStatusEventType eventType, UploadFileStatus entity) {
|
||||
this.uploadProgressEventType = eventType;
|
||||
this.uploadStatus = entity;
|
||||
}
|
||||
|
||||
public UploadFileStatus getUploadStatus() {
|
||||
return uploadStatus;
|
||||
}
|
||||
|
||||
public void setUploadStatus(UploadFileStatus uploadStatus) {
|
||||
this.uploadStatus = uploadStatus;
|
||||
}
|
||||
|
||||
public UploadStatusEventType getUploadProgressEventType() {
|
||||
return uploadProgressEventType;
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||
*
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*/
|
||||
package org.eclipse.hawkbit.ui.artifacts.event;
|
||||
/**
|
||||
*
|
||||
* Holds the upload file status.
|
||||
*
|
||||
*/
|
||||
public class UploadStatusEvent {
|
||||
|
||||
public enum UploadStatusEventType {
|
||||
UPLOAD_FAILED, UPLOAD_IN_PROGRESS, UPLOAD_STARTED, UPLOAD_FINISHED, UPLOAD_SUCCESSFUL, UPLOAD_STREAMING_FAILED, UPLOAD_STREAMING_FINISHED, ABORT_UPLOAD
|
||||
}
|
||||
|
||||
private UploadStatusEventType uploadProgressEventType;
|
||||
|
||||
private UploadFileStatus uploadStatus;
|
||||
|
||||
public UploadStatusEvent(UploadStatusEventType eventType, UploadFileStatus entity) {
|
||||
this.uploadProgressEventType = eventType;
|
||||
this.uploadStatus = entity;
|
||||
}
|
||||
|
||||
public UploadFileStatus getUploadStatus() {
|
||||
return uploadStatus;
|
||||
}
|
||||
|
||||
public void setUploadStatus(UploadFileStatus uploadStatus) {
|
||||
this.uploadStatus = uploadStatus;
|
||||
}
|
||||
|
||||
public UploadStatusEventType getUploadProgressEventType() {
|
||||
return uploadProgressEventType;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,8 +10,6 @@ package org.eclipse.hawkbit.ui.artifacts.smtable;
|
||||
|
||||
import java.security.SecureRandom;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||
|
||||
/**
|
||||
*
|
||||
* Proxy for software module to display details in Software modules table.
|
||||
@@ -19,7 +17,7 @@ import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class ProxyBaseSoftwareModuleItem extends SoftwareModule {
|
||||
public class ProxyBaseSoftwareModuleItem {
|
||||
|
||||
private static final long serialVersionUID = -1555306616599140635L;
|
||||
|
||||
@@ -39,6 +37,11 @@ public class ProxyBaseSoftwareModuleItem extends SoftwareModule {
|
||||
|
||||
private String modifiedByUser;
|
||||
|
||||
private String name;
|
||||
private String version;
|
||||
private String vendor;
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
@@ -47,6 +50,38 @@ public class ProxyBaseSoftwareModuleItem extends SoftwareModule {
|
||||
swId = RANDOM_OBJ.nextLong();
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(final String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(final String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public String getVendor() {
|
||||
return vendor;
|
||||
}
|
||||
|
||||
public void setVendor(final String vendor) {
|
||||
this.vendor = vendor;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(final String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getCreatedByUser() {
|
||||
return createdByUser;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ package org.eclipse.hawkbit.ui.artifacts.smtable;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleEvent;
|
||||
@@ -62,6 +63,9 @@ public class SoftwareModuleAddUpdateWindow extends CustomComponent implements Se
|
||||
@Autowired
|
||||
private transient SoftwareManagement softwareManagement;
|
||||
|
||||
@Autowired
|
||||
private transient EntityFactory entityFactory;
|
||||
|
||||
private Label mandatoryLabel;
|
||||
|
||||
private TextField nameTextField;
|
||||
@@ -249,8 +253,8 @@ public class SoftwareModuleAddUpdateWindow extends CustomComponent implements Se
|
||||
uiNotifcation.displayValidationError(
|
||||
i18n.get("message.duplicate.softwaremodule", new Object[] { name, version }));
|
||||
} else {
|
||||
final SoftwareModule newBaseSoftwareModule = HawkbitCommonUtil.addNewBaseSoftware(name, version, vendor,
|
||||
softwareManagement.findSoftwareModuleTypeByName(type), description);
|
||||
final SoftwareModule newBaseSoftwareModule = HawkbitCommonUtil.addNewBaseSoftware(entityFactory, name,
|
||||
version, vendor, softwareManagement.findSoftwareModuleTypeByName(type), description);
|
||||
if (newBaseSoftwareModule != null) {
|
||||
/* display success message */
|
||||
uiNotifcation.displaySuccess(i18n.get("message.save.success", new Object[] {
|
||||
|
||||
@@ -12,6 +12,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModuleType;
|
||||
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleTypeEvent;
|
||||
@@ -56,6 +57,9 @@ public class CreateUpdateSoftwareTypeLayout extends CreateUpdateTypeLayout
|
||||
@Autowired
|
||||
private transient SoftwareManagement swTypeManagementService;
|
||||
|
||||
@Autowired
|
||||
private transient EntityFactory entityFactory;
|
||||
|
||||
private String singleAssignStr;
|
||||
private String multiAssignStr;
|
||||
private Label singleAssign;
|
||||
@@ -227,8 +231,10 @@ public class CreateUpdateSoftwareTypeLayout extends CreateUpdateTypeLayout
|
||||
}
|
||||
|
||||
if (null != typeNameValue && null != typeKeyValue) {
|
||||
SoftwareModuleType newSWType = new SoftwareModuleType(typeKeyValue, typeNameValue, typeDescValue,
|
||||
assignNumber, colorPicked);
|
||||
SoftwareModuleType newSWType = entityFactory.generateSoftwareModuleType(typeKeyValue, typeNameValue,
|
||||
typeDescValue, assignNumber);
|
||||
newSWType.setColour(colorPicked);
|
||||
|
||||
if (null != typeDescValue) {
|
||||
newSWType.setDescription(typeDescValue);
|
||||
}
|
||||
|
||||
@@ -1,86 +1,86 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||
*
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*/
|
||||
package org.eclipse.hawkbit.ui.artifacts.upload;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||
|
||||
/**
|
||||
*
|
||||
* Holds uploaded file status.Used to display the details in upload status
|
||||
* popup.
|
||||
*
|
||||
*/
|
||||
public class UploadStatusObject {
|
||||
private String status;
|
||||
private Double progress;
|
||||
private String filename;
|
||||
private String reason;
|
||||
private SoftwareModule selectedSoftwareModule;
|
||||
|
||||
public UploadStatusObject(final String status, final Double progress, final String fileName, final String reason,
|
||||
final SoftwareModule selectedSoftwareModule) {
|
||||
this(fileName,selectedSoftwareModule);
|
||||
this.status = status;
|
||||
this.progress = progress;
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
public UploadStatusObject(String fileName, SoftwareModule selectedSoftwareModule) {
|
||||
this.filename = fileName;
|
||||
this.selectedSoftwareModule = selectedSoftwareModule;
|
||||
}
|
||||
|
||||
public SoftwareModule getSelectedSoftwareModule() {
|
||||
return selectedSoftwareModule;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Double getProgress() {
|
||||
return progress;
|
||||
}
|
||||
|
||||
public void setProgress(Double progress) {
|
||||
this.progress = progress;
|
||||
}
|
||||
|
||||
public String getFilename() {
|
||||
return filename;
|
||||
}
|
||||
|
||||
public void setFilename(String filename) {
|
||||
this.filename = filename;
|
||||
}
|
||||
|
||||
public String getReason() {
|
||||
return reason;
|
||||
}
|
||||
|
||||
public void setReason(String reason) {
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == null || obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (obj instanceof UploadStatusObject && this.getFilename() == ((UploadStatusObject) obj).getFilename()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||
*
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*/
|
||||
package org.eclipse.hawkbit.ui.artifacts.upload;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||
|
||||
/**
|
||||
*
|
||||
* Holds uploaded file status.Used to display the details in upload status
|
||||
* popup.
|
||||
*
|
||||
*/
|
||||
public class UploadStatusObject {
|
||||
private String status;
|
||||
private Double progress;
|
||||
private String filename;
|
||||
private String reason;
|
||||
private SoftwareModule selectedSoftwareModule;
|
||||
|
||||
public UploadStatusObject(final String status, final Double progress, final String fileName, final String reason,
|
||||
final SoftwareModule selectedSoftwareModule) {
|
||||
this(fileName,selectedSoftwareModule);
|
||||
this.status = status;
|
||||
this.progress = progress;
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
public UploadStatusObject(String fileName, SoftwareModule selectedSoftwareModule) {
|
||||
this.filename = fileName;
|
||||
this.selectedSoftwareModule = selectedSoftwareModule;
|
||||
}
|
||||
|
||||
public SoftwareModule getSelectedSoftwareModule() {
|
||||
return selectedSoftwareModule;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Double getProgress() {
|
||||
return progress;
|
||||
}
|
||||
|
||||
public void setProgress(Double progress) {
|
||||
this.progress = progress;
|
||||
}
|
||||
|
||||
public String getFilename() {
|
||||
return filename;
|
||||
}
|
||||
|
||||
public void setFilename(String filename) {
|
||||
this.filename = filename;
|
||||
}
|
||||
|
||||
public String getReason() {
|
||||
return reason;
|
||||
}
|
||||
|
||||
public void setReason(String reason) {
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == null || obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (obj instanceof UploadStatusObject && this.getFilename() == ((UploadStatusObject) obj).getFilename()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||
*
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*/
|
||||
package org.eclipse.hawkbit.ui.common;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class DistributionSetIdName implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final Long id;
|
||||
private final String name;
|
||||
private final String version;
|
||||
|
||||
public static DistributionSetIdName generate(final DistributionSet distributionSet) {
|
||||
return new DistributionSetIdName(distributionSet.getId(), distributionSet.getName(),
|
||||
distributionSet.getVersion());
|
||||
|
||||
}
|
||||
|
||||
public static DistributionSetIdName generate(final Long id, final String name, final String version) {
|
||||
return new DistributionSetIdName(id, name, version);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param id
|
||||
* the {@link DistributionSet#getId()}
|
||||
* @param name
|
||||
* the {@link DistributionSet#getName()}
|
||||
* @param version
|
||||
* the {@link DistributionSet#getVersion()}
|
||||
*
|
||||
*/
|
||||
public DistributionSetIdName(final Long id, final String name, final String version) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + (id == null ? 0 : id.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (!(obj instanceof DistributionSetIdName)) {
|
||||
return false;
|
||||
}
|
||||
final DistributionSetIdName other = (DistributionSetIdName) obj;
|
||||
if (id == null) {
|
||||
if (other.id != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!id.equals(other.id)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
// only return the ID because it's used in vaadin for setting the item
|
||||
// id in the dom
|
||||
return id.toString();
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
||||
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||
import org.eclipse.hawkbit.repository.OffsetBasedPageRequest;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetType;
|
||||
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
|
||||
@@ -41,6 +42,7 @@ public class DistributionSetTypeBeanQuery extends AbstractBeanQuery<Distribution
|
||||
private final Sort sort = new Sort(Direction.ASC, "name");
|
||||
private transient Page<DistributionSetType> firstPageDistSetType = null;
|
||||
private transient DistributionSetManagement distributionSetManagement;
|
||||
private transient EntityFactory entityFactory;
|
||||
|
||||
/**
|
||||
* Parametric constructor.
|
||||
@@ -57,8 +59,9 @@ public class DistributionSetTypeBeanQuery extends AbstractBeanQuery<Distribution
|
||||
|
||||
@Override
|
||||
protected DistributionSetType constructBean() {
|
||||
|
||||
return new DistributionSetType("", "", "", "");
|
||||
final DistributionSetType result = getEntityFactory().generateDistributionSetType("", "", "");
|
||||
result.setColour("");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -80,6 +83,13 @@ public class DistributionSetTypeBeanQuery extends AbstractBeanQuery<Distribution
|
||||
return distributionSetManagement;
|
||||
}
|
||||
|
||||
private EntityFactory getEntityFactory() {
|
||||
if (entityFactory == null) {
|
||||
entityFactory = SpringContextHelper.getBean(EntityFactory.class);
|
||||
}
|
||||
return entityFactory;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<DistributionSetType> loadBeans(final int startIndex, final int count) {
|
||||
Page<DistributionSetType> typeBeans;
|
||||
|
||||
@@ -11,6 +11,7 @@ package org.eclipse.hawkbit.ui.common;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||
import org.eclipse.hawkbit.repository.OffsetBasedPageRequest;
|
||||
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModuleType;
|
||||
@@ -31,6 +32,7 @@ public class SoftwareModuleTypeBeanQuery extends AbstractBeanQuery<SoftwareModul
|
||||
private final Sort sort = new Sort(Direction.ASC, "name");
|
||||
private transient Page<SoftwareModuleType> firstPageSwModuleType = null;
|
||||
private transient SoftwareManagement softwareManagement;
|
||||
private transient EntityFactory entityFactory;
|
||||
|
||||
/**
|
||||
* Parametric constructor.
|
||||
@@ -47,7 +49,14 @@ public class SoftwareModuleTypeBeanQuery extends AbstractBeanQuery<SoftwareModul
|
||||
|
||||
@Override
|
||||
protected SoftwareModuleType constructBean() {
|
||||
return new SoftwareModuleType();
|
||||
return getEntityFactory().generateSoftwareModuleType();
|
||||
}
|
||||
|
||||
private EntityFactory getEntityFactory() {
|
||||
if (entityFactory == null) {
|
||||
entityFactory = SpringContextHelper.getBean(EntityFactory.class);
|
||||
}
|
||||
return entityFactory;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -16,6 +16,7 @@ import org.eclipse.hawkbit.repository.exception.EntityLockedException;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModuleType;
|
||||
import org.eclipse.hawkbit.ui.common.DistributionSetIdName;
|
||||
import org.eclipse.hawkbit.ui.common.table.BaseEntityEventType;
|
||||
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
||||
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
|
||||
@@ -214,7 +215,7 @@ public class SoftwareModuleDetailsTable extends Table {
|
||||
.getItem(event.getButton().getId()).getItemProperty(SOFT_MODULE).getValue(), alreadyAssignedSwModules);
|
||||
final DistributionSet newDistributionSet = distributionSetManagement.unassignSoftwareModule(distributionSet,
|
||||
unAssignedSw);
|
||||
manageDistUIState.setLastSelectedEntity(newDistributionSet.getDistributionSetIdName());
|
||||
manageDistUIState.setLastSelectedEntity(DistributionSetIdName.generate(newDistributionSet));
|
||||
eventBus.publish(this, new DistributionTableEvent(BaseEntityEventType.SELECTED_ENTITY, newDistributionSet));
|
||||
eventBus.publish(this, DistributionsUIEvent.ORDER_BY_DISTRIBUTION);
|
||||
uiNotification.displaySuccess(i18n.get("message.sw.unassigned", unAssignedSw.getName()));
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.ui.common.tagdetails;
|
||||
|
||||
import org.eclipse.hawkbit.eventbus.event.TargetTagCreatedBulkEvent;
|
||||
import org.eclipse.hawkbit.eventbus.event.TargetTagDeletedEvent;
|
||||
import org.eclipse.hawkbit.repository.TagManagement;
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.TargetTagCreatedBulkEvent;
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.TargetTagDeletedEvent;
|
||||
import org.eclipse.hawkbit.repository.model.BaseEntity;
|
||||
import org.eclipse.hawkbit.repository.model.TargetTag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
@@ -14,12 +14,12 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.eclipse.hawkbit.eventbus.event.DistributionSetTagAssigmentResultEvent;
|
||||
import org.eclipse.hawkbit.eventbus.event.DistributionSetTagCreatedBulkEvent;
|
||||
import org.eclipse.hawkbit.eventbus.event.DistributionSetTagDeletedEvent;
|
||||
import org.eclipse.hawkbit.eventbus.event.DistributionSetTagUpdateEvent;
|
||||
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
||||
import org.eclipse.hawkbit.repository.TagManagement;
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.DistributionSetTagAssigmentResultEvent;
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.DistributionSetTagCreatedBulkEvent;
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.DistributionSetTagDeletedEvent;
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.DistributionSetTagUpdateEvent;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetTag;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetTagAssignmentResult;
|
||||
|
||||
@@ -14,9 +14,9 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.eclipse.hawkbit.eventbus.event.TargetTagAssigmentResultEvent;
|
||||
import org.eclipse.hawkbit.eventbus.event.TargetTagUpdateEvent;
|
||||
import org.eclipse.hawkbit.repository.TargetManagement;
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.TargetTagAssigmentResultEvent;
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.TargetTagUpdateEvent;
|
||||
import org.eclipse.hawkbit.repository.model.Target;
|
||||
import org.eclipse.hawkbit.repository.model.TargetTag;
|
||||
import org.eclipse.hawkbit.repository.model.TargetTagAssignmentResult;
|
||||
|
||||
@@ -9,13 +9,14 @@
|
||||
package org.eclipse.hawkbit.ui.components;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||
import org.eclipse.hawkbit.ui.common.DistributionSetIdName;
|
||||
|
||||
/**
|
||||
* Proxy for {@link DistributionSet}.
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class ProxyDistribution extends DistributionSet {
|
||||
public class ProxyDistribution {
|
||||
|
||||
private static final long serialVersionUID = -8891449133620645310L;
|
||||
|
||||
@@ -33,6 +34,11 @@ public class ProxyDistribution extends DistributionSet {
|
||||
|
||||
private String nameVersion;
|
||||
|
||||
private Long id;
|
||||
private String name;
|
||||
private String version;
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* @return the nameVersion
|
||||
*/
|
||||
@@ -40,6 +46,10 @@ public class ProxyDistribution extends DistributionSet {
|
||||
return nameVersion;
|
||||
}
|
||||
|
||||
public DistributionSetIdName getDistributionSetIdName() {
|
||||
return DistributionSetIdName.generate(id, name, version);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param nameVersion
|
||||
* the nameVersion to set
|
||||
@@ -96,4 +106,36 @@ public class ProxyDistribution extends DistributionSet {
|
||||
this.modifiedByUser = modifiedByUser;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(final Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(final String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(final String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(final String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,30 +8,33 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.ui.components;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.net.URI;
|
||||
import java.security.SecureRandom;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.Action.Status;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||
import org.eclipse.hawkbit.repository.model.Target;
|
||||
import org.eclipse.hawkbit.repository.model.TargetIdName;
|
||||
import org.eclipse.hawkbit.repository.model.TargetInfo;
|
||||
import org.eclipse.hawkbit.repository.model.TargetUpdateStatus;
|
||||
|
||||
/**
|
||||
* Proxy for {@link Target}.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* @author kaizimmerm
|
||||
*
|
||||
*/
|
||||
public class ProxyTarget extends Target {
|
||||
public class ProxyTarget implements Serializable {
|
||||
private static final long serialVersionUID = -8891449133620645310L;
|
||||
private String controllerId;
|
||||
private URI address = null;
|
||||
private Long lastTargetQuery = null;
|
||||
private Long installationDate;
|
||||
|
||||
private Long id;
|
||||
|
||||
private TargetUpdateStatus updateStatus = TargetUpdateStatus.UNKNOWN;
|
||||
|
||||
private DistributionSet installedDistributionSet;
|
||||
@@ -56,11 +59,58 @@ public class ProxyTarget extends Target {
|
||||
|
||||
private Status status;
|
||||
|
||||
private String name;
|
||||
|
||||
private String description;
|
||||
|
||||
private Long createdAt;
|
||||
|
||||
private TargetInfo targetInfo;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(final Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(final String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(final String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public Long getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public void setCreatedAt(final Long createdAt) {
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public TargetInfo getTargetInfo() {
|
||||
return targetInfo;
|
||||
}
|
||||
|
||||
public void setTargetInfo(final TargetInfo targetInfo) {
|
||||
this.targetInfo = targetInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param controllerId
|
||||
*/
|
||||
public ProxyTarget() {
|
||||
super(null);
|
||||
final Integer generatedId = new SecureRandom().nextInt(Integer.MAX_VALUE) - Integer.MAX_VALUE;
|
||||
targetIdName = new TargetIdName(generatedId, generatedId.toString(), generatedId.toString());
|
||||
}
|
||||
@@ -160,7 +210,6 @@ public class ProxyTarget extends Target {
|
||||
*
|
||||
* @return String as ID.
|
||||
*/
|
||||
@Override
|
||||
public String getControllerId() {
|
||||
return controllerId;
|
||||
}
|
||||
@@ -171,7 +220,6 @@ public class ProxyTarget extends Target {
|
||||
* @param controllerId
|
||||
* as ID
|
||||
*/
|
||||
@Override
|
||||
public void setControllerId(final String controllerId) {
|
||||
this.controllerId = controllerId;
|
||||
}
|
||||
@@ -262,18 +310,14 @@ public class ProxyTarget extends Target {
|
||||
* @param assignedDistributionSet
|
||||
* the assignedDistributionSet to set
|
||||
*/
|
||||
public void setAssignedDistributionSet(DistributionSet assignedDistributionSet) {
|
||||
public void setAssignedDistributionSet(final DistributionSet assignedDistributionSet) {
|
||||
this.assignedDistributionSet = assignedDistributionSet;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the targetIdName
|
||||
*/
|
||||
@Override
|
||||
public TargetIdName getTargetIdName() {
|
||||
if (this.targetIdName == null) {
|
||||
return super.getTargetIdName();
|
||||
}
|
||||
return this.targetIdName;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,14 +8,12 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.ui.components;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.TargetFilterQuery;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class ProxyTargetFilter extends TargetFilterQuery {
|
||||
public class ProxyTargetFilter {
|
||||
|
||||
private static final long serialVersionUID = 6622060929679084419L;
|
||||
|
||||
@@ -23,6 +21,12 @@ public class ProxyTargetFilter extends TargetFilterQuery {
|
||||
|
||||
private String modifiedDate;
|
||||
|
||||
private String name;
|
||||
private Long id;
|
||||
private String createdBy;
|
||||
private String lastModifiedBy;
|
||||
private String query;
|
||||
|
||||
public String getCreatedDate() {
|
||||
return createdDate;
|
||||
}
|
||||
@@ -46,4 +50,44 @@ public class ProxyTargetFilter extends TargetFilterQuery {
|
||||
this.modifiedDate = modifiedDate;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(final String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(final Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getLastModifiedBy() {
|
||||
return lastModifiedBy;
|
||||
}
|
||||
|
||||
public void setLastModifiedBy(final String lastModifiedBy) {
|
||||
this.lastModifiedBy = lastModifiedBy;
|
||||
}
|
||||
|
||||
public String getQuery() {
|
||||
return query;
|
||||
}
|
||||
|
||||
public void setQuery(final String query) {
|
||||
this.query = query;
|
||||
}
|
||||
|
||||
public String getCreatedBy() {
|
||||
return createdBy;
|
||||
}
|
||||
|
||||
public void setCreatedBy(final String createdBy) {
|
||||
this.createdBy = createdBy;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
||||
import org.eclipse.hawkbit.repository.DistributionSetRepository;
|
||||
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetType;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModuleType;
|
||||
@@ -76,7 +76,7 @@ public class CreateUpdateDistSetTypeLayout extends CreateUpdateTypeLayout
|
||||
private transient DistributionSetManagement distributionSetManagement;
|
||||
|
||||
@Autowired
|
||||
private transient DistributionSetRepository distributionSetRepository;
|
||||
private transient EntityFactory entityFactory;
|
||||
|
||||
private HorizontalLayout distTypeSelectLayout;
|
||||
private Table sourceTable;
|
||||
@@ -343,7 +343,8 @@ public class CreateUpdateDistSetTypeLayout extends CreateUpdateTypeLayout
|
||||
final String typeDescValue = HawkbitCommonUtil.trimAndNullIfEmpty(tagDesc.getValue());
|
||||
final List<Long> itemIds = (List<Long>) selectedTable.getItemIds();
|
||||
if (null != typeNameValue && null != typeKeyValue && null != itemIds && !itemIds.isEmpty()) {
|
||||
DistributionSetType newDistType = new DistributionSetType(typeKeyValue, typeNameValue, typeDescValue);
|
||||
DistributionSetType newDistType = entityFactory.generateDistributionSetType(typeKeyValue, typeNameValue,
|
||||
typeDescValue);
|
||||
for (final Long id : itemIds) {
|
||||
final Item item = selectedTable.getItem(id);
|
||||
final String distTypeName = (String) item.getItemProperty(DIST_TYPE_NAME).getValue();
|
||||
@@ -387,7 +388,8 @@ public class CreateUpdateDistSetTypeLayout extends CreateUpdateTypeLayout
|
||||
updateDistSetType.setKey(typeKeyValue);
|
||||
updateDistSetType.setDescription(null != typeDescValue ? typeDescValue : null);
|
||||
|
||||
if (distributionSetRepository.countByType(existingType) <= 0 && null != itemIds && !itemIds.isEmpty()) {
|
||||
if (distributionSetManagement.countDistributionSetsByType(existingType) <= 0 && null != itemIds
|
||||
&& !itemIds.isEmpty()) {
|
||||
for (final Long id : itemIds) {
|
||||
final Item item = selectedTable.getItem(id);
|
||||
final CheckBox mandatoryCheckBox = (CheckBox) item.getItemProperty(DIST_TYPE_MANDATORY).getValue();
|
||||
@@ -551,7 +553,7 @@ public class CreateUpdateDistSetTypeLayout extends CreateUpdateTypeLayout
|
||||
tagDesc.setValue(selectedTypeTag.getDescription());
|
||||
typeKey.setValue(selectedTypeTag.getKey());
|
||||
|
||||
if (distributionSetRepository.countByType(selectedTypeTag) <= 0) {
|
||||
if (distributionSetManagement.countDistributionSetsByType(selectedTypeTag) <= 0) {
|
||||
distTypeSelectLayout.setEnabled(true);
|
||||
selectedTable.setEnabled(true);
|
||||
window.setSaveButtonEnabled(true);
|
||||
|
||||
@@ -16,11 +16,11 @@ import java.util.Set;
|
||||
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
||||
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetIdName;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModuleIdName;
|
||||
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleEvent;
|
||||
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleEvent.SoftwareModuleEventType;
|
||||
import org.eclipse.hawkbit.ui.common.DistributionSetIdName;
|
||||
import org.eclipse.hawkbit.ui.common.detailslayout.AbstractNamedVersionedEntityTableDetailsLayout;
|
||||
import org.eclipse.hawkbit.ui.common.detailslayout.SoftwareModuleDetailsTable;
|
||||
import org.eclipse.hawkbit.ui.common.tagdetails.DistributionTagToken;
|
||||
|
||||
@@ -21,13 +21,12 @@ import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
||||
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||
import org.eclipse.hawkbit.repository.TargetManagement;
|
||||
import org.eclipse.hawkbit.repository.exception.EntityLockedException;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetIdName;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModuleIdName;
|
||||
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleEvent;
|
||||
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleEvent.SoftwareModuleEventType;
|
||||
import org.eclipse.hawkbit.ui.common.DistributionSetIdName;
|
||||
import org.eclipse.hawkbit.ui.common.table.AbstractNamedVersionTable;
|
||||
import org.eclipse.hawkbit.ui.common.table.AbstractTable;
|
||||
import org.eclipse.hawkbit.ui.common.table.BaseEntityEventType;
|
||||
@@ -322,11 +321,11 @@ public class DistributionSetTable extends AbstractNamedVersionTable<Distribution
|
||||
if (!validateSoftwareModule(sm, ds)) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
distributionSetManagement.checkDistributionSetAlreadyUse(ds);
|
||||
} catch (final EntityLockedException exception) {
|
||||
LOG.error("Unable to update distribution : ", exception);
|
||||
notification.displayValidationError(exception.getMessage());
|
||||
|
||||
if (distributionSetManagement.isDistributionSetInUse(ds)) {
|
||||
notification.displayValidationError(
|
||||
String.format("Distribution set %s:%s is already assigned to targets and cannot be changed",
|
||||
ds.getName(), ds.getVersion()));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -454,7 +453,7 @@ public class DistributionSetTable extends AbstractNamedVersionTable<Distribution
|
||||
if (manageDistUIState.getSelectedDistributions().isPresent()) {
|
||||
manageDistUIState.getSelectedDistributions().get().stream().forEach(this::unselect);
|
||||
}
|
||||
select(baseEntity.getDistributionSetIdName());
|
||||
select(DistributionSetIdName.generate(baseEntity));
|
||||
return item;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,11 +14,11 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.hawkbit.repository.DistributionSetFilter;
|
||||
import org.eclipse.hawkbit.repository.DistributionSetFilter.DistributionSetFilterBuilder;
|
||||
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
||||
import org.eclipse.hawkbit.repository.OffsetBasedPageRequest;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetFilter;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetFilter.DistributionSetFilterBuilder;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetType;
|
||||
import org.eclipse.hawkbit.ui.common.UserDetailsFormatter;
|
||||
import org.eclipse.hawkbit.ui.components.ProxyDistribution;
|
||||
@@ -95,8 +95,8 @@ public class ManageDistBeanQuery extends AbstractBeanQuery<ProxyDistribution> {
|
||||
distBeans = firstPageDistributionSets;
|
||||
} else if (Strings.isNullOrEmpty(searchText)) {
|
||||
// if no search filters available
|
||||
distBeans = getDistributionSetManagement()
|
||||
.findDistributionSetsAll(new OffsetBasedPageRequest(startIndex, count, sort), false, null);
|
||||
distBeans = getDistributionSetManagement().findDistributionSetsByDeletedAndOrCompleted(
|
||||
new OffsetBasedPageRequest(startIndex, count, sort), false, null);
|
||||
} else {
|
||||
final DistributionSetFilter distributionSetFilter = new DistributionSetFilterBuilder().setIsDeleted(false)
|
||||
.setSearchText(searchText).setSelectDSWithNoTag(Boolean.FALSE).setType(distributionSetType).build();
|
||||
@@ -113,7 +113,6 @@ public class ManageDistBeanQuery extends AbstractBeanQuery<ProxyDistribution> {
|
||||
proxyDistribution.setVersion(distributionSet.getVersion());
|
||||
proxyDistribution.setCreatedDate(SPDateTimeUtil.getFormattedDate(distributionSet.getCreatedAt()));
|
||||
proxyDistribution.setLastModifiedDate(SPDateTimeUtil.getFormattedDate(distributionSet.getLastModifiedAt()));
|
||||
proxyDistribution.setDescription(distributionSet.getDescription());
|
||||
proxyDistribution.setCreatedByUser(UserDetailsFormatter.loadAndFormatCreatedBy(distributionSet));
|
||||
proxyDistribution.setModifiedByUser(UserDetailsFormatter.loadAndFormatLastModifiedBy(distributionSet));
|
||||
proxyDistribution.setIsComplete(distributionSet.isComplete());
|
||||
@@ -132,8 +131,8 @@ public class ManageDistBeanQuery extends AbstractBeanQuery<ProxyDistribution> {
|
||||
public int size() {
|
||||
if (Strings.isNullOrEmpty(searchText) && null == distributionSetType) {
|
||||
// if no search filters available
|
||||
firstPageDistributionSets = getDistributionSetManagement()
|
||||
.findDistributionSetsAll(new PageRequest(0, SPUIDefinitions.PAGE_SIZE, sort), false, null);
|
||||
firstPageDistributionSets = getDistributionSetManagement().findDistributionSetsByDeletedAndOrCompleted(
|
||||
new PageRequest(0, SPUIDefinitions.PAGE_SIZE, sort), false, null);
|
||||
} else {
|
||||
final DistributionSetFilter distributionSetFilter = new DistributionSetFilterBuilder().setIsDeleted(false)
|
||||
.setSearchText(searchText).setSelectDSWithNoTag(Boolean.FALSE).setType(distributionSetType).build();
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.ui.distributions.event;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetIdName;
|
||||
import org.eclipse.hawkbit.ui.common.DistributionSetIdName;
|
||||
|
||||
/**
|
||||
* Event fired on discard of software module assignment.
|
||||
|
||||
@@ -16,9 +16,9 @@ import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.hawkbit.repository.SystemManagement;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetIdName;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetType;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModuleIdName;
|
||||
import org.eclipse.hawkbit.ui.common.DistributionSetIdName;
|
||||
import org.eclipse.hawkbit.ui.common.footer.AbstractDeleteActionsLayout;
|
||||
import org.eclipse.hawkbit.ui.common.table.AbstractTable;
|
||||
import org.eclipse.hawkbit.ui.distributions.event.DistributionsUIEvent;
|
||||
|
||||
@@ -19,9 +19,9 @@ import java.util.stream.Collectors;
|
||||
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
||||
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetIdName;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModuleIdName;
|
||||
import org.eclipse.hawkbit.ui.common.DistributionSetIdName;
|
||||
import org.eclipse.hawkbit.ui.common.confirmwindow.layout.AbstractConfirmationWindowLayout;
|
||||
import org.eclipse.hawkbit.ui.common.confirmwindow.layout.ConfirmationTab;
|
||||
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.util.Map;
|
||||
|
||||
import org.eclipse.hawkbit.repository.OffsetBasedPageRequest;
|
||||
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||
import org.eclipse.hawkbit.repository.model.CustomSoftwareModule;
|
||||
import org.eclipse.hawkbit.repository.model.AssignedSoftwareModule;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModuleType;
|
||||
import org.eclipse.hawkbit.ui.common.UserDetailsFormatter;
|
||||
@@ -75,20 +75,20 @@ public class SwModuleBeanQuery extends AbstractBeanQuery<ProxyBaseSwModuleItem>
|
||||
|
||||
@Override
|
||||
protected List<ProxyBaseSwModuleItem> loadBeans(final int startIndex, final int count) {
|
||||
final Slice<CustomSoftwareModule> swModuleBeans;
|
||||
final Slice<AssignedSoftwareModule> swModuleBeans;
|
||||
final List<ProxyBaseSwModuleItem> proxyBeans = new ArrayList<>();
|
||||
|
||||
swModuleBeans = getSoftwareManagement().findSoftwareModuleOrderBySetAssignmentAndModuleNameAscModuleVersionAsc(
|
||||
new OffsetBasedPageRequest(startIndex, count), orderByDistId, searchText, type);
|
||||
|
||||
for (final CustomSoftwareModule swModule : swModuleBeans) {
|
||||
for (final AssignedSoftwareModule swModule : swModuleBeans) {
|
||||
proxyBeans.add(getProxyBean(swModule));
|
||||
}
|
||||
|
||||
return proxyBeans;
|
||||
}
|
||||
|
||||
private ProxyBaseSwModuleItem getProxyBean(final CustomSoftwareModule customSoftwareModule) {
|
||||
private ProxyBaseSwModuleItem getProxyBean(final AssignedSoftwareModule customSoftwareModule) {
|
||||
final SoftwareModule bean = customSoftwareModule.getSoftwareModule();
|
||||
final ProxyBaseSwModuleItem proxyItem = new ProxyBaseSwModuleItem();
|
||||
proxyItem.setSwId(bean.getId());
|
||||
|
||||
@@ -16,8 +16,8 @@ import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetIdName;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModuleIdName;
|
||||
import org.eclipse.hawkbit.ui.common.DistributionSetIdName;
|
||||
import org.eclipse.hawkbit.ui.common.ManagmentEntityState;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ import java.util.concurrent.Executor;
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.PreDestroy;
|
||||
|
||||
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||
import org.eclipse.hawkbit.repository.TargetFilterQueryManagement;
|
||||
import org.eclipse.hawkbit.repository.model.TargetFilterQuery;
|
||||
@@ -95,6 +96,9 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
|
||||
@Qualifier("uiExecutor")
|
||||
private transient Executor executor;
|
||||
|
||||
@Autowired
|
||||
private transient EntityFactory entityFactory;
|
||||
|
||||
private HorizontalLayout breadcrumbLayout;
|
||||
|
||||
private Button breadcrumbButton;
|
||||
@@ -500,7 +504,7 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
|
||||
}
|
||||
|
||||
private void createTargetFilterQuery() {
|
||||
final TargetFilterQuery targetFilterQuery = new TargetFilterQuery();
|
||||
final TargetFilterQuery targetFilterQuery = entityFactory.generateTargetFilterQuery();
|
||||
targetFilterQuery.setName(nameTextField.getValue());
|
||||
targetFilterQuery.setQuery(queryTextField.getValue());
|
||||
targetFilterQueryManagement.createTargetFilterQuery(targetFilterQuery);
|
||||
|
||||
@@ -17,8 +17,8 @@ import java.util.stream.Collectors;
|
||||
|
||||
import org.eclipse.hawkbit.repository.TargetFields;
|
||||
import org.eclipse.hawkbit.repository.TargetManagement;
|
||||
import org.eclipse.hawkbit.repository.rsql.RSQLParameterSyntaxException;
|
||||
import org.eclipse.hawkbit.repository.rsql.RSQLParameterUnsupportedFieldException;
|
||||
import org.eclipse.hawkbit.repository.exception.RSQLParameterSyntaxException;
|
||||
import org.eclipse.hawkbit.repository.exception.RSQLParameterUnsupportedFieldException;
|
||||
import org.eclipse.hawkbit.ui.utils.SpringContextHelper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@@ -102,8 +102,8 @@ public abstract class AbstractCreateUpdateTagLayout extends CustomComponent
|
||||
protected boolean tagPreviewBtnClicked = false;
|
||||
|
||||
private String colorPicked;
|
||||
private String tagNameValue;
|
||||
private String tagDescValue;
|
||||
protected String tagNameValue;
|
||||
protected String tagDescValue;
|
||||
|
||||
protected void createWindow() {
|
||||
reset();
|
||||
|
||||
@@ -69,14 +69,15 @@ import com.vaadin.ui.UI;
|
||||
import com.vaadin.ui.themes.ValoTheme;
|
||||
|
||||
/**
|
||||
*
|
||||
* Table for {@link Target#getActions()} history.
|
||||
*
|
||||
*/
|
||||
|
||||
@SpringComponent
|
||||
@ViewScope
|
||||
public class ActionHistoryTable extends TreeTable implements Handler {
|
||||
|
||||
private static final String BUTTON_CANCEL = "button.cancel";
|
||||
private static final String BUTTON_OK = "button.ok";
|
||||
private static final long serialVersionUID = -1631514704696786653L;
|
||||
@Autowired
|
||||
private I18N i18n;
|
||||
@@ -241,11 +242,14 @@ public class ActionHistoryTable extends TreeTable implements Handler {
|
||||
|
||||
private void getcontainerData() {
|
||||
hierarchicalContainer.removeAllItems();
|
||||
/* service method to create action history for target */
|
||||
final List<ActionWithStatusCount> actionHistory = deploymentManagement
|
||||
|
||||
if (target != null) {
|
||||
/* service method to create action history for target */
|
||||
final List<ActionWithStatusCount> actionHistory = deploymentManagement
|
||||
.findActionsWithStatusCountByTargetOrderByIdDesc(target);
|
||||
|
||||
addDetailsToContainer(actionHistory);
|
||||
|
||||
addDetailsToContainer(actionHistory);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -268,29 +272,29 @@ public class ActionHistoryTable extends TreeTable implements Handler {
|
||||
|
||||
final Action action = actionWithStatusCount.getAction();
|
||||
|
||||
final Item item = hierarchicalContainer.addItem(actionWithStatusCount.getActionId());
|
||||
final Item item = hierarchicalContainer.addItem(actionWithStatusCount.getAction().getId());
|
||||
|
||||
item.getItemProperty(SPUIDefinitions.ACTION_HIS_TBL_STATUS_HIDDEN)
|
||||
.setValue(actionWithStatusCount.getActionStatus());
|
||||
.setValue(actionWithStatusCount.getAction().getStatus());
|
||||
|
||||
/*
|
||||
* add action id.
|
||||
*/
|
||||
item.getItemProperty(SPUIDefinitions.ACTION_HIS_TBL_ACTION_ID)
|
||||
.setValue(actionWithStatusCount.getActionId().toString());
|
||||
.setValue(actionWithStatusCount.getAction().getId().toString());
|
||||
/*
|
||||
* add active/inactive status to the item which will be used in
|
||||
* Column generator to generate respective icon
|
||||
*/
|
||||
item.getItemProperty(SPUIDefinitions.ACTION_HIS_TBL_ACTIVE_HIDDEN).setValue(
|
||||
actionWithStatusCount.isActionActive() ? SPUIDefinitions.ACTIVE : SPUIDefinitions.IN_ACTIVE);
|
||||
actionWithStatusCount.getAction().isActive() ? SPUIDefinitions.ACTIVE : SPUIDefinitions.IN_ACTIVE);
|
||||
|
||||
/*
|
||||
* add action Id to the item which will be used for fetching child
|
||||
* items ( previous action status ) during expand
|
||||
*/
|
||||
item.getItemProperty(SPUIDefinitions.ACTION_HIS_TBL_ACTION_ID_HIDDEN)
|
||||
.setValue(actionWithStatusCount.getActionId());
|
||||
.setValue(actionWithStatusCount.getAction().getId());
|
||||
|
||||
/*
|
||||
* add distribution name to the item which will be displayed in the
|
||||
@@ -301,18 +305,18 @@ public class ActionHistoryTable extends TreeTable implements Handler {
|
||||
item.getItemProperty(SPUIDefinitions.ACTION_HIS_TBL_FORCED).setValue(action);
|
||||
|
||||
/* Default no child */
|
||||
((Hierarchical) hierarchicalContainer).setChildrenAllowed(actionWithStatusCount.getActionId(), false);
|
||||
((Hierarchical) hierarchicalContainer).setChildrenAllowed(actionWithStatusCount.getAction().getId(), false);
|
||||
|
||||
item.getItemProperty(SPUIDefinitions.ACTION_HIS_TBL_DATETIME)
|
||||
.setValue(SPDateTimeUtil.getFormattedDate((actionWithStatusCount.getActionLastModifiedAt() != null)
|
||||
? actionWithStatusCount.getActionLastModifiedAt()
|
||||
: actionWithStatusCount.getActionCreatedAt()));
|
||||
.setValue(SPDateTimeUtil.getFormattedDate((actionWithStatusCount.getAction().getLastModifiedAt() != null)
|
||||
? actionWithStatusCount.getAction().getLastModifiedAt()
|
||||
: actionWithStatusCount.getAction().getLastModifiedAt()));
|
||||
|
||||
item.getItemProperty(SPUIDefinitions.ACTION_HIS_TBL_ROLLOUT_NAME)
|
||||
.setValue(actionWithStatusCount.getRolloutName());
|
||||
|
||||
if (actionWithStatusCount.getActionStatusCount() > 0) {
|
||||
((Hierarchical) hierarchicalContainer).setChildrenAllowed(actionWithStatusCount.getActionId(), true);
|
||||
((Hierarchical) hierarchicalContainer).setChildrenAllowed(actionWithStatusCount.getAction().getId(), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -422,8 +426,12 @@ public class ActionHistoryTable extends TreeTable implements Handler {
|
||||
.findActionWithDetails(actionId);
|
||||
final Pageable pageReq = new PageRequest(0, 1000,
|
||||
new Sort(Direction.DESC, ActionStatusFields.ID.getFieldName()));
|
||||
final Page<ActionStatus> actionStatusList = deploymentManagement.findActionStatusByAction(pageReq, action,
|
||||
managementUIState.isActionHistoryMaximized());
|
||||
final Page<ActionStatus> actionStatusList;
|
||||
if (managementUIState.isActionHistoryMaximized()) {
|
||||
actionStatusList = deploymentManagement.findActionStatusByActionWithMessages(pageReq, action);
|
||||
} else {
|
||||
actionStatusList = deploymentManagement.findActionStatusByAction(pageReq, action);
|
||||
}
|
||||
final List<ActionStatus> content = actionStatusList.getContent();
|
||||
/*
|
||||
* Since the recent action status and messages are already
|
||||
@@ -747,7 +755,7 @@ public class ActionHistoryTable extends TreeTable implements Handler {
|
||||
private void confirmAndForceAction(final Long actionId) {
|
||||
/* Display the confirmation */
|
||||
final ConfirmationDialog confirmDialog = new ConfirmationDialog(i18n.get("caption.force.action.confirmbox"),
|
||||
i18n.get("message.force.action.confirm"), i18n.get("button.ok"), i18n.get("button.cancel"), ok -> {
|
||||
i18n.get("message.force.action.confirm"), i18n.get(BUTTON_OK), i18n.get(BUTTON_CANCEL), ok -> {
|
||||
if (ok) {
|
||||
/* cancel the action */
|
||||
deploymentManagement.forceTargetAction(actionId);
|
||||
@@ -769,7 +777,7 @@ public class ActionHistoryTable extends TreeTable implements Handler {
|
||||
private void confirmAndForceQuitAction(final Long actionId) {
|
||||
/* Display the confirmation */
|
||||
final ConfirmationDialog confirmDialog = new ConfirmationDialog(i18n.get("caption.forcequit.action.confirmbox"),
|
||||
i18n.get("message.forcequit.action.confirm"), i18n.get("button.ok"), i18n.get("button.cancel"), ok -> {
|
||||
i18n.get("message.forcequit.action.confirm"), i18n.get(BUTTON_OK), i18n.get(BUTTON_CANCEL), ok -> {
|
||||
if (ok) {
|
||||
final boolean cancelResult = forceQuitActiveAction(actionId);
|
||||
if (cancelResult) {
|
||||
@@ -797,7 +805,7 @@ public class ActionHistoryTable extends TreeTable implements Handler {
|
||||
*/
|
||||
private void confirmAndCancelAction(final Long actionId) {
|
||||
final ConfirmationDialog confirmDialog = new ConfirmationDialog(i18n.get("caption.cancel.action.confirmbox"),
|
||||
i18n.get("message.cancel.action.confirm"), i18n.get("button.ok"), i18n.get("button.cancel"), ok -> {
|
||||
i18n.get("message.cancel.action.confirm"), i18n.get(BUTTON_OK), i18n.get(BUTTON_CANCEL), ok -> {
|
||||
if (ok) {
|
||||
final boolean cancelResult = cancelActiveAction(actionId);
|
||||
if (cancelResult) {
|
||||
|
||||
@@ -16,8 +16,8 @@ import java.util.Map;
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
||||
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||
import org.eclipse.hawkbit.repository.SystemManagement;
|
||||
import org.eclipse.hawkbit.repository.TenantMetaDataRepository;
|
||||
import org.eclipse.hawkbit.repository.exception.EntityAlreadyExistsException;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetType;
|
||||
@@ -88,7 +88,7 @@ public class DistributionAddUpdateWindowLayout extends CustomComponent {
|
||||
private transient SystemManagement systemManagement;
|
||||
|
||||
@Autowired
|
||||
private transient TenantMetaDataRepository tenantMetaDataRepository;
|
||||
private transient EntityFactory entityFactory;
|
||||
|
||||
private TextField distNameTextField;
|
||||
private TextField distVersionTextField;
|
||||
@@ -205,8 +205,7 @@ public class DistributionAddUpdateWindowLayout extends CustomComponent {
|
||||
}
|
||||
|
||||
private DistributionSetType getDefaultDistributionSetType() {
|
||||
final TenantMetaData tenantMetaData = tenantMetaDataRepository
|
||||
.findByTenantIgnoreCase(systemManagement.currentTenant());
|
||||
final TenantMetaData tenantMetaData = systemManagement.getTenantMetadata();
|
||||
return tenantMetaData.getDefaultDsType();
|
||||
}
|
||||
|
||||
@@ -281,7 +280,7 @@ public class DistributionAddUpdateWindowLayout extends CustomComponent {
|
||||
if (mandatoryCheck(name, version, distSetTypeName) && duplicateCheck(name, version)) {
|
||||
final String desc = HawkbitCommonUtil.trimAndNullIfEmpty(descTextArea.getValue());
|
||||
final boolean isMigStepReq = reqMigStepCheckbox.getValue();
|
||||
DistributionSet newDist = new DistributionSet();
|
||||
DistributionSet newDist = entityFactory.generateDistributionSet();
|
||||
|
||||
setDistributionValues(newDist, name, version, distSetTypeName, desc, isMigStepReq);
|
||||
newDist = distributionSetManagement.createDistributionSet(newDist);
|
||||
|
||||
@@ -13,11 +13,11 @@ import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.hawkbit.repository.DistributionSetFilter;
|
||||
import org.eclipse.hawkbit.repository.DistributionSetFilter.DistributionSetFilterBuilder;
|
||||
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
||||
import org.eclipse.hawkbit.repository.OffsetBasedPageRequest;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetFilter;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetFilter.DistributionSetFilterBuilder;
|
||||
import org.eclipse.hawkbit.ui.common.UserDetailsFormatter;
|
||||
import org.eclipse.hawkbit.ui.components.ProxyDistribution;
|
||||
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
||||
@@ -42,11 +42,11 @@ public class DistributionBeanQuery extends AbstractBeanQuery<ProxyDistribution>
|
||||
|
||||
private static final long serialVersionUID = 5862679853949173536L;
|
||||
private Sort sort = new Sort(Direction.ASC, "name", "version");
|
||||
private Collection<String> distributionTags = null;
|
||||
private String searchText = null;
|
||||
private String pinnedControllerId = null;
|
||||
private Collection<String> distributionTags;
|
||||
private String searchText;
|
||||
private String pinnedControllerId;
|
||||
private transient DistributionSetManagement distributionSetManagement;
|
||||
private transient Page<DistributionSet> firstPageDistributionSets = null;
|
||||
private transient Page<DistributionSet> firstPageDistributionSets;
|
||||
private Boolean noTagClicked = Boolean.FALSE;
|
||||
|
||||
/**
|
||||
@@ -110,8 +110,8 @@ public class DistributionBeanQuery extends AbstractBeanQuery<ProxyDistribution>
|
||||
pinnedControllerId);
|
||||
} else if (distributionTags.isEmpty() && Strings.isNullOrEmpty(searchText) && !noTagClicked) {
|
||||
// if no search filters available
|
||||
distBeans = getDistributionSetManagement()
|
||||
.findDistributionSetsAll(new OffsetBasedPageRequest(startIndex, count, sort), false, true);
|
||||
distBeans = getDistributionSetManagement().findDistributionSetsByDeletedAndOrCompleted(
|
||||
new OffsetBasedPageRequest(startIndex, count, sort), false, true);
|
||||
} else {
|
||||
final DistributionSetFilter distributionSetFilter = new DistributionSetFilterBuilder().setIsDeleted(false)
|
||||
.setIsComplete(true).setSearchText(searchText).setSelectDSWithNoTag(noTagClicked)
|
||||
@@ -129,7 +129,6 @@ public class DistributionBeanQuery extends AbstractBeanQuery<ProxyDistribution>
|
||||
proxyDistribution.setVersion(distributionSet.getVersion());
|
||||
proxyDistribution.setCreatedDate(SPDateTimeUtil.getFormattedDate(distributionSet.getCreatedAt()));
|
||||
proxyDistribution.setLastModifiedDate(SPDateTimeUtil.getFormattedDate(distributionSet.getLastModifiedAt()));
|
||||
proxyDistribution.setDescription(distributionSet.getDescription());
|
||||
proxyDistribution.setCreatedByUser(UserDetailsFormatter.loadAndFormatCreatedBy(distributionSet));
|
||||
proxyDistribution.setModifiedByUser(UserDetailsFormatter.loadAndFormatLastModifiedBy(distributionSet));
|
||||
proxyDistribution.setNameVersion(
|
||||
@@ -152,8 +151,8 @@ public class DistributionBeanQuery extends AbstractBeanQuery<ProxyDistribution>
|
||||
pinnedControllerId);
|
||||
} else if (distributionTags.isEmpty() && Strings.isNullOrEmpty(searchText) && !noTagClicked) {
|
||||
// if no search filters available
|
||||
firstPageDistributionSets = getDistributionSetManagement()
|
||||
.findDistributionSetsAll(new PageRequest(0, SPUIDefinitions.PAGE_SIZE, sort), false, true);
|
||||
firstPageDistributionSets = getDistributionSetManagement().findDistributionSetsByDeletedAndOrCompleted(
|
||||
new PageRequest(0, SPUIDefinitions.PAGE_SIZE, sort), false, true);
|
||||
} else {
|
||||
final DistributionSetFilter distributionSetFilter = new DistributionSetFilterBuilder().setIsDeleted(false)
|
||||
.setIsComplete(true).setSearchText(searchText).setSelectDSWithNoTag(noTagClicked)
|
||||
|
||||
@@ -21,10 +21,10 @@ import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
||||
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||
import org.eclipse.hawkbit.repository.TargetManagement;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetIdName;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetTagAssignmentResult;
|
||||
import org.eclipse.hawkbit.repository.model.Target;
|
||||
import org.eclipse.hawkbit.repository.model.TargetIdName;
|
||||
import org.eclipse.hawkbit.ui.common.DistributionSetIdName;
|
||||
import org.eclipse.hawkbit.ui.common.table.AbstractNamedVersionTable;
|
||||
import org.eclipse.hawkbit.ui.common.table.AbstractTable;
|
||||
import org.eclipse.hawkbit.ui.common.table.BaseEntityEventType;
|
||||
|
||||
@@ -12,15 +12,17 @@ import static org.apache.commons.lang3.StringUtils.isNotEmpty;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.hawkbit.eventbus.event.DistributionSetTagCreatedBulkEvent;
|
||||
import org.eclipse.hawkbit.eventbus.event.DistributionSetTagDeletedEvent;
|
||||
import org.eclipse.hawkbit.eventbus.event.DistributionSetTagUpdateEvent;
|
||||
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.DistributionSetTagCreatedBulkEvent;
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.DistributionSetTagDeletedEvent;
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.DistributionSetTagUpdateEvent;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetTag;
|
||||
import org.eclipse.hawkbit.ui.colorpicker.ColorPickerConstants;
|
||||
import org.eclipse.hawkbit.ui.colorpicker.ColorPickerHelper;
|
||||
import org.eclipse.hawkbit.ui.layouts.AbstractCreateUpdateTagLayout;
|
||||
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
|
||||
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.vaadin.spring.events.EventScope;
|
||||
import org.vaadin.spring.events.annotation.EventBusListenerMethod;
|
||||
|
||||
@@ -40,6 +42,9 @@ public class CreateUpdateDistributionTagLayoutWindow extends AbstractCreateUpdat
|
||||
|
||||
private static final long serialVersionUID = 444276149954167545L;
|
||||
|
||||
@Autowired
|
||||
private transient EntityFactory entityFactory;
|
||||
|
||||
private static final String TARGET_TAG_NAME_DYNAMIC_STYLE = "new-target-tag-name";
|
||||
private static final String MSG_TEXTFIELD_NAME = "textfield.name";
|
||||
|
||||
@@ -102,11 +107,9 @@ public class CreateUpdateDistributionTagLayoutWindow extends AbstractCreateUpdat
|
||||
protected void createNewTag() {
|
||||
super.createNewTag();
|
||||
if (isNotEmpty(getTagNameValue())) {
|
||||
DistributionSetTag newDistTag = new DistributionSetTag(getTagNameValue());
|
||||
if (isNotEmpty(getTagDescValue())) {
|
||||
newDistTag.setDescription(getTagDescValue());
|
||||
}
|
||||
newDistTag.setColour(ColorPickerConstants.START_COLOR.getCSS());
|
||||
DistributionSetTag newDistTag = entityFactory.generateDistributionSetTag(tagNameValue, tagDescValue,
|
||||
ColorPickerConstants.START_COLOR.getCSS());
|
||||
|
||||
if (isNotEmpty(getColorPicked())) {
|
||||
newDistTag.setColour(getColorPicked());
|
||||
}
|
||||
|
||||
@@ -11,9 +11,10 @@ package org.eclipse.hawkbit.ui.management.dstag;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.hawkbit.eventbus.event.DistributionSetTagCreatedBulkEvent;
|
||||
import org.eclipse.hawkbit.eventbus.event.DistributionSetTagDeletedEvent;
|
||||
import org.eclipse.hawkbit.eventbus.event.DistributionSetTagUpdateEvent;
|
||||
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.DistributionSetTagCreatedBulkEvent;
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.DistributionSetTagDeletedEvent;
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.DistributionSetTagUpdateEvent;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetTag;
|
||||
import org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterButtonClickBehaviour;
|
||||
import org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterButtons;
|
||||
@@ -54,10 +55,13 @@ public class DistributionTagButtons extends AbstractFilterButtons {
|
||||
@Autowired
|
||||
private ManagementUIState managementUIState;
|
||||
|
||||
@Autowired
|
||||
private transient EntityFactory entityFactory;
|
||||
|
||||
@Override
|
||||
public void init(final AbstractFilterButtonClickBehaviour filterButtonClickBehaviour) {
|
||||
super.init(filterButtonClickBehaviour);
|
||||
addNewTag(new DistributionSetTag("NO TAG"));
|
||||
addNewTag(entityFactory.generateDistributionSetTag("NO TAG"));
|
||||
}
|
||||
|
||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
||||
@@ -139,7 +143,7 @@ public class DistributionTagButtons extends AbstractFilterButtons {
|
||||
private void refreshTagTable() {
|
||||
((LazyQueryContainer) getContainerDataSource()).refresh();
|
||||
removeGeneratedColumn(FILTER_BUTTON_COLUMN);
|
||||
addNewTag(new DistributionSetTag("NO TAG"));
|
||||
addNewTag(entityFactory.generateDistributionSetTag("NO TAG"));
|
||||
addColumn();
|
||||
}
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@ import java.util.stream.Collectors;
|
||||
|
||||
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
||||
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetIdName;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetTagAssignmentResult;
|
||||
import org.eclipse.hawkbit.ui.common.DistributionSetIdName;
|
||||
import org.eclipse.hawkbit.ui.common.table.AbstractTable;
|
||||
import org.eclipse.hawkbit.ui.management.state.DistributionTableFilters;
|
||||
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
||||
|
||||
@@ -14,9 +14,9 @@ import javax.annotation.PostConstruct;
|
||||
import javax.annotation.PreDestroy;
|
||||
|
||||
import org.eclipse.hawkbit.repository.TargetManagement;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetIdName;
|
||||
import org.eclipse.hawkbit.repository.model.TargetFilterQuery;
|
||||
import org.eclipse.hawkbit.repository.model.TargetUpdateStatus;
|
||||
import org.eclipse.hawkbit.ui.common.DistributionSetIdName;
|
||||
import org.eclipse.hawkbit.ui.management.event.ManagementUIEvent;
|
||||
import org.eclipse.hawkbit.ui.management.event.PinUnpinEvent;
|
||||
import org.eclipse.hawkbit.ui.management.event.TargetTableEvent;
|
||||
|
||||
@@ -11,8 +11,8 @@ package org.eclipse.hawkbit.ui.management.footer;
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.hawkbit.repository.TagManagement;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetIdName;
|
||||
import org.eclipse.hawkbit.repository.model.TargetIdName;
|
||||
import org.eclipse.hawkbit.ui.common.DistributionSetIdName;
|
||||
import org.eclipse.hawkbit.ui.common.footer.AbstractDeleteActionsLayout;
|
||||
import org.eclipse.hawkbit.ui.common.table.AbstractTable;
|
||||
import org.eclipse.hawkbit.ui.management.event.BulkUploadPopupEvent;
|
||||
|
||||
@@ -23,10 +23,10 @@ import org.eclipse.hawkbit.repository.DeploymentManagement;
|
||||
import org.eclipse.hawkbit.repository.DistributionSetAssignmentResult;
|
||||
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
||||
import org.eclipse.hawkbit.repository.TargetManagement;
|
||||
import org.eclipse.hawkbit.repository.model.Action;
|
||||
import org.eclipse.hawkbit.repository.model.Action.ActionType;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetIdName;
|
||||
import org.eclipse.hawkbit.repository.model.RepositoryModelConstants;
|
||||
import org.eclipse.hawkbit.repository.model.TargetIdName;
|
||||
import org.eclipse.hawkbit.ui.common.DistributionSetIdName;
|
||||
import org.eclipse.hawkbit.ui.common.confirmwindow.layout.AbstractConfirmationWindowLayout;
|
||||
import org.eclipse.hawkbit.ui.common.confirmwindow.layout.ConfirmationTab;
|
||||
import org.eclipse.hawkbit.ui.management.event.PinUnpinEvent;
|
||||
@@ -148,7 +148,7 @@ public class ManangementConfirmationWindowLayout extends AbstractConfirmationWin
|
||||
final long forcedTimeStamp = (((ActionTypeOptionGroupLayout.ActionTypeOption) actionTypeOptionGroupLayout
|
||||
.getActionTypeOptionGroup().getValue()) == ActionTypeOption.AUTO_FORCED)
|
||||
? actionTypeOptionGroupLayout.getForcedTimeDateField().getValue().getTime()
|
||||
: Action.NO_FORCE_TIME;
|
||||
: RepositoryModelConstants.NO_FORCE_TIME;
|
||||
|
||||
final Map<Long, ArrayList<TargetIdName>> saveAssignedList = new HashMap<>();
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@ import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetIdName;
|
||||
import org.eclipse.hawkbit.repository.model.TargetIdName;
|
||||
import org.eclipse.hawkbit.ui.common.DistributionSetIdName;
|
||||
import org.eclipse.hawkbit.ui.common.ManagmentEntityState;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetIdName;
|
||||
import org.eclipse.hawkbit.ui.common.DistributionSetIdName;
|
||||
|
||||
/**
|
||||
* Hold details for target bulk upload window.
|
||||
|
||||
@@ -13,9 +13,9 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetIdName;
|
||||
import org.eclipse.hawkbit.repository.model.TargetFilterQuery;
|
||||
import org.eclipse.hawkbit.repository.model.TargetUpdateStatus;
|
||||
import org.eclipse.hawkbit.ui.common.DistributionSetIdName;
|
||||
|
||||
import com.vaadin.spring.annotation.SpringComponent;
|
||||
import com.vaadin.spring.annotation.VaadinSessionScope;
|
||||
|
||||
@@ -26,11 +26,12 @@ import java.util.concurrent.Executor;
|
||||
|
||||
import org.eclipse.hawkbit.repository.DeploymentManagement;
|
||||
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
||||
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||
import org.eclipse.hawkbit.repository.TagManagement;
|
||||
import org.eclipse.hawkbit.repository.TargetManagement;
|
||||
import org.eclipse.hawkbit.repository.model.Action.ActionType;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetIdName;
|
||||
import org.eclipse.hawkbit.repository.model.Target;
|
||||
import org.eclipse.hawkbit.ui.common.DistributionSetIdName;
|
||||
import org.eclipse.hawkbit.ui.common.tagdetails.AbstractTagToken.TagData;
|
||||
import org.eclipse.hawkbit.ui.management.event.BulkUploadValidationMessageEvent;
|
||||
import org.eclipse.hawkbit.ui.management.event.TargetTableEvent;
|
||||
@@ -97,6 +98,8 @@ public class BulkUploadHandler extends CustomComponent
|
||||
|
||||
final TargetBulkUpdateWindowLayout targetBulkUpdateWindowLayout;
|
||||
|
||||
private final EntityFactory entityFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param targetBulkUpdateWindowLayout
|
||||
@@ -124,6 +127,7 @@ public class BulkUploadHandler extends CustomComponent
|
||||
this.eventBus = targetBulkUpdateWindowLayout.getEventBus();
|
||||
distributionSetManagement = SpringContextHelper.getBean(DistributionSetManagement.class);
|
||||
tagManagement = SpringContextHelper.getBean(TagManagement.class);
|
||||
entityFactory = SpringContextHelper.getBean(EntityFactory.class);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -380,7 +384,7 @@ public class BulkUploadHandler extends CustomComponent
|
||||
final String newDesc = HawkbitCommonUtil.trimAndNullIfEmpty(descTextArea.getValue());
|
||||
|
||||
/* create new target entity */
|
||||
final Target newTarget = new Target(newControllerId);
|
||||
final Target newTarget = entityFactory.generateTarget(newControllerId);
|
||||
setTargetValues(newTarget, newName, newDesc);
|
||||
targetManagement.createTarget(newTarget);
|
||||
managementUIState.getTargetTableFilters().getBulkUpload().getTargetsCreated().add(newControllerId);
|
||||
|
||||
@@ -11,6 +11,7 @@ package org.eclipse.hawkbit.ui.management.targettable;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||
import org.eclipse.hawkbit.repository.TargetManagement;
|
||||
import org.eclipse.hawkbit.repository.model.Target;
|
||||
import org.eclipse.hawkbit.repository.model.TargetIdName;
|
||||
@@ -66,6 +67,9 @@ public class TargetAddUpdateWindowLayout extends CustomComponent {
|
||||
@Autowired
|
||||
private transient UINotification uINotification;
|
||||
|
||||
@Autowired
|
||||
private transient EntityFactory entityFactory;
|
||||
|
||||
private TextField controllerIDTextField;
|
||||
private TextField nameTextField;
|
||||
private TextArea descTextArea;
|
||||
@@ -220,7 +224,7 @@ public class TargetAddUpdateWindowLayout extends CustomComponent {
|
||||
final String newDesc = HawkbitCommonUtil.trimAndNullIfEmpty(descTextArea.getValue());
|
||||
|
||||
/* create new target entity */
|
||||
Target newTarget = new Target(newControlllerId);
|
||||
Target newTarget = entityFactory.generateTarget(newControlllerId);
|
||||
/* set values to the new target entity */
|
||||
setTargetValues(newTarget, newName, newDesc);
|
||||
/* save new target */
|
||||
|
||||
@@ -17,8 +17,8 @@ import javax.annotation.PreDestroy;
|
||||
|
||||
import org.eclipse.hawkbit.repository.DeploymentManagement;
|
||||
import org.eclipse.hawkbit.repository.TargetManagement;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetIdName;
|
||||
import org.eclipse.hawkbit.ui.UiProperties;
|
||||
import org.eclipse.hawkbit.ui.common.DistributionSetIdName;
|
||||
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
||||
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
|
||||
import org.eclipse.hawkbit.ui.management.dstable.DistributionBeanQuery;
|
||||
|
||||
@@ -18,19 +18,19 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.eclipse.hawkbit.eventbus.event.TargetCreatedEvent;
|
||||
import org.eclipse.hawkbit.eventbus.event.TargetDeletedEvent;
|
||||
import org.eclipse.hawkbit.eventbus.event.TargetInfoUpdateEvent;
|
||||
import org.eclipse.hawkbit.repository.OffsetBasedPageRequest;
|
||||
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||
import org.eclipse.hawkbit.repository.TargetManagement;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetIdName;
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.TargetCreatedEvent;
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.TargetInfoUpdateEvent;
|
||||
import org.eclipse.hawkbit.repository.model.Target;
|
||||
import org.eclipse.hawkbit.repository.model.TargetFilterQuery;
|
||||
import org.eclipse.hawkbit.repository.model.TargetIdName;
|
||||
import org.eclipse.hawkbit.repository.model.TargetInfo;
|
||||
import org.eclipse.hawkbit.repository.model.TargetTagAssignmentResult;
|
||||
import org.eclipse.hawkbit.repository.model.TargetUpdateStatus;
|
||||
import org.eclipse.hawkbit.ui.common.DistributionSetIdName;
|
||||
import org.eclipse.hawkbit.ui.common.ManagmentEntityState;
|
||||
import org.eclipse.hawkbit.ui.common.UserDetailsFormatter;
|
||||
import org.eclipse.hawkbit.ui.common.table.AbstractTable;
|
||||
|
||||
@@ -10,7 +10,7 @@ package org.eclipse.hawkbit.ui.management.targettable;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetIdName;
|
||||
import org.eclipse.hawkbit.ui.common.DistributionSetIdName;
|
||||
import org.eclipse.hawkbit.ui.common.table.AbstractTable;
|
||||
import org.eclipse.hawkbit.ui.common.table.AbstractTableHeader;
|
||||
import org.eclipse.hawkbit.ui.common.table.BaseEntityEventType;
|
||||
|
||||
@@ -12,13 +12,15 @@ import static org.apache.commons.lang3.StringUtils.isNotEmpty;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.hawkbit.eventbus.event.TargetTagCreatedBulkEvent;
|
||||
import org.eclipse.hawkbit.eventbus.event.TargetTagDeletedEvent;
|
||||
import org.eclipse.hawkbit.eventbus.event.TargetTagUpdateEvent;
|
||||
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.TargetTagCreatedBulkEvent;
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.TargetTagDeletedEvent;
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.TargetTagUpdateEvent;
|
||||
import org.eclipse.hawkbit.repository.model.TargetTag;
|
||||
import org.eclipse.hawkbit.ui.colorpicker.ColorPickerConstants;
|
||||
import org.eclipse.hawkbit.ui.colorpicker.ColorPickerHelper;
|
||||
import org.eclipse.hawkbit.ui.layouts.AbstractCreateUpdateTagLayout;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.vaadin.spring.events.EventScope;
|
||||
import org.vaadin.spring.events.annotation.EventBusListenerMethod;
|
||||
|
||||
@@ -36,6 +38,9 @@ public class CreateUpdateTargetTagLayoutWindow extends AbstractCreateUpdateTagLa
|
||||
|
||||
private static final long serialVersionUID = 2446682350481560235L;
|
||||
|
||||
@Autowired
|
||||
private transient EntityFactory entityFactory;
|
||||
|
||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
||||
// Exception squid:S1172 - event not needed
|
||||
@SuppressWarnings({ "squid:S1172" })
|
||||
@@ -116,7 +121,7 @@ public class CreateUpdateTargetTagLayoutWindow extends AbstractCreateUpdateTagLa
|
||||
protected void createNewTag() {
|
||||
super.createNewTag();
|
||||
if (isNotEmpty(getTagNameValue())) {
|
||||
TargetTag newTargetTag = new TargetTag(getTagNameValue());
|
||||
TargetTag newTargetTag = entityFactory.generateTargetTag(getTagNameValue());
|
||||
if (isNotEmpty(getTagDescValue())) {
|
||||
newTargetTag.setDescription(getTagDescValue());
|
||||
}
|
||||
|
||||
@@ -12,11 +12,12 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.eclipse.hawkbit.eventbus.event.TargetTagCreatedBulkEvent;
|
||||
import org.eclipse.hawkbit.eventbus.event.TargetTagDeletedEvent;
|
||||
import org.eclipse.hawkbit.eventbus.event.TargetTagUpdateEvent;
|
||||
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||
import org.eclipse.hawkbit.repository.TargetManagement;
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.TargetTagCreatedBulkEvent;
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.TargetTagDeletedEvent;
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.TargetTagUpdateEvent;
|
||||
import org.eclipse.hawkbit.repository.model.TargetIdName;
|
||||
import org.eclipse.hawkbit.repository.model.TargetTag;
|
||||
import org.eclipse.hawkbit.repository.model.TargetTagAssignmentResult;
|
||||
@@ -75,6 +76,9 @@ public class TargetTagFilterButtons extends AbstractFilterButtons {
|
||||
@Autowired
|
||||
private SpPermissionChecker permChecker;
|
||||
|
||||
@Autowired
|
||||
private transient EntityFactory entityFactory;
|
||||
|
||||
@Autowired
|
||||
private transient TargetManagement targetManagement;
|
||||
|
||||
@@ -90,7 +94,7 @@ public class TargetTagFilterButtons extends AbstractFilterButtons {
|
||||
public void init(final TargetTagFilterButtonClick filterButtonClickBehaviour) {
|
||||
this.filterButtonClickBehaviour = filterButtonClickBehaviour;
|
||||
super.init(filterButtonClickBehaviour);
|
||||
addNewTargetTag(new TargetTag("NO TAG"));
|
||||
addNewTargetTag(entityFactory.generateTargetTag("NO TAG"));
|
||||
}
|
||||
|
||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
||||
@@ -290,7 +294,7 @@ public class TargetTagFilterButtons extends AbstractFilterButtons {
|
||||
private void refreshContainer() {
|
||||
removeGeneratedColumn(FILTER_BUTTON_COLUMN);
|
||||
((LazyQueryContainer) getContainerDataSource()).refresh();
|
||||
addNewTargetTag(new TargetTag("NO TAG"));
|
||||
addNewTargetTag(entityFactory.generateTargetTag("NO TAG"));
|
||||
addColumn();
|
||||
}
|
||||
|
||||
|
||||
@@ -13,21 +13,23 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
||||
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||
import org.eclipse.hawkbit.repository.RolloutManagement;
|
||||
import org.eclipse.hawkbit.repository.TargetManagement;
|
||||
import org.eclipse.hawkbit.repository.model.Action;
|
||||
import org.eclipse.hawkbit.repository.model.Action.ActionType;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetIdName;
|
||||
import org.eclipse.hawkbit.repository.model.RepositoryModelConstants;
|
||||
import org.eclipse.hawkbit.repository.model.Rollout;
|
||||
import org.eclipse.hawkbit.repository.model.Rollout.RolloutStatus;
|
||||
import org.eclipse.hawkbit.repository.model.RolloutGroup;
|
||||
import org.eclipse.hawkbit.repository.model.RolloutGroup.RolloutGroupConditions;
|
||||
import org.eclipse.hawkbit.repository.model.RolloutGroup.RolloutGroupErrorAction;
|
||||
import org.eclipse.hawkbit.repository.model.RolloutGroup.RolloutGroupErrorCondition;
|
||||
import org.eclipse.hawkbit.repository.model.RolloutGroup.RolloutGroupSuccessAction;
|
||||
import org.eclipse.hawkbit.repository.model.RolloutGroup.RolloutGroupSuccessCondition;
|
||||
import org.eclipse.hawkbit.repository.model.RolloutGroupConditionBuilder;
|
||||
import org.eclipse.hawkbit.repository.model.RolloutGroupConditions;
|
||||
import org.eclipse.hawkbit.ui.UiProperties;
|
||||
import org.eclipse.hawkbit.ui.common.CommonDialogWindow;
|
||||
import org.eclipse.hawkbit.ui.common.DistributionSetIdName;
|
||||
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
||||
import org.eclipse.hawkbit.ui.filtermanagement.TargetFilterBeanQuery;
|
||||
import org.eclipse.hawkbit.ui.management.footer.ActionTypeOptionGroupLayout;
|
||||
@@ -104,6 +106,9 @@ public class AddUpdateRolloutWindowLayout extends GridLayout {
|
||||
@Autowired
|
||||
private transient UiProperties uiProperties;
|
||||
|
||||
@Autowired
|
||||
private transient EntityFactory entityFactory;
|
||||
|
||||
@Autowired
|
||||
private I18N i18n;
|
||||
|
||||
@@ -413,7 +418,7 @@ public class AddUpdateRolloutWindowLayout extends GridLayout {
|
||||
return (((ActionTypeOptionGroupLayout.ActionTypeOption) actionTypeOptionGroupLayout.getActionTypeOptionGroup()
|
||||
.getValue()) == ActionTypeOption.AUTO_FORCED)
|
||||
? actionTypeOptionGroupLayout.getForcedTimeDateField().getValue().getTime()
|
||||
: Action.NO_FORCE_TIME;
|
||||
: RepositoryModelConstants.NO_FORCE_TIME;
|
||||
}
|
||||
|
||||
private ActionType getActionType() {
|
||||
@@ -431,12 +436,12 @@ public class AddUpdateRolloutWindowLayout extends GridLayout {
|
||||
}
|
||||
|
||||
private Rollout saveRollout() {
|
||||
Rollout rolloutToCreate = new Rollout();
|
||||
Rollout rolloutToCreate = entityFactory.generateRollout();
|
||||
final int amountGroup = Integer.parseInt(noOfGroups.getValue());
|
||||
final String targetFilter = getTargetFilterQuery();
|
||||
final int errorThresoldPercent = getErrorThresoldPercentage(amountGroup);
|
||||
|
||||
final RolloutGroupConditions conditions = new RolloutGroup.RolloutGroupConditionBuilder()
|
||||
final RolloutGroupConditions conditions = new RolloutGroupConditionBuilder()
|
||||
.successAction(RolloutGroupSuccessAction.NEXTGROUP, null)
|
||||
.successCondition(RolloutGroupSuccessCondition.THRESHOLD, triggerThreshold.getValue())
|
||||
.errorCondition(RolloutGroupErrorCondition.THRESHOLD, String.valueOf(errorThresoldPercent))
|
||||
@@ -712,7 +717,7 @@ public class AddUpdateRolloutWindowLayout extends GridLayout {
|
||||
rolloutForEdit = rolloutManagement.findRolloutById(rolloutId);
|
||||
rolloutName.setValue(rolloutForEdit.getName());
|
||||
description.setValue(rolloutForEdit.getDescription());
|
||||
distributionSet.setValue(rolloutForEdit.getDistributionSet().getDistributionSetIdName());
|
||||
distributionSet.setValue(DistributionSetIdName.generate(rolloutForEdit.getDistributionSet()));
|
||||
final List<RolloutGroup> rolloutGroups = rolloutForEdit.getRolloutGroups();
|
||||
setThresoldValues(rolloutGroups);
|
||||
setActionType(rolloutForEdit);
|
||||
|
||||
@@ -14,10 +14,10 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.hawkbit.repository.DistributionSetFilter;
|
||||
import org.eclipse.hawkbit.repository.DistributionSetFilter.DistributionSetFilterBuilder;
|
||||
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetFilter;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetFilter.DistributionSetFilterBuilder;
|
||||
import org.eclipse.hawkbit.ui.common.UserDetailsFormatter;
|
||||
import org.eclipse.hawkbit.ui.components.ProxyDistribution;
|
||||
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
||||
@@ -113,7 +113,6 @@ public class DistributionBeanQuery extends AbstractBeanQuery<ProxyDistribution>
|
||||
proxyDistribution.setVersion(distributionSet.getVersion());
|
||||
proxyDistribution.setCreatedDate(SPDateTimeUtil.getFormattedDate(distributionSet.getCreatedAt()));
|
||||
proxyDistribution.setLastModifiedDate(SPDateTimeUtil.getFormattedDate(distributionSet.getLastModifiedAt()));
|
||||
proxyDistribution.setDescription(distributionSet.getDescription());
|
||||
proxyDistribution.setCreatedByUser(UserDetailsFormatter.loadAndFormatCreatedBy(distributionSet));
|
||||
proxyDistribution.setModifiedByUser(UserDetailsFormatter.loadAndFormatLastModifiedBy(distributionSet));
|
||||
proxyDistribution.setIsComplete(distributionSet.isComplete());
|
||||
|
||||
@@ -10,8 +10,10 @@ package org.eclipse.hawkbit.ui.rollout.rollout;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.Rollout;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||
import org.eclipse.hawkbit.repository.model.Rollout.RolloutStatus;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||
import org.eclipse.hawkbit.repository.model.TotalTargetCountStatus;
|
||||
import org.eclipse.hawkbit.ui.customrenderers.client.renderers.RolloutRendererData;
|
||||
|
||||
import com.vaadin.server.FontAwesome;
|
||||
@@ -20,7 +22,7 @@ import com.vaadin.server.FontAwesome;
|
||||
* Proxy rollout with custom properties.
|
||||
*
|
||||
*/
|
||||
public class ProxyRollout extends Rollout {
|
||||
public class ProxyRollout {
|
||||
|
||||
private static final long serialVersionUID = 4539849939617681918L;
|
||||
|
||||
@@ -46,6 +48,17 @@ public class ProxyRollout extends Rollout {
|
||||
|
||||
private Set<SoftwareModule> swModules;
|
||||
|
||||
private Long id;
|
||||
private String name;
|
||||
private String version;
|
||||
private String description;
|
||||
private DistributionSet distributionSet;
|
||||
private String createdBy;
|
||||
private String lastModifiedBy;
|
||||
private long forcedTime;
|
||||
private RolloutStatus status;
|
||||
private TotalTargetCountStatus totalTargetCountStatus;
|
||||
|
||||
/**
|
||||
* @return the isRequiredMigrationStep
|
||||
*/
|
||||
@@ -59,7 +72,7 @@ public class ProxyRollout extends Rollout {
|
||||
* the isRequiredMigrationStep to set
|
||||
*/
|
||||
|
||||
public void setIsRequiredMigrationStep(Boolean isRequiredMigrationStep) {
|
||||
public void setIsRequiredMigrationStep(final Boolean isRequiredMigrationStep) {
|
||||
this.isRequiredMigrationStep = isRequiredMigrationStep;
|
||||
}
|
||||
|
||||
@@ -76,7 +89,7 @@ public class ProxyRollout extends Rollout {
|
||||
* the discription to set
|
||||
*/
|
||||
|
||||
public void setDiscription(String discription) {
|
||||
public void setDiscription(final String discription) {
|
||||
this.discription = discription;
|
||||
}
|
||||
|
||||
@@ -92,7 +105,7 @@ public class ProxyRollout extends Rollout {
|
||||
* the type to set
|
||||
*/
|
||||
|
||||
public void setType(String type) {
|
||||
public void setType(final String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@@ -108,7 +121,7 @@ public class ProxyRollout extends Rollout {
|
||||
* @param swModules
|
||||
* Set<SoftwareModule> to set
|
||||
*/
|
||||
public void setSwModules(Set<SoftwareModule> swModules) {
|
||||
public void setSwModules(final Set<SoftwareModule> swModules) {
|
||||
this.swModules = swModules;
|
||||
}
|
||||
|
||||
@@ -116,7 +129,7 @@ public class ProxyRollout extends Rollout {
|
||||
return rolloutRendererData;
|
||||
}
|
||||
|
||||
public void setRolloutRendererData(RolloutRendererData rendererData) {
|
||||
public void setRolloutRendererData(final RolloutRendererData rendererData) {
|
||||
this.rolloutRendererData = rendererData;
|
||||
}
|
||||
|
||||
@@ -214,4 +227,83 @@ public class ProxyRollout extends Rollout {
|
||||
return FontAwesome.CIRCLE_O.getHtml();
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(final Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(final String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(final String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(final String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public DistributionSet getDistributionSet() {
|
||||
return distributionSet;
|
||||
}
|
||||
|
||||
public void setDistributionSet(final DistributionSet distributionSet) {
|
||||
this.distributionSet = distributionSet;
|
||||
}
|
||||
|
||||
public String getCreatedBy() {
|
||||
return createdBy;
|
||||
}
|
||||
|
||||
public void setCreatedBy(final String createdBy) {
|
||||
this.createdBy = createdBy;
|
||||
}
|
||||
|
||||
public String getLastModifiedBy() {
|
||||
return lastModifiedBy;
|
||||
}
|
||||
|
||||
public void setLastModifiedBy(final String lastModifiedBy) {
|
||||
this.lastModifiedBy = lastModifiedBy;
|
||||
}
|
||||
|
||||
public long getForcedTime() {
|
||||
return forcedTime;
|
||||
}
|
||||
|
||||
public void setForcedTime(final long forcedTime) {
|
||||
this.forcedTime = forcedTime;
|
||||
}
|
||||
|
||||
public RolloutStatus getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(final RolloutStatus status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public TotalTargetCountStatus getTotalTargetCountStatus() {
|
||||
return totalTargetCountStatus;
|
||||
}
|
||||
|
||||
public void setTotalTargetCountStatus(final TotalTargetCountStatus totalTargetCountStatus) {
|
||||
this.totalTargetCountStatus = totalTargetCountStatus;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,8 +138,6 @@ public class RolloutBeanQuery extends AbstractBeanQuery<ProxyRollout> {
|
||||
final TotalTargetCountStatus totalTargetCountActionStatus = rollout.getTotalTargetCountStatus();
|
||||
proxyRollout.setTotalTargetCountStatus(totalTargetCountActionStatus);
|
||||
proxyRollout.setTotalTargetsCount(String.valueOf(rollout.getTotalTargets()));
|
||||
|
||||
proxyRollout.setDescription(distributionSet.getDescription());
|
||||
proxyRollout.setType(distributionSet.getType().getName());
|
||||
proxyRollout.setIsRequiredMigrationStep(distributionSet.isRequiredMigrationStep());
|
||||
proxyRollout.setSwModules(distributionSet.getModules());
|
||||
|
||||
@@ -21,9 +21,9 @@ import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.hawkbit.eventbus.event.RolloutChangeEvent;
|
||||
import org.eclipse.hawkbit.repository.RolloutManagement;
|
||||
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.RolloutChangeEvent;
|
||||
import org.eclipse.hawkbit.repository.model.Rollout;
|
||||
import org.eclipse.hawkbit.repository.model.Rollout.RolloutStatus;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||
|
||||
@@ -8,212 +8,354 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.ui.rollout.rolloutgroup;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.RolloutGroup;
|
||||
import org.eclipse.hawkbit.repository.model.RolloutGroup.RolloutGroupErrorAction;
|
||||
import org.eclipse.hawkbit.repository.model.RolloutGroup.RolloutGroupErrorCondition;
|
||||
import org.eclipse.hawkbit.repository.model.RolloutGroup.RolloutGroupStatus;
|
||||
import org.eclipse.hawkbit.repository.model.RolloutGroup.RolloutGroupSuccessAction;
|
||||
import org.eclipse.hawkbit.repository.model.RolloutGroup.RolloutGroupSuccessCondition;
|
||||
import org.eclipse.hawkbit.repository.model.TotalTargetCountStatus;
|
||||
import org.eclipse.hawkbit.ui.customrenderers.client.renderers.RolloutRendererData;
|
||||
|
||||
/**
|
||||
* Proxy rollout group with renderer properties.
|
||||
*
|
||||
*/
|
||||
public class ProxyRolloutGroup extends RolloutGroup {
|
||||
public class ProxyRolloutGroup {
|
||||
|
||||
private static final long serialVersionUID = -2745056813306692356L;
|
||||
private static final long serialVersionUID = -2745056813306692356L;
|
||||
|
||||
private String createdDate;
|
||||
private String createdDate;
|
||||
|
||||
private String modifiedDate;
|
||||
private String modifiedDate;
|
||||
|
||||
private String finishedPercentage;
|
||||
private String finishedPercentage;
|
||||
|
||||
private Long runningTargetsCount;
|
||||
private Long runningTargetsCount;
|
||||
|
||||
private Long scheduledTargetsCount;
|
||||
private Long scheduledTargetsCount;
|
||||
|
||||
private Long cancelledTargetsCount;
|
||||
private Long cancelledTargetsCount;
|
||||
|
||||
private Long errorTargetsCount;
|
||||
private Long errorTargetsCount;
|
||||
|
||||
private Long finishedTargetsCount;
|
||||
private Long finishedTargetsCount;
|
||||
|
||||
private Long notStartedTargetsCount;
|
||||
private Long notStartedTargetsCount;
|
||||
|
||||
private Boolean isActionRecieved = Boolean.FALSE;
|
||||
private Boolean isActionRecieved = Boolean.FALSE;
|
||||
|
||||
private String totalTargetsCount;
|
||||
private String totalTargetsCount;
|
||||
|
||||
private RolloutRendererData rolloutRendererData;
|
||||
private Long id;
|
||||
private String name;
|
||||
private String description;
|
||||
private String createdBy;
|
||||
private String lastModifiedBy;
|
||||
private RolloutGroupStatus status;
|
||||
private TotalTargetCountStatus totalTargetCountStatus;
|
||||
|
||||
public RolloutRendererData getRolloutRendererData() {
|
||||
return rolloutRendererData;
|
||||
}
|
||||
private RolloutGroupSuccessCondition successCondition;
|
||||
private String successConditionExp;
|
||||
private RolloutGroupSuccessAction successAction;
|
||||
private String successActionExp;
|
||||
private RolloutGroupErrorCondition errorCondition;
|
||||
private String errorConditionExp;
|
||||
private RolloutGroupErrorAction errorAction;
|
||||
private String errorActionExp;
|
||||
|
||||
public void setRolloutRendererData(RolloutRendererData rendererData) {
|
||||
this.rolloutRendererData = rendererData;
|
||||
}
|
||||
private RolloutRendererData rolloutRendererData;
|
||||
|
||||
/**
|
||||
* @return the createdDate
|
||||
*/
|
||||
public String getCreatedDate() {
|
||||
return createdDate;
|
||||
}
|
||||
public RolloutRendererData getRolloutRendererData() {
|
||||
return rolloutRendererData;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param createdDate
|
||||
* the createdDate to set
|
||||
*/
|
||||
public void setCreatedDate(final String createdDate) {
|
||||
this.createdDate = createdDate;
|
||||
}
|
||||
public void setRolloutRendererData(final RolloutRendererData rendererData) {
|
||||
this.rolloutRendererData = rendererData;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the modifiedDate
|
||||
*/
|
||||
public String getModifiedDate() {
|
||||
return modifiedDate;
|
||||
}
|
||||
/**
|
||||
* @return the createdDate
|
||||
*/
|
||||
public String getCreatedDate() {
|
||||
return createdDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param modifiedDate
|
||||
* the modifiedDate to set
|
||||
*/
|
||||
public void setModifiedDate(final String modifiedDate) {
|
||||
this.modifiedDate = modifiedDate;
|
||||
}
|
||||
/**
|
||||
* @param createdDate
|
||||
* the createdDate to set
|
||||
*/
|
||||
public void setCreatedDate(final String createdDate) {
|
||||
this.createdDate = createdDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the finishedPercentage
|
||||
*/
|
||||
public String getFinishedPercentage() {
|
||||
return finishedPercentage;
|
||||
}
|
||||
/**
|
||||
* @return the modifiedDate
|
||||
*/
|
||||
public String getModifiedDate() {
|
||||
return modifiedDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param finishedPercentage
|
||||
* the finishedPercentage to set
|
||||
*/
|
||||
public void setFinishedPercentage(final String finishedPercentage) {
|
||||
this.finishedPercentage = finishedPercentage;
|
||||
}
|
||||
/**
|
||||
* @param modifiedDate
|
||||
* the modifiedDate to set
|
||||
*/
|
||||
public void setModifiedDate(final String modifiedDate) {
|
||||
this.modifiedDate = modifiedDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the runningTargetsCount
|
||||
*/
|
||||
public Long getRunningTargetsCount() {
|
||||
return runningTargetsCount;
|
||||
}
|
||||
/**
|
||||
* @return the finishedPercentage
|
||||
*/
|
||||
public String getFinishedPercentage() {
|
||||
return finishedPercentage;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param runningTargetsCount
|
||||
* the runningTargetsCount to set
|
||||
*/
|
||||
public void setRunningTargetsCount(final Long runningTargetsCount) {
|
||||
this.runningTargetsCount = runningTargetsCount;
|
||||
}
|
||||
/**
|
||||
* @param finishedPercentage
|
||||
* the finishedPercentage to set
|
||||
*/
|
||||
public void setFinishedPercentage(final String finishedPercentage) {
|
||||
this.finishedPercentage = finishedPercentage;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the scheduledTargetsCount
|
||||
*/
|
||||
public Long getScheduledTargetsCount() {
|
||||
return scheduledTargetsCount;
|
||||
}
|
||||
/**
|
||||
* @return the runningTargetsCount
|
||||
*/
|
||||
public Long getRunningTargetsCount() {
|
||||
return runningTargetsCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param scheduledTargetsCount
|
||||
* the scheduledTargetsCount to set
|
||||
*/
|
||||
public void setScheduledTargetsCount(final Long scheduledTargetsCount) {
|
||||
this.scheduledTargetsCount = scheduledTargetsCount;
|
||||
}
|
||||
/**
|
||||
* @param runningTargetsCount
|
||||
* the runningTargetsCount to set
|
||||
*/
|
||||
public void setRunningTargetsCount(final Long runningTargetsCount) {
|
||||
this.runningTargetsCount = runningTargetsCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the cancelledTargetsCount
|
||||
*/
|
||||
public Long getCancelledTargetsCount() {
|
||||
return cancelledTargetsCount;
|
||||
}
|
||||
/**
|
||||
* @return the scheduledTargetsCount
|
||||
*/
|
||||
public Long getScheduledTargetsCount() {
|
||||
return scheduledTargetsCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param cancelledTargetsCount
|
||||
* the cancelledTargetsCount to set
|
||||
*/
|
||||
public void setCancelledTargetsCount(final Long cancelledTargetsCount) {
|
||||
this.cancelledTargetsCount = cancelledTargetsCount;
|
||||
}
|
||||
/**
|
||||
* @param scheduledTargetsCount
|
||||
* the scheduledTargetsCount to set
|
||||
*/
|
||||
public void setScheduledTargetsCount(final Long scheduledTargetsCount) {
|
||||
this.scheduledTargetsCount = scheduledTargetsCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the errorTargetsCount
|
||||
*/
|
||||
public Long getErrorTargetsCount() {
|
||||
return errorTargetsCount;
|
||||
}
|
||||
/**
|
||||
* @return the cancelledTargetsCount
|
||||
*/
|
||||
public Long getCancelledTargetsCount() {
|
||||
return cancelledTargetsCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param errorTargetsCount
|
||||
* the errorTargetsCount to set
|
||||
*/
|
||||
public void setErrorTargetsCount(final Long errorTargetsCount) {
|
||||
this.errorTargetsCount = errorTargetsCount;
|
||||
}
|
||||
/**
|
||||
* @param cancelledTargetsCount
|
||||
* the cancelledTargetsCount to set
|
||||
*/
|
||||
public void setCancelledTargetsCount(final Long cancelledTargetsCount) {
|
||||
this.cancelledTargetsCount = cancelledTargetsCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the finishedTargetsCount
|
||||
*/
|
||||
public Long getFinishedTargetsCount() {
|
||||
return finishedTargetsCount;
|
||||
}
|
||||
/**
|
||||
* @return the errorTargetsCount
|
||||
*/
|
||||
public Long getErrorTargetsCount() {
|
||||
return errorTargetsCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param finishedTargetsCount
|
||||
* the finishedTargetsCount to set
|
||||
*/
|
||||
public void setFinishedTargetsCount(final Long finishedTargetsCount) {
|
||||
this.finishedTargetsCount = finishedTargetsCount;
|
||||
}
|
||||
/**
|
||||
* @param errorTargetsCount
|
||||
* the errorTargetsCount to set
|
||||
*/
|
||||
public void setErrorTargetsCount(final Long errorTargetsCount) {
|
||||
this.errorTargetsCount = errorTargetsCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the notStartedTargetsCount
|
||||
*/
|
||||
public Long getNotStartedTargetsCount() {
|
||||
return notStartedTargetsCount;
|
||||
}
|
||||
/**
|
||||
* @return the finishedTargetsCount
|
||||
*/
|
||||
public Long getFinishedTargetsCount() {
|
||||
return finishedTargetsCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param notStartedTargetsCount
|
||||
* the notStartedTargetsCount to set
|
||||
*/
|
||||
public void setNotStartedTargetsCount(final Long notStartedTargetsCount) {
|
||||
this.notStartedTargetsCount = notStartedTargetsCount;
|
||||
}
|
||||
/**
|
||||
* @param finishedTargetsCount
|
||||
* the finishedTargetsCount to set
|
||||
*/
|
||||
public void setFinishedTargetsCount(final Long finishedTargetsCount) {
|
||||
this.finishedTargetsCount = finishedTargetsCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the isActionRecieved
|
||||
*/
|
||||
public Boolean getIsActionRecieved() {
|
||||
return isActionRecieved;
|
||||
}
|
||||
/**
|
||||
* @return the notStartedTargetsCount
|
||||
*/
|
||||
public Long getNotStartedTargetsCount() {
|
||||
return notStartedTargetsCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param isActionRecieved
|
||||
* the isActionRecieved to set
|
||||
*/
|
||||
public void setIsActionRecieved(final Boolean isActionRecieved) {
|
||||
this.isActionRecieved = isActionRecieved;
|
||||
}
|
||||
/**
|
||||
* @param notStartedTargetsCount
|
||||
* the notStartedTargetsCount to set
|
||||
*/
|
||||
public void setNotStartedTargetsCount(final Long notStartedTargetsCount) {
|
||||
this.notStartedTargetsCount = notStartedTargetsCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the totalTargetsCount
|
||||
*/
|
||||
public String getTotalTargetsCount() {
|
||||
return totalTargetsCount;
|
||||
}
|
||||
/**
|
||||
* @return the isActionRecieved
|
||||
*/
|
||||
public Boolean getIsActionRecieved() {
|
||||
return isActionRecieved;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param totalTargetsCount
|
||||
* the totalTargetsCount to set
|
||||
*/
|
||||
public void setTotalTargetsCount(final String totalTargetsCount) {
|
||||
this.totalTargetsCount = totalTargetsCount;
|
||||
}
|
||||
/**
|
||||
* @param isActionRecieved
|
||||
* the isActionRecieved to set
|
||||
*/
|
||||
public void setIsActionRecieved(final Boolean isActionRecieved) {
|
||||
this.isActionRecieved = isActionRecieved;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the totalTargetsCount
|
||||
*/
|
||||
public String getTotalTargetsCount() {
|
||||
return totalTargetsCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param totalTargetsCount
|
||||
* the totalTargetsCount to set
|
||||
*/
|
||||
public void setTotalTargetsCount(final String totalTargetsCount) {
|
||||
this.totalTargetsCount = totalTargetsCount;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(final String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(final Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(final String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getCreatedBy() {
|
||||
return createdBy;
|
||||
}
|
||||
|
||||
public void setCreatedBy(final String createdBy) {
|
||||
this.createdBy = createdBy;
|
||||
}
|
||||
|
||||
public String getLastModifiedBy() {
|
||||
return lastModifiedBy;
|
||||
}
|
||||
|
||||
public void setLastModifiedBy(final String lastModifiedBy) {
|
||||
this.lastModifiedBy = lastModifiedBy;
|
||||
}
|
||||
|
||||
public RolloutGroupStatus getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(final RolloutGroupStatus status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public TotalTargetCountStatus getTotalTargetCountStatus() {
|
||||
return totalTargetCountStatus;
|
||||
}
|
||||
|
||||
public void setTotalTargetCountStatus(final TotalTargetCountStatus totalTargetCountStatus) {
|
||||
this.totalTargetCountStatus = totalTargetCountStatus;
|
||||
}
|
||||
|
||||
public RolloutGroupSuccessCondition getSuccessCondition() {
|
||||
return successCondition;
|
||||
}
|
||||
|
||||
public void setSuccessCondition(final RolloutGroupSuccessCondition successCondition) {
|
||||
this.successCondition = successCondition;
|
||||
}
|
||||
|
||||
public String getSuccessConditionExp() {
|
||||
return successConditionExp;
|
||||
}
|
||||
|
||||
public void setSuccessConditionExp(final String successConditionExp) {
|
||||
this.successConditionExp = successConditionExp;
|
||||
}
|
||||
|
||||
public RolloutGroupSuccessAction getSuccessAction() {
|
||||
return successAction;
|
||||
}
|
||||
|
||||
public void setSuccessAction(final RolloutGroupSuccessAction successAction) {
|
||||
this.successAction = successAction;
|
||||
}
|
||||
|
||||
public String getSuccessActionExp() {
|
||||
return successActionExp;
|
||||
}
|
||||
|
||||
public void setSuccessActionExp(final String successActionExp) {
|
||||
this.successActionExp = successActionExp;
|
||||
}
|
||||
|
||||
public RolloutGroupErrorCondition getErrorCondition() {
|
||||
return errorCondition;
|
||||
}
|
||||
|
||||
public void setErrorCondition(final RolloutGroupErrorCondition errorCondition) {
|
||||
this.errorCondition = errorCondition;
|
||||
}
|
||||
|
||||
public String getErrorConditionExp() {
|
||||
return errorConditionExp;
|
||||
}
|
||||
|
||||
public void setErrorConditionExp(final String errorConditionExp) {
|
||||
this.errorConditionExp = errorConditionExp;
|
||||
}
|
||||
|
||||
public RolloutGroupErrorAction getErrorAction() {
|
||||
return errorAction;
|
||||
}
|
||||
|
||||
public void setErrorAction(final RolloutGroupErrorAction errorAction) {
|
||||
this.errorAction = errorAction;
|
||||
}
|
||||
|
||||
public String getErrorActionExp() {
|
||||
return errorActionExp;
|
||||
}
|
||||
|
||||
public void setErrorActionExp(final String errorActionExp) {
|
||||
this.errorActionExp = errorActionExp;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -15,10 +15,10 @@ import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.hawkbit.eventbus.event.RolloutGroupChangeEvent;
|
||||
import org.eclipse.hawkbit.repository.RolloutGroupManagement;
|
||||
import org.eclipse.hawkbit.repository.RolloutManagement;
|
||||
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.RolloutGroupChangeEvent;
|
||||
import org.eclipse.hawkbit.repository.model.RolloutGroup;
|
||||
import org.eclipse.hawkbit.repository.model.RolloutGroup.RolloutGroupStatus;
|
||||
import org.eclipse.hawkbit.repository.model.TotalTargetCountStatus;
|
||||
|
||||
@@ -19,15 +19,15 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||
import org.eclipse.hawkbit.repository.model.AssignmentResult;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||
import org.eclipse.hawkbit.repository.model.NamedEntity;
|
||||
import org.eclipse.hawkbit.repository.model.PollStatus;
|
||||
import org.eclipse.hawkbit.repository.model.RolloutGroup;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModuleType;
|
||||
import org.eclipse.hawkbit.repository.model.TargetInfo.PollStatus;
|
||||
import org.eclipse.hawkbit.repository.model.TargetUpdateStatus;
|
||||
import org.eclipse.hawkbit.repository.model.TotalTargetCountStatus;
|
||||
import org.eclipse.hawkbit.repository.model.TotalTargetCountStatus.Status;
|
||||
@@ -431,7 +431,7 @@ public final class HawkbitCommonUtil {
|
||||
return trimAndNullIfEmpty(orgText) == null ? SPUIDefinitions.SPACE : orgText;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Find extra height required to increase by all the components to utilize
|
||||
* the full height of browser for the responsive UI.
|
||||
*
|
||||
@@ -761,10 +761,10 @@ public final class HawkbitCommonUtil {
|
||||
* base software module description
|
||||
* @return BaseSoftwareModule new base software module
|
||||
*/
|
||||
public static SoftwareModule addNewBaseSoftware(final String bsname, final String bsversion, final String bsvendor,
|
||||
final SoftwareModuleType bstype, final String description) {
|
||||
public static SoftwareModule addNewBaseSoftware(final EntityFactory entityFactory, final String bsname,
|
||||
final String bsversion, final String bsvendor, final SoftwareModuleType bstype, final String description) {
|
||||
final SoftwareManagement swMgmtService = SpringContextHelper.getBean(SoftwareManagement.class);
|
||||
SoftwareModule newSWModule = new SoftwareModule();
|
||||
SoftwareModule newSWModule = entityFactory.generateSoftwareModule();
|
||||
newSWModule.setType(bstype);
|
||||
newSWModule.setName(bsname);
|
||||
newSWModule.setVersion(bsversion);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
package org.eclipse.hawkbit.ui.utils;
|
||||
|
||||
/**
|
||||
* Constants required for Button.
|
||||
* RepositoryConstants required for Button.
|
||||
*
|
||||
*
|
||||
*
|
||||
|
||||
@@ -11,7 +11,7 @@ package org.eclipse.hawkbit.ui.utils;
|
||||
import com.vaadin.ui.themes.ValoTheme;
|
||||
|
||||
/**
|
||||
* Constants required for Label.
|
||||
* RepositoryConstants required for Label.
|
||||
*
|
||||
*
|
||||
*
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
package org.eclipse.hawkbit.ui.utils;
|
||||
|
||||
/**
|
||||
* Constants required for Style.
|
||||
* RepositoryConstants required for Style.
|
||||
*
|
||||
*
|
||||
*
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
package org.eclipse.hawkbit.ui.utils;
|
||||
|
||||
/**
|
||||
* Constants required for Target.
|
||||
* RepositoryConstants required for Target.
|
||||
*
|
||||
*
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user