-
Notifications
You must be signed in to change notification settings - Fork 10
[URMF] VersionManager
[VersionManager.java] *- [Version.java]
λ²μ μ ꡬμ±μ major number μ minor number λ‘ κ΅¬μ±λκ³ , κ°κΈ° majorVersionUp() λ©μλμ minorVersionUp() λ©μλμ μνμ¬ 1μ© μ¦κ°νλ€.
major.minor
private void versionUp(Version lastVersion) throws Exception {
//copy dev to new version.
IContainer dev = new ContainerResource();
dev.setPath(rootPath);
IContainer newVersion = new ContainerResource();
newVersion.setPath(versionDirectoryOf(lastVersion)); // μ λ²μ μ λλ ν 리 μμΉ
resourceManager.getStorage().copy(dev, newVersion.getPath());
if(isMakeThisVersionAsProduction()){
MetaworksRemoteService.autowire(lastVersion);
lastVersion.makeAsProduction(this);
}
MetaworksRemoteService.wrapReturn(new Label("<div class='alert alert-success' role='alert'>Version has been set as " + lastVersion.getMajor() + "." + lastVersion.getMinor() + "</div>"));
}
resourceManager.getStorage().copy(dev, newVersion.getPath()) μ μνμ¬ νμ¬ μμ μ€μΈ ν΄λμ 볡μ¬λ³Έμ λ§λ€μ΄ μ λ²μ μ ν΄λλ‘ λ³΅μ νλ€. μ λ²μ μ ν΄λ μμΉλ versionDirectoryOf(lastVersion) λ©μλμ μνμ¬ κ΅¬ν΄μ§λ©° μλμ κ°μ΄ ꡬμ±λλ€:
protected String versionDirectoryOf(Version version) {
return appName + β_versions/" + version.getMajor() + "." + version.getMinor();
}
uEngine BPMμμ appName μ βcodiβ μ΄λ€. λ°λΌμ, μλμ κ°μ΄ νμ¬ ν΄λμμμ μ μ νμΌμ μμΉμ νΉμ λ²μ μ νμΌμμΉκ° λμλλ€:
codi/package/Model.process <β νμ¬ νΈμ§μ€μΈ μμΉ
codi_versions/1.1/package/Model.process <β 1.1 λ²μ μ μμΉ
λ²μ μ versionUp λ©μλκ° νΈμΆλ λλ§λ€ (VersionManager UI μμ major version up, minor version up λ²νΌμ ν΄λ¦ν λλ§λ€) μμ±λλ€. μμ±λ λ²μ μ€μμ μ΄λ€ λ²μ μ νλ‘λμ λ²μ μΌλ‘ μ§μ ν κ²μΈκ°λ νλ‘λμ μΈν μ μν΄μ μ§μ λλ€.
νλ‘λμ λ²μ μ λν μ 보λ Version.java λ₯Ό serialize ν xmlμ ν΄λΉ appFolder (uEngine BPM μ κ²½μ°λ βcodiβ) μ΄νμ μ μ₯νλ€. μ΄ νμΌμ μ½μ΄λ€μ΄λ©΄ νλ‘λμ μ 보λ₯Ό μ»μ΄λΌ μ μλ€.
protected DefaultResource getProductionVersionInfo() {
DefaultResource productionInfoXML = new DefaultResource();
productionInfoXML.setPath(getRootPath() + ".version.info.xml");
return productionInfoXML;
}
@ServiceMethod(callByContent = true, target = ServiceMethod.TARGET_SELF)
public void makeAsProduction(@AutowiredFromClient VersionManager versionManager) throws Exception {
DefaultResource productionInfoXML = versionManager.getProductionVersionInfo();
ResourceManager resourceManager = MetaworksRemoteService.getComponent(ResourceManager.class);
resourceManager.getStorage().save(productionInfoXML, this);
setProduction(true);
}
package λ³λ‘ λ³λ version μ κ΄λ¦¬ν΄μΌ νλ κ²½μ° λ€μκ³Ό κ°μ ꡬ쑰λ₯Ό μκ°ν μ μλ€.
codi/package/Model.process <β νμ¬ νΈμ§μ€μΈ μμΉ
codi_versions/package/1.1/Model.process <β package μ 1.1 λ²μ μ μμΉ
μμ²λλ resource path μ λν λ²μ λ³ μ€μ μμΉλ₯Ό 리ν΄νλ λ‘μ§μ μλμ κ°μ΄ λ³νλλ©΄ λλ€.
package org.uengine.modeling.resource;
public class PackageVersionManager extends VersionManager{
@Override
protected String versionDirectoryOf() {
String[] pathElements = getRootPath().split("/");
String appName = pathElements[0];
String packageName = pathElements[1];
String versionPath = appName + VERSION_DIR + "/" + packageName;
return versionPath;
}
}