diff --git a/build/Jenkinsfile b/build/Jenkinsfile index 1f99f6aff..19d8ee63e 100644 --- a/build/Jenkinsfile +++ b/build/Jenkinsfile @@ -10,7 +10,7 @@ pipeline { } parameters { - string(name: 'engineSource', defaultValue: 'https://product.ivyteam.io', description: 'Engine page url') + string(name: 'engineSource', defaultValue: 'https://jenkins.ivyteam.io/job/core_product/job/kingfisher/', description: 'Engine page url') } stages { diff --git a/build/build.groovy b/build/build.groovy index 3c7246b0c..9070b9aa2 100644 --- a/build/build.groovy +++ b/build/build.groovy @@ -51,7 +51,7 @@ def build() { } def mvnBuild(def mvnArgs = '') { - def phase = isReleasingBranch() ? 'deploy' : 'verify' + def phase = isReleasingBranch() ? 'deploy' : 'deploy' maven cmd: "clean ${phase} -ntp -Divy.engine.version.latest.minor=true -Dmaven.test.skip=false " + mvnArgs junit testDataPublishers: [[$class: 'AttachmentPublisher'], [$class: 'StabilityTestDataPublisher']], testResults: '**/target/surefire-reports/**/*.xml' } diff --git a/build/integration/Jenkinsfile b/build/integration/Jenkinsfile index 512d9b566..4224194bb 100644 --- a/build/integration/Jenkinsfile +++ b/build/integration/Jenkinsfile @@ -10,7 +10,7 @@ pipeline { } parameters { - string(name: 'engineSource', defaultValue: 'https://product.ivyteam.io', description: 'Engine page url') + string(name: 'engineSource', defaultValue: 'https://jenkins.ivyteam.io/job/core_product/job/kingfisher/', description: 'Engine page url') string(name: 'testFilter', defaultValue: 'WebTest*.java', description: 'Change to only run tests of the matching classes (flag will be gnored on master)') } diff --git a/build/integration/windows/Jenkinsfile b/build/integration/windows/Jenkinsfile index cbd39fed2..8faec964d 100644 --- a/build/integration/windows/Jenkinsfile +++ b/build/integration/windows/Jenkinsfile @@ -16,7 +16,7 @@ pipeline { } parameters { - string(name: 'engineSource', defaultValue: 'https://product.ivyteam.io', description: 'Engine page url') + string(name: 'engineSource', defaultValue: 'https://jenkins.ivyteam.io/job/core_product/job/kingfisher/', description: 'Engine page url') } stages { diff --git a/build/screenshots/Jenkinsfile b/build/screenshots/Jenkinsfile index 8db3b88ad..3ebd73f0d 100644 --- a/build/screenshots/Jenkinsfile +++ b/build/screenshots/Jenkinsfile @@ -10,7 +10,7 @@ pipeline { } parameters { - string(name: 'engineSource', defaultValue: 'https://product.ivyteam.io', description: 'Engine page url') + string(name: 'engineSource', defaultValue: 'https://jenkins.ivyteam.io/job/core_product/job/kingfisher/', description: 'Engine page url') } stages { diff --git a/engine-cockpit-selenium-test/pom.xml b/engine-cockpit-selenium-test/pom.xml index f44376e4a..92be1e9fb 100644 --- a/engine-cockpit-selenium-test/pom.xml +++ b/engine-cockpit-selenium-test/pom.xml @@ -1,7 +1,7 @@ 4.0.0 - ch.ivyteam.enginecockpit + ch.ivyteam.kingfisher.enginecockpit engine-cockpit-config 14.0.0-SNAPSHOT ../maven-config @@ -78,7 +78,7 @@ - ch.ivyteam.enginecockpit + ch.ivyteam.kingfisher.enginecockpit engine-cockpit ${project.version} engine-cockpit.jar diff --git a/engine-cockpit-selenium-test/test-apps/pmv-dependencies-app/core/pom.xml b/engine-cockpit-selenium-test/test-apps/pmv-dependencies-app/core/pom.xml index 3e888c873..958bb3867 100644 --- a/engine-cockpit-selenium-test/test-apps/pmv-dependencies-app/core/pom.xml +++ b/engine-cockpit-selenium-test/test-apps/pmv-dependencies-app/core/pom.xml @@ -3,13 +3,13 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - ch.ivyteam.enginecockpit + ch.ivyteam.kingfisher.enginecockpit engine-cockpit-config 14.0.0-SNAPSHOT ../../../../maven-config - ch.ivyteam.enginecockpit + ch.ivyteam.kingfisher.enginecockpit core-pmv-test 14.0.0-SNAPSHOT iar diff --git a/engine-cockpit-selenium-test/test-apps/pmv-dependencies-app/custom/pom.xml b/engine-cockpit-selenium-test/test-apps/pmv-dependencies-app/custom/pom.xml index 63a6b358e..20d188ce6 100644 --- a/engine-cockpit-selenium-test/test-apps/pmv-dependencies-app/custom/pom.xml +++ b/engine-cockpit-selenium-test/test-apps/pmv-dependencies-app/custom/pom.xml @@ -3,18 +3,18 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - ch.ivyteam.enginecockpit + ch.ivyteam.kingfisher.enginecockpit engine-cockpit-config 14.0.0-SNAPSHOT ../../../../maven-config - ch.ivyteam.enginecockpit + ch.ivyteam.kingfisher.enginecockpit custom-pmv-test 14.0.0-SNAPSHOT iar - ch.ivyteam.enginecockpit + ch.ivyteam.kingfisher.enginecockpit main-pmv-test ${project.version} iar diff --git a/engine-cockpit-selenium-test/test-apps/pmv-dependencies-app/main/pom.xml b/engine-cockpit-selenium-test/test-apps/pmv-dependencies-app/main/pom.xml index 1e18bd48d..46eb3c76c 100644 --- a/engine-cockpit-selenium-test/test-apps/pmv-dependencies-app/main/pom.xml +++ b/engine-cockpit-selenium-test/test-apps/pmv-dependencies-app/main/pom.xml @@ -3,18 +3,18 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - ch.ivyteam.enginecockpit + ch.ivyteam.kingfisher.enginecockpit engine-cockpit-config 14.0.0-SNAPSHOT ../../../../maven-config - ch.ivyteam.enginecockpit + ch.ivyteam.kingfisher.enginecockpit main-pmv-test 14.0.0-SNAPSHOT iar - ch.ivyteam.enginecockpit + ch.ivyteam.kingfisher.enginecockpit core-pmv-test ${project.version} iar diff --git a/engine-cockpit-selenium-test/test-apps/pmv-dependencies-app/pom.xml b/engine-cockpit-selenium-test/test-apps/pmv-dependencies-app/pom.xml index dfdd7df7e..046ea8fd4 100644 --- a/engine-cockpit-selenium-test/test-apps/pmv-dependencies-app/pom.xml +++ b/engine-cockpit-selenium-test/test-apps/pmv-dependencies-app/pom.xml @@ -1,13 +1,13 @@ 4.0.0 - ch.ivyteam.enginecockpit + ch.ivyteam.kingfisher.enginecockpit engine-cockpit-config 14.0.0-SNAPSHOT ../../../maven-config - ch.ivyteam.enginecockpit + ch.ivyteam.kingfisher.enginecockpit engine-cockpit-test-app-pmvs 14.0.0-SNAPSHOT pom diff --git a/engine-cockpit-selenium-test/test-apps/test-ad/pom.xml b/engine-cockpit-selenium-test/test-apps/test-ad/pom.xml index 6066f41e7..82fb5efc6 100644 --- a/engine-cockpit-selenium-test/test-apps/test-ad/pom.xml +++ b/engine-cockpit-selenium-test/test-apps/test-ad/pom.xml @@ -1,20 +1,20 @@ 4.0.0 - ch.ivyteam.enginecockpit + ch.ivyteam.kingfisher.enginecockpit engine-cockpit-config 14.0.0-SNAPSHOT ../../../maven-config - ch.ivyteam.enginecockpit + ch.ivyteam.kingfisher.enginecockpit engine-cockpit-test-app-test-ad 14.0.0-SNAPSHOT pom - ch.ivyteam.enginecockpit + ch.ivyteam.kingfisher.enginecockpit engine-cockpit-test-data 14.0.0-SNAPSHOT iar diff --git a/engine-cockpit-test-data/pom.xml b/engine-cockpit-test-data/pom.xml index a66aead3e..5bc421db6 100644 --- a/engine-cockpit-test-data/pom.xml +++ b/engine-cockpit-test-data/pom.xml @@ -3,13 +3,13 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - ch.ivyteam.enginecockpit + ch.ivyteam.kingfisher.enginecockpit engine-cockpit-config 14.0.0-SNAPSHOT ../maven-config - ch.ivyteam.enginecockpit + ch.ivyteam.kingfisher.enginecockpit engine-cockpit-test-data 14.0.0-SNAPSHOT iar diff --git a/engine-cockpit-test-data/src/ch/ivyteam/enginecockpit/testdata/security/DynamicRoles.java b/engine-cockpit-test-data/src/ch/ivyteam/enginecockpit/testdata/security/DynamicRoles.java index c8da1c09e..2778cb509 100644 --- a/engine-cockpit-test-data/src/ch/ivyteam/enginecockpit/testdata/security/DynamicRoles.java +++ b/engine-cockpit-test-data/src/ch/ivyteam/enginecockpit/testdata/security/DynamicRoles.java @@ -2,6 +2,7 @@ import java.util.UUID; +import ch.ivyteam.ivy.application.ReleaseState; import ch.ivyteam.ivy.application.app.IApplicationRepository; import ch.ivyteam.ivy.security.IRole; import ch.ivyteam.ivy.security.ISecurityContext; @@ -38,7 +39,10 @@ private static IRole getEverybody() { private static ISecurityContext context() { return IApplicationRepository.instance() - .findByName("test").orElseThrow() + .findByName("test").stream() + .filter(a -> a.getReleaseState() == ReleaseState.RELEASED) + .findAny() + .orElseThrow() .getSecurityContext(); } } diff --git a/engine-cockpit-test/pom.xml b/engine-cockpit-test/pom.xml index 994d263e2..d78e38872 100644 --- a/engine-cockpit-test/pom.xml +++ b/engine-cockpit-test/pom.xml @@ -3,13 +3,13 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - ch.ivyteam.enginecockpit + ch.ivyteam.kingfisher.enginecockpit engine-cockpit-config 14.0.0-SNAPSHOT ../maven-config - ch.ivyteam.enginecockpit + ch.ivyteam.kingfisher.enginecockpit engine-cockpit-test 14.0.0-SNAPSHOT iar @@ -20,7 +20,7 @@ - ch.ivyteam.enginecockpit + ch.ivyteam.kingfisher.enginecockpit engine-cockpit ${project.version} iar diff --git a/engine-cockpit-test/src_test/ch/ivyteam/enginecockpit/application/TestProcessModelVersion.java b/engine-cockpit-test/src_test/ch/ivyteam/enginecockpit/application/TestProcessModelVersion.java index 28f29d547..9ff073717 100644 --- a/engine-cockpit-test/src_test/ch/ivyteam/enginecockpit/application/TestProcessModelVersion.java +++ b/engine-cockpit-test/src_test/ch/ivyteam/enginecockpit/application/TestProcessModelVersion.java @@ -16,9 +16,9 @@ public class TestProcessModelVersion { /** ISSUE XIVY-4159 Application overview not displayed due to NPE */ @Test void emptyLibrary() { - ProcessModelVersion pmv = new ProcessModelVersion(createPmvProxy()); - assertThat(pmv.getQualifiedVersion()).isEqualTo("Unknown version"); - assertThat(pmv.getLibraryId()).isEqualTo("Unknown id"); + var pmv = new ProcessModelVersion(createPmvProxy()); + assertThat(pmv.getQualifiedVersion()).isNull(); + assertThat(pmv.getLibraryId()).isNull(); } private IProcessModelVersion createPmvProxy() { diff --git a/engine-cockpit/cms/cms_en.yaml b/engine-cockpit/cms/cms_en.yaml index f8b159216..45d4c79f4 100644 --- a/engine-cockpit/cms/cms_en.yaml +++ b/engine-cockpit/cms/cms_en.yaml @@ -14,7 +14,7 @@ admins: applicationDetail: ProcessModels: Process Models applications: - AppPmPmvHeader: App / PM / PMV + AppPmPmvHeader: App / Version / Project ApplicationConvertToLatestVersionMessage: All Axon Ivy Projects in state RELEASED and DEPRECATED will be converted to the latest version. ApplicationWarningMessageForNoReleasedPmv: At least one process model has no released process model version Convert: Convert diff --git a/engine-cockpit/pom.xml b/engine-cockpit/pom.xml index a3148bca0..528e777e4 100644 --- a/engine-cockpit/pom.xml +++ b/engine-cockpit/pom.xml @@ -5,13 +5,13 @@ 4.0.0 - ch.ivyteam.enginecockpit + ch.ivyteam.kingfisher.enginecockpit engine-cockpit-config 14.0.0-SNAPSHOT ../maven-config - ch.ivyteam.enginecockpit + ch.ivyteam.kingfisher.enginecockpit 14.0.0-SNAPSHOT engine-cockpit iar diff --git a/engine-cockpit/src/ch/ivyteam/enginecockpit/application/ApplicationBean.java b/engine-cockpit/src/ch/ivyteam/enginecockpit/application/ApplicationBean.java index 32e6d2590..8561fcdad 100644 --- a/engine-cockpit/src/ch/ivyteam/enginecockpit/application/ApplicationBean.java +++ b/engine-cockpit/src/ch/ivyteam/enginecockpit/application/ApplicationBean.java @@ -11,15 +11,12 @@ import org.primefaces.model.DefaultTreeNode; import org.primefaces.model.TreeNode; -import ch.ivyteam.enginecockpit.application.model.AbstractActivity; +import ch.ivyteam.enginecockpit.application.model.AppTreeItem; import ch.ivyteam.enginecockpit.application.model.Application; -import ch.ivyteam.enginecockpit.application.model.ProcessModel; import ch.ivyteam.enginecockpit.application.model.ProcessModelVersion; import ch.ivyteam.enginecockpit.commons.TreeView; import ch.ivyteam.enginecockpit.system.ManagerBean; import ch.ivyteam.ivy.application.IApplication; -import ch.ivyteam.ivy.application.IProcessModel; -import ch.ivyteam.ivy.application.ReleaseState; import ch.ivyteam.ivy.application.app.IApplicationRepository; import ch.ivyteam.ivy.application.app.NewApplication; import ch.ivyteam.ivy.environment.Ivy; @@ -27,10 +24,10 @@ @ManagedBean @ViewScoped -public class ApplicationBean extends TreeView { +public class ApplicationBean extends TreeView { private boolean processing; - private AbstractActivity selectedActivity; + private AppTreeItem selectedActivity; private final Application newApp; private boolean activateNewApp; @@ -50,36 +47,36 @@ public ApplicationBean() { protected void buildTree() { for (var app : managerBean.getIApplications()) { var activity = new Application(app, this); - var node = new DefaultTreeNode(activity, rootTreeNode); - loadPmTree(app, node, activity); - activity.getState().updateChildProblems(activity); + var node = new DefaultTreeNode(activity, rootTreeNode); + loadPmvTree(app, node, activity); + // activity.getState().updateChildProblems(activity); } } - private void loadPmTree(IApplication app, TreeNode appNode, AbstractActivity parent) { - for (var pm : app.getProcessModels()) { - var activity = new ProcessModel(pm, this); - parent.addChild(activity); - var node = new DefaultTreeNode(activity, appNode); - loadPmvTree(pm, node, activity); - activity.getState().updateChildProblems(activity); - } - } + // private void loadPmTree(IApplication app, TreeNode appNode, AppTreeItem parent) { + // for (var pm : app.getProcessModels()) { + // var activity = new ProcessModel(pm, this); + // // parent.addChild(activity); + // var node = new DefaultTreeNode(activity, appNode); + // loadPmvTree(pm, node, activity); + // // activity.getState().updateChildProblems(activity); + // } + // } @SuppressWarnings("unused") - private void loadPmvTree(IProcessModel pm, TreeNode pmNode, AbstractActivity parent) { - for (var pmv : pm.getProcessModelVersions()) { - if (pmv.getReleaseState() != ReleaseState.DELETED) { - var activity = new ProcessModelVersion(pmv, this); - parent.addChild(activity); - new DefaultTreeNode(activity, pmNode); - } + private void loadPmvTree(IApplication app, TreeNode pmNode, AppTreeItem parent) { + for (var pmv : app.getProcessModelVersions().toList()) { + // if (pmv.getReleaseState() != ReleaseState.DELETED) { + var activity = new ProcessModelVersion(pmv, this); + // parent.addChild(activity); + new DefaultTreeNode(activity, pmNode); + // } } } @Override @SuppressWarnings("unused") - protected void filterNode(TreeNode node) { + protected void filterNode(TreeNode node) { var activity = node.getData(); if (Strings.CI.contains(activity.getName(), filter)) { new DefaultTreeNode<>(activity, filteredTreeNode); @@ -91,15 +88,15 @@ public void reloadActivityStates() { reloadNodeState(rootTreeNode.getChildren()); } - private void reloadNodeState(List> nodes) { + private void reloadNodeState(List> nodes) { for (var node : nodes) { - var activity = node.getData(); - activity.updateStats(); + // var activity = node.getData(); + // activity.updateStats(); if (!processing) { - processing = activity.getState().isProcessing(); + // processing = activity.getState().isProcessing(); } reloadNodeState(node.getChildren()); - activity.getState().updateChildProblems(activity); + // activity.getState().updateChildProblems(activity); } } @@ -127,7 +124,7 @@ public void createNewApplication() { try { var securityContext = ISecurityManager.instance().securityContexts().get(newApp.getSecSystem()); var appToCreate = NewApplication.create(newApp.getName()) - .active(activateNewApp) + // .active(activateNewApp) .toNewApplication(); IApplicationRepository.of(securityContext).create(appToCreate); reloadTree(); @@ -138,22 +135,22 @@ public void createNewApplication() { } } - public void setActiveActivity(AbstractActivity activity) { + public void setActiveActivity(AppTreeItem activity) { this.selectedActivity = activity; } - public AbstractActivity getActiveActivity() { + public AppTreeItem getActiveActivity() { return selectedActivity; } - @Override - protected String dataIdentifier(AbstractActivity data) { - var id = Long.toString(data.getApplicationId()); - if (data.isPm()) { - id += "-" + Long.toString(data.getId()); - } else if (data instanceof ProcessModelVersion pmv) { - id += "-" + Long.toString(pmv.getProcessModelId()) + "-" + Long.toString(pmv.getId()); - } - return id; - } + // @Override + // protected String dataIdentifier(AppTreeItem data) { + // var id = Long.toString(data.getApplicationId()); + // if (data.isPm()) { + // id += "-" + Long.toString(data.getId()); + // } else if (data instanceof ProcessModelVersion pmv) { + // id += "-" + Long.toString(pmv.getProcessModelId()) + "-" + Long.toString(pmv.getId()); + // } + // return id; + // } } diff --git a/engine-cockpit/src/ch/ivyteam/enginecockpit/application/ApplicationDetailBean.java b/engine-cockpit/src/ch/ivyteam/enginecockpit/application/ApplicationDetailBean.java index 429ca7d5c..a251f65ac 100644 --- a/engine-cockpit/src/ch/ivyteam/enginecockpit/application/ApplicationDetailBean.java +++ b/engine-cockpit/src/ch/ivyteam/enginecockpit/application/ApplicationDetailBean.java @@ -5,7 +5,6 @@ import java.util.LinkedList; import java.util.List; import java.util.Objects; -import java.util.stream.Collectors; import javax.faces.bean.ManagedBean; import javax.faces.bean.ViewScoped; @@ -21,8 +20,6 @@ import ch.ivyteam.enginecockpit.security.model.SecuritySystem; import ch.ivyteam.enginecockpit.system.ManagerBean; import ch.ivyteam.ivy.application.IApplication; -import ch.ivyteam.ivy.application.ILibrary; -import ch.ivyteam.ivy.application.IProcessModelVersion; import ch.ivyteam.ivy.application.restricted.IApplicationInternal; import ch.ivyteam.ivy.environment.Ivy; import ch.ivyteam.ivy.workflow.StandardProcessType; @@ -85,7 +82,7 @@ public SecuritySystem getSecuritySystem() { } public String deleteApplication() { - managerBean.apps().delete(appName); + managerBean.apps().delete(app.getName(), app.version()); managerBean.reloadApplications(); return "applications.xhtml?faces-redirect=true"; } @@ -113,8 +110,7 @@ public String getCasesCount() { } public String getPmCount() { - return managerBean.formatNumber(getIApplication().getProcessModels().stream() - .mapToInt(pm -> pm.getProcessModelVersions().size()).sum()); + return managerBean.formatNumber(getIApplication().getProcessModelVersions().count()); } private IApplication getIApplication() { @@ -151,14 +147,14 @@ private List availableStandardProcesses(ConfigProperty config) { private static List librariesOf(IApplication app) { List libs = new LinkedList<>(); libs.add(""); - var available = app.getProcessModels().stream() - .flatMap(pm -> pm.getProcessModelVersions().stream()) - .map(IProcessModelVersion::getLibrary) - .filter(Objects::nonNull) - .map(ILibrary::getId) - .distinct() - .collect(Collectors.toList()); - libs.addAll(available); + // var available = app.getProcessModels().stream() + // .flatMap(pm -> pm.getProcessModelVersions().stream()) + // .map(IProcessModelVersion::getLibrary) + // .filter(Objects::nonNull) + // .map(ILibrary::getId) + // .distinct() + // .collect(Collectors.toList()); + // libs.addAll(available); return libs; } } diff --git a/engine-cockpit/src/ch/ivyteam/enginecockpit/application/PmvDetailBean.java b/engine-cockpit/src/ch/ivyteam/enginecockpit/application/PmvDetailBean.java index 999bf6214..73661d79a 100644 --- a/engine-cockpit/src/ch/ivyteam/enginecockpit/application/PmvDetailBean.java +++ b/engine-cockpit/src/ch/ivyteam/enginecockpit/application/PmvDetailBean.java @@ -6,23 +6,20 @@ import javax.faces.bean.ManagedBean; import javax.faces.bean.ViewScoped; -import org.apache.log4j.Logger; - import ch.ivyteam.enginecockpit.application.model.LibSpecification; import ch.ivyteam.enginecockpit.application.model.ProcessModelVersion; import ch.ivyteam.enginecockpit.commons.ResponseHelper; import ch.ivyteam.enginecockpit.system.ManagerBean; -import ch.ivyteam.ivy.application.restricted.IApplicationConfigurationManager; import ch.ivyteam.ivy.application.ProcessModelVersionRelation; +import ch.ivyteam.ivy.application.restricted.IApplicationConfigurationManager; @ManagedBean @ViewScoped public class PmvDetailBean { - private static final Logger LOGGER = Logger.getLogger(PmvDetailBean.class); private String appName; - private String pmName; - private String pmvVersion; + private String pmVersion; + private String pmvName; private final ManagerBean managerBean; private ProcessModelVersion pmv; private String deployedProject; @@ -34,12 +31,12 @@ public PmvDetailBean() { managerBean = ManagerBean.instance(); } - public void setPmvVersion(String pmvVersion) { - this.pmvVersion = pmvVersion; + public void setPmvName(String pmvName) { + this.pmvName = pmvName; } - public String getPmvVersion() { - return pmvVersion; + public String getPmvName() { + return pmvName; } public void setAppName(String appName) { @@ -50,12 +47,12 @@ public String getAppName() { return appName; } - public void setPmName(String pmName) { - this.pmName = pmName; + public void setPmVersion(String pmVersion) { + this.pmVersion = pmVersion; } - public String getPmName() { - return pmName; + public String getPmVersion() { + return pmVersion; } public void onload() { @@ -63,22 +60,20 @@ public void onload() { ResponseHelper.notFound("appName not set"); return; } - if (pmName == null) { + if (pmVersion == null) { ResponseHelper.notFound("pmName not set"); return; } - if (pmvVersion == null) { + if (pmvName == null) { ResponseHelper.notFound("pmvVersion not set"); return; } managerBean.reloadApplications(); var appMgr = IApplicationConfigurationManager.instance(); - var iPmv = appMgr.findProcessModelVersion(appName, pmName, Integer.parseInt(pmvVersion)); + var iPmv = appMgr.findProcessModelVersion(appName, pmvName, Integer.parseInt(pmVersion)); if (iPmv == null) { - LOGGER.warn("Can not refresh PMV details for " + appName + "/" + pmName + "/" + pmvVersion); - ResponseHelper.notFound("Process Model Version '" + pmName + "' for version '" + pmvVersion - + "' in app '" + appName + "' not found"); + ResponseHelper.notFound("Process Model Version '" + pmVersion + "' for version '" + pmvName + "' in app '" + appName + "' not found"); return; } @@ -89,14 +84,14 @@ public void onload() { requriedPmvs = iPmv.getAllRelatedProcessModelVersions(ProcessModelVersionRelation.REQUIRED).stream() .map(ProcessModelVersion::new) .collect(Collectors.toList()); - var library = iPmv.getLibrary(); - if (library == null) { - return; - } - deployedProject = library.getId(); - requiredSpecifications = library.getRequiredLibrarySpecifications().stream() - .map(LibSpecification::new) - .collect(Collectors.toList()); + // var library = iPmv.getLibrary(); + // if (library == null) { + // return; + // } + // deployedProject = library.getId(); + // requiredSpecifications = library.getRequiredLibrarySpecifications().stream() + // .map(LibSpecification::new) + // .collect(Collectors.toList()); } public ProcessModelVersion getPmv() { diff --git a/engine-cockpit/src/ch/ivyteam/enginecockpit/application/model/AppTreeItem.java b/engine-cockpit/src/ch/ivyteam/enginecockpit/application/model/AppTreeItem.java new file mode 100644 index 000000000..de9965958 --- /dev/null +++ b/engine-cockpit/src/ch/ivyteam/enginecockpit/application/model/AppTreeItem.java @@ -0,0 +1,67 @@ +package ch.ivyteam.enginecockpit.application.model; + +import java.util.List; +import java.util.stream.Collectors; + +import ch.ivyteam.ivy.application.ReleaseState; + +public interface AppTreeItem { + + String getName(); + String getDetailView(); + List isDeletable(); + + default String getNotDeletableMessage() { + return isDeletable().stream().collect(Collectors.joining("\n")); + } + + // APP stuff + default boolean isApp() { + return false; + } + + default String getReleaseStateIcon() { + return null; + } + + default ReleaseState getReleaseState() { + return null; + } + + default boolean isNotStartable() { + return true; + } + + default boolean isNotStopable() { + return true; + } + + default boolean isNotLockable() { + return true; + } + + default boolean isReleasable() { + return false; + } + + default void release() {} + + default void activate() {} + + default void deactivate() {} + + default void lock() {} + + // PMV stuff + default boolean isPmv() { + return false; + } + + default String getVersion() { + return null; + } + + default String getLastChangeDate() { + return null; + } +} diff --git a/engine-cockpit/src/ch/ivyteam/enginecockpit/application/model/Application.java b/engine-cockpit/src/ch/ivyteam/enginecockpit/application/model/Application.java index 7591a8c69..532152983 100644 --- a/engine-cockpit/src/ch/ivyteam/enginecockpit/application/model/Application.java +++ b/engine-cockpit/src/ch/ivyteam/enginecockpit/application/model/Application.java @@ -1,25 +1,22 @@ package ch.ivyteam.enginecockpit.application.model; import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; import javax.faces.application.FacesMessage; import javax.faces.context.FacesContext; import javax.ws.rs.core.UriBuilder; import ch.ivyteam.enginecockpit.application.ApplicationBean; +import ch.ivyteam.ivy.application.ActivityState; import ch.ivyteam.ivy.application.IApplication; -import ch.ivyteam.ivy.application.IProcessModel; -import ch.ivyteam.ivy.application.app.IApplicationRepository; +import ch.ivyteam.ivy.application.ReleaseState; import ch.ivyteam.ivy.application.restricted.IApplicationInternal; import ch.ivyteam.ivy.environment.Ivy; import ch.ivyteam.ivy.security.ISecurityContext; -import ch.ivyteam.ivy.workflow.IWorkflowProcessModelVersion; import ch.ivyteam.ivy.workflow.WorkflowNavigationUtil; -@SuppressWarnings("removal") -public class Application extends AbstractActivity { +@SuppressWarnings({"removal", "unused"}) +public class Application implements AppTreeItem { private String fileDir; private String secSystem = ISecurityContext.DEFAULT; @@ -27,8 +24,18 @@ public class Application extends AbstractActivity { private IApplicationInternal app; private List webServiceProcesses; - public Application() { - super("", 0, null, null); + public Application() {} + + @Override + public String getName() { + if (app == null) { + return ""; + } + return app.getName() + " (v" + app.getVersion() + ")"; + } + + public long getId() { + return app.getId(); } public Application(IApplication app) { @@ -36,17 +43,11 @@ public Application(IApplication app) { } public Application(IApplication app, ApplicationBean bean) { - super(app.getName(), app.getId(), app, bean); this.app = (IApplicationInternal) app; fileDir = app.getFileDirectory(); secSystem = app.getSecurityContext().getName(); } - @Override - public boolean isApplication() { - return true; - } - @Override public String getDetailView() { return UriBuilder.fromPath("application-detail.xhtml") @@ -56,33 +57,77 @@ public String getDetailView() { } @Override + public boolean isApp() { + return true; + } + public long getRunningCasesCount() { countRunningCases(); return runningCasesCount; } - @Override public String getIcon() { return "module"; } @Override public boolean isNotStartable() { - return super.isNotStartable() || isDesignerOrSystem(); + return app.getActivityState() == ActivityState.ACTIVE; } @Override public boolean isNotStopable() { - return super.isNotStopable() || isDesignerOrSystem(); + return app.getActivityState() == ActivityState.INACTIVE; + } + + @Override + public void activate() { + app.activate(); + } + + @Override + public void deactivate() { + app.deactivate(); + } + + @Override + public void release() { + app.release(); + } + + @Override + public void lock() { + app.lock(); + } + + @Override + public ReleaseState getReleaseState() { + return app.getReleaseState(); } @Override public boolean isNotLockable() { - return super.isNotLockable() || isDesignerOrSystem(); + return app.getActivityState() == ActivityState.LOCKED; + } + + @Override + public boolean isReleasable() { + return app.getReleaseState() != ReleaseState.RELEASED; + } + + @Override + public String getReleaseStateIcon() { + return switch (getReleaseState()) { + case RELEASED -> "check-circle-1"; + case DEPRECATED -> "delete"; + case ARCHIVED -> "archive"; + case CREATED, PREPARED -> "advertising-megaphone-2"; + default -> "question-circle"; + }; } private boolean isDesignerOrSystem() { - return app.isDesigner() || app.isSystem(); + return app.isDesigner(); } public String getHomeUrl() { @@ -125,47 +170,39 @@ public ISecurityContext getSecurityContext() { return app.getSecurityContext(); } - @Override public long getApplicationId() { return getId(); } - @Override public String getActivityType() { return AbstractActivity.APP; } - @Override public void convert() { - execute(() -> app.convertProjects(new ProjectConversionLog()), "convert", true); + // execute(() -> app.convertProjects(new ProjectConversionLog()), "convert", true); } - @Override public boolean canConvert() { return true; } + // + // if(app!=null) + // { + // return !app.hasProjectsToConvert(); + // }return true; + // } - @Override - public boolean isNotConvertable() { - if (app != null) { - return !app.hasProjectsToConvert(); - } - return true; - } - - @Override public void delete() { - execute(() -> IApplicationRepository.instance().delete(getName()), "delete", false); + // execute(() -> IApplicationRepository.instance().delete(getName()), "delete", false); } - @Override public String getDeleteHint() { var message = new StringBuilder(); if (runningCasesCount > 0) { message.append(Ivy.cm().content("/applications/DeleteRunningCasesHintMessage") .replace("activityType", getActivityType()).replace("runningCases", String.valueOf(runningCasesCount)).get()); } - message.append(super.getDeleteHint()); + // message.append(super.getDeleteHint()); return message.toString(); } @@ -183,29 +220,27 @@ public IApplicationInternal app() { return app; } - @SuppressWarnings("deprecation") public List getWebServiceProcesses() { if (webServiceProcesses == null) { - webServiceProcesses = app.getProcessModels().stream() - .map(IProcessModel::getReleasedProcessModelVersion) - .map(IWorkflowProcessModelVersion::of) - .filter(Objects::nonNull) - .flatMap(pmv -> pmv.getWebServiceProcesses().stream()) - .map(WebServiceProcess::new) - .collect(Collectors.toList()); + // webServiceProcesses = app.getProcessModels().stream() + // .map(IProcessModel::getReleasedProcessModelVersion) + // .map(IWorkflowProcessModelVersion::of) + // .filter(Objects::nonNull) + // .flatMap(pmv -> pmv.getWebServiceProcesses().stream()) + // .map(WebServiceProcess::new) + // .collect(Collectors.toList()); } return webServiceProcesses; } - @Override public boolean hasReleasedProcessModelVersion() { - return app.getProcessModels() - .stream() - .map(ch.ivyteam.ivy.application.internal.ProcessModel.class::cast) - .allMatch(ch.ivyteam.ivy.application.internal.ProcessModel::hasReleasedProcessModelVersion); + // return app.getProcessModels() + // .stream() + // .map(ch.ivyteam.ivy.application.internal.ProcessModel.class::cast) + // .allMatch(ch.ivyteam.ivy.application.internal.ProcessModel::hasReleasedProcessModelVersion); + return true; } - @Override public String getWarningMessageForNoReleasedPmv() { return Ivy.cm().co("/applications/ApplicationWarningMessageForNoReleasedPmv"); } @@ -214,4 +249,8 @@ public String getWarningMessageForNoReleasedPmv() { public List isDeletable() { return app.isDeletable(); } + + public int version() { + return app.getVersion(); + } } diff --git a/engine-cockpit/src/ch/ivyteam/enginecockpit/application/model/LibSpecification.java b/engine-cockpit/src/ch/ivyteam/enginecockpit/application/model/LibSpecification.java index a242e6876..0b0f8e5ef 100644 --- a/engine-cockpit/src/ch/ivyteam/enginecockpit/application/model/LibSpecification.java +++ b/engine-cockpit/src/ch/ivyteam/enginecockpit/application/model/LibSpecification.java @@ -1,27 +1,25 @@ package ch.ivyteam.enginecockpit.application.model; -import ch.ivyteam.ivy.application.ILibrarySpecification; -import ch.ivyteam.ivy.application.value.VersionRange; import ch.ivyteam.ivy.environment.Ivy; public class LibSpecification { - private final String id; - private final boolean resolved; - private final String version; + private String id; + private boolean resolved; + private String version; private ProcessModelVersion resolvedPmv; private String resolvedPmvName; - public LibSpecification(ILibrarySpecification spec) { - id = spec.getId(); - resolved = spec.isResolved(); - version = VersionRange.of(spec).toString(); - var resolvedLib = spec.getResolvedLibrary(); - if (resolvedLib != null) { - resolvedPmv = new ProcessModelVersion(resolvedLib.getProcessModelVersion()); - resolvedPmvName = resolvedPmv.getName() + " (" + resolvedPmv.getQualifiedVersion() + " / " + - resolvedPmv.getState().getOperation() + " / " + resolvedPmv.getState().getReleaseState() + ")"; - } + public LibSpecification() { + // id = spec.getId(); + // resolved = spec.isResolved(); + // version = VersionRange.of(spec).toString(); + // var resolvedLib = spec.getResolvedLibrary(); + // if (resolvedLib != null) { + // resolvedPmv = new ProcessModelVersion(resolvedLib.getProcessModelVersion()); + // resolvedPmvName = resolvedPmv.getName() + " (" + resolvedPmv.getQualifiedVersion() + " / " + + // resolvedPmv.getState().getOperation() + " / " + resolvedPmv.getState().getReleaseState() + ")"; + // } } public String getId() { diff --git a/engine-cockpit/src/ch/ivyteam/enginecockpit/application/model/ProcessModel.java b/engine-cockpit/src/ch/ivyteam/enginecockpit/application/model/ProcessModel.java deleted file mode 100644 index ad67826be..000000000 --- a/engine-cockpit/src/ch/ivyteam/enginecockpit/application/model/ProcessModel.java +++ /dev/null @@ -1,103 +0,0 @@ -package ch.ivyteam.enginecockpit.application.model; - -import java.util.List; -import java.util.Objects; - -import ch.ivyteam.enginecockpit.application.ApplicationBean; -import ch.ivyteam.ivy.application.ILibrary; -import ch.ivyteam.ivy.application.IProcessModel; -import ch.ivyteam.ivy.application.IProcessModelVersion; -import ch.ivyteam.ivy.application.restricted.IApplicationInternal; -import ch.ivyteam.ivy.environment.Ivy; -import ch.ivyteam.ivy.workflow.IWorkflowContext; -import ch.ivyteam.ivy.workflow.restricted.WorkflowContextInternal; - -public class ProcessModel extends AbstractActivity { - private final IProcessModel pm; - private Boolean isOverrideProject; - private long runningCasesCount = -1; - private List deletable; - - public ProcessModel(IProcessModel pm, ApplicationBean bean) { - super(pm.getName(), pm.getId(), pm, bean); - this.pm = pm; - } - - @Override - public boolean isPm() { - return true; - } - - @Override - public long getRunningCasesCount() { - if (runningCasesCount < 0) { - var wf = (WorkflowContextInternal) IWorkflowContext.current(); - runningCasesCount = wf.getRunningCasesCount(pm); - } - return runningCasesCount; - } - - @Override - public String getIcon() { - return isOverrideProject() ? "move-to-bottom" : "module-three-2"; - } - - @Override - public String getIconTitle() { - return isOverrideProject() ? "This PM is configured as strict override project" : getActivityType(); - } - - @Override - public long getApplicationId() { - return ((IProcessModel) activity).getApplication().getId(); - } - - @Override - public String getActivityType() { - return AbstractActivity.PM; - } - - @Override - public void delete() { - execute(() -> pm.getApplication().deleteProcessModel(getName()), "delete", false); - } - - @Override - public void forceDelete() { - execute(() -> ((IApplicationInternal) pm.getApplication()).forceDeleteProcessModel(getName()), "force delete", false); - } - - @Override - public List isDeletable() { - if (deletable == null) { - deletable = pm.isDeletableInternal(); - } - return deletable; - } - - @Override - public boolean hasReleasedProcessModelVersion() { - var processModel = (ch.ivyteam.ivy.application.internal.ProcessModel) pm; - return processModel.hasReleasedProcessModelVersion(); - } - - @Override - public String getWarningMessageForNoReleasedPmv() { - return Ivy.cm().co("/applications/WarningMessageForNoReleasedPmv"); - } - - public boolean isOverrideProject() { - if (isOverrideProject == null) { - var overrideProject = ((IApplicationInternal) pm.getApplication()).getConfiguration().getOrDefault("OverrideProject"); - var projectId = pm.getProcessModelVersions().stream() - .map(IProcessModelVersion::getLibrary) - .filter(Objects::nonNull) - .map(ILibrary::getId) - .distinct() - .findFirst() - .orElse(null); - isOverrideProject = projectId != null && projectId.equals(overrideProject); - } - return isOverrideProject; - } -} diff --git a/engine-cockpit/src/ch/ivyteam/enginecockpit/application/model/ProcessModelVersion.java b/engine-cockpit/src/ch/ivyteam/enginecockpit/application/model/ProcessModelVersion.java index 01688a7c2..14d4b15a4 100644 --- a/engine-cockpit/src/ch/ivyteam/enginecockpit/application/model/ProcessModelVersion.java +++ b/engine-cockpit/src/ch/ivyteam/enginecockpit/application/model/ProcessModelVersion.java @@ -2,29 +2,30 @@ import java.util.List; +import javax.ws.rs.core.UriBuilder; + import ch.ivyteam.enginecockpit.application.ApplicationBean; import ch.ivyteam.enginecockpit.util.DateUtil; -import ch.ivyteam.ivy.application.ILibrary; import ch.ivyteam.ivy.application.IProcessModelVersion; import ch.ivyteam.ivy.application.restricted.IProcessModelVersionInternal; -import ch.ivyteam.ivy.environment.Ivy; -import ch.ivyteam.ivy.application.ReleaseState; import ch.ivyteam.ivy.workflow.IWorkflowContext; -public class ProcessModelVersion extends AbstractActivity { +public class ProcessModelVersion implements AppTreeItem { private final IProcessModelVersionInternal pmv; private final String lastChangeDate; - private final Library lib; private int runningCasesCount = -1; public ProcessModelVersion(IProcessModelVersion pmv) { this(pmv, null); } + @Override + public String getName() { + return pmv.getName(); + } + public ProcessModelVersion(IProcessModelVersion pmv, ApplicationBean bean) { - super(pmv.getVersionName(), pmv.getId(), pmv, bean); - lib = new Library(pmv.getLibrary()); lastChangeDate = DateUtil.formatDate(pmv.getLastChangeDate()); this.pmv = (IProcessModelVersionInternal) pmv; updateStats(); @@ -32,25 +33,26 @@ public ProcessModelVersion(IProcessModelVersion pmv, ApplicationBean bean) { @Override public String getDetailView() { - return "pmv-detail.xhtml?appName=" + pmv.getApplication().getName() + "&pmName=" - + pmv.getProcessModel().getName() + "&pmvVersion=" + pmv.getVersionNumber(); + return UriBuilder.fromPath("pmv-detail.xhtml") + .queryParam("appName", pmv.getApplication().getName()) + .queryParam("pmVersion", pmv.getApplication().getVersion()) + .queryParam("pmvName", pmv.getName()) + .build() + .toString(); } - @Override public void updateStats() { - super.updateStats(); - if (pmv != null) { - getState().updateReleaseState(pmv.getReleaseState()); - } + // super.updateStats(); + // if (pmv != null) { + //// getState().updateReleaseState(pmv.getReleaseState()); + // } } - @Override public long getRunningCasesCount() { countRunningCases(); return runningCasesCount; } - @Override public String getIcon() { return "module-three-1"; } @@ -61,96 +63,71 @@ public boolean isPmv() { } @Override + public String getVersion() { + return pmv.getLibraryVersion(); + } + public boolean isNotConvertable() { return !pmv.canBeConverted(); } @Override public void release() { - execute(() -> pmv.release(), "release", true); + // execute(() -> pmv.release(), "release", true); } - @Override public void delete() { - execute(() -> pmv.delete(), "delete", false); + // execute(() -> pmv.delete(), "delete", false); } - @Override public void convert() { - execute(() -> pmv.convertProject(new ProjectConversionLog()), "convert", true); + // execute(() -> pmv.convertProject(new ProjectConversionLog()), "convert", true); } - @Override public boolean canConvert() { return true; } @Override public boolean isReleasable() { - return getState().is(ReleaseState.DEPRECATED, ReleaseState.ARCHIVED, ReleaseState.PREPARED); + // return getState().is(ReleaseState.DEPRECATED, ReleaseState.ARCHIVED, ReleaseState.PREPARED); + return true; } @Override public List isDeletable() { - return pmv.isDeletable(); + // return pmv.isDeletable(); + return List.of(); } - @Override public long getApplicationId() { - return pmv.getProcessModel().getApplication().getId(); - } - - public long getProcessModelId() { - return pmv.getProcessModel().getId(); + return pmv.getApplication().getId(); } - @Override public String getActivityType() { return AbstractActivity.PMV; } public String getQualifiedVersion() { - return lib.version; + return pmv.getLibraryVersion(); } + @Override public String getLastChangeDate() { return lastChangeDate; } public String getLibraryId() { - return lib.id; - } - - public boolean isLibraryResolved() { - return lib.resolved; + return pmv.getLibraryId(); } public int getProjectVersion() { return pmv.projectVersion(); } - public String getLibraryResolvedTooltip() { - return isLibraryResolved() ? Ivy.cm().co("/pmvDetail/AllDirectIndirectRequiredLibrariesAvailableMessage") - : Ivy.cm().co("/pmvDetail/NotAllDirectIndirectRequiredLibrariesAvailableMessage"); - } - private void countRunningCases() { if (pmv != null && runningCasesCount < 0) { runningCasesCount = IWorkflowContext.current().getRunningCasesCount(pmv); } } - - private static class Library { - private String id = "Unknown id"; - private String version = "Unknown version"; - private boolean resolved = false; - - private Library(ILibrary lib) { - if (lib != null) { - id = lib.getId(); - version = lib.getQualifiedVersion().getRawVersion(); - resolved = lib.isResolved(); - } - } - } } diff --git a/engine-cockpit/src/ch/ivyteam/enginecockpit/configuration/BrandingBean.java b/engine-cockpit/src/ch/ivyteam/enginecockpit/configuration/BrandingBean.java index 380a01a5f..32b1d95a2 100644 --- a/engine-cockpit/src/ch/ivyteam/enginecockpit/configuration/BrandingBean.java +++ b/engine-cockpit/src/ch/ivyteam/enginecockpit/configuration/BrandingBean.java @@ -31,6 +31,7 @@ import ch.ivyteam.enginecockpit.system.ManagerBean; import ch.ivyteam.enginecockpit.util.DownloadUtil; import ch.ivyteam.ivy.application.IApplication; +import ch.ivyteam.ivy.application.ReleaseState; import ch.ivyteam.ivy.application.app.IApplicationRepository; import ch.ivyteam.ivy.application.branding.BrandingIO; import ch.ivyteam.ivy.application.branding.BrandingResolver; @@ -74,7 +75,10 @@ public void upload(FileUploadEvent event) { if (!ALLOWED_EXTENSIONS.contains(extension)) { throw new InvalidAttributesException("Not supported file extension: '" + extension + "'"); } - var app = IApplicationRepository.instance().findByName(managerBean.getSelectedApplicationName()).orElse(null); + var app = IApplicationRepository.instance().findByName(managerBean.getSelectedApplicationName()).stream() + .filter(a -> a.getReleaseState() == ReleaseState.RELEASED) + .findAny() + .orElse(null); try (var in = uploadFile.getInputStream()) { var newResourceName = new BrandingIO(app).setImage(getCurrentRes(), extension, in); message = new FacesMessage(FacesMessage.SEVERITY_INFO, Ivy.cm().co("/common/Success"), diff --git a/engine-cockpit/src/ch/ivyteam/enginecockpit/deployment/DeployOptions.java b/engine-cockpit/src/ch/ivyteam/enginecockpit/deployment/DeployOptions.java index d3280aa1f..ecfa74044 100644 --- a/engine-cockpit/src/ch/ivyteam/enginecockpit/deployment/DeployOptions.java +++ b/engine-cockpit/src/ch/ivyteam/enginecockpit/deployment/DeployOptions.java @@ -4,7 +4,6 @@ import java.util.List; import ch.ivyteam.ivy.deployment.DeploymentOptions.TargetState; -import ch.ivyteam.ivy.deployment.DeploymentOptions.TargetVersion; import ch.ivyteam.ivy.deployment.DeploymentOptions.TestUser; public class DeployOptions { @@ -12,9 +11,6 @@ public class DeployOptions { private TestUser deployTestUsers = TestUser.AUTO; private List deployTestUsersValues = Arrays.asList(TestUser.values()); - private TargetVersion version = TargetVersion.AUTO; - private List versions = Arrays.asList(TargetVersion.values()); - private TargetState state = TargetState.ACTIVE_AND_RELEASED; private List states = Arrays.asList(TargetState.values()); @@ -26,18 +22,6 @@ public List getDeployTestUsersValues() { return deployTestUsersValues; } - public TargetVersion getVersion() { - return version; - } - - public Boolean isRangeVersion() { - return TargetVersion.RANGE.equals(version); - } - - public List getVersions() { - return versions; - } - public TargetState getState() { return state; } @@ -54,14 +38,6 @@ public void setDeployTestUsersValues(List deployTestUsersValues) { this.deployTestUsersValues = deployTestUsersValues; } - public void setVersion(TargetVersion version) { - this.version = version; - } - - public void setVersions(List versions) { - this.versions = versions; - } - public void setState(TargetState state) { this.state = state; } diff --git a/engine-cockpit/src/ch/ivyteam/enginecockpit/deployment/DeploymentBean.java b/engine-cockpit/src/ch/ivyteam/enginecockpit/deployment/DeploymentBean.java index 101d2b765..d4fd1e20e 100644 --- a/engine-cockpit/src/ch/ivyteam/enginecockpit/deployment/DeploymentBean.java +++ b/engine-cockpit/src/ch/ivyteam/enginecockpit/deployment/DeploymentBean.java @@ -104,7 +104,6 @@ private void deploy() { var deploymentOptions = DeploymentOptions.create() .deployTestUsers(deployOptions.getDeployTestUsers()) - .targetVersion(deployOptions.getVersion()) .targetState(deployOptions.getState()) .toOptions(); diff --git a/engine-cockpit/src/ch/ivyteam/enginecockpit/services/DatabaseDetailBean.java b/engine-cockpit/src/ch/ivyteam/enginecockpit/services/DatabaseDetailBean.java index e9cd22ff7..ca732d2ee 100644 --- a/engine-cockpit/src/ch/ivyteam/enginecockpit/services/DatabaseDetailBean.java +++ b/engine-cockpit/src/ch/ivyteam/enginecockpit/services/DatabaseDetailBean.java @@ -30,6 +30,7 @@ import ch.ivyteam.enginecockpit.system.SystemDatabaseBean; import ch.ivyteam.enginecockpit.util.UrlUtil; import ch.ivyteam.ivy.application.IApplication; +import ch.ivyteam.ivy.application.ReleaseState; import ch.ivyteam.ivy.application.app.IApplicationRepository; import ch.ivyteam.ivy.db.Database.Builder; import ch.ivyteam.ivy.db.Databases; @@ -75,7 +76,10 @@ public void setName(String databaseName) { } public void onload() { - app = IApplicationRepository.instance().findByName(appName).orElse(null); + app = IApplicationRepository.instance().findByName(appName).stream() + .filter(a -> a.getReleaseState() == ReleaseState.RELEASED) + .findAny() + .orElse(null); if (app == null) { ResponseHelper.notFound(Ivy.cm().content("/common/NotFoundApplication").replace("application", appName).get()); return; diff --git a/engine-cockpit/src/ch/ivyteam/enginecockpit/services/WebserviceDetailBean.java b/engine-cockpit/src/ch/ivyteam/enginecockpit/services/WebserviceDetailBean.java index 0acfb99ba..b81085b30 100644 --- a/engine-cockpit/src/ch/ivyteam/enginecockpit/services/WebserviceDetailBean.java +++ b/engine-cockpit/src/ch/ivyteam/enginecockpit/services/WebserviceDetailBean.java @@ -30,6 +30,7 @@ import ch.ivyteam.enginecockpit.services.model.Webservice.PortType; import ch.ivyteam.enginecockpit.util.UrlUtil; import ch.ivyteam.ivy.application.IApplication; +import ch.ivyteam.ivy.application.ReleaseState; import ch.ivyteam.ivy.application.app.IApplicationRepository; import ch.ivyteam.ivy.environment.Ivy; import ch.ivyteam.ivy.ssl.restricted.SslConnectionTesterClient; @@ -79,7 +80,10 @@ public void setId(String webserviceId) { } public void onload() { - app = IApplicationRepository.instance().findByName(appName).orElse(null); + app = IApplicationRepository.instance().findByName(appName).stream() + .filter(a -> a.getReleaseState() == ReleaseState.RELEASED) + .findAny() + .orElse(null); if (app == null) { ResponseHelper.notFound(Ivy.cm().content("/common/NotFoundApplication").replace("application", appName).get()); return; diff --git a/engine-cockpit/src/ch/ivyteam/enginecockpit/services/notification/NotificationDto.java b/engine-cockpit/src/ch/ivyteam/enginecockpit/services/notification/NotificationDto.java index 016924c2f..4c4c456ac 100644 --- a/engine-cockpit/src/ch/ivyteam/enginecockpit/services/notification/NotificationDto.java +++ b/engine-cockpit/src/ch/ivyteam/enginecockpit/services/notification/NotificationDto.java @@ -51,7 +51,7 @@ public boolean isReceiversConcat() { public String getPmv() { return notification.pmv() - .map(IProcessModelVersion::getVersionName) + .map(IProcessModelVersion::getName) .orElse(""); } diff --git a/engine-cockpit/src/ch/ivyteam/enginecockpit/services/rest/RestClientDetailBean.java b/engine-cockpit/src/ch/ivyteam/enginecockpit/services/rest/RestClientDetailBean.java index 3e6359615..c6df4a360 100644 --- a/engine-cockpit/src/ch/ivyteam/enginecockpit/services/rest/RestClientDetailBean.java +++ b/engine-cockpit/src/ch/ivyteam/enginecockpit/services/rest/RestClientDetailBean.java @@ -23,6 +23,7 @@ import ch.ivyteam.enginecockpit.services.model.RestClientDto; import ch.ivyteam.enginecockpit.util.UrlUtil; import ch.ivyteam.ivy.application.IApplication; +import ch.ivyteam.ivy.application.ReleaseState; import ch.ivyteam.ivy.application.app.IApplicationRepository; import ch.ivyteam.ivy.environment.Ivy; import ch.ivyteam.ivy.rest.client.RestClient; @@ -71,7 +72,10 @@ public void setName(String restClientName) { } public void onload() { - app = IApplicationRepository.instance().findByName(appName).orElse(null); + app = IApplicationRepository.instance().findByName(appName).stream() + .filter(a -> a.getReleaseState() == ReleaseState.RELEASED) + .findAny() + .orElse(null); if (app == null) { ResponseHelper.notFound(Ivy.cm().content("/common/NotFoundApplication").replace("application", appName).get()); return; diff --git a/engine-cockpit/src/ch/ivyteam/enginecockpit/services/rest/RestTestRunner.java b/engine-cockpit/src/ch/ivyteam/enginecockpit/services/rest/RestTestRunner.java index 49ffa055b..d4752894b 100644 --- a/engine-cockpit/src/ch/ivyteam/enginecockpit/services/rest/RestTestRunner.java +++ b/engine-cockpit/src/ch/ivyteam/enginecockpit/services/rest/RestTestRunner.java @@ -12,7 +12,6 @@ import ch.ivyteam.enginecockpit.services.model.ConnectionTestResult; import ch.ivyteam.enginecockpit.services.model.ConnectionTestResult.TestResult; import ch.ivyteam.ivy.application.IApplication; -import ch.ivyteam.ivy.application.IProcessModel; import ch.ivyteam.ivy.application.IProcessModelVersion; import ch.ivyteam.ivy.application.restricted.di.ApplicationContext; import ch.ivyteam.ivy.application.restricted.di.ProcessModelVersionContext; @@ -51,8 +50,7 @@ private ConnectionTestResult testInAppContext() { private Optional findClientPmv() { var restManager = ch.ivyteam.ivy.rest.client.config.restricted.IRestClientsManager.instance(); - return app.getProcessModels().stream() - .map(IProcessModel::getReleasedProcessModelVersion) + return app.getProcessModelVersions() .filter(pmv -> restManager.getProjectDataModelFor(pmv).findRestClient(uiClient.uniqueId()).isPresent()) .findAny(); } diff --git a/engine-cockpit/src/ch/ivyteam/enginecockpit/system/ManagerBean.java b/engine-cockpit/src/ch/ivyteam/enginecockpit/system/ManagerBean.java index f3be56096..7b6120b5d 100644 --- a/engine-cockpit/src/ch/ivyteam/enginecockpit/system/ManagerBean.java +++ b/engine-cockpit/src/ch/ivyteam/enginecockpit/system/ManagerBean.java @@ -163,7 +163,6 @@ public IApplication getIApplication(long id) { public List getIApplications() { return apps.all().stream() - .filter(app -> !app.isSystem()) .sorted(Comparator.comparing(IApplication::getName, String.CASE_INSENSITIVE_ORDER)) .collect(Collectors.toList()); } diff --git a/engine-cockpit/webContent/includes/dialogs/deployment.xhtml b/engine-cockpit/webContent/includes/dialogs/deployment.xhtml index dbc92a975..7b9fe355f 100644 --- a/engine-cockpit/webContent/includes/dialogs/deployment.xhtml +++ b/engine-cockpit/webContent/includes/dialogs/deployment.xhtml @@ -45,17 +45,6 @@ - - - - - - - - - diff --git a/engine-cockpit/webContent/view/application-detail.xhtml b/engine-cockpit/webContent/view/application-detail.xhtml index 64d62e09a..f2e0996a7 100644 --- a/engine-cockpit/webContent/view/application-detail.xhtml +++ b/engine-cockpit/webContent/view/application-detail.xhtml @@ -50,9 +50,6 @@
-
- -
diff --git a/engine-cockpit/webContent/view/applications.xhtml b/engine-cockpit/webContent/view/applications.xhtml index 17b682928..e1de14b00 100644 --- a/engine-cockpit/webContent/view/applications.xhtml +++ b/engine-cockpit/webContent/view/applications.xhtml @@ -37,6 +37,7 @@ actionListener="#{applicationBean.collapseAllNodes}" update="tree" title="#{ivy.cm.co('/common/CollapseAll')}" styleClass="ml-1 flex-shrink-0 ui-button-secondary rounded-button ui-button-outlined" />
+ @@ -53,33 +54,26 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + - + - - + + + + + + diff --git a/engine-cockpit/webContent/view/pmv-detail.xhtml b/engine-cockpit/webContent/view/pmv-detail.xhtml index 55648a707..2a48dc5f4 100644 --- a/engine-cockpit/webContent/view/pmv-detail.xhtml +++ b/engine-cockpit/webContent/view/pmv-detail.xhtml @@ -6,8 +6,8 @@ - - + + @@ -28,7 +28,7 @@
-
+
@@ -42,9 +42,7 @@ - - - + @@ -53,60 +51,6 @@
-
-
-
-
- -
#{ivy.cm.co('/common/Activity')}
-
-
- - - - - - #{pmvDetailBean.pmv.state.errorMessage} - - - - - - -
-
- -
-
-
-
- -
#{ivy.cm.co('/pmvDetail/SpecifiedRequiredProjects')}
-
-
- - - - - - - - - - - - - - -
-
-
@@ -124,14 +68,10 @@ - - - +
@@ -162,14 +103,10 @@ - - - +
diff --git a/image-validation/pom.xml b/image-validation/pom.xml index 5dd6fee2e..5c64a9d0c 100644 --- a/image-validation/pom.xml +++ b/image-validation/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - ch.ivyteam.enginecockpit + ch.ivyteam.kingfisher.enginecockpit engine-cockpit-config 14.0.0-SNAPSHOT ../maven-config diff --git a/maven-config/pom.xml b/maven-config/pom.xml index 1d450a206..67fda7d4a 100644 --- a/maven-config/pom.xml +++ b/maven-config/pom.xml @@ -1,6 +1,6 @@ 4.0.0 - ch.ivyteam.enginecockpit + ch.ivyteam.kingfisher.enginecockpit engine-cockpit-config 14.0.0-SNAPSHOT pom @@ -8,7 +8,7 @@ com.axonivy.ivy.api ivy-project-parent - 14.0.0-SNAPSHOT + 14.0.999-SNAPSHOT diff --git a/pom.xml b/pom.xml index 0f45b38f9..dbb44f28f 100644 --- a/pom.xml +++ b/pom.xml @@ -1,7 +1,7 @@ 4.0.0 - ch.ivyteam.enginecockpit + ch.ivyteam.kingfisher.enginecockpit engine-cockpit-config 14.0.0-SNAPSHOT maven-config