vgritsenko 2004/05/28 05:20:20
Modified: src/blocks/forms/java/org/apache/cocoon/forms/flow/javascript
Form.js
src/java/org/apache/cocoon/components/flow/javascript/fom
FOM_Cocoon.java
Log:
CocoonComponentManager was moved, but source was not refactored.
Correcting package name. Forms still do not work - required method
was removed.
Revision Changes Path
1.14 +13 -13
cocoon-2.1/src/blocks/forms/java/org/apache/cocoon/forms/flow/javascript/Form.js
Index: Form.js
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/blocks/forms/java/org/apache/cocoon/forms/flow/javascript/Form.js,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- Form.js 18 May 2004 15:32:27 -0000 1.13
+++ Form.js 28 May 2004 12:20:20 -0000 1.14
@@ -1,12 +1,12 @@
/*
* Copyright 1999-2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -40,7 +40,7 @@
this.eventHandler = null;
// TODO : do we keep this ?
this.formWidget = new Widget(this.form);
-
+
} finally {
cocoon.releaseComponent(formMgr);
if (src != null) resolver.release(src);
@@ -60,7 +60,7 @@
if (name != undefined) {
throw "getWidget(id) has been deprecated.\n" +
"Consider using getChild(id) or lookupWidget(path) instead."
- }
+ }
return this.form;
}
@@ -100,7 +100,7 @@
if (this.locale == null)
this.locale = java.util.Locale.getDefault();
bizData["locale"] = this.locale;
-
+
// Keep the first continuation that will be created as the result of
this function
var result = null;
@@ -115,30 +115,30 @@
do {
var k = cocoon.sendPageAndWait(uri, bizData);
if (result == null) result = k;
-
+
var formContext = new
Packages.org.apache.cocoon.forms.FormContext(cocoon.request, this.locale);
// Prematurely add the bizData as in the object model so that event
listeners can use it
// (the same is done by cocoon.sendPage())
// FIXME: hack because object model isn't available in flowscript.
- var objectModel =
org.apache.cocoon.components.CocoonComponentManager.getCurrentEnvironment().getObjectModel();
+ var objectModel =
org.apache.cocoon.components.container.CocoonComponentManager.getCurrentEnvironment().getObjectModel();
org.apache.cocoon.components.flow.FlowHelper.setContextObject(objectModel,
bizData);
finished = this.form.process(formContext);
if (finished) {
this.isValid = this.form.isValid();
}
-
+
// FIXME: Theoretically, we should clone the form widget (this.form)
to ensure it keeps its
// value with the continuation. We don't do it since there should me
not much pratical consequences
// except a sudden change of repeaters whose size changed from a
continuation to another.
-
+
} while(!finished);
var widget = this.form.getSubmitWidget();
// Can be null on "normal" submit
- this.submitId = widget == null ? null : widget.getId();
-
+ this.submitId = widget == null ? null : widget.getId();
+
return result;
}
1.36 +7 -8
cocoon-2.1/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_Cocoon.java
Index: FOM_Cocoon.java
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_Cocoon.java,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- FOM_Cocoon.java 7 May 2004 21:13:50 -0000 1.35
+++ FOM_Cocoon.java 28 May 2004 12:20:20 -0000 1.36
@@ -231,7 +231,7 @@
void popCallContext() {
// Clear the scope attribute
- FOM_JavaScriptFlowHelper.setFOM_FlowScope(this.getObjectModel(),
null);
+ FOM_JavaScriptFlowHelper.setFOM_FlowScope(getObjectModel(), null);
this.currentCall = this.currentCall.caller;
// reset current page locals
@@ -1278,7 +1278,6 @@
public InputStream getResourceAsStream(String path) {
return context.getResourceAsStream(path);
}
-
}
public static class FOM_Log extends ScriptableObject {
@@ -1443,11 +1442,11 @@
return ContextHelper.getObjectModel(currentCall.avalonContext);
}
- /**
- * Get the current Sitemap's component manager
- * @return The component manager
- */
-
+// /**
+// * Get the current Sitemap's component manager
+// * @return The component manager
+// */
+//
// public ComponentManager getComponentManager() {
// return currentCall.componentManager;
// }