001: /*
002: * Copyright 2005 Joe Walker
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016: package org.getahead.dwrdemo.fluent;
017:
018: import org.directwebremoting.fluent.FluentConfigurator;
019:
020: /**
021: * An equivalent of dwr.xml for demo purposes
022: * @author Joe Walker [joe at getahead dot ltd dot uk]
023: */
024: public class DemoFluentConfigurator extends FluentConfigurator {
025: /* (non-Javadoc)
026: * @see org.directwebremoting.fluent.FluentConfigurator#configure()
027: */
028: @Override
029: public void configure() {
030: /*
031: withFilter("org.getahead.dwrdemo.monitor.MonitoringAjaxFilter");
032: withFilter("org.directwebremoting.filter.ExtraLatencyAjaxFilter")
033: .addParam("delay", "200");
034: */
035:
036: // intro - for the test on index.html
037: withCreator("new", "Intro").addParam("class",
038: "org.getahead.dwrdemo.intro.Intro");
039:
040: // address
041: withCreator("new", "AddressLookup").addParam("class",
042: "org.getahead.dwrdemo.address.AddressLookup");
043:
044: // chat
045: withCreator("new", "JavascriptChat").addParam("scope",
046: "application").addParam("class",
047: "org.getahead.dwrdemo.chat.JavascriptChat");
048: withCreator("new", "JavaChat")
049: .addParam("scope", "application")
050: .addParam("class", "org.getahead.dwrdemo.chat.JavaChat");
051: withConverter("bean", "org.getahead.dwrdemo.chat.Message");
052:
053: // clock
054: withCreator("new", "Clock").addParam("scope", "application")
055: .addParam("class", "org.getahead.dwrdemo.clock.Clock");
056:
057: // people
058: withCreator("new", "People")
059: .addParam("scope", "script")
060: .addParam("class", "org.getahead.dwrdemo.people.People");
061: withConverter("bean", "org.getahead.dwrdemo.people.Person")
062: .addParam("scriptName", "Person"); /* TODO: make this work */
063:
064: // simple text
065: withCreator("new", "Demo").addParam("class",
066: "org.getahead.dwrdemo.simpletext.Demo");
067:
068: // resources not in this war file: java.util.Date
069: withCreator("new", "JDate")
070: .addParam("scope", "session")
071: .addParam("class", "java.util.Date")
072: .exclude("getHours")
073: .withAuth("getMinutes", "admin")
074: .withAuth("getMinutes", "devel")
075: .addFilter(
076: "org.getahead.dwrdemo.filter.LoggingAjaxFilter");
077:
078: // TIBCO GI demos
079: withCreator("new", "Publisher")
080: .addParam("scope", "application").addParam("class",
081: "org.getahead.dwrdemo.gidemo.Publisher");
082: withCreator("new", "Corporations").addParam("scope",
083: "application").addParam("class",
084: "org.getahead.dwrdemo.gidemo.Corporations");
085: withConverter("bean", "org.getahead.dwrdemo.gidemo.Corporation");
086: withCreator("new", "CallCenter").addParam("scope",
087: "application").addParam("class",
088: "org.getahead.dwrdemo.ticketcenter.CallCenter");
089: withConverter("bean", "org.getahead.dwrdemo.ticketcenter.Call");
090: withCreator("new", "Reverse").addParam("scope", "application")
091: .addParam("class",
092: "org.getahead.dwrdemo.reverse.Reverse");
093:
094: // image generator
095: withCreator("new", "UploadDownload").addParam("scope",
096: "session").addParam("class",
097: "org.getahead.dwrdemo.files.UploadDownload");
098:
099: // this is a bad idea for live, but can be useful in testing
100: withConverter("exception", "java.lang.Exception");
101: withConverter("bean", "java.lang.StackTraceElement");
102: }
103: }
|