Source Code Cross Referenced for Tree.java in  » Ajax » dwr » jsx3 » gui » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Ajax » dwr » jsx3.gui 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


0001:        /*
0002:         * Copyright 2005 Joe Walker
0003:         *
0004:         * Licensed under the Apache License, Version 2.0 (the "License");
0005:         * you may not use this file except in compliance with the License.
0006:         * You may obtain a copy of the License at
0007:         *
0008:         *     http://www.apache.org/licenses/LICENSE-2.0
0009:         *
0010:         * Unless required by applicable law or agreed to in writing, software
0011:         * distributed under the License is distributed on an "AS IS" BASIS,
0012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0013:         * See the License for the specific language governing permissions and
0014:         * limitations under the License.
0015:         */
0016:        package jsx3.gui;
0017:
0018:        import org.directwebremoting.ScriptBuffer;
0019:        import org.directwebremoting.proxy.ScriptProxy;
0020:        import org.directwebremoting.proxy.io.Context;
0021:
0022:        /**
0023:         * Creates a DHTML-based navigational trees (similar to the tree structure used by Windows Explorer with folders
0024:         and files). This class expects XML source adhering to standards for version 3.0, the Common Data Format.
0025:
0026:         The Tree class by default supports the following CDF attributes:
0027:
0028:
0029:         jsxid
0030:        
0031:
0032:         jsxselected
0033:        
0034:
0035:         jsxstyle
0036:        
0037:
0038:         jsxclass
0039:        
0040:
0041:         jsxopen
0042:        
0043:
0044:         jsximg
0045:        
0046:
0047:         jsxtip
0048:        
0049:
0050:         jsxtext
0051:        
0052:
0053:         jsxunselectable
0054:        
0055:
0056:         This class publishes the following model events:
0057:
0058:
0059:         EXECUTE Ð
0060:
0061:         SELECT (deprecated) Ð
0062:
0063:         MENU Ð
0064:
0065:         TOGGLE Ð
0066:
0067:         CHANGE Ð
0068:
0069:         SPYGLASS Ð
0070:
0071:         ADOPT Ð
0072:
0073:         DROP/CTRL_DROP/BEFORE_DROP/CANCEL_DROP Ð
0074:         * @author Joe Walker [joe at getahead dot org]
0075:         * @author DRAPGEN - Dwr Reverse Ajax Proxy GENerator
0076:         */
0077:        public class Tree extends jsx3.gui.Block {
0078:            /**
0079:             * All reverse ajax proxies need context to work from
0080:             * @param scriptProxy The place we are writing scripts to
0081:             * @param context The script that got us to where we are now
0082:             */
0083:            public Tree(Context context, String extension,
0084:                    ScriptProxy scriptProxy) {
0085:                super (context, extension, scriptProxy);
0086:            }
0087:
0088:            /**
0089:             * instance initializer
0090:             * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0091:             * @param strId this value should correspond to the jsxid for the 'record' node is the selected node for the tree
0092:             */
0093:            public Tree(String strName, String strId) {
0094:                super ((Context) null, (String) null, (ScriptProxy) null);
0095:                ScriptBuffer script = new ScriptBuffer();
0096:                script.appendCall("new Tree", strName, strId);
0097:                setInitScript(script);
0098:            }
0099:
0100:            /**
0101:             * 
0102:             */
0103:            public static final String DEFAULTXSLURL = null;
0104:
0105:            /**
0106:             * JSX/images/tree/minus.gif (default)
0107:             */
0108:            public static final String ICONMINUS = "jsx:///images/tree/minus.gif";
0109:
0110:            /**
0111:             * JSX/images/tree/plus.gif (default)
0112:             */
0113:            public static final String ICONPLUS = "jsx:///images/tree/plus.gif";
0114:
0115:            /**
0116:             * JSX/images/tree/file.gif (default)
0117:             */
0118:            public static final String ICON = "jsx:///images/tree/file.gif";
0119:
0120:            /**
0121:             * JSX/images/tree/select.gif (default)
0122:             */
0123:            public static final String SELECTEDIMAGE = null;
0124:
0125:            /**
0126:             * jsx:///images/matrix/insert_before.gif
0127:             */
0128:            public static final String INSERT_BEFORE_IMG = null;
0129:
0130:            /**
0131:             * jsx:///images/matrix/append.gif
0132:             */
0133:            public static final String APPEND_IMG = null;
0134:
0135:            /**
0136:             * #8CAEDF (default)
0137:             */
0138:            public static final String BORDERCOLOR = "#8CAEDF";
0139:
0140:            /**
0141:             * #ffffff (default)
0142:             */
0143:            public static final String DEFAULTBACKGROUNDCOLOR = "#ffffff";
0144:
0145:            /**
0146:             *   (default)
0147:             */
0148:            public static final String DEFAULTNODATAMSG = " ";
0149:
0150:            /**
0151:             * Enum value for the multiSelect property indicating a multi-select tree.
0152:             */
0153:            public static final int MULTI = 1;
0154:
0155:            /**
0156:             * Enum value for the multiSelect property indicating a single-select tree.
0157:             */
0158:            public static final int SINGLE = 0;
0159:
0160:            /**
0161:             * Returns XSLT for the Tree, prioritizing the acquisition in the following order: 1) check cache; 2) check jsxxsl; 3) check jsxxslurl; 4) use default
0162:             * @return jsx3.xml.Document instance containing valid XSL stylesheet
0163:             */
0164:            @SuppressWarnings("unchecked")
0165:            public jsx3.xml.CdfDocument getXSL() {
0166:                String extension = "getXSL().";
0167:                try {
0168:                    java.lang.reflect.Constructor<jsx3.xml.CdfDocument> ctor = jsx3.xml.CdfDocument.class
0169:                            .getConstructor(Context.class, String.class,
0170:                                    ScriptProxy.class);
0171:                    return ctor.newInstance(this , extension, getScriptProxy());
0172:                } catch (Exception ex) {
0173:                    throw new IllegalArgumentException("Unsupported type: "
0174:                            + jsx3.xml.CdfDocument.class.getName());
0175:                }
0176:            }
0177:
0178:            /**
0179:             * Returns XSLT for the Tree, prioritizing the acquisition in the following order: 1) check cache; 2) check jsxxsl; 3) check jsxxslurl; 4) use default
0180:             * @param returnType The expected return type
0181:             * @return jsx3.xml.Document instance containing valid XSL stylesheet
0182:             */
0183:            @SuppressWarnings("unchecked")
0184:            public <T> T getXSL(Class<T> returnType) {
0185:                String extension = "getXSL().";
0186:                try {
0187:                    java.lang.reflect.Constructor<T> ctor = returnType
0188:                            .getConstructor(Context.class, String.class,
0189:                                    ScriptProxy.class);
0190:                    return ctor.newInstance(this , extension, getScriptProxy());
0191:                } catch (Exception ex) {
0192:                    throw new IllegalArgumentException(
0193:                            "Unsupported return type: " + returnType.getName());
0194:                }
0195:            }
0196:
0197:            /**
0198:             * validates the Tree; if the Tree is set to 'required', a selection must be made to pass validation. Otherwise, a Tree will always pass validation
0199:             * @param callback one of: jsx3.gui.Form.STATEINVALID or jsx3.gui.Form.STATEVALID
0200:             */
0201:            @SuppressWarnings("unchecked")
0202:            public void doValidate(
0203:                    org.directwebremoting.proxy.Callback<Integer> callback) {
0204:                ScriptBuffer script = new ScriptBuffer();
0205:                String callbackPrefix = "";
0206:
0207:                if (callback != null) {
0208:                    callbackPrefix = "var reply = ";
0209:                }
0210:
0211:                script.appendCall(callbackPrefix + getContextPath()
0212:                        + "doValidate");
0213:
0214:                if (callback != null) {
0215:                    String key = org.directwebremoting.extend.CallbackHelper
0216:                            .saveCallback(callback, Integer.class);
0217:                    script
0218:                            .appendCall("__System.activateCallback", key,
0219:                                    "reply");
0220:                }
0221:
0222:                getScriptProxy().addScript(script);
0223:            }
0224:
0225:            /**
0226:             * Selects a record in the tree.  This method updates the model, datamodel, and view.
0227:             * @param strRecordId id for the record that will be the selected item, may be null to deselect all records
0228:             * @param bReveal 
0229:             * @return this object
0230:             */
0231:            public jsx3.gui.Tree setValue(Object[] strRecordId, boolean bReveal) {
0232:                ScriptBuffer script = new ScriptBuffer();
0233:                script.appendCall(getContextPath() + "setValue", strRecordId,
0234:                        bReveal);
0235:                getScriptProxy().addScript(script);
0236:                return this ;
0237:            }
0238:
0239:            /**
0240:             * Selects a record in the tree.  This method updates the model, datamodel, and view.
0241:             * @param strRecordId id for the record that will be the selected item, may be null to deselect all records
0242:             * @param bReveal 
0243:             * @return this object
0244:             */
0245:            public jsx3.gui.Tree setValue(String strRecordId, boolean bReveal) {
0246:                ScriptBuffer script = new ScriptBuffer();
0247:                script.appendCall(getContextPath() + "setValue", strRecordId,
0248:                        bReveal);
0249:                getScriptProxy().addScript(script);
0250:                return this ;
0251:            }
0252:
0253:            /**
0254:             * Reveals a record by toggling parent nodes as necessary and scrolling any containing blocks within the tree.
0255:             * @param strRecordId the id of the record to reveal
0256:             * @param objJSX if provided, reveal the record up to this visual block; useful if the tree is set
0257:            to <code>overflow:expand</code> and the containing block is set to <code>overflow:scroll</code>.
0258:             */
0259:            public void revealRecord(String strRecordId, jsx3.gui.Block objJSX) {
0260:                ScriptBuffer script = new ScriptBuffer();
0261:                script.appendCall(getContextPath() + "revealRecord",
0262:                        strRecordId, objJSX);
0263:                getScriptProxy().addScript(script);
0264:            }
0265:
0266:            /**
0267:             * Returns the jsxid attribute for the selected CDF record/records.
0268:             * @param callback if single-select the jsxid of the selected record or <code>null</code> if none
0269:            selected; if multi-select an array of the selected record ids.
0270:             */
0271:            @SuppressWarnings("unchecked")
0272:            public void getValue(
0273:                    org.directwebremoting.proxy.Callback<String> callback) {
0274:                ScriptBuffer script = new ScriptBuffer();
0275:                String callbackPrefix = "";
0276:
0277:                if (callback != null) {
0278:                    callbackPrefix = "var reply = ";
0279:                }
0280:
0281:                script.appendCall(callbackPrefix + getContextPath()
0282:                        + "getValue");
0283:
0284:                if (callback != null) {
0285:                    String key = org.directwebremoting.extend.CallbackHelper
0286:                            .saveCallback(callback, String.class);
0287:                    script
0288:                            .appendCall("__System.activateCallback", key,
0289:                                    "reply");
0290:                }
0291:
0292:                getScriptProxy().addScript(script);
0293:            }
0294:
0295:            /**
0296:             * Returns whether this tree is multi- (Tree.MULTI) or single-select (Tree.SINGLE).
0297:             */
0298:            @SuppressWarnings("unchecked")
0299:            public void getMultiSelect(
0300:                    org.directwebremoting.proxy.Callback<Integer> callback) {
0301:                ScriptBuffer script = new ScriptBuffer();
0302:                String callbackPrefix = "";
0303:
0304:                if (callback != null) {
0305:                    callbackPrefix = "var reply = ";
0306:                }
0307:
0308:                script.appendCall(callbackPrefix + getContextPath()
0309:                        + "getMultiSelect");
0310:
0311:                if (callback != null) {
0312:                    String key = org.directwebremoting.extend.CallbackHelper
0313:                            .saveCallback(callback, Integer.class);
0314:                    script
0315:                            .appendCall("__System.activateCallback", key,
0316:                                    "reply");
0317:                }
0318:
0319:                getScriptProxy().addScript(script);
0320:            }
0321:
0322:            /**
0323:             * Sets whether this tree is multi- (Tree.MULTI) or single-select (Tree.SINGLE).
0324:             * @param intMulti <code>Tree.MULTI</code> or <code>Tree.SINGLE</code>
0325:             * @return this object
0326:             */
0327:            public jsx3.gui.Tree setMultiSelect(int intMulti) {
0328:                ScriptBuffer script = new ScriptBuffer();
0329:                script
0330:                        .appendCall(getContextPath() + "setMultiSelect",
0331:                                intMulti);
0332:                getScriptProxy().addScript(script);
0333:                return this ;
0334:            }
0335:
0336:            /**
0337:             * if @strRecordId equals the id of the selected option (this.getValue()), only the text property will update;
0338:                   returns a ref to self to facilitate method chaining
0339:             * @param strRecordId id for the record that will be 'redrawn' on-screen
0340:             * @param ACTION One of the following two values: jsx3.xml.CDF.INSERT, jsx3.xml.CDF.DELETE
0341:             * @return this object
0342:             */
0343:            @SuppressWarnings("unchecked")
0344:            public jsx3.gui.Tree redrawRecord(String strRecordId, int ACTION) {
0345:                String extension = "redrawRecord(\"" + strRecordId + "\", \""
0346:                        + ACTION + "\").";
0347:                try {
0348:                    java.lang.reflect.Constructor<jsx3.gui.Tree> ctor = jsx3.gui.Tree.class
0349:                            .getConstructor(Context.class, String.class,
0350:                                    ScriptProxy.class);
0351:                    return ctor.newInstance(this , extension, getScriptProxy());
0352:                } catch (Exception ex) {
0353:                    throw new IllegalArgumentException("Unsupported type: "
0354:                            + jsx3.gui.Tree.class.getName());
0355:                }
0356:            }
0357:
0358:            /**
0359:             * Returns whether or not the tree should paint its root node or paint the direct child nodes to the VIEW without rendering their containing root. Default: jsx3.Boolean.TRUE
0360:             * @param callback one of jsx3.Boolean.TRUE or jsx3.Boolean.FALSE
0361:             */
0362:            @SuppressWarnings("unchecked")
0363:            public void getRoot(
0364:                    org.directwebremoting.proxy.Callback<Integer> callback) {
0365:                ScriptBuffer script = new ScriptBuffer();
0366:                String callbackPrefix = "";
0367:
0368:                if (callback != null) {
0369:                    callbackPrefix = "var reply = ";
0370:                }
0371:
0372:                script
0373:                        .appendCall(callbackPrefix + getContextPath()
0374:                                + "getRoot");
0375:
0376:                if (callback != null) {
0377:                    String key = org.directwebremoting.extend.CallbackHelper
0378:                            .saveCallback(callback, Integer.class);
0379:                    script
0380:                            .appendCall("__System.activateCallback", key,
0381:                                    "reply");
0382:                }
0383:
0384:                getScriptProxy().addScript(script);
0385:            }
0386:
0387:            /**
0388:             * Sets whether or not the tree should paint its root node or paint the direct child nodes to the VIEW without rendering their containing root;
0389:             * @param bBoolean one of jsx3.Boolean.TRUE or jsx3.Boolean.FALSE
0390:             * @return this object
0391:             */
0392:            public jsx3.gui.Tree setRoot(int bBoolean) {
0393:                ScriptBuffer script = new ScriptBuffer();
0394:                script.appendCall(getContextPath() + "setRoot", bBoolean);
0395:                getScriptProxy().addScript(script);
0396:                return this ;
0397:            }
0398:
0399:            /**
0400:             * Returns the Icon to use for items in the tree. Default: jsx3.gui.Tree.ICON
0401:             */
0402:            @SuppressWarnings("unchecked")
0403:            public void getIcon(
0404:                    org.directwebremoting.proxy.Callback<String> callback) {
0405:                ScriptBuffer script = new ScriptBuffer();
0406:                String callbackPrefix = "";
0407:
0408:                if (callback != null) {
0409:                    callbackPrefix = "var reply = ";
0410:                }
0411:
0412:                script
0413:                        .appendCall(callbackPrefix + getContextPath()
0414:                                + "getIcon");
0415:
0416:                if (callback != null) {
0417:                    String key = org.directwebremoting.extend.CallbackHelper
0418:                            .saveCallback(callback, String.class);
0419:                    script
0420:                            .appendCall("__System.activateCallback", key,
0421:                                    "reply");
0422:                }
0423:
0424:                getScriptProxy().addScript(script);
0425:            }
0426:
0427:            /**
0428:             * Sets the Icon to use for items in the tree; returns a ref to self
0429:             * @param strURL URL for icon to use
0430:             * @return this object
0431:             */
0432:            public jsx3.gui.Tree setIcon(String strURL) {
0433:                ScriptBuffer script = new ScriptBuffer();
0434:                script.appendCall(getContextPath() + "setIcon", strURL);
0435:                getScriptProxy().addScript(script);
0436:                return this ;
0437:            }
0438:
0439:            /**
0440:             * Returns the Icon to use when a node is in an open state. Default: jsx3.gui.Tree.ICONMINUS
0441:             * @param callback URL for icon to use when given tree node is toggled to closed; if null, value is reset to use URL referenced by jsx3.gui.Tree.ICONBOOKCLOSED
0442:             */
0443:            @SuppressWarnings("unchecked")
0444:            public void getIconMinus(
0445:                    org.directwebremoting.proxy.Callback<String> callback) {
0446:                ScriptBuffer script = new ScriptBuffer();
0447:                String callbackPrefix = "";
0448:
0449:                if (callback != null) {
0450:                    callbackPrefix = "var reply = ";
0451:                }
0452:
0453:                script.appendCall(callbackPrefix + getContextPath()
0454:                        + "getIconMinus");
0455:
0456:                if (callback != null) {
0457:                    String key = org.directwebremoting.extend.CallbackHelper
0458:                            .saveCallback(callback, String.class);
0459:                    script
0460:                            .appendCall("__System.activateCallback", key,
0461:                                    "reply");
0462:                }
0463:
0464:                getScriptProxy().addScript(script);
0465:            }
0466:
0467:            /**
0468:             * Sets the Icon to use when a node is in an open state.
0469:             * @param strURL URL for icon to use when given tree node is toggled to closed; if null, value is reset to use URL referenced by jsx3.gui.Tree.ICONBOOKCLOSED
0470:             * @return this object
0471:             */
0472:            public jsx3.gui.Tree setIconMinus(String strURL) {
0473:                ScriptBuffer script = new ScriptBuffer();
0474:                script.appendCall(getContextPath() + "setIconMinus", strURL);
0475:                getScriptProxy().addScript(script);
0476:                return this ;
0477:            }
0478:
0479:            /**
0480:             * Returns the Icon to use when the given tree node is in an closed state. Default: jsx3.gui.Tree.ICONPLUS
0481:             * @param callback URL for icon to use
0482:             */
0483:            @SuppressWarnings("unchecked")
0484:            public void getIconPlus(
0485:                    org.directwebremoting.proxy.Callback<String> callback) {
0486:                ScriptBuffer script = new ScriptBuffer();
0487:                String callbackPrefix = "";
0488:
0489:                if (callback != null) {
0490:                    callbackPrefix = "var reply = ";
0491:                }
0492:
0493:                script.appendCall(callbackPrefix + getContextPath()
0494:                        + "getIconPlus");
0495:
0496:                if (callback != null) {
0497:                    String key = org.directwebremoting.extend.CallbackHelper
0498:                            .saveCallback(callback, String.class);
0499:                    script
0500:                            .appendCall("__System.activateCallback", key,
0501:                                    "reply");
0502:                }
0503:
0504:                getScriptProxy().addScript(script);
0505:            }
0506:
0507:            /**
0508:             * Sets the Icon to use when the given tree node is in an closed state
0509:             * @param strURL URL for icon to use when given tree node is toggled to open; if null, value is reset to use URL referenced by jsx3.gui.Tree.ICONBOOKOPEN
0510:             * @return this object
0511:             */
0512:            public jsx3.gui.Tree setIconPlus(String strURL) {
0513:                ScriptBuffer script = new ScriptBuffer();
0514:                script.appendCall(getContextPath() + "setIconPlus", strURL);
0515:                getScriptProxy().addScript(script);
0516:                return this ;
0517:            }
0518:
0519:            /**
0520:             * toggles the open/closed state for a node on the tree; updates both MODEL and VIEW; if the tree is not yet
0521:                 painted and the open state for a node needs to be set, call: [tree instance].insertRecordProperty(@strId,@strPropName,@strPropValue,false);
0522:                 if there is a VIEW for the item, the 'ontoggle' event will be fired; if the developer has bound an ontoggle script
0523:                 (e.g., [treeinstance].setEvent("var a=1;",jsx3.gui.Interactive.TOGGLE);), this script will have contextual access to the variables:
0524:                 objGUI: object reference to the on-screen DHTML object for the node just toggled; objRECORD: object reference for the node
0525:                 in the XML Cache; strID: The jsxid property(as a string) for the node object; bOPEN: whether to item was toggled open (true) or closed (false).
0526:                 Returns a reference to self to facilitate method chaining
0527:             * @param strRecordId unique id for the given record (the 'jsxid' attribute on the given record node)
0528:             * @param bOpen if null, the open state will be toggled; otherwise, true will expand the node to display its childre; false, vice versa
0529:             * @param bBook false if null; if true, the system wants to force the VIEW to make the item a book
0530:             * @return this object
0531:             */
0532:            @SuppressWarnings("unchecked")
0533:            public jsx3.gui.Tree toggleItem(String strRecordId, boolean bOpen,
0534:                    boolean bBook) {
0535:                String extension = "toggleItem(\"" + strRecordId + "\", \""
0536:                        + bOpen + "\", \"" + bBook + "\").";
0537:                try {
0538:                    java.lang.reflect.Constructor<jsx3.gui.Tree> ctor = jsx3.gui.Tree.class
0539:                            .getConstructor(Context.class, String.class,
0540:                                    ScriptProxy.class);
0541:                    return ctor.newInstance(this , extension, getScriptProxy());
0542:                } catch (Exception ex) {
0543:                    throw new IllegalArgumentException("Unsupported type: "
0544:                            + jsx3.gui.Tree.class.getName());
0545:                }
0546:            }
0547:
0548:            /**
0549:             * Executes any bound code for the record with id strRecordId. This method only invokes the
0550:            EXECUTE model event for this tree under the deprecated 3.0 model event protocol.
0551:             * @param strRecordId <code>jsxid</code> value for the record node (according to the CDF) to execute
0552:             */
0553:            public void executeRecord(String strRecordId) {
0554:                ScriptBuffer script = new ScriptBuffer();
0555:                script.appendCall(getContextPath() + "executeRecord",
0556:                        strRecordId);
0557:                getScriptProxy().addScript(script);
0558:            }
0559:
0560:            /**
0561:             * Returns the text/HTML to display on-screen when the xml/xsl transformation for this object results in a null or empty result set
0562:             * @param callback text/HTML
0563:             */
0564:            @SuppressWarnings("unchecked")
0565:            public void getNoDataMessage(
0566:                    org.directwebremoting.proxy.Callback<String> callback) {
0567:                ScriptBuffer script = new ScriptBuffer();
0568:                String callbackPrefix = "";
0569:
0570:                if (callback != null) {
0571:                    callbackPrefix = "var reply = ";
0572:                }
0573:
0574:                script.appendCall(callbackPrefix + getContextPath()
0575:                        + "getNoDataMessage");
0576:
0577:                if (callback != null) {
0578:                    String key = org.directwebremoting.extend.CallbackHelper
0579:                            .saveCallback(callback, String.class);
0580:                    script
0581:                            .appendCall("__System.activateCallback", key,
0582:                                    "reply");
0583:                }
0584:
0585:                getScriptProxy().addScript(script);
0586:            }
0587:
0588:            /**
0589:             * Binds the given key sequence to a callback function. Any object that has a key binding (specified with
0590:            setKeyBinding()) will call this method when painted to register the key sequence with an appropriate
0591:            ancestor of this form control. Any key down event that bubbles up to the ancestor without being intercepted
0592:            and matches the given key sequence will invoke the given callback function.
0593:
0594:            As of 3.2: The hot key will be registered with the first ancestor found that is either a
0595:            jsx3.gui.Window, a jsx3.gui.Dialog, or the root block of a jsx3.app.Server.
0596:             * @param fctCallback JavaScript function to execute when the given sequence is keyed by the user.
0597:             * @param strKeys a plus-delimited ('+') key sequence such as <code>ctrl+s</code> or
0598:            <code>ctrl+shift+alt+h</code> or <code>shift+a</code>, etc. Any combination of shift, ctrl, and alt are
0599:            supported, including none. Also supported as the final token are <code>enter</code>, <code>esc</code>,
0600:            <code>tab</code>, <code>del</code>, and <code>space</code>. To specify the final token as a key code, the
0601:            last token can be the key code contained in brackets, <code>[13]</code>.
0602:             * @return the registered hot key.
0603:             */
0604:            @SuppressWarnings("unchecked")
0605:            public jsx3.gui.HotKey doKeyBinding(
0606:                    org.directwebremoting.proxy.CodeBlock fctCallback,
0607:                    String strKeys) {
0608:                String extension = "doKeyBinding(\"" + fctCallback + "\", \""
0609:                        + strKeys + "\").";
0610:                try {
0611:                    java.lang.reflect.Constructor<jsx3.gui.HotKey> ctor = jsx3.gui.HotKey.class
0612:                            .getConstructor(Context.class, String.class,
0613:                                    ScriptProxy.class);
0614:                    return ctor.newInstance(this , extension, getScriptProxy());
0615:                } catch (Exception ex) {
0616:                    throw new IllegalArgumentException("Unsupported type: "
0617:                            + jsx3.gui.HotKey.class.getName());
0618:                }
0619:            }
0620:
0621:            /**
0622:             * Resets the validation state of this control.
0623:             * @return this object.
0624:             */
0625:            @SuppressWarnings("unchecked")
0626:            public jsx3.gui.Form doReset() {
0627:                String extension = "doReset().";
0628:                try {
0629:                    java.lang.reflect.Constructor<jsx3.gui.Form> ctor = jsx3.gui.Form.class
0630:                            .getConstructor(Context.class, String.class,
0631:                                    ScriptProxy.class);
0632:                    return ctor.newInstance(this , extension, getScriptProxy());
0633:                } catch (Exception ex) {
0634:                    throw new IllegalArgumentException("Unsupported type: "
0635:                            + jsx3.gui.Form.class.getName());
0636:                }
0637:            }
0638:
0639:            /**
0640:             * Resets the validation state of this control.
0641:             * @param returnType The expected return type
0642:             * @return this object.
0643:             */
0644:            @SuppressWarnings("unchecked")
0645:            public <T> T doReset(Class<T> returnType) {
0646:                String extension = "doReset().";
0647:                try {
0648:                    java.lang.reflect.Constructor<T> ctor = returnType
0649:                            .getConstructor(Context.class, String.class,
0650:                                    ScriptProxy.class);
0651:                    return ctor.newInstance(this , extension, getScriptProxy());
0652:                } catch (Exception ex) {
0653:                    throw new IllegalArgumentException(
0654:                            "Unsupported return type: " + returnType.getName());
0655:                }
0656:            }
0657:
0658:            /**
0659:             * Returns the background color of this control when it is disabled.
0660:             * @param callback valid CSS property value, (i.e., red, #ff0000)
0661:             */
0662:            @SuppressWarnings("unchecked")
0663:            public void getDisabledBackgroundColor(
0664:                    org.directwebremoting.proxy.Callback<String> callback) {
0665:                ScriptBuffer script = new ScriptBuffer();
0666:                String callbackPrefix = "";
0667:
0668:                if (callback != null) {
0669:                    callbackPrefix = "var reply = ";
0670:                }
0671:
0672:                script.appendCall(callbackPrefix + getContextPath()
0673:                        + "getDisabledBackgroundColor");
0674:
0675:                if (callback != null) {
0676:                    String key = org.directwebremoting.extend.CallbackHelper
0677:                            .saveCallback(callback, String.class);
0678:                    script
0679:                            .appendCall("__System.activateCallback", key,
0680:                                    "reply");
0681:                }
0682:
0683:                getScriptProxy().addScript(script);
0684:            }
0685:
0686:            /**
0687:             * Returns the font color to use when this control is disabled.
0688:             * @param callback valid CSS property value, (i.e., red, #ff0000)
0689:             */
0690:            @SuppressWarnings("unchecked")
0691:            public void getDisabledColor(
0692:                    org.directwebremoting.proxy.Callback<String> callback) {
0693:                ScriptBuffer script = new ScriptBuffer();
0694:                String callbackPrefix = "";
0695:
0696:                if (callback != null) {
0697:                    callbackPrefix = "var reply = ";
0698:                }
0699:
0700:                script.appendCall(callbackPrefix + getContextPath()
0701:                        + "getDisabledColor");
0702:
0703:                if (callback != null) {
0704:                    String key = org.directwebremoting.extend.CallbackHelper
0705:                            .saveCallback(callback, String.class);
0706:                    script
0707:                            .appendCall("__System.activateCallback", key,
0708:                                    "reply");
0709:                }
0710:
0711:                getScriptProxy().addScript(script);
0712:            }
0713:
0714:            /**
0715:             * Returns the state for the form field control. If no enabled state is set, this method returns
0716:            STATEENABLED.
0717:             * @param callback <code>STATEDISABLED</code> or <code>STATEENABLED</code>.
0718:             */
0719:            @SuppressWarnings("unchecked")
0720:            public void getEnabled(
0721:                    org.directwebremoting.proxy.Callback<Integer> callback) {
0722:                ScriptBuffer script = new ScriptBuffer();
0723:                String callbackPrefix = "";
0724:
0725:                if (callback != null) {
0726:                    callbackPrefix = "var reply = ";
0727:                }
0728:
0729:                script.appendCall(callbackPrefix + getContextPath()
0730:                        + "getEnabled");
0731:
0732:                if (callback != null) {
0733:                    String key = org.directwebremoting.extend.CallbackHelper
0734:                            .saveCallback(callback, Integer.class);
0735:                    script
0736:                            .appendCall("__System.activateCallback", key,
0737:                                    "reply");
0738:                }
0739:
0740:                getScriptProxy().addScript(script);
0741:            }
0742:
0743:            /**
0744:             * Returns the key binding that when keyed will fire the execute event for this control.
0745:             * @param callback plus-delimited (e.g.,'+') key sequence such as ctrl+s or ctrl+shift+alt+h or shift+a, etc
0746:             */
0747:            @SuppressWarnings("unchecked")
0748:            public void getKeyBinding(
0749:                    org.directwebremoting.proxy.Callback<String> callback) {
0750:                ScriptBuffer script = new ScriptBuffer();
0751:                String callbackPrefix = "";
0752:
0753:                if (callback != null) {
0754:                    callbackPrefix = "var reply = ";
0755:                }
0756:
0757:                script.appendCall(callbackPrefix + getContextPath()
0758:                        + "getKeyBinding");
0759:
0760:                if (callback != null) {
0761:                    String key = org.directwebremoting.extend.CallbackHelper
0762:                            .saveCallback(callback, String.class);
0763:                    script
0764:                            .appendCall("__System.activateCallback", key,
0765:                                    "reply");
0766:                }
0767:
0768:                getScriptProxy().addScript(script);
0769:            }
0770:
0771:            /**
0772:             * Returns whether or not this control is required. If the required property has never been set, this method returns
0773:            OPTIONAL.
0774:             * @param callback <code>REQUIRED</code> or <code>OPTIONAL</code>.
0775:             */
0776:            @SuppressWarnings("unchecked")
0777:            public void getRequired(
0778:                    org.directwebremoting.proxy.Callback<Integer> callback) {
0779:                ScriptBuffer script = new ScriptBuffer();
0780:                String callbackPrefix = "";
0781:
0782:                if (callback != null) {
0783:                    callbackPrefix = "var reply = ";
0784:                }
0785:
0786:                script.appendCall(callbackPrefix + getContextPath()
0787:                        + "getRequired");
0788:
0789:                if (callback != null) {
0790:                    String key = org.directwebremoting.extend.CallbackHelper
0791:                            .saveCallback(callback, Integer.class);
0792:                    script
0793:                            .appendCall("__System.activateCallback", key,
0794:                                    "reply");
0795:                }
0796:
0797:                getScriptProxy().addScript(script);
0798:            }
0799:
0800:            /**
0801:             * Returns the validation state of this control. If the validationState property has never been set, this method returns
0802:            STATEVALID.
0803:             * @param callback <code>STATEINVALID</code> or <code>STATEVALID</code>.
0804:             */
0805:            @SuppressWarnings("unchecked")
0806:            public void getValidationState(
0807:                    org.directwebremoting.proxy.Callback<Integer> callback) {
0808:                ScriptBuffer script = new ScriptBuffer();
0809:                String callbackPrefix = "";
0810:
0811:                if (callback != null) {
0812:                    callbackPrefix = "var reply = ";
0813:                }
0814:
0815:                script.appendCall(callbackPrefix + getContextPath()
0816:                        + "getValidationState");
0817:
0818:                if (callback != null) {
0819:                    String key = org.directwebremoting.extend.CallbackHelper
0820:                            .saveCallback(callback, Integer.class);
0821:                    script
0822:                            .appendCall("__System.activateCallback", key,
0823:                                    "reply");
0824:                }
0825:
0826:                getScriptProxy().addScript(script);
0827:            }
0828:
0829:            /**
0830:             * Sets the background color of this form control when it is disabled.
0831:             * @param strColor valid CSS property value, (i.e., red, #ff0000)
0832:             * @return this object.
0833:             */
0834:            @SuppressWarnings("unchecked")
0835:            public jsx3.gui.Form setDisabledBackgroundColor(String strColor) {
0836:                String extension = "setDisabledBackgroundColor(\"" + strColor
0837:                        + "\").";
0838:                try {
0839:                    java.lang.reflect.Constructor<jsx3.gui.Form> ctor = jsx3.gui.Form.class
0840:                            .getConstructor(Context.class, String.class,
0841:                                    ScriptProxy.class);
0842:                    return ctor.newInstance(this , extension, getScriptProxy());
0843:                } catch (Exception ex) {
0844:                    throw new IllegalArgumentException("Unsupported type: "
0845:                            + jsx3.gui.Form.class.getName());
0846:                }
0847:            }
0848:
0849:            /**
0850:             * Sets the background color of this form control when it is disabled.
0851:             * @param strColor valid CSS property value, (i.e., red, #ff0000)
0852:             * @param returnType The expected return type
0853:             * @return this object.
0854:             */
0855:            @SuppressWarnings("unchecked")
0856:            public <T> T setDisabledBackgroundColor(String strColor,
0857:                    Class<T> returnType) {
0858:                String extension = "setDisabledBackgroundColor(\"" + strColor
0859:                        + "\").";
0860:                try {
0861:                    java.lang.reflect.Constructor<T> ctor = returnType
0862:                            .getConstructor(Context.class, String.class,
0863:                                    ScriptProxy.class);
0864:                    return ctor.newInstance(this , extension, getScriptProxy());
0865:                } catch (Exception ex) {
0866:                    throw new IllegalArgumentException(
0867:                            "Unsupported return type: " + returnType.getName());
0868:                }
0869:            }
0870:
0871:            /**
0872:             * Sets the font color to use when this control is disabled.
0873:             * @param strColor valid CSS property value, (i.e., red, #ff0000)
0874:             * @return this object.
0875:             */
0876:            @SuppressWarnings("unchecked")
0877:            public jsx3.gui.Form setDisabledColor(String strColor) {
0878:                String extension = "setDisabledColor(\"" + strColor + "\").";
0879:                try {
0880:                    java.lang.reflect.Constructor<jsx3.gui.Form> ctor = jsx3.gui.Form.class
0881:                            .getConstructor(Context.class, String.class,
0882:                                    ScriptProxy.class);
0883:                    return ctor.newInstance(this , extension, getScriptProxy());
0884:                } catch (Exception ex) {
0885:                    throw new IllegalArgumentException("Unsupported type: "
0886:                            + jsx3.gui.Form.class.getName());
0887:                }
0888:            }
0889:
0890:            /**
0891:             * Sets the font color to use when this control is disabled.
0892:             * @param strColor valid CSS property value, (i.e., red, #ff0000)
0893:             * @param returnType The expected return type
0894:             * @return this object.
0895:             */
0896:            @SuppressWarnings("unchecked")
0897:            public <T> T setDisabledColor(String strColor, Class<T> returnType) {
0898:                String extension = "setDisabledColor(\"" + strColor + "\").";
0899:                try {
0900:                    java.lang.reflect.Constructor<T> ctor = returnType
0901:                            .getConstructor(Context.class, String.class,
0902:                                    ScriptProxy.class);
0903:                    return ctor.newInstance(this , extension, getScriptProxy());
0904:                } catch (Exception ex) {
0905:                    throw new IllegalArgumentException(
0906:                            "Unsupported return type: " + returnType.getName());
0907:                }
0908:            }
0909:
0910:            /**
0911:             * Sets whether this control is enabled. Disabled controls do not respond to user interaction.
0912:             * @param intEnabled <code>STATEDISABLED</code> or <code>STATEENABLED</code>. <code>null</code> is
0913:            equivalent to <code>STATEENABLED</code>.
0914:             * @param bRepaint if <code>true</code> this control is immediately repainted to reflect the new setting.
0915:             */
0916:            public void setEnabled(int intEnabled, boolean bRepaint) {
0917:                ScriptBuffer script = new ScriptBuffer();
0918:                script.appendCall(getContextPath() + "setEnabled", intEnabled,
0919:                        bRepaint);
0920:                getScriptProxy().addScript(script);
0921:            }
0922:
0923:            /**
0924:             * Sets the key binding that when keyed will fire the bound execute (jsx3.gui.Interactive.EXECUTE)
0925:            event for this control.
0926:             * @param strSequence plus-delimited (e.g.,'+') key sequence such as ctrl+s or ctrl+shift+alt+h or shift+a, etc
0927:             * @return this object.
0928:             */
0929:            @SuppressWarnings("unchecked")
0930:            public jsx3.gui.Form setKeyBinding(String strSequence) {
0931:                String extension = "setKeyBinding(\"" + strSequence + "\").";
0932:                try {
0933:                    java.lang.reflect.Constructor<jsx3.gui.Form> ctor = jsx3.gui.Form.class
0934:                            .getConstructor(Context.class, String.class,
0935:                                    ScriptProxy.class);
0936:                    return ctor.newInstance(this , extension, getScriptProxy());
0937:                } catch (Exception ex) {
0938:                    throw new IllegalArgumentException("Unsupported type: "
0939:                            + jsx3.gui.Form.class.getName());
0940:                }
0941:            }
0942:
0943:            /**
0944:             * Sets the key binding that when keyed will fire the bound execute (jsx3.gui.Interactive.EXECUTE)
0945:            event for this control.
0946:             * @param strSequence plus-delimited (e.g.,'+') key sequence such as ctrl+s or ctrl+shift+alt+h or shift+a, etc
0947:             * @param returnType The expected return type
0948:             * @return this object.
0949:             */
0950:            @SuppressWarnings("unchecked")
0951:            public <T> T setKeyBinding(String strSequence, Class<T> returnType) {
0952:                String extension = "setKeyBinding(\"" + strSequence + "\").";
0953:                try {
0954:                    java.lang.reflect.Constructor<T> ctor = returnType
0955:                            .getConstructor(Context.class, String.class,
0956:                                    ScriptProxy.class);
0957:                    return ctor.newInstance(this , extension, getScriptProxy());
0958:                } catch (Exception ex) {
0959:                    throw new IllegalArgumentException(
0960:                            "Unsupported return type: " + returnType.getName());
0961:                }
0962:            }
0963:
0964:            /**
0965:             * Sets whether or not this control is required.
0966:             * @param required {int} <code>REQUIRED</code> or <code>OPTIONAL</code>.
0967:             * @return this object.
0968:             */
0969:            @SuppressWarnings("unchecked")
0970:            public jsx3.gui.Form setRequired(int required) {
0971:                String extension = "setRequired(\"" + required + "\").";
0972:                try {
0973:                    java.lang.reflect.Constructor<jsx3.gui.Form> ctor = jsx3.gui.Form.class
0974:                            .getConstructor(Context.class, String.class,
0975:                                    ScriptProxy.class);
0976:                    return ctor.newInstance(this , extension, getScriptProxy());
0977:                } catch (Exception ex) {
0978:                    throw new IllegalArgumentException("Unsupported type: "
0979:                            + jsx3.gui.Form.class.getName());
0980:                }
0981:            }
0982:
0983:            /**
0984:             * Sets whether or not this control is required.
0985:             * @param required {int} <code>REQUIRED</code> or <code>OPTIONAL</code>.
0986:             * @param returnType The expected return type
0987:             * @return this object.
0988:             */
0989:            @SuppressWarnings("unchecked")
0990:            public <T> T setRequired(int required, Class<T> returnType) {
0991:                String extension = "setRequired(\"" + required + "\").";
0992:                try {
0993:                    java.lang.reflect.Constructor<T> ctor = returnType
0994:                            .getConstructor(Context.class, String.class,
0995:                                    ScriptProxy.class);
0996:                    return ctor.newInstance(this , extension, getScriptProxy());
0997:                } catch (Exception ex) {
0998:                    throw new IllegalArgumentException(
0999:                            "Unsupported return type: " + returnType.getName());
1000:                }
1001:            }
1002:
1003:            /**
1004:             * Sets the validation state of this control. The validation state of a control is not serialized.
1005:             * @param intState <code>STATEINVALID</code> or <code>STATEVALID</code>.
1006:             * @return this object.
1007:             */
1008:            @SuppressWarnings("unchecked")
1009:            public jsx3.gui.Form setValidationState(int intState) {
1010:                String extension = "setValidationState(\"" + intState + "\").";
1011:                try {
1012:                    java.lang.reflect.Constructor<jsx3.gui.Form> ctor = jsx3.gui.Form.class
1013:                            .getConstructor(Context.class, String.class,
1014:                                    ScriptProxy.class);
1015:                    return ctor.newInstance(this , extension, getScriptProxy());
1016:                } catch (Exception ex) {
1017:                    throw new IllegalArgumentException("Unsupported type: "
1018:                            + jsx3.gui.Form.class.getName());
1019:                }
1020:            }
1021:
1022:            /**
1023:             * Sets the validation state of this control. The validation state of a control is not serialized.
1024:             * @param intState <code>STATEINVALID</code> or <code>STATEVALID</code>.
1025:             * @param returnType The expected return type
1026:             * @return this object.
1027:             */
1028:            @SuppressWarnings("unchecked")
1029:            public <T> T setValidationState(int intState, Class<T> returnType) {
1030:                String extension = "setValidationState(\"" + intState + "\").";
1031:                try {
1032:                    java.lang.reflect.Constructor<T> ctor = returnType
1033:                            .getConstructor(Context.class, String.class,
1034:                                    ScriptProxy.class);
1035:                    return ctor.newInstance(this , extension, getScriptProxy());
1036:                } catch (Exception ex) {
1037:                    throw new IllegalArgumentException(
1038:                            "Unsupported return type: " + returnType.getName());
1039:                }
1040:            }
1041:
1042:            /**
1043:             * Resets the XML source document stored in the server cache under the XML ID of this object to an empty CDF
1044:            document.
1045:             */
1046:            public void clearXmlData() {
1047:                ScriptBuffer script = new ScriptBuffer();
1048:                script.appendCall(getContextPath() + "clearXmlData");
1049:                getScriptProxy().addScript(script);
1050:            }
1051:
1052:            /**
1053:             * Returns whether this object removes its XML and XSL source documents from the cache of its server when it
1054:            is destroyed.
1055:             * @param callback <code>CLEANUPRESOURCES</code> or <code>SHARERESOURCES</code>.
1056:             */
1057:            @SuppressWarnings("unchecked")
1058:            public void getShareResources(
1059:                    org.directwebremoting.proxy.Callback<Integer> callback) {
1060:                ScriptBuffer script = new ScriptBuffer();
1061:                String callbackPrefix = "";
1062:
1063:                if (callback != null) {
1064:                    callbackPrefix = "var reply = ";
1065:                }
1066:
1067:                script.appendCall(callbackPrefix + getContextPath()
1068:                        + "getShareResources");
1069:
1070:                if (callback != null) {
1071:                    String key = org.directwebremoting.extend.CallbackHelper
1072:                            .saveCallback(callback, Integer.class);
1073:                    script
1074:                            .appendCall("__System.activateCallback", key,
1075:                                    "reply");
1076:                }
1077:
1078:                getScriptProxy().addScript(script);
1079:            }
1080:
1081:            /**
1082:             * Returns the XML source document of this object. The XML document is determined by the following steps:
1083:
1084:            If an XML document exists in the server cache under an ID equal to the XML ID of this object, that
1085:            document is returned.
1086:            If the XML string of this object is not empty, a new document is created by parsing this string.
1087:            If the XML URL of this object is not empty, a new document is created by parsing the file at the location
1088:            specified by the URL resolved against the server owning this object.
1089:            Otherwise, an empty CDF document is returned.
1090:
1091:            If a new document is created for this object (any of the steps listed above except for the first one), the
1092:            following actions are also taken:
1093:
1094:            If creating the document resulted in an error (XML parsing error, file not found error, etc) the offending
1095:            document is returned immediately.
1096:            Otherwise, setSourceXML is called on this object, passing in the created document.
1097:             */
1098:            @SuppressWarnings("unchecked")
1099:            public jsx3.xml.CdfDocument getXML() {
1100:                String extension = "getXML().";
1101:                try {
1102:                    java.lang.reflect.Constructor<jsx3.xml.CdfDocument> ctor = jsx3.xml.CdfDocument.class
1103:                            .getConstructor(Context.class, String.class,
1104:                                    ScriptProxy.class);
1105:                    return ctor.newInstance(this , extension, getScriptProxy());
1106:                } catch (Exception ex) {
1107:                    throw new IllegalArgumentException("Unsupported type: "
1108:                            + jsx3.xml.CdfDocument.class.getName());
1109:                }
1110:            }
1111:
1112:            /**
1113:             * Returns the XML source document of this object. The XML document is determined by the following steps:
1114:
1115:            If an XML document exists in the server cache under an ID equal to the XML ID of this object, that
1116:            document is returned.
1117:            If the XML string of this object is not empty, a new document is created by parsing this string.
1118:            If the XML URL of this object is not empty, a new document is created by parsing the file at the location
1119:            specified by the URL resolved against the server owning this object.
1120:            Otherwise, an empty CDF document is returned.
1121:
1122:            If a new document is created for this object (any of the steps listed above except for the first one), the
1123:            following actions are also taken:
1124:
1125:            If creating the document resulted in an error (XML parsing error, file not found error, etc) the offending
1126:            document is returned immediately.
1127:            Otherwise, setSourceXML is called on this object, passing in the created document.
1128:             * @param returnType The expected return type
1129:             */
1130:            @SuppressWarnings("unchecked")
1131:            public <T> T getXML(Class<T> returnType) {
1132:                String extension = "getXML().";
1133:                try {
1134:                    java.lang.reflect.Constructor<T> ctor = returnType
1135:                            .getConstructor(Context.class, String.class,
1136:                                    ScriptProxy.class);
1137:                    return ctor.newInstance(this , extension, getScriptProxy());
1138:                } catch (Exception ex) {
1139:                    throw new IllegalArgumentException(
1140:                            "Unsupported return type: " + returnType.getName());
1141:                }
1142:            }
1143:
1144:            /**
1145:             * Returns the XML ID of this object.
1146:             * @param callback the XML ID.
1147:             */
1148:            @SuppressWarnings("unchecked")
1149:            public void getXMLId(
1150:                    org.directwebremoting.proxy.Callback<String> callback) {
1151:                ScriptBuffer script = new ScriptBuffer();
1152:                String callbackPrefix = "";
1153:
1154:                if (callback != null) {
1155:                    callbackPrefix = "var reply = ";
1156:                }
1157:
1158:                script.appendCall(callbackPrefix + getContextPath()
1159:                        + "getXMLId");
1160:
1161:                if (callback != null) {
1162:                    String key = org.directwebremoting.extend.CallbackHelper
1163:                            .saveCallback(callback, String.class);
1164:                    script
1165:                            .appendCall("__System.activateCallback", key,
1166:                                    "reply");
1167:                }
1168:
1169:                getScriptProxy().addScript(script);
1170:            }
1171:
1172:            /**
1173:             * Returns the XML string of this object.
1174:             */
1175:            @SuppressWarnings("unchecked")
1176:            public void getXMLString(
1177:                    org.directwebremoting.proxy.Callback<String> callback) {
1178:                ScriptBuffer script = new ScriptBuffer();
1179:                String callbackPrefix = "";
1180:
1181:                if (callback != null) {
1182:                    callbackPrefix = "var reply = ";
1183:                }
1184:
1185:                script.appendCall(callbackPrefix + getContextPath()
1186:                        + "getXMLString");
1187:
1188:                if (callback != null) {
1189:                    String key = org.directwebremoting.extend.CallbackHelper
1190:                            .saveCallback(callback, String.class);
1191:                    script
1192:                            .appendCall("__System.activateCallback", key,
1193:                                    "reply");
1194:                }
1195:
1196:                getScriptProxy().addScript(script);
1197:            }
1198:
1199:            /**
1200:             * Returns the list of XML transformers of this object.
1201:             */
1202:            @SuppressWarnings("unchecked")
1203:            public void getXMLTransformers(
1204:                    org.directwebremoting.proxy.Callback<Object[]> callback) {
1205:                ScriptBuffer script = new ScriptBuffer();
1206:                String callbackPrefix = "";
1207:
1208:                if (callback != null) {
1209:                    callbackPrefix = "var reply = ";
1210:                }
1211:
1212:                script.appendCall(callbackPrefix + getContextPath()
1213:                        + "getXMLTransformers");
1214:
1215:                if (callback != null) {
1216:                    String key = org.directwebremoting.extend.CallbackHelper
1217:                            .saveCallback(callback, Object[].class);
1218:                    script
1219:                            .appendCall("__System.activateCallback", key,
1220:                                    "reply");
1221:                }
1222:
1223:                getScriptProxy().addScript(script);
1224:            }
1225:
1226:            /**
1227:             * Returns the XML URL of this object.
1228:             */
1229:            @SuppressWarnings("unchecked")
1230:            public void getXMLURL(
1231:                    org.directwebremoting.proxy.Callback<String> callback) {
1232:                ScriptBuffer script = new ScriptBuffer();
1233:                String callbackPrefix = "";
1234:
1235:                if (callback != null) {
1236:                    callbackPrefix = "var reply = ";
1237:                }
1238:
1239:                script.appendCall(callbackPrefix + getContextPath()
1240:                        + "getXMLURL");
1241:
1242:                if (callback != null) {
1243:                    String key = org.directwebremoting.extend.CallbackHelper
1244:                            .saveCallback(callback, String.class);
1245:                    script
1246:                            .appendCall("__System.activateCallback", key,
1247:                                    "reply");
1248:                }
1249:
1250:                getScriptProxy().addScript(script);
1251:            }
1252:
1253:            /**
1254:             * Returns the XSL ID of this object.
1255:             */
1256:            @SuppressWarnings("unchecked")
1257:            public void getXSLId(
1258:                    org.directwebremoting.proxy.Callback<String> callback) {
1259:                ScriptBuffer script = new ScriptBuffer();
1260:                String callbackPrefix = "";
1261:
1262:                if (callback != null) {
1263:                    callbackPrefix = "var reply = ";
1264:                }
1265:
1266:                script.appendCall(callbackPrefix + getContextPath()
1267:                        + "getXSLId");
1268:
1269:                if (callback != null) {
1270:                    String key = org.directwebremoting.extend.CallbackHelper
1271:                            .saveCallback(callback, String.class);
1272:                    script
1273:                            .appendCall("__System.activateCallback", key,
1274:                                    "reply");
1275:                }
1276:
1277:                getScriptProxy().addScript(script);
1278:            }
1279:
1280:            /**
1281:             * Returns a map containing all the parameters to pass to the XSL stylesheet during transformation.
1282:             */
1283:            @SuppressWarnings("unchecked")
1284:            public jsx3.lang.Object getXSLParams() {
1285:                String extension = "getXSLParams().";
1286:                try {
1287:                    java.lang.reflect.Constructor<jsx3.lang.Object> ctor = jsx3.lang.Object.class
1288:                            .getConstructor(Context.class, String.class,
1289:                                    ScriptProxy.class);
1290:                    return ctor.newInstance(this , extension, getScriptProxy());
1291:                } catch (Exception ex) {
1292:                    throw new IllegalArgumentException("Unsupported type: "
1293:                            + jsx3.lang.Object.class.getName());
1294:                }
1295:            }
1296:
1297:            /**
1298:             * Returns a map containing all the parameters to pass to the XSL stylesheet during transformation.
1299:             * @param returnType The expected return type
1300:             */
1301:            @SuppressWarnings("unchecked")
1302:            public <T> T getXSLParams(Class<T> returnType) {
1303:                String extension = "getXSLParams().";
1304:                try {
1305:                    java.lang.reflect.Constructor<T> ctor = returnType
1306:                            .getConstructor(Context.class, String.class,
1307:                                    ScriptProxy.class);
1308:                    return ctor.newInstance(this , extension, getScriptProxy());
1309:                } catch (Exception ex) {
1310:                    throw new IllegalArgumentException(
1311:                            "Unsupported return type: " + returnType.getName());
1312:                }
1313:            }
1314:
1315:            /**
1316:             * Returns whether the XML data source of this object is loaded asynchronously.
1317:             * @param callback <code>0</code> or <code>1</code>.
1318:             */
1319:            @SuppressWarnings("unchecked")
1320:            public void getXmlAsync(
1321:                    org.directwebremoting.proxy.Callback<Integer> callback) {
1322:                ScriptBuffer script = new ScriptBuffer();
1323:                String callbackPrefix = "";
1324:
1325:                if (callback != null) {
1326:                    callbackPrefix = "var reply = ";
1327:                }
1328:
1329:                script.appendCall(callbackPrefix + getContextPath()
1330:                        + "getXmlAsync");
1331:
1332:                if (callback != null) {
1333:                    String key = org.directwebremoting.extend.CallbackHelper
1334:                            .saveCallback(callback, Integer.class);
1335:                    script
1336:                            .appendCall("__System.activateCallback", key,
1337:                                    "reply");
1338:                }
1339:
1340:                getScriptProxy().addScript(script);
1341:            }
1342:
1343:            /**
1344:             * Returns whether this object is bound to the XML document stored in the data cache.
1345:             * @param callback <code>0</code> or <code>1</code>.
1346:             */
1347:            @SuppressWarnings("unchecked")
1348:            public void getXmlBind(
1349:                    org.directwebremoting.proxy.Callback<Integer> callback) {
1350:                ScriptBuffer script = new ScriptBuffer();
1351:                String callbackPrefix = "";
1352:
1353:                if (callback != null) {
1354:                    callbackPrefix = "var reply = ";
1355:                }
1356:
1357:                script.appendCall(callbackPrefix + getContextPath()
1358:                        + "getXmlBind");
1359:
1360:                if (callback != null) {
1361:                    String key = org.directwebremoting.extend.CallbackHelper
1362:                            .saveCallback(callback, Integer.class);
1363:                    script
1364:                            .appendCall("__System.activateCallback", key,
1365:                                    "reply");
1366:                }
1367:
1368:                getScriptProxy().addScript(script);
1369:            }
1370:
1371:            /**
1372:             * This method is called in two situations:
1373:
1374:            When the datasource of this object finishes loading (success, error, or timeout), if the
1375:              xmlAsync property of this object is true, its datasource is specified as an
1376:               XML URL, and the first time doTransform() was called the datasource was still loading.
1377:            Any time the value stored in the server XML cache under the key equal to the XML Id of this object
1378:              changes, if the xmlBind property of this object is true.
1379:
1380:            Any methods overriding this method should begin with a call to jsxsupermix().
1381:             * @param objEvent the event published by the cache.
1382:             */
1383:            public void onXmlBinding(jsx3.lang.Object objEvent) {
1384:                ScriptBuffer script = new ScriptBuffer();
1385:                script.appendCall(getContextPath() + "onXmlBinding", objEvent);
1386:                getScriptProxy().addScript(script);
1387:            }
1388:
1389:            /**
1390:             * Removes a parameter from the list of parameters to pass to the XSL stylesheet during transformation.
1391:             * @param strName the name of the XSL parameter to remove.
1392:             * @return this object.
1393:             */
1394:            @SuppressWarnings("unchecked")
1395:            public jsx3.xml.Cacheable removeXSLParam(String strName) {
1396:                String extension = "removeXSLParam(\"" + strName + "\").";
1397:                try {
1398:                    java.lang.reflect.Constructor<jsx3.xml.Cacheable> ctor = jsx3.xml.Cacheable.class
1399:                            .getConstructor(Context.class, String.class,
1400:                                    ScriptProxy.class);
1401:                    return ctor.newInstance(this , extension, getScriptProxy());
1402:                } catch (Exception ex) {
1403:                    throw new IllegalArgumentException("Unsupported type: "
1404:                            + jsx3.xml.Cacheable.class.getName());
1405:                }
1406:            }
1407:
1408:            /**
1409:             * Removes a parameter from the list of parameters to pass to the XSL stylesheet during transformation.
1410:             * @param strName the name of the XSL parameter to remove.
1411:             * @param returnType The expected return type
1412:             * @return this object.
1413:             */
1414:            @SuppressWarnings("unchecked")
1415:            public <T> T removeXSLParam(String strName, Class<T> returnType) {
1416:                String extension = "removeXSLParam(\"" + strName + "\").";
1417:                try {
1418:                    java.lang.reflect.Constructor<T> ctor = returnType
1419:                            .getConstructor(Context.class, String.class,
1420:                                    ScriptProxy.class);
1421:                    return ctor.newInstance(this , extension, getScriptProxy());
1422:                } catch (Exception ex) {
1423:                    throw new IllegalArgumentException(
1424:                            "Unsupported return type: " + returnType.getName());
1425:                }
1426:            }
1427:
1428:            /**
1429:             * Removes all parameters from the list of parameters to pass to the XSL stylesheet during transformation.
1430:             * @return this object.
1431:             */
1432:            @SuppressWarnings("unchecked")
1433:            public jsx3.xml.Cacheable removeXSLParams() {
1434:                String extension = "removeXSLParams().";
1435:                try {
1436:                    java.lang.reflect.Constructor<jsx3.xml.Cacheable> ctor = jsx3.xml.Cacheable.class
1437:                            .getConstructor(Context.class, String.class,
1438:                                    ScriptProxy.class);
1439:                    return ctor.newInstance(this , extension, getScriptProxy());
1440:                } catch (Exception ex) {
1441:                    throw new IllegalArgumentException("Unsupported type: "
1442:                            + jsx3.xml.Cacheable.class.getName());
1443:                }
1444:            }
1445:
1446:            /**
1447:             * Removes all parameters from the list of parameters to pass to the XSL stylesheet during transformation.
1448:             * @param returnType The expected return type
1449:             * @return this object.
1450:             */
1451:            @SuppressWarnings("unchecked")
1452:            public <T> T removeXSLParams(Class<T> returnType) {
1453:                String extension = "removeXSLParams().";
1454:                try {
1455:                    java.lang.reflect.Constructor<T> ctor = returnType
1456:                            .getConstructor(Context.class, String.class,
1457:                                    ScriptProxy.class);
1458:                    return ctor.newInstance(this , extension, getScriptProxy());
1459:                } catch (Exception ex) {
1460:                    throw new IllegalArgumentException(
1461:                            "Unsupported return type: " + returnType.getName());
1462:                }
1463:            }
1464:
1465:            /**
1466:             * Removes the XML and XSL source documents from the server cache.
1467:             * @param objServer the server owning the cache to modify. This is a required argument only if
1468:            <code>this.getServer()</code> does not returns a server instance.
1469:             */
1470:            public void resetCacheData(jsx3.app.Server objServer) {
1471:                ScriptBuffer script = new ScriptBuffer();
1472:                script.appendCall(getContextPath() + "resetCacheData",
1473:                        objServer);
1474:                getScriptProxy().addScript(script);
1475:            }
1476:
1477:            /**
1478:             * Removes the XML source document stored under the XML ID of this object from the server cache.
1479:             * @param objServer the server owning the cache to modify. This is a required argument only if
1480:            <code>this.getServer()</code> does not returns a server instance.
1481:             */
1482:            public void resetXmlCacheData(jsx3.app.Server objServer) {
1483:                ScriptBuffer script = new ScriptBuffer();
1484:                script.appendCall(getContextPath() + "resetXmlCacheData",
1485:                        objServer);
1486:                getScriptProxy().addScript(script);
1487:            }
1488:
1489:            /**
1490:             * Sets whether this object removes its XML and XSL source documents from the cache of its server when it
1491:            is destroyed.
1492:             * @param intShare <code>CLEANUPRESOURCES</code> or <code>SHARERESOURCES</code>. <code>CLEANUPRESOURCES</code>
1493:            is the default value if the property is <code>null</code>.
1494:             * @return this object.
1495:             */
1496:            @SuppressWarnings("unchecked")
1497:            public jsx3.xml.Cacheable setShareResources(int intShare) {
1498:                String extension = "setShareResources(\"" + intShare + "\").";
1499:                try {
1500:                    java.lang.reflect.Constructor<jsx3.xml.Cacheable> ctor = jsx3.xml.Cacheable.class
1501:                            .getConstructor(Context.class, String.class,
1502:                                    ScriptProxy.class);
1503:                    return ctor.newInstance(this , extension, getScriptProxy());
1504:                } catch (Exception ex) {
1505:                    throw new IllegalArgumentException("Unsupported type: "
1506:                            + jsx3.xml.Cacheable.class.getName());
1507:                }
1508:            }
1509:
1510:            /**
1511:             * Sets whether this object removes its XML and XSL source documents from the cache of its server when it
1512:            is destroyed.
1513:             * @param intShare <code>CLEANUPRESOURCES</code> or <code>SHARERESOURCES</code>. <code>CLEANUPRESOURCES</code>
1514:            is the default value if the property is <code>null</code>.
1515:             * @param returnType The expected return type
1516:             * @return this object.
1517:             */
1518:            @SuppressWarnings("unchecked")
1519:            public <T> T setShareResources(int intShare, Class<T> returnType) {
1520:                String extension = "setShareResources(\"" + intShare + "\").";
1521:                try {
1522:                    java.lang.reflect.Constructor<T> ctor = returnType
1523:                            .getConstructor(Context.class, String.class,
1524:                                    ScriptProxy.class);
1525:                    return ctor.newInstance(this , extension, getScriptProxy());
1526:                } catch (Exception ex) {
1527:                    throw new IllegalArgumentException(
1528:                            "Unsupported return type: " + returnType.getName());
1529:                }
1530:            }
1531:
1532:            /**
1533:             * Sets the source document of this object as though objDoc were retrieved from the XML URL or XML
1534:            string of this object. This method executes the following steps:
1535:
1536:            The document is transformed serially by each XML transformers of this object.
1537:            The XML document is saved in the server cache under the XML ID of this object.
1538:            If this object is an instance of jsx3.xml.CDF and the root node is a <data> element
1539:            and its jsxassignids attribute is equal to 1, all <record> elements without a
1540:            jsxid attribute are assigned a unique jsxid.
1541:            If this object is an instance of jsx3.xml.CDF, convertProperties() is called
1542:            on this object.
1543:             * @param objDoc 
1544:             * @param objCache 
1545:             * @return the document stored in the server cache as the data source of this object. If
1546:            transformers were run, this value will not be equal to the <code>objDoc</code> parameter.
1547:             */
1548:            @SuppressWarnings("unchecked")
1549:            public jsx3.xml.CdfDocument setSourceXML(
1550:                    jsx3.xml.CdfDocument objDoc, jsx3.app.Cache objCache) {
1551:                String extension = "setSourceXML(\"" + objDoc + "\", \""
1552:                        + objCache + "\").";
1553:                try {
1554:                    java.lang.reflect.Constructor<jsx3.xml.CdfDocument> ctor = jsx3.xml.CdfDocument.class
1555:                            .getConstructor(Context.class, String.class,
1556:                                    ScriptProxy.class);
1557:                    return ctor.newInstance(this , extension, getScriptProxy());
1558:                } catch (Exception ex) {
1559:                    throw new IllegalArgumentException("Unsupported type: "
1560:                            + jsx3.xml.CdfDocument.class.getName());
1561:                }
1562:            }
1563:
1564:            /**
1565:             * Sets the source document of this object as though objDoc were retrieved from the XML URL or XML
1566:            string of this object. This method executes the following steps:
1567:
1568:            The document is transformed serially by each XML transformers of this object.
1569:            The XML document is saved in the server cache under the XML ID of this object.
1570:            If this object is an instance of jsx3.xml.CDF and the root node is a <data> element
1571:            and its jsxassignids attribute is equal to 1, all <record> elements without a
1572:            jsxid attribute are assigned a unique jsxid.
1573:            If this object is an instance of jsx3.xml.CDF, convertProperties() is called
1574:            on this object.
1575:             * @param objDoc 
1576:             * @param objCache 
1577:             * @param returnType The expected return type
1578:             * @return the document stored in the server cache as the data source of this object. If
1579:            transformers were run, this value will not be equal to the <code>objDoc</code> parameter.
1580:             */
1581:            @SuppressWarnings("unchecked")
1582:            public <T> T setSourceXML(jsx3.xml.CdfDocument objDoc,
1583:                    jsx3.app.Cache objCache, Class<T> returnType) {
1584:                String extension = "setSourceXML(\"" + objDoc + "\", \""
1585:                        + objCache + "\").";
1586:                try {
1587:                    java.lang.reflect.Constructor<T> ctor = returnType
1588:                            .getConstructor(Context.class, String.class,
1589:                                    ScriptProxy.class);
1590:                    return ctor.newInstance(this , extension, getScriptProxy());
1591:                } catch (Exception ex) {
1592:                    throw new IllegalArgumentException(
1593:                            "Unsupported return type: " + returnType.getName());
1594:                }
1595:            }
1596:
1597:            /**
1598:             * Sets the XML ID of this object. This value is the key under which the XML source document of this object is
1599:            saved in the cache of the server owning this object. The developer may specify either a unique or shared value.
1600:            If no value is specified, a unique id is generated.
1601:             * @param strXMLId 
1602:             * @return this object.
1603:             */
1604:            @SuppressWarnings("unchecked")
1605:            public jsx3.xml.Cacheable setXMLId(String strXMLId) {
1606:                String extension = "setXMLId(\"" + strXMLId + "\").";
1607:                try {
1608:                    java.lang.reflect.Constructor<jsx3.xml.Cacheable> ctor = jsx3.xml.Cacheable.class
1609:                            .getConstructor(Context.class, String.class,
1610:                                    ScriptProxy.class);
1611:                    return ctor.newInstance(this , extension, getScriptProxy());
1612:                } catch (Exception ex) {
1613:                    throw new IllegalArgumentException("Unsupported type: "
1614:                            + jsx3.xml.Cacheable.class.getName());
1615:                }
1616:            }
1617:
1618:            /**
1619:             * Sets the XML ID of this object. This value is the key under which the XML source document of this object is
1620:            saved in the cache of the server owning this object. The developer may specify either a unique or shared value.
1621:            If no value is specified, a unique id is generated.
1622:             * @param strXMLId 
1623:             * @param returnType The expected return type
1624:             * @return this object.
1625:             */
1626:            @SuppressWarnings("unchecked")
1627:            public <T> T setXMLId(String strXMLId, Class<T> returnType) {
1628:                String extension = "setXMLId(\"" + strXMLId + "\").";
1629:                try {
1630:                    java.lang.reflect.Constructor<T> ctor = returnType
1631:                            .getConstructor(Context.class, String.class,
1632:                                    ScriptProxy.class);
1633:                    return ctor.newInstance(this , extension, getScriptProxy());
1634:                } catch (Exception ex) {
1635:                    throw new IllegalArgumentException(
1636:                            "Unsupported return type: " + returnType.getName());
1637:                }
1638:            }
1639:
1640:            /**
1641:             * Sets the XML string of this object. Setting this value to the string serialization of an XML document is one
1642:            way of specifying the source XML document of this object.
1643:             * @param strXML <code>null</code> or a well-formed serialized XML element.
1644:             * @return this object.
1645:             */
1646:            @SuppressWarnings("unchecked")
1647:            public jsx3.xml.Cacheable setXMLString(String strXML) {
1648:                String extension = "setXMLString(\"" + strXML + "\").";
1649:                try {
1650:                    java.lang.reflect.Constructor<jsx3.xml.Cacheable> ctor = jsx3.xml.Cacheable.class
1651:                            .getConstructor(Context.class, String.class,
1652:                                    ScriptProxy.class);
1653:                    return ctor.newInstance(this , extension, getScriptProxy());
1654:                } catch (Exception ex) {
1655:                    throw new IllegalArgumentException("Unsupported type: "
1656:                            + jsx3.xml.Cacheable.class.getName());
1657:                }
1658:            }
1659:
1660:            /**
1661:             * Sets the XML string of this object. Setting this value to the string serialization of an XML document is one
1662:            way of specifying the source XML document of this object.
1663:             * @param strXML <code>null</code> or a well-formed serialized XML element.
1664:             * @param returnType The expected return type
1665:             * @return this object.
1666:             */
1667:            @SuppressWarnings("unchecked")
1668:            public <T> T setXMLString(String strXML, Class<T> returnType) {
1669:                String extension = "setXMLString(\"" + strXML + "\").";
1670:                try {
1671:                    java.lang.reflect.Constructor<T> ctor = returnType
1672:                            .getConstructor(Context.class, String.class,
1673:                                    ScriptProxy.class);
1674:                    return ctor.newInstance(this , extension, getScriptProxy());
1675:                } catch (Exception ex) {
1676:                    throw new IllegalArgumentException(
1677:                            "Unsupported return type: " + returnType.getName());
1678:                }
1679:            }
1680:
1681:            /**
1682:             * Sets the list of XML transformers of this object. The XML source document of this object is transformed
1683:            serially by each of these transformers before it is placed in the XML cache.
1684:
1685:            Each transformer is either the URI of an XSLT document (which will be resolved against the
1686:            the server of this object) or the cache id of a XSLT document in the XML cache of the server
1687:            of this object. When any transformer is loaded from a URI it is placed in the server cache under the id
1688:            equal to its resolved URI. Any transformer that does not correspond to a valid XSLT document will be skipped
1689:            without throwing an error.
1690:             * @param arrTrans 
1691:             */
1692:            public void setXMLTransformers(Object[] arrTrans) {
1693:                ScriptBuffer script = new ScriptBuffer();
1694:                script.appendCall(getContextPath() + "setXMLTransformers",
1695:                        arrTrans);
1696:                getScriptProxy().addScript(script);
1697:            }
1698:
1699:            /**
1700:             * Sets the XML URL of this object. Settings this value to the URI of an XML document is one way of specifying the
1701:            source XML document of this object.
1702:             * @param strXMLURL <code>null</code> or a URI that when resolved against the server owning this object
1703:            specifies a valid XML document.
1704:             * @return this object.
1705:             */
1706:            @SuppressWarnings("unchecked")
1707:            public jsx3.xml.Cacheable setXMLURL(String strXMLURL) {
1708:                String extension = "setXMLURL(\"" + strXMLURL + "\").";
1709:                try {
1710:                    java.lang.reflect.Constructor<jsx3.xml.Cacheable> ctor = jsx3.xml.Cacheable.class
1711:                            .getConstructor(Context.class, String.class,
1712:                                    ScriptProxy.class);
1713:                    return ctor.newInstance(this , extension, getScriptProxy());
1714:                } catch (Exception ex) {
1715:                    throw new IllegalArgumentException("Unsupported type: "
1716:                            + jsx3.xml.Cacheable.class.getName());
1717:                }
1718:            }
1719:
1720:            /**
1721:             * Sets the XML URL of this object. Settings this value to the URI of an XML document is one way of specifying the
1722:            source XML document of this object.
1723:             * @param strXMLURL <code>null</code> or a URI that when resolved against the server owning this object
1724:            specifies a valid XML document.
1725:             * @param returnType The expected return type
1726:             * @return this object.
1727:             */
1728:            @SuppressWarnings("unchecked")
1729:            public <T> T setXMLURL(String strXMLURL, Class<T> returnType) {
1730:                String extension = "setXMLURL(\"" + strXMLURL + "\").";
1731:                try {
1732:                    java.lang.reflect.Constructor<T> ctor = returnType
1733:                            .getConstructor(Context.class, String.class,
1734:                                    ScriptProxy.class);
1735:                    return ctor.newInstance(this , extension, getScriptProxy());
1736:                } catch (Exception ex) {
1737:                    throw new IllegalArgumentException(
1738:                            "Unsupported return type: " + returnType.getName());
1739:                }
1740:            }
1741:
1742:            /**
1743:             * Adds a name/value pair to the list of parameters to pass to the XSL stylesheet during transformation. If
1744:            strValue is null the parameter is removed.
1745:             * @param strName the name of the XSL parameter to add.
1746:             * @param strValue the value of the XSL parameter to add.
1747:             * @return this object.
1748:             */
1749:            @SuppressWarnings("unchecked")
1750:            public jsx3.xml.Cacheable setXSLParam(String strName,
1751:                    String strValue) {
1752:                String extension = "setXSLParam(\"" + strName + "\", \""
1753:                        + strValue + "\").";
1754:                try {
1755:                    java.lang.reflect.Constructor<jsx3.xml.Cacheable> ctor = jsx3.xml.Cacheable.class
1756:                            .getConstructor(Context.class, String.class,
1757:                                    ScriptProxy.class);
1758:                    return ctor.newInstance(this , extension, getScriptProxy());
1759:                } catch (Exception ex) {
1760:                    throw new IllegalArgumentException("Unsupported type: "
1761:                            + jsx3.xml.Cacheable.class.getName());
1762:                }
1763:            }
1764:
1765:            /**
1766:             * Adds a name/value pair to the list of parameters to pass to the XSL stylesheet during transformation. If
1767:            strValue is null the parameter is removed.
1768:             * @param strName the name of the XSL parameter to add.
1769:             * @param strValue the value of the XSL parameter to add.
1770:             * @param returnType The expected return type
1771:             * @return this object.
1772:             */
1773:            @SuppressWarnings("unchecked")
1774:            public <T> T setXSLParam(String strName, String strValue,
1775:                    Class<T> returnType) {
1776:                String extension = "setXSLParam(\"" + strName + "\", \""
1777:                        + strValue + "\").";
1778:                try {
1779:                    java.lang.reflect.Constructor<T> ctor = returnType
1780:                            .getConstructor(Context.class, String.class,
1781:                                    ScriptProxy.class);
1782:                    return ctor.newInstance(this , extension, getScriptProxy());
1783:                } catch (Exception ex) {
1784:                    throw new IllegalArgumentException(
1785:                            "Unsupported return type: " + returnType.getName());
1786:                }
1787:            }
1788:
1789:            /**
1790:             * Sets whether the XML data source of this object is loaded asynchronously. This setting only applies to
1791:            data sources loaded from an XML URL.
1792:             * @param bAsync 
1793:             * @return this object.
1794:             */
1795:            @SuppressWarnings("unchecked")
1796:            public jsx3.xml.Cacheable setXmlAsync(boolean bAsync) {
1797:                String extension = "setXmlAsync(\"" + bAsync + "\").";
1798:                try {
1799:                    java.lang.reflect.Constructor<jsx3.xml.Cacheable> ctor = jsx3.xml.Cacheable.class
1800:                            .getConstructor(Context.class, String.class,
1801:                                    ScriptProxy.class);
1802:                    return ctor.newInstance(this , extension, getScriptProxy());
1803:                } catch (Exception ex) {
1804:                    throw new IllegalArgumentException("Unsupported type: "
1805:                            + jsx3.xml.Cacheable.class.getName());
1806:                }
1807:            }
1808:
1809:            /**
1810:             * Sets whether the XML data source of this object is loaded asynchronously. This setting only applies to
1811:            data sources loaded from an XML URL.
1812:             * @param bAsync 
1813:             * @param returnType The expected return type
1814:             * @return this object.
1815:             */
1816:            @SuppressWarnings("unchecked")
1817:            public <T> T setXmlAsync(boolean bAsync, Class<T> returnType) {
1818:                String extension = "setXmlAsync(\"" + bAsync + "\").";
1819:                try {
1820:                    java.lang.reflect.Constructor<T> ctor = returnType
1821:                            .getConstructor(Context.class, String.class,
1822:                                    ScriptProxy.class);
1823:                    return ctor.newInstance(this , extension, getScriptProxy());
1824:                } catch (Exception ex) {
1825:                    throw new IllegalArgumentException(
1826:                            "Unsupported return type: " + returnType.getName());
1827:                }
1828:            }
1829:
1830:            /**
1831:             * Sets whether this object is bound to the XML document stored in the data cache. If this object is bound to the
1832:            cache, then the onXmlBinding() method of this object is called any time the document stored in
1833:            the cache under the XML Id of this object changes.
1834:             * @param bBind 
1835:             * @param callback <code>0</code> or <code>1</code>.
1836:             */
1837:            @SuppressWarnings("unchecked")
1838:            public void setXmlBind(boolean bBind,
1839:                    org.directwebremoting.proxy.Callback<Integer> callback) {
1840:                ScriptBuffer script = new ScriptBuffer();
1841:                String callbackPrefix = "";
1842:
1843:                if (callback != null) {
1844:                    callbackPrefix = "var reply = ";
1845:                }
1846:
1847:                script.appendCall(callbackPrefix + getContextPath()
1848:                        + "setXmlBind", bBind);
1849:
1850:                if (callback != null) {
1851:                    String key = org.directwebremoting.extend.CallbackHelper
1852:                            .saveCallback(callback, Integer.class);
1853:                    script
1854:                            .appendCall("__System.activateCallback", key,
1855:                                    "reply");
1856:                }
1857:
1858:                getScriptProxy().addScript(script);
1859:            }
1860:
1861:            /**
1862:             * Transfers a CDF record from another object to this object. If no XML data source exists
1863:            yet for this object, an empty one is created before adding the new record. This method always updates the
1864:            on-screen view of both the source and destination objects.
1865:
1866:            This method fails quietly if any of the following conditions apply:
1867:
1868:            there is no object with id equal to strSourceId
1869:                
1870:            there is no record in the source object with jsxid equal to strRecordId
1871:                
1872:
1873:                  strParentRecordId is specified and there is no record in this object with
1874:            jsxid equal to strParentRecordId
1875:                
1876:            the this object already has a record with jsxid equal to the record to adopt
1877:             * @param strSourceId <span style="text-decoration: line-through;">either the id of the source object or the</span> source object itself.
1878:             * @param strRecordId the <code>jsxid</code> attribute of the data record in the source object to transfer.
1879:             * @param strParentRecordId the unique <code>jsxid</code> of an existing record. If this optional parameter
1880:            is provided, the adopted record will be added as a child of this record. Otherwise, the adopted record will
1881:            be added to the root <code>data</code> element.
1882:             * @param bRedraw forces suppression of the insert event
1883:             * @return the adopted record.
1884:             */
1885:            @SuppressWarnings("unchecked")
1886:            public jsx3.xml.Node adoptRecord(String strSourceId,
1887:                    String strRecordId, String strParentRecordId,
1888:                    boolean bRedraw) {
1889:                String extension = "adoptRecord(\"" + strSourceId + "\", \""
1890:                        + strRecordId + "\", \"" + strParentRecordId + "\", \""
1891:                        + bRedraw + "\").";
1892:                try {
1893:                    java.lang.reflect.Constructor<jsx3.xml.Node> ctor = jsx3.xml.Node.class
1894:                            .getConstructor(Context.class, String.class,
1895:                                    ScriptProxy.class);
1896:                    return ctor.newInstance(this , extension, getScriptProxy());
1897:                } catch (Exception ex) {
1898:                    throw new IllegalArgumentException("Unsupported type: "
1899:                            + jsx3.xml.Node.class.getName());
1900:                }
1901:            }
1902:
1903:            /**
1904:             * Transfers a CDF record from another object to this object. If no XML data source exists
1905:            yet for this object, an empty one is created before adding the new record. This method always updates the
1906:            on-screen view of both the source and destination objects.
1907:
1908:            This method fails quietly if any of the following conditions apply:
1909:
1910:            there is no object with id equal to strSourceId
1911:                
1912:            there is no record in the source object with jsxid equal to strRecordId
1913:                
1914:
1915:                  strParentRecordId is specified and there is no record in this object with
1916:            jsxid equal to strParentRecordId
1917:                
1918:            the this object already has a record with jsxid equal to the record to adopt
1919:             * @param strSourceId <span style="text-decoration: line-through;">either the id of the source object or the</span> source object itself.
1920:             * @param strRecordId the <code>jsxid</code> attribute of the data record in the source object to transfer.
1921:             * @param strParentRecordId the unique <code>jsxid</code> of an existing record. If this optional parameter
1922:            is provided, the adopted record will be added as a child of this record. Otherwise, the adopted record will
1923:            be added to the root <code>data</code> element.
1924:             * @param bRedraw forces suppression of the insert event
1925:             * @return the adopted record.
1926:             */
1927:            @SuppressWarnings("unchecked")
1928:            public jsx3.xml.Node adoptRecord(jsx3.xml.CdfDocument strSourceId,
1929:                    String strRecordId, String strParentRecordId,
1930:                    boolean bRedraw) {
1931:                String extension = "adoptRecord(\"" + strSourceId + "\", \""
1932:                        + strRecordId + "\", \"" + strParentRecordId + "\", \""
1933:                        + bRedraw + "\").";
1934:                try {
1935:                    java.lang.reflect.Constructor<jsx3.xml.Node> ctor = jsx3.xml.Node.class
1936:                            .getConstructor(Context.class, String.class,
1937:                                    ScriptProxy.class);
1938:                    return ctor.newInstance(this , extension, getScriptProxy());
1939:                } catch (Exception ex) {
1940:                    throw new IllegalArgumentException("Unsupported type: "
1941:                            + jsx3.xml.Node.class.getName());
1942:                }
1943:            }
1944:
1945:            /**
1946:             * Equivalent to adoptRecord, except that the to-be relationship is as a previousSibling to the CDF record identified by the parameter, strSiblingRecordId
1947:
1948:            This method fails quietly if any of the following conditions apply:
1949:
1950:            there is no record with a jsxid equal to strSourceId
1951:                
1952:            there is no record in the source object with a jsxid equal to strRecordId
1953:                
1954:
1955:                  strSiblingRecordId is specified and there is no record in this object with a
1956:            jsxid equal to strParentRecordId
1957:                
1958:            this object already has a record with jsxid equal to the record to adopt
1959:             * @param strSourceId <span style="text-decoration: line-through;">either the id of the source object or the</span> source object itself.
1960:             * @param strRecordId the <code>jsxid</code> attribute of the data record in the source object to transfer.
1961:             * @param strSiblingRecordId the unique <code>jsxid</code> of an existing record in front of
1962:            which the record identified by strSourceId will be placed
1963:             * @param bRedraw if <code>true</code> or <code>null</code>, the on-screen view of this object is
1964:            immediately updated to reflect the deleted record.
1965:             * @return the adopted record.
1966:             */
1967:            @SuppressWarnings("unchecked")
1968:            public jsx3.xml.Node adoptRecordBefore(
1969:                    jsx3.xml.CdfDocument strSourceId, String strRecordId,
1970:                    String strSiblingRecordId, boolean bRedraw) {
1971:                String extension = "adoptRecordBefore(\"" + strSourceId
1972:                        + "\", \"" + strRecordId + "\", \""
1973:                        + strSiblingRecordId + "\", \"" + bRedraw + "\").";
1974:                try {
1975:                    java.lang.reflect.Constructor<jsx3.xml.Node> ctor = jsx3.xml.Node.class
1976:                            .getConstructor(Context.class, String.class,
1977:                                    ScriptProxy.class);
1978:                    return ctor.newInstance(this , extension, getScriptProxy());
1979:                } catch (Exception ex) {
1980:                    throw new IllegalArgumentException("Unsupported type: "
1981:                            + jsx3.xml.Node.class.getName());
1982:                }
1983:            }
1984:
1985:            /**
1986:             * Equivalent to adoptRecord, except that the to-be relationship is as a previousSibling to the CDF record identified by the parameter, strSiblingRecordId
1987:
1988:            This method fails quietly if any of the following conditions apply:
1989:
1990:            there is no record with a jsxid equal to strSourceId
1991:                
1992:            there is no record in the source object with a jsxid equal to strRecordId
1993:                
1994:
1995:                  strSiblingRecordId is specified and there is no record in this object with a
1996:            jsxid equal to strParentRecordId
1997:                
1998:            this object already has a record with jsxid equal to the record to adopt
1999:             * @param strSourceId <span style="text-decoration: line-through;">either the id of the source object or the</span> source object itself.
2000:             * @param strRecordId the <code>jsxid</code> attribute of the data record in the source object to transfer.
2001:             * @param strSiblingRecordId the unique <code>jsxid</code> of an existing record in front of
2002:            which the record identified by strSourceId will be placed
2003:             * @param bRedraw if <code>true</code> or <code>null</code>, the on-screen view of this object is
2004:            immediately updated to reflect the deleted record.
2005:             * @return the adopted record.
2006:             */
2007:            @SuppressWarnings("unchecked")
2008:            public jsx3.xml.Node adoptRecordBefore(String strSourceId,
2009:                    String strRecordId, String strSiblingRecordId,
2010:                    boolean bRedraw) {
2011:                String extension = "adoptRecordBefore(\"" + strSourceId
2012:                        + "\", \"" + strRecordId + "\", \""
2013:                        + strSiblingRecordId + "\", \"" + bRedraw + "\").";
2014:                try {
2015:                    java.lang.reflect.Constructor<jsx3.xml.Node> ctor = jsx3.xml.Node.class
2016:                            .getConstructor(Context.class, String.class,
2017:                                    ScriptProxy.class);
2018:                    return ctor.newInstance(this , extension, getScriptProxy());
2019:                } catch (Exception ex) {
2020:                    throw new IllegalArgumentException("Unsupported type: "
2021:                            + jsx3.xml.Node.class.getName());
2022:                }
2023:            }
2024:
2025:            /**
2026:             * Converts all attributes in this CDF document that are property keys of the form {key} to
2027:            the value of the property.
2028:             * @param objProps the properties repository to query.
2029:             * @param arrProps if provided, these attributes are converted rather than the default set of
2030:            attributes.
2031:             * @param bUnion if <code>true</code>, <code>arrProps</code> is combined with the default set of
2032:            attributes and those attributes are converted.
2033:             */
2034:            public void convertProperties(java.util.Properties objProps,
2035:                    Object[] arrProps, boolean bUnion) {
2036:                ScriptBuffer script = new ScriptBuffer();
2037:                script.appendCall(getContextPath() + "convertProperties",
2038:                        objProps, arrProps, bUnion);
2039:                getScriptProxy().addScript(script);
2040:            }
2041:
2042:            /**
2043:             * Removes a record from the XML data source of this object.
2044:             * @param strRecordId the <code>jsxid</code> attribute of the data record to remove.
2045:             * @param bRedraw if <code>true</code> or <code>null</code>, the on-screen view of this object is
2046:            immediately updated to reflect the deleted record.
2047:             * @return the record removed from the data source or <code>null</code> if no such record found.
2048:             */
2049:            @SuppressWarnings("unchecked")
2050:            public jsx3.xml.Node deleteRecord(String strRecordId,
2051:                    boolean bRedraw) {
2052:                String extension = "deleteRecord(\"" + strRecordId + "\", \""
2053:                        + bRedraw + "\").";
2054:                try {
2055:                    java.lang.reflect.Constructor<jsx3.xml.Node> ctor = jsx3.xml.Node.class
2056:                            .getConstructor(Context.class, String.class,
2057:                                    ScriptProxy.class);
2058:                    return ctor.newInstance(this , extension, getScriptProxy());
2059:                } catch (Exception ex) {
2060:                    throw new IllegalArgumentException("Unsupported type: "
2061:                            + jsx3.xml.Node.class.getName());
2062:                }
2063:            }
2064:
2065:            /**
2066:             * Removes a specific property from a record. If no such record exists in the XML document, this method fails quietly.
2067:             * @param strRecordId the <code>jsxid</code> attribute of the data record to modify.
2068:             * @param strPropName the name of the property to remove from the record.
2069:             * @param bRedraw if <code>true</code> or <code>null</code>, the on-screen view of this object is
2070:            immediately updated to reflect the deleted property.
2071:             */
2072:            public void deleteRecordProperty(String strRecordId,
2073:                    String strPropName, boolean bRedraw) {
2074:                ScriptBuffer script = new ScriptBuffer();
2075:                script.appendCall(getContextPath() + "deleteRecordProperty",
2076:                        strRecordId, strPropName, bRedraw);
2077:                getScriptProxy().addScript(script);
2078:            }
2079:
2080:            /**
2081:             * Returns an object containing the attributes of a particular CDF record as property/value pairs. The object returned by this
2082:            method is a copy of the underlying data. Therefore, updates to this object will not affect the underlying data.
2083:
2084:            The following two lines of code evaluate to the same value:
2085:
2086:            objCDF.getRecord(strId).propName;
2087:            objCDF.getRecordNode(strId).getAttribute("propName");
2088:             * @param strRecordId the <code>jsxid</code> attribute of the data record to return.
2089:             * @return the object representation of a CDF node or <code>null</code> if no such record found.
2090:             */
2091:            @SuppressWarnings("unchecked")
2092:            public jsx3.lang.Object getRecord(String strRecordId) {
2093:                String extension = "getRecord(\"" + strRecordId + "\").";
2094:                try {
2095:                    java.lang.reflect.Constructor<jsx3.lang.Object> ctor = jsx3.lang.Object.class
2096:                            .getConstructor(Context.class, String.class,
2097:                                    ScriptProxy.class);
2098:                    return ctor.newInstance(this , extension, getScriptProxy());
2099:                } catch (Exception ex) {
2100:                    throw new IllegalArgumentException("Unsupported type: "
2101:                            + jsx3.lang.Object.class.getName());
2102:                }
2103:            }
2104:
2105:            /**
2106:             * Returns an object containing the attributes of a particular CDF record as property/value pairs. The object returned by this
2107:            method is a copy of the underlying data. Therefore, updates to this object will not affect the underlying data.
2108:
2109:            The following two lines of code evaluate to the same value:
2110:
2111:            objCDF.getRecord(strId).propName;
2112:            objCDF.getRecordNode(strId).getAttribute("propName");
2113:             * @param strRecordId the <code>jsxid</code> attribute of the data record to return.
2114:             * @param returnType The expected return type
2115:             * @return the object representation of a CDF node or <code>null</code> if no such record found.
2116:             */
2117:            @SuppressWarnings("unchecked")
2118:            public <T> T getRecord(String strRecordId, Class<T> returnType) {
2119:                String extension = "getRecord(\"" + strRecordId + "\").";
2120:                try {
2121:                    java.lang.reflect.Constructor<T> ctor = returnType
2122:                            .getConstructor(Context.class, String.class,
2123:                                    ScriptProxy.class);
2124:                    return ctor.newInstance(this , extension, getScriptProxy());
2125:                } catch (Exception ex) {
2126:                    throw new IllegalArgumentException(
2127:                            "Unsupported return type: " + returnType.getName());
2128:                }
2129:            }
2130:
2131:            /**
2132:             * Returns a record from the XML data source of this object. This returned value is a handle to the record and
2133:            not a clone. Therefore, any updates made to the returned value with update the XML document of this object.
2134:            To reflect such changes in the on-screen view of this object, call
2135:            redrawRecord(strRecordId, jsx3.xml.CDF.UPDATE); on this object.
2136:             * @param strRecordId the <code>jsxid</code> attribute of the data record to return.
2137:             * @return the record node or <code>null</code> if none exists with a <code>jsxid</code>
2138:            attribute equal to <code>strRecordId</code>.
2139:             */
2140:            @SuppressWarnings("unchecked")
2141:            public jsx3.xml.Node getRecordNode(String strRecordId) {
2142:                String extension = "getRecordNode(\"" + strRecordId + "\").";
2143:                try {
2144:                    java.lang.reflect.Constructor<jsx3.xml.Node> ctor = jsx3.xml.Node.class
2145:                            .getConstructor(Context.class, String.class,
2146:                                    ScriptProxy.class);
2147:                    return ctor.newInstance(this , extension, getScriptProxy());
2148:                } catch (Exception ex) {
2149:                    throw new IllegalArgumentException("Unsupported type: "
2150:                            + jsx3.xml.Node.class.getName());
2151:                }
2152:            }
2153:
2154:            /**
2155:             * Inserts a new record into the XML data source of this object. If no XML data source exists
2156:            yet for this object, an empty one is created before adding the new record.
2157:            If a record already exists with an id equal to the jsxid property of objRecord,
2158:            the operation is treated as an update, meaning the existing record is completely removed and a new record with
2159:            the given jsxid is inserted.
2160:             * @param objRecord a JavaScript object containing property/value pairs that define the
2161:            attributes of the XML entity to create. Note that most classes that implement this interface require that all
2162:            records have an attribute named <code>jsxid</code> that is unique across all records in the XML document.
2163:            All property values will be treated as strings. Additionally, the following 3 characters are escaped:
2164:            <code>" &gt; &lt;</code>.
2165:             * @param strParentRecordId the unique <code>jsxid</code> of an existing record. If this optional parameter
2166:            is provided and a record exists with a matching <code>jsxid</code> attribute, the new record will be added as a child of
2167:            this record. Otherwise, the new record will be added to the root <code>data</code> element. However, if a
2168:            record already exists with a <code>jsxid</code> attribute equal to the <code>jsxid</code> property of
2169:            <code>objRecord</code>, this parameter will be ignored. In this case <code>adoptRecord()</code> must be called
2170:            to change the parent of the record.
2171:             * @param bRedraw if <code>true</code> or <code>null</code>, the on-screen view of this object is
2172:            immediately updated to reflect the additional record.
2173:             * @return the newly created or updated entity.
2174:             */
2175:            @SuppressWarnings("unchecked")
2176:            public jsx3.xml.Node insertRecord(jsx3.lang.Object objRecord,
2177:                    String strParentRecordId, boolean bRedraw) {
2178:                String extension = "insertRecord(\"" + objRecord + "\", \""
2179:                        + strParentRecordId + "\", \"" + bRedraw + "\").";
2180:                try {
2181:                    java.lang.reflect.Constructor<jsx3.xml.Node> ctor = jsx3.xml.Node.class
2182:                            .getConstructor(Context.class, String.class,
2183:                                    ScriptProxy.class);
2184:                    return ctor.newInstance(this , extension, getScriptProxy());
2185:                } catch (Exception ex) {
2186:                    throw new IllegalArgumentException("Unsupported type: "
2187:                            + jsx3.xml.Node.class.getName());
2188:                }
2189:            }
2190:
2191:            /**
2192:             * Creates a new CDF record and inserts it into the CDF data source of this object, before the record identified by strSiblingRecordId.
2193:
2194:            This method fails quietly if any of the following conditions apply:
2195:
2196:            there is no existing record with a jsxid equal to strSiblingRecordId
2197:                
2198:            there is an existing record with jsxid equal to objRecord.jsxid
2199:             * @param objRecord a JavaScript object containing property/value pairs that define the
2200:            attributes of the XML entity to create. Note that most classes that implement this interface require that all
2201:            records have an attribute named <code>jsxid</code> that is unique across all records in the XML document.
2202:            All property values will be treated as strings. Additionally, the following 3 characters are escaped:
2203:            <code>" &gt; &lt;</code>.
2204:             * @param strSiblingRecordId the unique <code>jsxid</code> of an existing record before which the new record will be inserted.
2205:             * @param bRedraw if <code>true</code> or <code>null</code>, the on-screen view of this object is
2206:            immediately updated to reflect the additional record.
2207:             * @return the newly created entity.
2208:             */
2209:            @SuppressWarnings("unchecked")
2210:            public jsx3.xml.Node insertRecordBefore(jsx3.lang.Object objRecord,
2211:                    String strSiblingRecordId, boolean bRedraw) {
2212:                String extension = "insertRecordBefore(\"" + objRecord
2213:                        + "\", \"" + strSiblingRecordId + "\", \"" + bRedraw
2214:                        + "\").";
2215:                try {
2216:                    java.lang.reflect.Constructor<jsx3.xml.Node> ctor = jsx3.xml.Node.class
2217:                            .getConstructor(Context.class, String.class,
2218:                                    ScriptProxy.class);
2219:                    return ctor.newInstance(this , extension, getScriptProxy());
2220:                } catch (Exception ex) {
2221:                    throw new IllegalArgumentException("Unsupported type: "
2222:                            + jsx3.xml.Node.class.getName());
2223:                }
2224:            }
2225:
2226:            /**
2227:             * Inserts a new record into the XML data source of this object. This method is the same as
2228:            insertRecord() except that its first parameter is of type jsx3.xml.Entity rather than
2229:            Object.
2230:             * @param objRecordNode an XML element of name <code>record</code>. Note that most classes that
2231:            implement this interface require that all records have an attribute named <code>jsxid</code> that is unique
2232:            across all records in the XML document.
2233:             * @param strParentRecordId the unique <code>jsxid</code> of an existing record. If this optional parameter
2234:            is provided and a record exists with a matching <code>jsxid</code> attribute, the new record will be added as a child of
2235:            this record. Otherwise, the new record will be added to the root <code>data</code> element.
2236:             * @param bRedraw if <code>true</code> or <code>null</code>, the on-screen view of this object is
2237:            immediately updated to reflect the additional record.
2238:             */
2239:            public void insertRecordNode(jsx3.xml.Node objRecordNode,
2240:                    String strParentRecordId, boolean bRedraw) {
2241:                ScriptBuffer script = new ScriptBuffer();
2242:                script.appendCall(getContextPath() + "insertRecordNode",
2243:                        objRecordNode, strParentRecordId, bRedraw);
2244:                getScriptProxy().addScript(script);
2245:            }
2246:
2247:            /**
2248:             * Inserts a new property into an existing record with jsxid equal to strRecordId.
2249:            If the property already exists, the existing property value will be updated. If no such record exists
2250:            in the XML document, this method fails quietly.
2251:             * @param strRecordId the <code>jsxid</code> attribute of the data record to modify.
2252:             * @param strPropName the name of the property to insert into the record.
2253:             * @param strPropValue the value of the property to insert.
2254:             * @param bRedraw if <code>true</code> or <code>null</code>, the on-screen view of this object is
2255:            immediately updated to reflect the inserted property.
2256:             * @return this object.
2257:             */
2258:            @SuppressWarnings("unchecked")
2259:            public jsx3.xml.CdfDocument insertRecordProperty(
2260:                    String strRecordId, String strPropName,
2261:                    String strPropValue, boolean bRedraw) {
2262:                String extension = "insertRecordProperty(\"" + strRecordId
2263:                        + "\", \"" + strPropName + "\", \"" + strPropValue
2264:                        + "\", \"" + bRedraw + "\").";
2265:                try {
2266:                    java.lang.reflect.Constructor<jsx3.xml.CdfDocument> ctor = jsx3.xml.CdfDocument.class
2267:                            .getConstructor(Context.class, String.class,
2268:                                    ScriptProxy.class);
2269:                    return ctor.newInstance(this , extension, getScriptProxy());
2270:                } catch (Exception ex) {
2271:                    throw new IllegalArgumentException("Unsupported type: "
2272:                            + jsx3.xml.CdfDocument.class.getName());
2273:                }
2274:            }
2275:
2276:            /**
2277:             * Inserts a new property into an existing record with jsxid equal to strRecordId.
2278:            If the property already exists, the existing property value will be updated. If no such record exists
2279:            in the XML document, this method fails quietly.
2280:             * @param strRecordId the <code>jsxid</code> attribute of the data record to modify.
2281:             * @param strPropName the name of the property to insert into the record.
2282:             * @param strPropValue the value of the property to insert.
2283:             * @param bRedraw if <code>true</code> or <code>null</code>, the on-screen view of this object is
2284:            immediately updated to reflect the inserted property.
2285:             * @param returnType The expected return type
2286:             * @return this object.
2287:             */
2288:            @SuppressWarnings("unchecked")
2289:            public <T> T insertRecordProperty(String strRecordId,
2290:                    String strPropName, String strPropValue, boolean bRedraw,
2291:                    Class<T> returnType) {
2292:                String extension = "insertRecordProperty(\"" + strRecordId
2293:                        + "\", \"" + strPropName + "\", \"" + strPropValue
2294:                        + "\", \"" + bRedraw + "\").";
2295:                try {
2296:                    java.lang.reflect.Constructor<T> ctor = returnType
2297:                            .getConstructor(Context.class, String.class,
2298:                                    ScriptProxy.class);
2299:                    return ctor.newInstance(this , extension, getScriptProxy());
2300:                } catch (Exception ex) {
2301:                    throw new IllegalArgumentException(
2302:                            "Unsupported return type: " + returnType.getName());
2303:                }
2304:            }
2305:
2306:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.