Skip to content
Snippets Groups Projects
Commit 3a51d148 authored by Dott. Federico Volpini's avatar Dott. Federico Volpini
Browse files

Bug #322 fixed

parent b311d400
No related branches found
No related tags found
No related merge requests found
......@@ -11,10 +11,11 @@ public interface Page {
public final String PAGE4 = "Application requirements";
public final String PAGE5 = "Application management";
public final String PAGE_LICENSE = "SLA and licenses";
public final String PAGE_PART_DU = "Application Part (Deployment Unit - 1/4): ";
public final String PAGE_PART_EU = "Application Part (Execution Unit - 2/4): ";
public final String PAGE_PART_PC = "Application Part (Part Capabilities - 3/4): ";
public final String PAGE_PART_PR = "Application Part (Part Requirements - 4/4): ";
public final String PAGE_PART_BUNDLE = "Application Part (Bundle Id and version - 1/5): ";
public final String PAGE_PART_DU = "Application Part (Deployment Unit - 2/5): ";
public final String PAGE_PART_EU = "Application Part (Execution Unit - 3/5): ";
public final String PAGE_PART_PC = "Application Part (Part Capabilities - 4/5): ";
public final String PAGE_PART_PR = "Application Part (Part Requirements - 5/5): ";
public final String PAGE_END = "universAAL Application Packager";
public final String KARAF_NAMESPACE = "krf";
......
......@@ -63,7 +63,7 @@ import org.universaal.tools.packaging.tool.zip.UAPP;
public class GUI extends WizardMod {
public MPA mpa;
private PageImpl p0, p1, p2, pl, p3, p4, p5, ppDU, ppEU, ppPC, ppPR, p, p_end;
private PageImpl p0, p1, p2, pl, p3, p4, p5, ppB, ppDU, ppEU, ppPC, ppPR, p, p_end;
private List<IProject> parts;
private static GUI instance;
......@@ -90,6 +90,7 @@ public class GUI extends WizardMod {
public void addPages() {
if(this.parts != null){
p0 = new StartPage(Page.PAGE_START);
addPage(p0);
p0.setMPA(mpa);
......@@ -117,7 +118,7 @@ public class GUI extends WizardMod {
p5 = new Page5(Page.PAGE5);
addPage(p5);
p5.setMPA(mpa);
if(parts.size() > 1)
mpa.getAAL_UAPP().getApplication().setMultipart(true);
else
......@@ -129,6 +130,11 @@ public class GUI extends WizardMod {
mpa.getAAL_UAPP().getAppParts().add(new Part("part"+(i+1)));
ppB = new PagePartBundle(Page.PAGE_PART_BUNDLE+partName, i); //deployment units
addPage(ppB);
ppB.setMPA(mpa);
ppB.setArtifact(parts.get(i));
ppDU = new PagePartDU(Page.PAGE_PART_DU+partName, i); //deployment units
addPage(ppDU);
ppDU.setMPA(mpa);
......
package org.universaal.tools.packaging.tool.gui;
import org.eclipse.core.resources.IProject;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.universaal.tools.packaging.tool.impl.PageImpl;
import org.universaal.tools.packaging.tool.impl.PageImpl.FullListener;
import org.universaal.tools.packaging.tool.validators.AlphabeticV;
import org.universaal.tools.packaging.tool.validators.IntegerV;
public class PagePartBundle extends PageImpl {
//private IProject artifact;
//private POMParser p;
private int partNumber;
private Text bundleId, bundleVersion;
protected PagePartBundle(String pageName, int pn) {
super(pageName, "Part "+(pn+1)+"/"+GUI.getInstance().getPartsCount()+
" - Specify Bundle Id and Version");
this.partNumber = pn;
}
public void createControl(final Composite parent) {
container = new Composite(parent, SWT.NULL);
setControl(container);
GridLayout layout = new GridLayout();
container.setLayout(layout);
layout.numColumns = 2;
gd = new GridData(GridData.FILL_HORIZONTAL);
Label l1 = new Label(container, SWT.NULL);
bundleId = new Text(container, SWT.BORDER | SWT.SINGLE);
mandatory.add(bundleId);
l1.setText("* Bundle Id");
bundleId.addVerifyListener(new AlphabeticV());
bundleId.setLayoutData(gd);
Label l2 = new Label(container, SWT.NULL);
bundleVersion = new Text(container, SWT.BORDER | SWT.SINGLE);
mandatory.add(bundleVersion);
l2.setText("* Bundle Version");
bundleVersion.addVerifyListener(new AlphabeticV());
bundleVersion.setLayoutData(gd);
bundleId.addKeyListener(new FullListener());
bundleVersion.addKeyListener(new FullListener());
}
@Override
public boolean nextPressed() {
try{
app.getAppParts().get(partNumber).setPartBundle(bundleId.getText(),bundleVersion.getText());
} catch(Exception ex) {
ex.printStackTrace();
}
return true;
}
}
\ No newline at end of file
......@@ -36,6 +36,8 @@ import java.util.Properties;
public class Part implements Serializable {
private String id; // unique
private String bundleId;
private String bundleVersion;
private Properties partCapabilities;
private List<Requirement> partRequirements;
private List<DeploymentUnit> deploymentUnits;
......@@ -80,6 +82,12 @@ public class Part implements Serializable {
public void setPartCapabilities(Properties partCapabilities) {
this.partCapabilities = partCapabilities;
}
public void setPartBundle(String id, String version) {
this.bundleId = id;
this.bundleVersion = version;
}
public void setCapability(String name, String value){
partCapabilities.put(name, value);
}
......@@ -103,7 +111,10 @@ public class Part implements Serializable {
String r = "";
r = r.concat("<part partId='"+id+"'>");
r = r.concat("<bundleId>"+this.bundleId+"</bundleId>");
r = r.concat("<bundleVersion>"+this.bundleVersion+"</bundleVersion>");
r = r.concat("<partCapabilities>");
try{
Enumeration<Object> cs = partCapabilities.keys();
......
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