Author: shane.bryzak(a)jboss.com
Date: 2009-12-30 18:38:56 -0500 (Wed, 30 Dec 2009)
New Revision: 11895
Modified:
modules/remoting/trunk/src/main/java/org/jboss/seam/remoting/MarshalUtils.java
modules/remoting/trunk/src/main/java/org/jboss/seam/remoting/model/ModelHandler.java
modules/remoting/trunk/src/main/resources/org/jboss/seam/remoting/remote.js
Log:
fixed model apply updates response handling
Modified: modules/remoting/trunk/src/main/java/org/jboss/seam/remoting/MarshalUtils.java
===================================================================
---
modules/remoting/trunk/src/main/java/org/jboss/seam/remoting/MarshalUtils.java 2009-12-30
20:57:38 UTC (rev 11894)
+++
modules/remoting/trunk/src/main/java/org/jboss/seam/remoting/MarshalUtils.java 2009-12-30
23:38:56 UTC (rev 11895)
@@ -18,7 +18,7 @@
private static final byte[] RESULT_TAG_OPEN = "<result>".getBytes();
private static final byte[] RESULT_TAG_CLOSE =
"</result>".getBytes();
- private static final byte[] MODEL_TAG_OPEN_START = "<model
uid=\"".getBytes();
+ private static final byte[] MODEL_TAG_OPEN_START = "<model
id=\"".getBytes();
private static final byte[] MODEL_TAG_OPEN_END = "\">".getBytes();
private static final byte[] MODEL_TAG_CLOSE = "</model>".getBytes();
Modified:
modules/remoting/trunk/src/main/java/org/jboss/seam/remoting/model/ModelHandler.java
===================================================================
---
modules/remoting/trunk/src/main/java/org/jboss/seam/remoting/model/ModelHandler.java 2009-12-30
20:57:38 UTC (rev 11894)
+++
modules/remoting/trunk/src/main/java/org/jboss/seam/remoting/model/ModelHandler.java 2009-12-30
23:38:56 UTC (rev 11895)
@@ -207,7 +207,7 @@
private Model processApplyRequest(Element modelElement)
throws Exception
{
- Model model = registry.getModel(modelElement.attributeValue("uid"));
+ Model model = registry.getModel(modelElement.attributeValue("id"));
model.setAction(null);
CallContext ctx = new CallContext(beanManager);
@@ -258,19 +258,19 @@
{
out.write(ENVELOPE_TAG_OPEN);
+ out.write(HEADER_OPEN);
+ out.write(CONTEXT_TAG_OPEN);
if (ctx.getConversationId() != null)
{
- out.write(HEADER_OPEN);
- out.write(CONTEXT_TAG_OPEN);
out.write(CONVERSATION_ID_TAG_OPEN);
out.write(ctx.getConversationId().getBytes());
out.write(CONVERSATION_ID_TAG_CLOSE);
- out.write(CALL_ID_TAG_OPEN);
- out.write(ctx.getCallId().toString().getBytes());
- out.write(CALL_ID_TAG_CLOSE);
- out.write(CONTEXT_TAG_CLOSE);
- out.write(HEADER_CLOSE);
}
+ out.write(CALL_ID_TAG_OPEN);
+ out.write(ctx.getCallId().toString().getBytes());
+ out.write(CALL_ID_TAG_CLOSE);
+ out.write(CONTEXT_TAG_CLOSE);
+ out.write(HEADER_CLOSE);
out.write(BODY_TAG_OPEN);
Modified: modules/remoting/trunk/src/main/resources/org/jboss/seam/remoting/remote.js
===================================================================
--- modules/remoting/trunk/src/main/resources/org/jboss/seam/remoting/remote.js 2009-12-30
20:57:38 UTC (rev 11894)
+++ modules/remoting/trunk/src/main/resources/org/jboss/seam/remoting/remote.js 2009-12-30
23:38:56 UTC (rev 11895)
@@ -516,7 +516,7 @@
}
}
-Seam.preProcessModelFetchResponse = function(call) {
+Seam.preProcessModelResponse = function(call) {
var cn = Seam.Xml.childNode;
var b = cn(call.response.documentElement, "body");
if (b) {
@@ -525,19 +525,19 @@
var refsNode = cn(m, "refs");
var u = Seam.validateRefs(refsNode);
if (u.length > 0) {
- call.handler = Seam.processModelFetchResponse;
+ call.handler = Seam.processModelResponse;
var c = Seam.createImportBeansCall(u, null, call);
var envelope = Seam.createEnvelope(Seam.createHeader(c.id), c.data);
Seam.pendingCalls.put(c.id, c);
Seam.sendAjaxRequest(envelope, Seam.PATH_EXECUTE, Seam.processResponse, false);
} else {
- Seam.processModelFetchResponse(call);
+ Seam.processModelResponse(call);
}
}
}
}
-Seam.processModelFetchResponse = function(call) {
+Seam.processModelResponse = function(call) {
Seam.pendingCalls.remove(call.callId);
var cn = Seam.Xml.childNode;
var b = cn(call.response.documentElement, "body");
@@ -919,7 +919,7 @@
Seam.Model.prototype.createFetchRequest = function(a) {
var callId = "" + Seam.__callId++;
- var d = "<model operation=\"fetch\" callId=\"" + callId +
"\">";
+ var d = "<model operation=\"fetch\">";
var refs = [];
if (a) {
d += "<action>";
@@ -968,12 +968,12 @@
}
}
d += "</model>";
- return {data:d, id:callId, model:this, handler: Seam.preProcessModelFetchResponse};
+ return {data:d, id:callId, model:this, handler: Seam.preProcessModelResponse};
}
Seam.Model.prototype.processResponse = function(modelNode) {
var refsNode = Seam.Xml.childNode(modelNode, "refs");
- this.id = modelNode.getAttribute("uid");
+ this.id = modelNode.getAttribute("id");
var valueNodes = Seam.Xml.childNodes(modelNode, "value");
this.sourceRefs = Seam.unmarshalRefs(refsNode);
this.workingRefs = Seam.cloneObject(this.sourceRefs);
@@ -997,7 +997,7 @@
Seam.Model.prototype.createApplyRequest = function(a, delta) {
var callId = "" + Seam.__callId++;
- var d = "<model uid=\"" + this.id + "\"
operation=\"apply\">";
+ var d = "<model id=\"" + this.id + "\"
operation=\"apply\">";
var refs = delta.buildRefs();
if (a) {
d += "<action>";
@@ -1048,7 +1048,7 @@
d += "</refs>";
}
d += "</model>";
- return {data:d, id:callId, model:this, handler: null};
+ return {data:d, id:callId, model:this, handler: Seam.preProcessModelResponse};
}
Seam.Model.prototype.getRefId = function(v) {