01: /**
02: * Copyright 2006 Webmedia Group Ltd.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: **/package org.araneaframework.example.main.web.demo;
16:
17: import org.araneaframework.example.main.TemplateBaseWidget;
18: import org.araneaframework.uilib.event.ProxyOnClickEventListener;
19: import org.araneaframework.uilib.form.FormElement;
20: import org.araneaframework.uilib.form.FormWidget;
21: import org.araneaframework.uilib.form.control.ButtonControl;
22: import org.araneaframework.uilib.form.control.TextareaControl;
23: import org.araneaframework.uilib.form.data.StringData;
24:
25: /**
26: * Sample widget for using the rich textarea tag. The widget
27: * shows an area with richtext controls. When users submits
28: * the area's contents it is displayed in a preview div.
29: *
30: * See accompanying
31: *
32: * @author "Toomas Römer" <toomas@webmedia.ee>
33: */
34: public class DemoRichTextForm extends TemplateBaseWidget {
35: private static final long serialVersionUID = 1L;
36: private FormWidget form;
37: private StringData areaContents;
38:
39: protected void init() throws Exception {
40: setViewSelector("demo/demoRichTextArea");
41:
42: form = new FormWidget();
43: areaContents = new StringData();
44: areaContents.setValue(defaultContents);
45: FormElement el = form.createElement("#Element",
46: new TextareaControl(), areaContents, false);
47: form.addElement("richArea", el);
48:
49: ButtonControl button = new ButtonControl();
50: button.addOnClickEventListener(new ProxyOnClickEventListener(
51: this , "testForm"));
52: form.addElement("button", "#Preview", button, null, false);
53:
54: if (isRunningInOverlay())
55: getOverlayCtx().getOverlayOptions().put("height",
56: new Integer(600));
57:
58: addWidget("form", form);
59: }
60:
61: protected void destroy() throws Exception {
62: if (isRunningInOverlay())
63: getOverlayCtx().getOverlayOptions().remove("height");
64: }
65:
66: public void handleEventTestForm() throws Exception {
67: form.convert();
68: putViewData("preview", areaContents.getValue());
69: }
70:
71: private static final String defaultContents = "<div class='post' id='post-12'>"
72: + "<h2><a href='http://blog.araneaframework.org/2006/05/16/aranea-web-framework-10-m3-released/' rel='bookmark' title='Permanent Link to Aranea Web Framework 1.0 M3 Released'>Aranea Web Framework 1.0 M3 Released</a></h2>"
73: + "<small>May 16th, 2006 <!-- by ekabanov --></small>"
74: + "<div class='entry'>"
75: + "<p><em>This release provides improvements in configuration, JSP tag API, AJAX and popups. Since the release was delayed due to technical problems it also contains early support for holding session state on client and lightweight JSP container.</em></p>"
76: + "<p>The <a href='http://araneaframework.org'>Aranea</a> 1.0 M3 release is a major milestone on the way to the final release. It contains both functional and API improvements, and numerous bugfixes. The major improvements are as follows:</p>"
77: + "<ul><li><strong>JSP tags.</strong> We want it to make it very simple to create new Aranea JSP tags and customize existing ones. For that we have refactored the current tag library to be closer to the standard API and now provide a simple set of utility classes instead of scattered functions.</li>"
78: + "<li><strong>Configuration. </strong>Aranea now supports the <em>Configuration by convention</em> by providing a default, overridable configuration. It is now possible to configure simple Aranea setups using only web.xml, yet be able to override (or add your own) filters when needed.</li>"
79: + "<li><strong>Popups. </strong>Popup API has been significantly improved and now it should be very easy to open and use arbitrary popups windows.</li>"
80: + "<li><strong>Partial page update. </strong>Partial page update allows to update only parts of the HTML page by sending a background AJAX request. Its performance has been significantly improved in this milestone.</li>"
81: + "<li><strong>Client state serialization. </strong>Aranea allows now to serialize the session state to client (optionally compressing it) to save server memory. This functionality is in prototype stage at the moment and will be finalized in 1.0 M4.</li>"
82: + "<li><strong>Lightweight JSP container. </strong>Aranea uses an internal implementation of parts of the JSP spec to power the live examples in the distribution. This feature (which will become an Aranea subproject) is also in its prototype phase and more information will follow later.</li>"
83: + "</ul><p>The next release is 1.0 M4, which is scheduled for June and should be a last, feature complete milestone before the final release, which will follow right after.</p>"
84: + "<p><em><a href='http://araneaframework.org/'>Aranea</a> is an Open Source (APL 2.0) Java Hierarchical Model-View-Controller Web Framework that provides a common simple approach to building the web application components, reusing custom or general GUI logic and extending the framework. The framework enforces programming using Object-Oriented techniques with POJOs and provides a JSP tag library that facilitates programming web GUIs without writing HTML.</em>"
85: + "</p></div>";
86: }
|