Commit b4fbd3ae authored by Matt Strum's avatar Matt Strum
Browse files

Almost finished support for adding nodes to the flash client, probably...

Almost finished support for adding nodes to the flash client, probably everything on the map is done.
parent df562013
......@@ -41,7 +41,10 @@
[Bindable]
public var manager:ComponentManager;
[Bindable]
public var available:Boolean;
[Bindable]
public var exclusive:Boolean;
[Bindable]
......
......@@ -219,7 +219,7 @@
<mx:VRule height="16"/>
<mx:Label text="Availability" fontWeight="bold"/>
<mx:Image id="imgAvailable"/>
<mx:Button label="Add" click="tryAdd();"/>
<mx:Button label="Add" click="tryAdd();" enabled="{node.available}"/>
</mx:GridItem>
</mx:GridRow>
<mx:GridRow width="100%">
......
......@@ -122,7 +122,7 @@
{
main.pgHandler.CurrentUser.credential = String(response.value);
var cred:XML = new XML(response.value);
main.pgHandler.CurrentUser.uuid = cred.credential.owner_urn;
main.pgHandler.CurrentUser.urn = cred.credential.owner_urn;
postCall();
}
else
......@@ -195,7 +195,7 @@
currentIndex++;
}
if(currentIndex == main.pgHandler.ComponentManagers.length)
if(currentIndex >= main.pgHandler.ComponentManagers.length)
//if(currentIndex == 1)
{
main.chooseCMWindow.refreshList();
......@@ -257,8 +257,18 @@
//var decodedRspec:String = response.value;
currentCm.Rspec = new XML(decodedRspec);
currentIndex++;
currentCm.processRspec(startResourceLookup);
currentIndex++;
currentCm.processRspec(startResourceLookup);
}
else if(code == 1)
{
main.setProgress("Done", Common.failColor);
main.stopWaiting();
currentCm.Message = "Malformed arguments";
currentCm.Status = ComponentManager.FAILED;
currentIndex++;
main.chooseCMWindow.ResetStatus(currentCm);
startResourceLookup();
}
else
{
......@@ -279,7 +289,7 @@
op.reset(Geni.resolve);
op.addField("credential", main.pgHandler.CurrentUser.credential);
//op.addField("uuid", main.pgHandler.CurrentUser.uuid);
op.addField("uuid", main.pgHandler.CurrentUser.uuid);
op.addField("hrn", main.pgHandler.CurrentUser.urn);
op.addField("type", "User");
op.setUrl("https://boss.emulab.net:443/protogeni/xmlrpc");
op.call(completeResolveUser, failure);
......@@ -298,51 +308,6 @@
main.pgHandler.CurrentUser.email = response.value.email;
main.pgHandler.CurrentUser.name = response.value.name;
/*/ HACK ----------------------------
currentCm = main.pgHandler.ComponentManagers[0];
var ba:ByteArray = new DemoSliceEmbeddedXml() as ByteArray;
var demoSlice : Slice = new Slice();
demoSlice.creator = main.pgHandler.CurrentUser;
demoSlice.hrn = "DEMO";
demoSlice.uuid = "DEMO";
demoSlice.urn = "DEMO";
demoSlice.status = Slice.READY;
main.pgHandler.CurrentUser.slices.addItem(demoSlice);
var demoSliver : Sliver = new Sliver(demoSlice);
demoSliver.componentManager = currentCm;
demoSliver.status = Sliver.READY;
demoSliver.rspec = new XML(ba.readUTFBytes(ba.length));
demoSliver.parseRspec();
demoSlice.slivers.addItem(demoSliver);
main.pgHandler.map.drawAll();
return;
// END DEMO ---------------------------- /*/
/* START DEMO
currentSlice = new Slice();
currentSlice.hrn = "gec6";
var ba:ByteArray = new DelegatedCredentialXml() as ByteArray;
currentSlice.credential = ba.readUTFBytes(ba.length);
main.pgHandler.CurrentUser.slices.addItem(currentSlice);
currentCm = main.pgHandler.ComponentManagers[0];
startIndexedCall(startSliceStatus);
return;
//opName = "Acquiring " + (((main.pgHandler.CurrentUser.slices.length - currentIndex) * main.pgHandler.ComponentManagers.length) + (currentSecondaryIndex - main.pgHandler.ComponentManagers.length)) + " more sliver credential(s)";
main.setProgress(opName, Common.waitColor);
main.startWaiting();
main.console.appendText(opName);
op.reset(Geni.getSliver);
op.addField("credential", currentSlice.credential);
op.setExactUrl(currentCm.Url);
op.call(completeGetSliver, failure);
addSend();
return;
END DEMO */
var sliceHrns:Array = response.value.slices;
if(sliceHrns != null && sliceHrns.length > 0) {
for each(var sliceHrn:String in sliceHrns)
......@@ -534,6 +499,10 @@
currentSlice.slivers.addItem(newSliver);
nextTotalCalls++;
}
else if(code == 12)
{
// NO SLICE FOUND HERE
}
else
{
//codeFailure();
......
......@@ -30,6 +30,7 @@
public var email : String;
public var name : String;
public var credential : String;
public var urn : String;
public var slices:ArrayCollection;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment