details: https://code.openbravo.com/erp/devel/pi/rev/ab84b5bf2f33
changeset: 15184:ab84b5bf2f33
user: Adrián Romero <adrianromero <at> openbravo.com>
date: Tue Jan 24 12:03:01 2012 +0100
summary: Improving SimpleCallout. Now it is posible to invoke a SimpleCallout
functionality from another SimpleCallout
diffstat:
src/org/openbravo/erpCommon/ad_callouts/SimpleCallout.java | 22 ++++++++++++-
1 files changed, 19 insertions(+), 3 deletions(-)
diffs (51 lines):
diff -r 575f08555346 -r ab84b5bf2f33
src/org/openbravo/erpCommon/ad_callouts/SimpleCallout.java
--- a/src/org/openbravo/erpCommon/ad_callouts/SimpleCallout.java Tue Jan
24 13:33:58 2012 +0100
+++ b/src/org/openbravo/erpCommon/ad_callouts/SimpleCallout.java Tue Jan
24 12:03:01 2012 +0100
@@ -101,7 +101,7 @@
XmlDocument xmlDocument = xmlEngine.readXmlTemplate(
"org/openbravo/erpCommon/ad_callouts/CallOut").createXmlDocument();
- CalloutInfo info = new CalloutInfo(vars, getSimpleClassName());
+ CalloutInfo info = new CalloutInfo(vars, getSimpleClassName(),
getServletConfig());
execute(info);
@@ -131,13 +131,16 @@
private StringBuilder result;
private int rescounter;
private int selectcounter;
+ private final ServletConfig config;
/**
* Provides the coder friendly methods to retrieve certain environment,
session and servlet call
* variables.
*/
- public VariablesSecureApp vars;
+ public final VariablesSecureApp vars;
- private CalloutInfo(VariablesSecureApp vars, String classname) {
+
+ private CalloutInfo(VariablesSecureApp vars, String classname,
ServletConfig config) {
+ this.config = config;
this.vars = vars;
result = new StringBuilder();
@@ -156,6 +159,19 @@
/**
*
+ * Invokes another SimpleCallout. This method allows to divide callouts
functionality into
+ * several callout classes
+ *
+ * @param callout
+ * SimpleCallout instance to invoke
+ */
+ public void executeCallout(SimpleCallout callout) throws ServletException {
+ callout.init(config);
+ callout.execute(this);
+ }
+
+ /**
+ *
* @return The name of field that triggered the callout.
*/
public String getLastFieldChanged() {
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits