Skip to content
Snippets Groups Projects
Commit 5907e547 authored by Nicole Merkle's avatar Nicole Merkle
Browse files

No commit message

No commit message
parent b2144ec7
No related branches found
No related tags found
No related merge requests found
...@@ -26,6 +26,7 @@ import org.universAAL.ucc.configuration.view.ConfigurationOverviewWindow; ...@@ -26,6 +26,7 @@ import org.universAAL.ucc.configuration.view.ConfigurationOverviewWindow;
import org.universAAL.ucc.database.aalspace.DataAccess; import org.universAAL.ucc.database.aalspace.DataAccess;
import org.universAAL.ucc.frontend.api.impl.FrontendImpl; import org.universAAL.ucc.frontend.api.impl.FrontendImpl;
import org.universAAL.ucc.model.AALService; import org.universAAL.ucc.model.AALService;
import org.universAAL.ucc.model.UAPP;
import org.universAAL.ucc.model.UAPPPart; import org.universAAL.ucc.model.UAPPPart;
import org.universAAL.ucc.model.UAPPReqAtom; import org.universAAL.ucc.model.UAPPReqAtom;
import org.universAAL.ucc.model.jaxb.EnumObject; import org.universAAL.ucc.model.jaxb.EnumObject;
...@@ -82,27 +83,27 @@ public class DeploymentInfoController implements Button.ClickListener, ...@@ -82,27 +83,27 @@ public class DeploymentInfoController implements Button.ClickListener,
dcvMap = new HashMap<String, DeployConfigView>(); dcvMap = new HashMap<String, DeployConfigView>();
mapLayout = new HashMap<Part, List<PeerCard>>(); mapLayout = new HashMap<Part, List<PeerCard>>();
int i = 0; int i = 0;
for(UAPP ua : aal.getUaapList()) {
for (UAPPPart uapp : aal.getUaapList()) { for (Map.Entry<String, UAPPPart>uapp : ua.getParts().entrySet()) {
i++; i++;
if (i == 1) { if (i == 1) {
selected = uapp.getPart().getPartId(); selected = uapp.getValue().getPart().getPartId();
} }
System.err.println(uapp.getPart().getPartId() + " "+aal.getUaapList().size()); System.err.println(uapp.getValue().getPart().getPartId() + " "+aal.getUaapList().size());
win.getTree().addItem(uapp.getPart().getPartId()); win.getTree().addItem(uapp.getValue().getPart().getPartId());
win.getTree().setChildrenAllowed(uapp.getPart().getPartId(), false); win.getTree().setChildrenAllowed(uapp.getValue().getPart().getPartId(), false);
DeployStrategyView dsv = new DeployStrategyView(aal.getName(), DeployStrategyView dsv = new DeployStrategyView(aal.getName(),
aal.getServiceId(), uapp.getUappLocation()); aal.getServiceId(), uapp.getValue().getUappLocation());
dsv.getOptions().addListener(this); dsv.getOptions().addListener(this);
dsvMap.put(uapp.getPart().getPartId(), dsv); dsvMap.put(uapp.getValue().getPart().getPartId(), dsv);
DeployConfigView dcv = new DeployConfigView(app, DeployConfigView dcv = new DeployConfigView(app,
aal.getServiceId(), uapp.getUappLocation()); aal.getServiceId(), uapp.getValue().getUappLocation());
dcv.getTxt().setValue(uapp.getPart().getPartId()); dcv.getTxt().setValue(uapp.getValue().getPart().getPartId());
dcv.getTxt().setEnabled(false); dcv.getTxt().setEnabled(false);
System.err.println("Befor getValidPeers()"); System.err.println("Befor getValidPeers()");
//Insert valid PeerNodes to dropbox of DeployConfigView //Insert valid PeerNodes to dropbox of DeployConfigView
List<PeerCard> validpeers = getValidPeers(uapp.getReqAtoms(), uapp.getPart().getPartId()); List<PeerCard> validpeers = getValidPeers(uapp.getValue().getReqAtoms(), uapp.getValue().getPart().getPartId());
System.err.println("In validpeers size: "+validpeers.size()); System.err.println("In validpeers size: "+validpeers.size());
for(PeerCard pc : validpeers) { for(PeerCard pc : validpeers) {
if (pc != null) { if (pc != null) {
...@@ -116,16 +117,17 @@ public class DeploymentInfoController implements Button.ClickListener, ...@@ -116,16 +117,17 @@ public class DeploymentInfoController implements Button.ClickListener,
dcv.getSelect().setEnabled(false); dcv.getSelect().setEnabled(false);
dcv.setEnabled(false); dcv.setEnabled(false);
dcvMap.put(uapp.getPart().getPartId(), dcv); dcvMap.put(uapp.getValue().getPart().getPartId(), dcv);
} }
win.getTree().select(selected); win.getTree().select(selected);
for (UAPPPart ua : aal.getUaapList()) { for (Map.Entry<String, UAPPPart> u : ua.getParts().entrySet()) {
if (ua.getPart().getPartId().equals(selected)) { if (u.getValue().getPart().getPartId().equals(selected)) {
DeployStrategyView dsv = dsvMap.get(ua.getPart().getPartId()); DeployStrategyView dsv = dsvMap.get(u.getValue().getPart().getPartId());
DeployConfigView dcv = dcvMap.get(ua.getPart().getPartId()); DeployConfigView dcv = dcvMap.get(u.getValue().getPart().getPartId());
actVL = win.createSecondComponent(dsv, dcv); actVL = win.createSecondComponent(dsv, dcv);
} }
} }
}
win.getTree().addListener(this); win.getTree().addListener(this);
win.getOk().addListener((Button.ClickListener) this); win.getOk().addListener((Button.ClickListener) this);
win.getCancel().addListener((Button.ClickListener) this); win.getCancel().addListener((Button.ClickListener) this);
...@@ -137,28 +139,30 @@ public class DeploymentInfoController implements Button.ClickListener, ...@@ -137,28 +139,30 @@ public class DeploymentInfoController implements Button.ClickListener,
Map<Part, List<PeerCard>> config = null; Map<Part, List<PeerCard>> config = null;
// TODO: Deployment // TODO: Deployment
peers = installer.getPeers(); peers = installer.getPeers();
for (UAPPPart uapp : aal.getUaapList()) { for(UAPP up : aal.getUaapList()) {
for (Map.Entry<String, UAPPPart> uapp : up.getParts().entrySet()) {
// Selected part in tree // Selected part in tree
if (uapp.getPart().getPartId().equals(selected)) { if (uapp.getValue().getPart().getPartId().equals(selected)) {
// Default Deployment Strategy // Default Deployment Strategy
if (dsvMap.get(selected).getOptions().getValue().toString() if (dsvMap.get(selected).getOptions().getValue().toString()
.equals(bundle.getString("opt.available.nodes"))) { .equals(bundle.getString("opt.available.nodes"))) {
config = buildDefaultInstallationLayout(uapp); config = buildDefaultInstallationLayout(uapp.getValue());
} }
// User selection strategy // User selection strategy
else if (dsvMap.get(selected).getOptions().getValue() else if (dsvMap.get(selected).getOptions().getValue()
.toString() .toString()
.equals(bundle.getString("opt.selected.nodes"))) { .equals(bundle.getString("opt.selected.nodes"))) {
System.err.println("User Installation for part: "+uapp.getPart().getPartId()); System.err.println("User Installation for part: "+uapp.getValue().getPart().getPartId());
config = buildUserInstallationLayout(uapp); config = buildUserInstallationLayout(uapp.getValue());
if (config.isEmpty()) if (config.isEmpty())
return; return;
} }
} }
} }
}
// Remove installed part view and item from tree // Remove installed part view and item from tree
win.getHp().removeComponent(actVL); win.getHp().removeComponent(actVL);
...@@ -186,11 +190,12 @@ public class DeploymentInfoController implements Button.ClickListener, ...@@ -186,11 +190,12 @@ public class DeploymentInfoController implements Button.ClickListener,
} }
// Deploy to MW // Deploy to MW
for(UAPPPart uapp : aal.getUaapList()) { for(UAPP up : aal.getUaapList()) {
for(Map.Entry<String, UAPPPart> uapp : up.getParts().entrySet()) {
UAPPPackage uapack = null; UAPPPackage uapack = null;
// Get uapp location uri // Get uapp location uri
String appLocation = uapp.getUappLocation(); String appLocation = uapp.getValue().getUappLocation();
System.err.println("THE UAPP_LOCATION: "+uapp.getUappLocation()); System.err.println("THE UAPP_LOCATION: "+uapp.getValue().getUappLocation());
appLocation = FrontendImpl.getUappURI(); appLocation = FrontendImpl.getUappURI();
System.err.println("LOCATION URI: "+appLocation); System.err.println("LOCATION URI: "+appLocation);
File uf = new File(appLocation.trim()); File uf = new File(appLocation.trim());
...@@ -204,19 +209,19 @@ public class DeploymentInfoController implements Button.ClickListener, ...@@ -204,19 +209,19 @@ public class DeploymentInfoController implements Button.ClickListener,
//MW installation //MW installation
uapack = new UAPPPackage(aal.getServiceId(), uapack = new UAPPPackage(aal.getServiceId(),
uapp.getAppId(), uf.toURI(), peerMap); uapp.getValue().getAppId(), uf.toURI(), peerMap);
InstallationResultsDetails res = installer.requestToInstall(uapack); InstallationResultsDetails res = installer.requestToInstall(uapack);
// add app and bundles to "services.xml" file. // add app and bundles to "services.xml" file.
System.err.println("The GLOBAL RESULT: "+res.getGlobalResult().toString()); System.err.println("The GLOBAL RESULT: "+res.getGlobalResult().toString());
System.err.println("Service ID: "+aal.getServiceId()+ " App ID: "+uapp.getAppId()+" Bundle ID: "+uapp.getBundleId()+ "Bundle Version: "+uapp.getBundleId()); System.err.println("Service ID: "+aal.getServiceId()+ " App ID: "+uapp.getValue().getAppId()+" Bundle ID: "+uapp.getValue().getBundleId()+ "Bundle Version: "+uapp.getValue().getBundleId());
if (res.getGlobalResult().toString().equals(InstallationResults.SUCCESS.name())) { if (res.getGlobalResult().toString().equals(InstallationResults.SUCCESS.name())) {
srvRegistration.registerApp(aal.getServiceId(), srvRegistration.registerApp(aal.getServiceId(),
uapp.getAppId()); uapp.getValue().getAppId());
// get bundles for each part in the appId; // get bundles for each part in the appId;
// for each bundle: // for each bundle:
srvRegistration.registerBundle(aal.getServiceId(), srvRegistration.registerBundle(aal.getServiceId(),
uapp.getBundleId(), uapp.getBundleVersion()); uapp.getValue().getBundleId(), uapp.getValue().getBundleVersion());
// TODO: Call configurator to configure the uapps, after // TODO: Call configurator to configure the uapps, after
// uapp is running (for every uapp) // uapp is running (for every uapp)
...@@ -230,10 +235,10 @@ public class DeploymentInfoController implements Button.ClickListener, ...@@ -230,10 +235,10 @@ public class DeploymentInfoController implements Button.ClickListener,
+ reg.getAllConfigDefinitions().size()); + reg.getAllConfigDefinitions().size());
for (Configuration configurator : reg for (Configuration configurator : reg
.getAllConfigDefinitions()) { .getAllConfigDefinitions()) {
System.err.println(uapp.getBundleId()+" + "+configurator.getBundlename()); System.err.println(uapp.getValue().getBundleId()+" + "+configurator.getBundlename());
if (configurator.getBundlename() != null if (configurator.getBundlename() != null
&& configurator.getBundlename().equals( && configurator.getBundlename().equals(
uapp.getBundleId())) { uapp.getValue().getBundleId())) {
conf = configurator; conf = configurator;
} }
} }
...@@ -354,6 +359,7 @@ public class DeploymentInfoController implements Button.ClickListener, ...@@ -354,6 +359,7 @@ public class DeploymentInfoController implements Button.ClickListener,
} }
} }
}
selected = (String) win.getTree().getItemIds().iterator().next(); selected = (String) win.getTree().getItemIds().iterator().next();
win.getTree().select(selected); win.getTree().select(selected);
...@@ -387,16 +393,17 @@ public class DeploymentInfoController implements Button.ClickListener, ...@@ -387,16 +393,17 @@ public class DeploymentInfoController implements Button.ClickListener,
} }
public void valueChange(ValueChangeEvent event) { public void valueChange(ValueChangeEvent event) {
for (UAPPPart ua : aal.getUaapList()) { for(UAPP up : aal.getUaapList()) {
for (Map.Entry<String, UAPPPart> ua : up.getParts().entrySet()) {
System.err.println(aal.getUaapList().size()); System.err.println(aal.getUaapList().size());
if (ua.getPart().getPartId().equals(event.getProperty().toString())) { if (ua.getValue().getPart().getPartId().equals(event.getProperty().toString())) {
selected = event.getProperty().toString(); selected = event.getProperty().toString();
DeployStrategyView dsv = dsvMap.get(ua.getPart().getPartId()); DeployStrategyView dsv = dsvMap.get(ua.getValue().getPart().getPartId());
DeployConfigView dcv = dcvMap.get(ua.getPart().getPartId()); DeployConfigView dcv = dcvMap.get(ua.getValue().getPart().getPartId());
actVL = win.createSecondComponent(dsv, dcv); actVL = win.createSecondComponent(dsv, dcv);
} }
} }
}
if (event.getProperty().getValue().toString() if (event.getProperty().getValue().toString()
.equals(bundle.getString("opt.selected.nodes"))) { .equals(bundle.getString("opt.selected.nodes"))) {
dcvMap.get(selected).setEnabled(true); dcvMap.get(selected).setEnabled(true);
......
...@@ -122,7 +122,7 @@ public class LicenseController implements Property.ValueChangeListener, ...@@ -122,7 +122,7 @@ public class LicenseController implements Property.ValueChangeListener,
if (event.getButton() == win.getGo()) { if (event.getButton() == win.getGo()) {
app.getMainWindow().removeWindow(win); app.getMainWindow().removeWindow(win);
// Test, if uapps size greater than 0 // Test, if uapps size greater than 0
if (appCounter > 0) { if (aal.getUaapList().size() > 0) {
System.err.println("[LicenseController]: appCounter " System.err.println("[LicenseController]: appCounter "
+ appCounter); + appCounter);
// Load Infoview for Deployment of uapps // Load Infoview for Deployment of uapps
......
...@@ -13,13 +13,13 @@ public class AALService { ...@@ -13,13 +13,13 @@ public class AALService {
private String provider = ""; private String provider = "";
private ArrayList<String> tags; private ArrayList<String> tags;
private License licenses; private License licenses;
private ArrayList<UAPPPart> uaapList; private ArrayList<UAPP> uaapList;
private String ontologyUri; private String ontologyUri;
private String iconPath; private String iconPath;
public AALService() { public AALService() {
tags = new ArrayList<String>(); tags = new ArrayList<String>();
uaapList = new ArrayList<UAPPPart>(); uaapList = new ArrayList<UAPP>();
} }
public AALService(String serviceId, int minor, int major, int micro, public AALService(String serviceId, int minor, int major, int micro,
...@@ -37,7 +37,7 @@ public class AALService { ...@@ -37,7 +37,7 @@ public class AALService {
this.ontologyUri = ontologyUri; this.ontologyUri = ontologyUri;
this.iconPath = iconPath; this.iconPath = iconPath;
tags = new ArrayList<String>(); tags = new ArrayList<String>();
uaapList = new ArrayList<UAPPPart>(); uaapList = new ArrayList<UAPP>();
} }
public int getMinor() { public int getMinor() {
...@@ -104,11 +104,11 @@ public class AALService { ...@@ -104,11 +104,11 @@ public class AALService {
this.provider = provider; this.provider = provider;
} }
public ArrayList<UAPPPart> getUaapList() { public ArrayList<UAPP> getUaapList() {
return uaapList; return uaapList;
} }
public void setUaapList(ArrayList<UAPPPart> uaapList) { public void setUaapList(ArrayList<UAPP> uaapList) {
this.uaapList = uaapList; this.uaapList = uaapList;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment