ENTAXY-374 release 1.8.2
This commit is contained in:
@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>ru.entaxy.esb.system</groupId>
|
||||
<artifactId>management</artifactId>
|
||||
<version>1.8.1</version>
|
||||
<version>1.8.2</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -31,9 +31,12 @@ import ru.entaxy.esb.system.management.bundle.jpa.dto.BundleStatus;
|
||||
import ru.entaxy.esb.system.management.bundle.jpa.entity.BundleType;
|
||||
import ru.entaxy.platform.base.support.CommonUtils;
|
||||
import ru.entaxy.platform.core.artifact.Artifact;
|
||||
import ru.entaxy.platform.core.artifact.ArtifactManifest;
|
||||
import ru.entaxy.platform.core.artifact.Artifacts;
|
||||
import ru.entaxy.platform.core.artifact.CapabilityDescriptor;
|
||||
import ru.entaxy.platform.core.artifact.DeployedArtifact;
|
||||
import ru.entaxy.platform.core.artifact.Manifested;
|
||||
import ru.entaxy.platform.core.artifact.capabilities.CapabilityDescriptor;
|
||||
import ru.entaxy.platform.core.artifact.capabilities.ManifestCapabilityHelper;
|
||||
import ru.entaxy.platform.core.artifact.legacy.BundleController;
|
||||
import ru.entaxy.platform.core.artifact.service.ArtifactService;
|
||||
import ru.entaxy.platform.core.blueprint.generator.Blueprint;
|
||||
@ -67,9 +70,10 @@ public class BundleManagerImpl implements BundleManager {
|
||||
|
||||
private BundleDto doInstallBundle(String bundleName, String templateName, String templateFileName, String bundleType, String bundleVersion,
|
||||
URL templateUrl, Map<String, String> param, boolean start) throws Exception {
|
||||
BundleDto bundle = new BundleDto(templateName + "-" + bundleName, BundleType.getValueOf(bundleType.toUpperCase()));
|
||||
BundleDto bundle = new BundleDto(templateName + "." + bundleName, BundleType.getValueOf(bundleType.toUpperCase()));
|
||||
Blueprint blueprint = blueprintGenerator.createBlueprint(templateUrl, templateFileName, bundleName, param);
|
||||
installAndStartBundle(bundleType, bundleVersion, bundle, blueprint, start);
|
||||
bundle.setBundleName(getFullBundleNameByNameAndType(templateName + "." + bundleName, bundleType));
|
||||
return bundle;
|
||||
}
|
||||
|
||||
@ -190,22 +194,31 @@ public class BundleManagerImpl implements BundleManager {
|
||||
|
||||
// TODO remove hardcode after blueprint-generator is removed
|
||||
// and all the operations are switched to artifact-management
|
||||
CapabilityDescriptor descriptor = artifact.provideCapability(artifact.getCoordinates().getGroupId())
|
||||
.attribute("name", bundle.getBundleName().replace(bundleType + "-", ""))
|
||||
.attribute("bundleName", bundle.getBundleName());
|
||||
if (blueprint.getProperties().containsKey("systemName")) {
|
||||
Object val = blueprint.getProperties().get("systemName");
|
||||
if (val != null)
|
||||
descriptor.attribute("system", val.toString());
|
||||
}
|
||||
if (blueprint.getProperties().containsKey("template.id")) {
|
||||
Object val = blueprint.getProperties().get("template.id");
|
||||
Object val2 = blueprint.getProperties().get("template.name");
|
||||
if (val != null)
|
||||
descriptor.attribute("templateId", val.toString());
|
||||
else
|
||||
descriptor.attribute("templateId", val2.toString());
|
||||
descriptor.attribute("templateName", val2.toString());
|
||||
if (artifact.isManifested()) {
|
||||
|
||||
ArtifactManifest artifactManifest = ((Manifested)artifact).getManifest();
|
||||
ManifestCapabilityHelper capabilityHelper = new ManifestCapabilityHelper(artifactManifest);
|
||||
|
||||
CapabilityDescriptor descriptor = capabilityHelper.provideCapability(artifact.getCoordinates().getGroupId())
|
||||
.attribute("name", bundle.getBundleName().replace(bundleType + "-", ""))
|
||||
.attribute("bundleName", bundle.getBundleName());
|
||||
|
||||
if (blueprint.getProperties().containsKey("systemName")) {
|
||||
Object val = blueprint.getProperties().get("systemName");
|
||||
if (val != null)
|
||||
descriptor.attribute("system", val.toString());
|
||||
}
|
||||
if (blueprint.getProperties().containsKey("template.id")) {
|
||||
Object val = blueprint.getProperties().get("template.id");
|
||||
Object val2 = blueprint.getProperties().get("template.name");
|
||||
if (val != null)
|
||||
descriptor.attribute("templateId", val.toString());
|
||||
else
|
||||
descriptor.attribute("templateId", val2.toString());
|
||||
descriptor.attribute("templateName", val2.toString());
|
||||
}
|
||||
|
||||
capabilityHelper.save();
|
||||
}
|
||||
|
||||
DeployedArtifact deployedArtifact = artifactService.deployShared(artifact);
|
||||
@ -235,7 +248,7 @@ public class BundleManagerImpl implements BundleManager {
|
||||
}
|
||||
|
||||
protected String getFullBundleNameByNameAndType(String bundleName, String bundleType) {
|
||||
return Artifact.DEFAULT_RUNTIME_GROUP_ID + "." + bundleType + "." + bundleType + "-" + bundleName;
|
||||
return Artifact.DEFAULT_RUNTIME_GROUP_ID + "." + bundleType + "." + bundleName;
|
||||
}
|
||||
|
||||
public void setBundleService(BundleService bundleService) {
|
||||
|
Reference in New Issue
Block a user