Author: steveh
Date: Tue Apr 12 13:23:23 2005
New Revision: 161112
URL: http://svn.apache.org/viewcvs?view=rev&rev=161112
Log:
Netui feature samples.
Added:
incubator/beehive/trunk/samples/netui-samples/
incubator/beehive/trunk/samples/netui-samples/Controller.jpf (with props)
incubator/beehive/trunk/samples/netui-samples/WEB-INF/
incubator/beehive/trunk/samples/netui-samples/WEB-INF/lib/
incubator/beehive/trunk/samples/netui-samples/WEB-INF/netui-validator-rules.xml
(with props)
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/build-dist.properties
(with props)
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/build-dist.xml
(with props)
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/build.xml (with
props)
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/bundles/
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/bundles/site.properties
(with props)
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/datagrid/
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/datagrid/grid.properties
(with props)
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/global/
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/log4j.xml (with
props)
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/controls/
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/controls/pets/
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/controls/pets/Pets.java
(with props)
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/controls/pets/PetsImpl.jcs
(with props)
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/beans/
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/beans/PetType.java
(with props)
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/shared/
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/shared/SharedFlow.jpfs
(with props)
incubator/beehive/trunk/samples/netui-samples/WEB-INF/validator-rules.xml
(with props)
incubator/beehive/trunk/samples/netui-samples/WEB-INF/web.xml (with props)
incubator/beehive/trunk/samples/netui-samples/error.jsp (with props)
incubator/beehive/trunk/samples/netui-samples/index.jsp (with props)
incubator/beehive/trunk/samples/netui-samples/resources/
incubator/beehive/trunk/samples/netui-samples/resources/beehive/
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/Thumbs.db
(with props)
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/error-header.jpg
(with props)
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/folder.gif
(with props)
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/lastLineJoin.gif
(with props)
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/lastNodeCollapsed.gif
(with props)
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/lastNodeExpanded.gif
(with props)
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/lineJoin.gif
(with props)
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/nodeCollapsed.gif
(with props)
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/nodeExpanded.gif
(with props)
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/rootCollapsed.gif
(with props)
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/rootExpanded.gif
(with props)
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/spacer.gif
(with props)
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/verticalLine.gif
(with props)
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/javascript/
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/javascript/netui-datagrid.js
(with props)
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/javascript/netui-tree.js
(with props)
incubator/beehive/trunk/samples/netui-samples/resources/css/
incubator/beehive/trunk/samples/netui-samples/resources/css/style.css
(with props)
incubator/beehive/trunk/samples/netui-samples/resources/template/
incubator/beehive/trunk/samples/netui-samples/resources/template/template.jsp
(with props)
incubator/beehive/trunk/samples/netui-samples/ui/
incubator/beehive/trunk/samples/netui-samples/ui/datagrid/
incubator/beehive/trunk/samples/netui-samples/ui/datagrid/Controller.jpf
(with props)
incubator/beehive/trunk/samples/netui-samples/ui/datagrid/error.jsp (with
props)
incubator/beehive/trunk/samples/netui-samples/ui/datagrid/index.jsp (with
props)
incubator/beehive/trunk/samples/netui-samples/ui/tree/
incubator/beehive/trunk/samples/netui-samples/ui/tree/Controller.jpf
(with props)
incubator/beehive/trunk/samples/netui-samples/ui/tree/content/
incubator/beehive/trunk/samples/netui-samples/ui/tree/content/0.0.0.0.jsp
(with props)
incubator/beehive/trunk/samples/netui-samples/ui/tree/content/0.0.0.1.jsp
(with props)
incubator/beehive/trunk/samples/netui-samples/ui/tree/content/0.0.0.jsp
(with props)
incubator/beehive/trunk/samples/netui-samples/ui/tree/content/0.0.jsp
(with props)
incubator/beehive/trunk/samples/netui-samples/ui/tree/content/0.1.0.jsp
(with props)
incubator/beehive/trunk/samples/netui-samples/ui/tree/content/0.1.1.jsp
(with props)
incubator/beehive/trunk/samples/netui-samples/ui/tree/content/0.1.jsp
(with props)
incubator/beehive/trunk/samples/netui-samples/ui/tree/content/0.2.0.jsp
(with props)
incubator/beehive/trunk/samples/netui-samples/ui/tree/content/0.2.1.jsp
(with props)
incubator/beehive/trunk/samples/netui-samples/ui/tree/content/0.2.jsp
(with props)
incubator/beehive/trunk/samples/netui-samples/ui/tree/content/0.jsp (with
props)
incubator/beehive/trunk/samples/netui-samples/ui/tree/echo.jsp (with
props)
incubator/beehive/trunk/samples/netui-samples/ui/tree/frameSet.jsp (with
props)
incubator/beehive/trunk/samples/netui-samples/ui/tree/tree.jsp (with
props)
incubator/beehive/trunk/samples/netui-samples/validation/
incubator/beehive/trunk/samples/netui-samples/validation/Controller.jpf
(with props)
incubator/beehive/trunk/samples/netui-samples/validation/error.jsp (with
props)
incubator/beehive/trunk/samples/netui-samples/validation/index.jsp (with
props)
incubator/beehive/trunk/samples/netui-samples/validation/success.jsp
(with props)
incubator/beehive/trunk/samples/netui-samples/velocity.log
Added: incubator/beehive/trunk/samples/netui-samples/Controller.jpf
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/Controller.jpf?view=auto&rev=161112
==============================================================================
--- incubator/beehive/trunk/samples/netui-samples/Controller.jpf (added)
+++ incubator/beehive/trunk/samples/netui-samples/Controller.jpf Tue Apr 12
13:23:23 2005
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+ import javax.servlet.http.HttpSession;
+
+import org.apache.beehive.netui.pageflow.Forward;
+import org.apache.beehive.netui.pageflow.PageFlowController;
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+
[EMAIL PROTECTED](
+ simpleActions={
+ @Jpf.SimpleAction(name="begin", path="index.jsp")
+ },
+ sharedFlowRefs={
+ @Jpf.SharedFlowRef(name="shared", type=shared.SharedFlow.class)
+ }
+)
+public class Controller
+ extends PageFlowController
+{
+ @Jpf.SharedFlowField(name="shared")
+ private shared.SharedFlow sharedFlow;
+
+ /**
+ * Callback that is invoked when this controller instance is created.
+ */
+ protected void onCreate()
+ {
+ }
+
+ /**
+ * Callback that is invoked when this controller instance is destroyed.
+ */
+ protected void onDestroy(HttpSession session)
+ {
+ }
+}
Propchange: incubator/beehive/trunk/samples/netui-samples/Controller.jpf
------------------------------------------------------------------------------
svn:eol-style = native
Added:
incubator/beehive/trunk/samples/netui-samples/WEB-INF/netui-validator-rules.xml
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/WEB-INF/netui-validator-rules.xml?view=auto&rev=161112
==============================================================================
---
incubator/beehive/trunk/samples/netui-samples/WEB-INF/netui-validator-rules.xml
(added)
+++
incubator/beehive/trunk/samples/netui-samples/WEB-INF/netui-validator-rules.xml
Tue Apr 12 13:23:23 2005
@@ -0,0 +1,38 @@
+<!DOCTYPE form-validation PUBLIC
+ "-//Apache Software Foundation//DTD Commons Validator Rules
Configuration 1.0//EN"
+ "http://jakarta.apache.org/commons/dtds/validator_1_0.dtd">
+<!--
+ This file contains the default NetUI validator definitions. It should be
+ placed in /WEB-INF, and is automatically referenced in Struts config files
+ generated by the Page Flow compiler.
+-->
+
+<form-validation>
+
+ <global>
+
+ <validator name="netui_validwhen"
+
classname="org.apache.beehive.netui.pageflow.validation.ValidatorRules"
+ method="validateValidWhen"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest,
+ javax.servlet.ServletContext"
+ msg="errors.netui_validwhen"/>
+
+ <validator name="netui_longRange"
+
classname="org.apache.beehive.netui.pageflow.validation.ValidatorRules"
+ method="validateLongRange"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends="long"
+ msg="errors.range"/>
+
+ </global>
+
+</form-validation>
Propchange:
incubator/beehive/trunk/samples/netui-samples/WEB-INF/netui-validator-rules.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added:
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/build-dist.properties
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/build-dist.properties?view=auto&rev=161112
==============================================================================
---
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/build-dist.properties
(added)
+++
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/build-dist.properties
Tue Apr 12 13:23:23 2005
@@ -0,0 +1,9 @@
+#
+#
+#
+beehive.home=../../../..
+
+servlet-api.jar=${os.CATALINA_HOME}/common/lib/servlet-api.jar
+jsp-api.jar=${os.CATALINA_HOME}/common/lib/jsp-api.jar
+
+context.path=netui-samples
\ No newline at end of file
Propchange:
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/build-dist.properties
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/build-dist.xml
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/build-dist.xml?view=auto&rev=161112
==============================================================================
--- incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/build-dist.xml
(added)
+++ incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/build-dist.xml
Tue Apr 12 13:23:23 2005
@@ -0,0 +1,121 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2004 The Apache Software Foundation.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ $Header:$
+ -->
+
+<!--
+ An Ant build file for compiling the petstoreWeb Beehive sample web
application.
+-->
+<project name="Beehive/Samples/PetstoreWeb" default="usage" basedir="../..">
+
+ <property environment="os"/>
+ <property file="${basedir}/WEB-INF/src/build.properties"/>
+
+ <import file="${beehive.home}/beehive-imports.xml"/>
+ <import file="${beehive.home}/ant/beehive-tools.xml"/>
+
+ <property name="webapp.dir" location="${basedir}"/>
+
+ <property name="tmp.sourcegen.dir" value=".tmpbeansrc"/>
+ <property name="tmp.jpfgen.dir" value=".pageflow-struts-generated"/>
+
+ <!-- Define the classpath used to build the webapp -->
+ <path id="webapp.build.classpath">
+ <pathelement location="${servlet-api.jar}"/>
+ <pathelement location="${jsp-api.jar}"/>
+ <pathelement location="${webapp.dir}/WEB-INF/classes"/>
+ <fileset dir="${webapp.dir}/WEB-INF/lib">
+ <include name="*.jar"/>
+ </fileset>
+ </path>
+
+ <target name="deploy-beehive" description="Copy the Beehive webapp rutime
into the petstoreWeb webapp">
+ <deploy-netui webappDir="${webapp.dir}"/>
+ <deploy-wsm webappDir="${webapp.dir}"/>
+ </target>
+
+ <target name="build" depends="deploy-beehive" description="Build the
petstoreWeb webapp">
+ <available property="webapp.dir.available" file="${webapp.dir}"
type="dir"/>
+ <fail unless="webapp.dir.available" message="Can't find the webapp
directory ${webapp.dir}"/>
+
+ <!--
+ this directory needs to get whacked before every build so
+ that control interface repackagings don't cause stale
+ files to be compiled
+ -->
+ <delete dir="${webapp.dir}/WEB-INF/${tmp.sourcegen.dir}"
includeEmptyDirs="true"/>
+
+ <mkdir dir="${webapp.dir}/WEB-INF/classes"/>
+
+ <!-- compile XSDs -->
+ <build-schemas sourceDir="${webapp.dir}/WEB-INF/schemas"
destDir="${webapp.dir}/WEB-INF/classes"/>
+
+ <!-- compile controls -->
+ <build-controls sourceDir="${webapp.dir}/WEB-INF/src"
+ destdir="${webapp.dir}/WEB-INF/classes"
+ tmpdir="${webapp.dir}/WEB-INF/${tmp.sourcegen.dir}"
+ classpathRef="webapp.build.classpath"/>
+
+ <!-- compile JPFs -->
+ <build-pageflows sourceDir="${webapp.dir}"
+ destdir="${webapp.dir}/WEB-INF/classes"
+ tmpdir="${webapp.dir}/WEB-INF/${tmp.sourcegen.dir}"
+ classpathRef="webapp.build.classpath"/>
+
+ <!-- copy resources -->
+ <echo>Copy all .properties and .xml files</echo>
+ <copy todir="${webapp.dir}/WEB-INF/classes">
+ <fileset dir="${webapp.dir}/WEB-INF/src"
includes="**/*.properties"/>
+ <fileset dir="${webapp.dir}/WEB-INF/src" includes="**/*.xml"/>
+ </copy>
+ </target>
+
+ <target name="clean" description="Clean the petstoreWeb">
+ <delete dir="${webapp.dir}/WEB-INF/classes" includeEmptyDirs="true"/>
+ <delete dir="${webapp.dir}/WEB-INF/${tmp.sourcegen.dir}"
includeEmptyDirs="true"/>
+ <delete dir="${webapp.dir}/WEB-INF/${tmp.jpfgen.dir}"
includeEmptyDirs="true"/>
+ </target>
+
+ <target name="war" description="Build a compressed WAR file that can be
deployed to an application container">
+ <property name="archive.dir" value="${webapp.dir}/.."/>
+
+ <!-- this does *not* exclude source from the archive -->
+ <war destfile="${archive.dir}/${context.path}.war"
webxml="${webapp.dir}/WEB-INF/web.xml">
+ <fileset dir="${webapp.dir}">
+ <exclude name="WEB-INF/web.xml"/>
+ <exclude name="WEB-INF/src/**"/>
+ </fileset>
+ </war>
+ </target>
+
+ <target name="usage" description="Print usage information for this build
file">
+ <echo>
+Welcome to the Beehive petstoreWeb sample webapp!
+
+To run the webapp, two steps need to occur:
+- copy the Beehive runtime to the webapp
+- build the webapp
+
+Once the webapp is built, it's ready to deploy onto your application container.
+ </echo>
+
+ <java fork="no" classname="org.apache.tools.ant.Main">
+ <arg line="-f ${ant.file} -projecthelp"/>
+ </java>
+ </target>
+
+</project>
\ No newline at end of file
Propchange:
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/build-dist.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/build.xml
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/build.xml?view=auto&rev=161112
==============================================================================
--- incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/build.xml (added)
+++ incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/build.xml Tue Apr
12 13:23:23 2005
@@ -0,0 +1,62 @@
+<?xml version="1.0" ?>
+
+<!--
+ Copyright 2004 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ $Header:$
+ -->
+
+<project name="Beehive petstoreWeb sample" default="build" basedir="../..">
+
+ <import file="../../../../beehive-imports.xml" />
+
+ <property name="context.path" value="petstoreWeb"/>
+
+ <!-- =========================================== -->
+ <!-- deploy targets - move the app to the server -->
+ <!-- =========================================== -->
+
+ <target name="deploy" description="Deploy the webapp to a running server">
+ <deploy-webapp webappDir="${basedir}" contextPath="${context.path}"/>
+ </target>
+
+ <target name="undeploy" description="Undeploy the webapp from a running
server">
+ <undeploy-webapp contextPath="${context.path}"/>
+ </target>
+
+ <target name="redeploy" description="Redeploy the webapp on a running
server">
+ <redeploy-webapp contextPath="${context.path}"/>
+ </target>
+
+ <!-- ========================================= -->
+ <!-- build - build the webapp -->
+ <!-- ========================================= -->
+
+ <target name="build" description="Build the webapp">
+ <deploy-netui webappDir="${basedir}"/>
+ <deploy-wsm webappDir="${basedir}"/>
+ <build-webapp webappDir="${basedir}"/>
+ </target>
+
+
+ <!-- ========================================= -->
+ <!-- clean - clean the webapp -->
+ <!-- ========================================= -->
+
+ <target name="clean" description="Clean the webapp">
+ <clean-webapp webappDir="${basedir}"/>
+ </target>
+
+</project>
Propchange: incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/build.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added:
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/bundles/site.properties
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/bundles/site.properties?view=auto&rev=161112
==============================================================================
---
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/bundles/site.properties
(added)
+++
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/bundles/site.properties
Tue Apr 12 13:23:23 2005
@@ -0,0 +1,2 @@
+browserTitle=Beehive Page Flow Feature Samples
+welcome=Welcome to the Page Flow Feature Samples
Propchange:
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/bundles/site.properties
------------------------------------------------------------------------------
svn:eol-style = native
Added:
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/datagrid/grid.properties
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/datagrid/grid.properties?view=auto&rev=161112
==============================================================================
---
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/datagrid/grid.properties
(added)
+++
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/datagrid/grid.properties
Tue Apr 12 13:23:23 2005
@@ -0,0 +1,12 @@
+datagrid.resource.path=resources/images
+datagrid.msg.nodata=No data to display
+
+sort.asc.img=/sortdown.gif
+sort.desc.img=/sortup.gif
+sort.none.img=/sortable.gif
+
+pager.msg.first=First
+pager.msg.previous=Previous
+pager.msg.next=Next
+pager.msg.last=Last
+pager.fmt.banner=Page {0} of {1}
\ No newline at end of file
Propchange:
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/datagrid/grid.properties
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/log4j.xml
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/log4j.xml?view=auto&rev=161112
==============================================================================
--- incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/log4j.xml (added)
+++ incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/log4j.xml Tue Apr
12 13:23:23 2005
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+ <appender name="BEEHIVE_FILE_LOG"
class="org.apache.log4j.RollingFileAppender">
+ <param name="File" value="beehive.log"/>
+ <param name="Append" value="true"/>
+ <param name="MaxFileSize" value="500000KB"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d{DATE} %-5p %-15c{1} [%x]:
%m%n"/>
+ </layout>
+ </appender>
+
+ <appender name="BEEHIVE_CONSOLE_LOG"
class="org.apache.log4j.ConsoleAppender">
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d{DATE} %-5p %-15c{1} [%x]:
%m%n"/>
+ </layout>
+ </appender>
+
+ <!-- Beehive -->
+ <category name="org.apache.beehive">
+ <priority value="warn"/>
+ <appender-ref ref="BEEHIVE_CONSOLE_LOG"/>
+ </category>
+
+ <!-- NetUI Script: this allows separate configuration of script error
reporting -->
+ <category name="org.apache.beehive.netui.script">
+ <priority value="error"/>
+ <appender-ref ref="BEEHIVE_CONSOLE_LOG"/>
+ </category>
+
+ <!-- Struts -->
+ <category name="org.apache.struts">
+ <priority value="warn"/>
+ <appender-ref ref="BEEHIVE_CONSOLE_LOG"/>
+ </category>
+
+ <!-- Jakarta Commons -->
+ <category name="org.apache.commons">
+ <priority value="warn"/>
+ <appender-ref ref="BEEHIVE_CONSOLE_LOG"/>
+ </category>
+
+</log4j:configuration>
Propchange: incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/log4j.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added:
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/controls/pets/Pets.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/controls/pets/Pets.java?view=auto&rev=161112
==============================================================================
---
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/controls/pets/Pets.java
(added)
+++
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/controls/pets/Pets.java
Tue Apr 12 13:23:23 2005
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+package org.apache.beehive.samples.controls.pets;
+
+import org.apache.beehive.controls.api.bean.*;
+import org.apache.beehive.samples.netui.beans.PetType;
+
[EMAIL PROTECTED]
+public interface Pets
+{
+ String hello();
+
+ PetType[] getPetList();
+}
+
+
Propchange:
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/controls/pets/Pets.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/controls/pets/PetsImpl.jcs
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/controls/pets/PetsImpl.jcs?view=auto&rev=161112
==============================================================================
---
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/controls/pets/PetsImpl.jcs
(added)
+++
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/controls/pets/PetsImpl.jcs
Tue Apr 12 13:23:23 2005
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+package org.apache.beehive.samples.controls.pets;
+
+import org.apache.beehive.controls.api.bean.*;
+import org.apache.beehive.samples.netui.beans.PetType;
+
[EMAIL PROTECTED]
+public class PetsImpl implements Pets
+{
+ public String hello()
+ {
+ return "hello!";
+ }
+
+ public PetType[] getPetList()
+ {
+ PetType[] petlist = {
+ new PetType(1, "American Tabby", "Cat", 20.00),
+ new PetType(2, "Short Haired", "Cat", 20.00),
+ new PetType(3, "Long Haired", "Cat", 20.00),
+ new PetType(4, "Blue Russian", "Cat", 80.00),
+ new PetType(5, "Pixy Bob", "Cat", 20.00),
+ new PetType(6, "Siamese", "Cat", 80.00),
+ new PetType(7, "Minx", "Cat", 20.00),
+ new PetType(8, "Bull Mastif", "Dog", 350.00),
+ new PetType(9, "Dalmatian", "Dog", 20.00)
+ };
+
+ return petlist;
+ }
+}
+
+
Propchange:
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/controls/pets/PetsImpl.jcs
------------------------------------------------------------------------------
svn:eol-style = native
Added:
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/beans/PetType.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/beans/PetType.java?view=auto&rev=161112
==============================================================================
---
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/beans/PetType.java
(added)
+++
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/beans/PetType.java
Tue Apr 12 13:23:23 2005
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+package org.apache.beehive.samples.netui.beans;
+
+public class PetType
+{
+
+ private int petID;
+ private String name;
+ private String description;
+ private double price;
+
+ public PetType() {}
+
+ public PetType(int petID, String name, String description, double price) {
+ this.petID= petID;
+ this.name = name;
+ this.description = description;
+ this.price = price;
+ }
+
+ public int getPetID() {return petID;}
+ public String getName() {return name;}
+ public String getDescription() {return description;}
+ public double getPrice() {return price;}
+}
\ No newline at end of file
Propchange:
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/beans/PetType.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/shared/SharedFlow.jpfs
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/shared/SharedFlow.jpfs?view=auto&rev=161112
==============================================================================
---
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/shared/SharedFlow.jpfs
(added)
+++
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/shared/SharedFlow.jpfs
Tue Apr 12 13:23:23 2005
@@ -0,0 +1,85 @@
+package shared;
+
+import java.io.IOException;
+
+import org.apache.beehive.netui.pageflow.Forward;
+import org.apache.beehive.netui.pageflow.PageFlowException;
+import org.apache.beehive.netui.pageflow.SharedFlowController;
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+
+/**
+ * This shared flow can define actions, exception handlers, and state to be
shared among page flows
+ * that reference it. A page flow references this shared flow inside a
<code>Jpf.Controller</code>
+ * annotation as:
+ * <pre>
+ * sharedFlowRefs={
+ * @Jpf.SharedFlowRef(name="shared", type=shared.SharedFlow.class)
+ * }
+ * </pre>
+ *
+ * Once referenced, the following features apply:
+ * <ul>
+ * <li>
+ * An instance of this shared flow will be created and stored the
first time the page
+ * flow is accessed.
+ * </li>
+ * <li>
+ * The page flow (or its pages) can reference actions using the
pattern
+ * <i>shared-flow-name.action-name</i>, e.g., "shared.someAction".
+ * </li>
+ * <li>
+ * Unhandled exceptions in the page flow will be handled by
<code>Jpf.Catch</code>
+ * annotations in this shared flow.
+ * </li>
+ * <li>
+ * In pages and annotations that bind to data using the expression
language, properties
+ * in this shared flow are accessed through the
<code>sharedFlow</code> binding context.
+ * </li>
+ * <li>
+ * A page flow can have an automatically-initialized member
reference to this shared
+ * flow using the <code>Jpf.SharedFlowField</code> annotation, like
this:
+ * <pre>
+ * @Jpf.SharedFlowField(name="shared")
+ * private shared.SharedFlow _mySharedFlowReference;
+ * </pre>
+ * </li>
+ * </ul>
+ */
[EMAIL PROTECTED](
+ catches={
+ @Jpf.Catch(type=PageFlowException.class,
method="handlePageFlowException"),
+ @Jpf.Catch(type=Exception.class, method="handleException")
+ }
+)
+public class SharedFlow
+ extends SharedFlowController
+{
+ @Jpf.ExceptionHandler(
+ forwards={
+ @Jpf.Forward(name="errorPage", path="/error.jsp")
+ }
+ )
+ protected Forward handleException(Exception ex, String actionName, String
message, Object form)
+ {
+ System.err.print("[" + getRequest().getContextPath() + "] ");
+ System.err.println("Unhandled exception caught in shared flow " +
getDisplayName() + ":");
+ ex.printStackTrace();
+ return new Forward("errorPage");
+ }
+
+ /**
+ * Handler for native page flow exceptions (e.g., ActionNotFoundException,
which is thrown when
+ * an unknown page flow action is requested). This handler allows these
exceptions to write
+ * informative error pages to the response when the server is not in
production mode, and it
+ * allows them to send an appropriate error on the response when the
server is in production
+ * mode. To use the standard exception handler for these exceptions,
simply remove this method
+ * and the Jpf.Catch annotation that references it.
+ */
+ @Jpf.ExceptionHandler
+ public Forward handlePageFlowException(PageFlowException ex, String
actionName, String message, Object form)
+ throws IOException
+ {
+ ex.sendError(getRequest(), getResponse());
+ return null;
+ }
+}
Propchange:
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/shared/SharedFlow.jpfs
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/beehive/trunk/samples/netui-samples/WEB-INF/validator-rules.xml
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/WEB-INF/validator-rules.xml?view=auto&rev=161112
==============================================================================
--- incubator/beehive/trunk/samples/netui-samples/WEB-INF/validator-rules.xml
(added)
+++ incubator/beehive/trunk/samples/netui-samples/WEB-INF/validator-rules.xml
Tue Apr 12 13:23:23 2005
@@ -0,0 +1,287 @@
+<!DOCTYPE form-validation PUBLIC
+ "-//Apache Software Foundation//DTD Commons Validator Rules
Configuration 1.1.3//EN"
+ "http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd">
+<!--
+ $Header: /home/cvs/jakarta-struts/conf/share/validator-rules.xml,v 1.52
2004/07/25 12:00:20 niallp Exp $
+ $Revision: 1.52 $
+ $Date: 2004/07/25 12:00:20 $
+
+ This file contains the default Struts Validator pluggable validator
+ definitions. It should be placed somewhere under /WEB-INF and
+ referenced in the struts-config.xml under the plug-in element
+ for the ValidatorPlugIn.
+
+ <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
+ <set-property property="pathnames" value="/WEB-INF/validator-rules.xml,
+ /WEB-INF/validation.xml"/>
+ </plug-in>
+
+ These are the default error messages associated with
+ each validator defined in this file. They should be
+ added to your projects ApplicationResources.properties
+ file or you can associate new ones by modifying the
+ pluggable validators msg attributes in this file.
+
+ # Struts Validator Error Messages
+ errors.required={0} is required.
+ errors.minlength={0} can not be less than {1} characters.
+ errors.maxlength={0} can not be greater than {1} characters.
+ errors.invalid={0} is invalid.
+
+ errors.byte={0} must be a byte.
+ errors.short={0} must be a short.
+ errors.integer={0} must be an integer.
+ errors.long={0} must be a long.
+ errors.float={0} must be a float.
+ errors.double={0} must be a double.
+
+ errors.date={0} is not a date.
+ errors.range={0} is not in the range {1} through {2}.
+ errors.creditcard={0} is an invalid credit card number.
+ errors.email={0} is an invalid e-mail address.
+
+ Note: Starting in Struts 1.2.0 the default javascript definitions have
+ been consolidated to commons-validator. The default can be overridden
+ by supplying a <javascript> element with a CDATA section, just as
+ in struts 1.1.
+
+-->
+
+<form-validation>
+
+ <global>
+
+ <validator name="required"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateRequired"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ msg="errors.required"/>
+
+ <validator name="requiredif"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateRequiredIf"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ org.apache.commons.validator.Validator,
+ javax.servlet.http.HttpServletRequest"
+ msg="errors.required"/>
+
+ <validator name="validwhen"
+ msg="errors.required"
+ classname="org.apache.struts.validator.validwhen.ValidWhen"
+ method="validateValidWhen"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ org.apache.commons.validator.Validator,
+ javax.servlet.http.HttpServletRequest"/>
+
+
+ <validator name="minlength"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateMinLength"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends=""
+ msg="errors.minlength"
+
jsFunction="org.apache.commons.validator.javascript.validateMinLength"/>
+
+
+ <validator name="maxlength"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateMaxLength"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends=""
+ msg="errors.maxlength"
+
jsFunction="org.apache.commons.validator.javascript.validateMaxLength"/>
+
+
+
+ <validator name="mask"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateMask"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends=""
+ msg="errors.invalid"/>
+
+
+ <validator name="byte"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateByte"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends=""
+ msg="errors.byte"
+ jsFunctionName="ByteValidations"/>
+
+
+ <validator name="short"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateShort"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends=""
+ msg="errors.short"
+ jsFunctionName="ShortValidations"/>
+
+
+ <validator name="integer"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateInteger"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends=""
+ msg="errors.integer"
+ jsFunctionName="IntegerValidations"/>
+
+
+
+ <validator name="long"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateLong"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends=""
+ msg="errors.long"/>
+
+
+ <validator name="float"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateFloat"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends=""
+ msg="errors.float"
+ jsFunctionName="FloatValidations"/>
+
+ <validator name="double"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateDouble"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends=""
+ msg="errors.double"/>
+
+
+ <validator name="date"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateDate"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends=""
+ msg="errors.date"
+ jsFunctionName="DateValidations"/>
+
+
+ <validator name="intRange"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateIntRange"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends="integer"
+ msg="errors.range"/>
+
+
+ <validator name="floatRange"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateFloatRange"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends="float"
+ msg="errors.range"/>
+
+
+ <validator name="creditCard"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateCreditCard"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends=""
+ msg="errors.creditcard"/>
+
+
+ <validator name="email"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateEmail"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends=""
+ msg="errors.email"/>
+
+ <validator name="url"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateUrl"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends=""
+ msg="errors.url"/>
+
+ <!--
+ This simply allows struts to include the validateUtilities into a page,
it should
+ not be used as a validation rule.
+ -->
+ <validator name="includeJavaScriptUtilities"
+ classname=""
+ method=""
+ methodParams=""
+ depends=""
+ msg=""
+
jsFunction="org.apache.commons.validator.javascript.validateUtilities"/>
+
+ </global>
+
+</form-validation>
Propchange:
incubator/beehive/trunk/samples/netui-samples/WEB-INF/validator-rules.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/beehive/trunk/samples/netui-samples/WEB-INF/web.xml
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/WEB-INF/web.xml?view=auto&rev=161112
==============================================================================
--- incubator/beehive/trunk/samples/netui-samples/WEB-INF/web.xml (added)
+++ incubator/beehive/trunk/samples/netui-samples/WEB-INF/web.xml Tue Apr 12
13:23:23 2005
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <display-name>Beehive Web Application</display-name>
+
+ <filter>
+ <filter-name>PageFlowJspFilter</filter-name>
+
<filter-class>org.apache.beehive.netui.pageflow.PageFlowJspFilter</filter-class>
+ </filter>
+
+ <filter>
+ <filter-name>PageFlowFacesFilter</filter-name>
+
<filter-class>org.apache.beehive.netui.pageflow.PageFlowFacesFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>PageFlowJspFilter</filter-name>
+ <url-pattern>*.jsp</url-pattern>
+ <dispatcher>FORWARD</dispatcher>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>INCLUDE</dispatcher>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>PageFlowJspFilter</filter-name>
+ <url-pattern>*.jspx</url-pattern>
+ <dispatcher>FORWARD</dispatcher>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>INCLUDE</dispatcher>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>PageFlowFacesFilter</filter-name>
+ <url-pattern>*.faces</url-pattern>
+ <dispatcher>FORWARD</dispatcher>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>INCLUDE</dispatcher>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>PageFlowFacesFilter</filter-name>
+ <url-pattern>*.jsf</url-pattern>
+ <dispatcher>FORWARD</dispatcher>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>INCLUDE</dispatcher>
+ </filter-mapping>
+
+ <!-- Action Servlet Configuration (with debugging) -->
+ <servlet>
+ <servlet-name>action</servlet-name>
+
<servlet-class>org.apache.beehive.netui.pageflow.PageFlowActionServlet</servlet-class>
+ <init-param>
+ <param-name>config</param-name>
+
<param-value>/WEB-INF/.pageflow-struts-generated/jpf-struts-config.xml</param-value>
+ </init-param>
+ <init-param>
+ <param-name>debug</param-name>
+ <param-value>2</param-value>
+ </init-param>
+ <init-param>
+ <param-name>detail</param-name>
+ <param-value>2</param-value>
+ </init-param>
+ <load-on-startup>2</load-on-startup>
+ </servlet>
+
+ <!-- The XmlHttpRequest handler Servlet -->
+ <servlet>
+ <servlet-name>XmlHttpRequestServlet</servlet-name>
+
<servlet-class>org.apache.beehive.netui.pageflow.xmlhttprequest.XmlHttpRequestServlet</servlet-class>
+ </servlet>
+
+ <!-- Struts Action Servlet Mappings -->
+ <!-- Note that because Struts takes the *last* mapping here as the
extension to add to
+ actions posted from forms, we must have *.do come after *.jpf (etc.).
-->
+ <servlet-mapping>
+ <servlet-name>action</servlet-name>
+ <url-pattern>*.jpf</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>action</servlet-name>
+ <url-pattern>*.jpfs</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>action</servlet-name>
+ <url-pattern>*.jsfb</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>action</servlet-name>
+ <url-pattern>*.do</url-pattern>
+ </servlet-mapping>
+
+ <!-- XmlHttpRequest Servlet -->
+ <servlet-mapping>
+ <servlet-name>XmlHttpRequestServlet</servlet-name>
+ <url-pattern>*.xhr</url-pattern>
+ </servlet-mapping>
+
+ <welcome-file-list>
+ <welcome-file>index.jsp</welcome-file>
+ </welcome-file-list>
+
+ <error-page>
+ <error-code>500</error-code>
+ <location>/error.jsp</location>
+ </error-page>
+</web-app>
Propchange: incubator/beehive/trunk/samples/netui-samples/WEB-INF/web.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/beehive/trunk/samples/netui-samples/error.jsp
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/error.jsp?view=auto&rev=161112
==============================================================================
--- incubator/beehive/trunk/samples/netui-samples/error.jsp (added)
+++ incubator/beehive/trunk/samples/netui-samples/error.jsp Tue Apr 12 13:23:23
2005
@@ -0,0 +1,69 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<netui:html>
+ <head>
+ <title>NetUI Error</title>
+ <style>
+ table {
+ border: solid 1pt #90180F;
+ background-color: #ffffff;
+ }
+ body {
+ margin: 20pt 5%;
+ background-color: #fdf4b6;
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 10pt;
+ }
+ .caption {
+ font-weight: bold;
+ font-size: 20pt;
+ text-align: left;
+ width: 500px
+ }
+ th {vertical-align: top;
+ text-align: right;
+ font-size: 12pt;
+ color: #90180F;
+ width: 100px;
+ }
+ td {
+ text-align: left;
+ }
+ hr {
+ color: #90180F;
+ }
+ .posTitle {
+ position: relative;
+ color: #6C0C06;
+ left: -160pt;
+ top: -12pt;
+ }
+ .pfErrorLineOne {
+ color: red;
+ font-size: 12pt;
+ font-style: italic;
+ }
+ img {
+ border: solid 2pt #90180F;
+ }
+ </style>
+ <netui:base/>
+ </head>
+ <netui:body>
+ <div class="caption">
+ <netui:image
src="${pageContext.request.contextPath}/resources/beehive/version1/images/error-header.jpg"
width="338" height="96" alt="Page Flow Error"/>
+ <span class="posTitle">NetUI Error</span>
+ </div>
+ <table border="0" cellspacing='0' cellpadding='4'>
+ <c:if test="${request.errorMessage != null}">
+ <tr><th>Message:</th><td class="pfErrorLineOne"><netui:label
value="${request.errorMessage}" defaultValue=" "/></td></tr>
+ </c:if>
+ <tr><th>Exception:</th><td class="pfErrorLineOne"><netui:exceptions
showMessage="true"/></td></tr>
+ <tr><td colspan="2" style="min-width:342"><hr></td></tr>
+ <tr><th>Stack Trace:</th><td><netui:exceptions showMessage="false"
showStackTrace="true"/></td></tr>
+ </table>
+ </netui:body>
+</netui:html>
+<%-- Some browsers will not display this page unless the response status code
is 200. --%>
+<% response.setStatus(200); %>
Propchange: incubator/beehive/trunk/samples/netui-samples/error.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/beehive/trunk/samples/netui-samples/index.jsp
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/index.jsp?view=auto&rev=161112
==============================================================================
--- incubator/beehive/trunk/samples/netui-samples/index.jsp (added)
+++ incubator/beehive/trunk/samples/netui-samples/index.jsp Tue Apr 12 13:23:23
2005
@@ -0,0 +1,25 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0"
prefix="netui-data"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0"
prefix="netui-template"%>
+
+<netui-template:template templatePage="/resources/template/template.jsp">
+ <netui-template:setAttribute name="samTitle" value="Home Page"/>
+ <netui-template:section name="main">
+ <p>The following samples demonstrate a variety of individual Page Flow
features.
+ </p>
+ <dl>
+ <dt><a href="validation/Controller.jpf">validation</a></dt>
+ <dd>This sample demonstrates the declarative validation model.</dd>
+ </dl>
+ <dl>
+ <dt><a href="ui/datagrid/Controller.jpf">data grid</a></dt>
+ <dd>Demonstrates how to render a data set (in this case, an array of
objects)
+ as an HTML table using the &netui-data:dataGrid> tag.</dd>
+ </dl>
+ <dl>
+ <dt><a href="ui/tree/Controller.jpf">tree</a></dt>
+ <dd>Demonstrates how to use &netui:tree> and related tags.</dd>
+ </dl>
+ </netui-template:section>
+</netui-template:template>
Propchange: incubator/beehive/trunk/samples/netui-samples/index.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Added:
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/Thumbs.db
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/Thumbs.db?view=auto&rev=161112
==============================================================================
Binary file - no diff available.
Propchange:
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/Thumbs.db
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/error-header.jpg
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/error-header.jpg?view=auto&rev=161112
==============================================================================
Binary file - no diff available.
Propchange:
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/error-header.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/folder.gif
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/folder.gif?view=auto&rev=161112
==============================================================================
Binary file - no diff available.
Propchange:
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/folder.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/lastLineJoin.gif
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/lastLineJoin.gif?view=auto&rev=161112
==============================================================================
Binary file - no diff available.
Propchange:
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/lastLineJoin.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/lastNodeCollapsed.gif
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/lastNodeCollapsed.gif?view=auto&rev=161112
==============================================================================
Binary file - no diff available.
Propchange:
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/lastNodeCollapsed.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/lastNodeExpanded.gif
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/lastNodeExpanded.gif?view=auto&rev=161112
==============================================================================
Binary file - no diff available.
Propchange:
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/lastNodeExpanded.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/lineJoin.gif
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/lineJoin.gif?view=auto&rev=161112
==============================================================================
Binary file - no diff available.
Propchange:
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/lineJoin.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/nodeCollapsed.gif
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/nodeCollapsed.gif?view=auto&rev=161112
==============================================================================
Binary file - no diff available.
Propchange:
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/nodeCollapsed.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/nodeExpanded.gif
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/nodeExpanded.gif?view=auto&rev=161112
==============================================================================
Binary file - no diff available.
Propchange:
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/nodeExpanded.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/rootCollapsed.gif
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/rootCollapsed.gif?view=auto&rev=161112
==============================================================================
Binary file - no diff available.
Propchange:
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/rootCollapsed.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/rootExpanded.gif
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/rootExpanded.gif?view=auto&rev=161112
==============================================================================
Binary file - no diff available.
Propchange:
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/rootExpanded.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/spacer.gif
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/spacer.gif?view=auto&rev=161112
==============================================================================
Binary file - no diff available.
Propchange:
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/spacer.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/verticalLine.gif
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/verticalLine.gif?view=auto&rev=161112
==============================================================================
Binary file - no diff available.
Propchange:
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/images/verticalLine.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/javascript/netui-datagrid.js
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/javascript/netui-datagrid.js?view=auto&rev=161112
==============================================================================
---
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/javascript/netui-datagrid.js
(added)
+++
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/javascript/netui-datagrid.js
Tue Apr 12 13:23:23 2005
@@ -0,0 +1,383 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+
+/* ==========================================================
+ *
+ *
+ *
+ * ==========================================================
+ */
+function NetUIFilterURL() {
+ this._urlParams = new Array();
+ this._filters = new Array();
+}
+
+/* return void */
+NetUIFilterURL.prototype.init = function(search) {
+ /* todo: parse the URL into its component key/value pairs */
+ var qIndex = search.indexOf('?') + 1;
+ var paramsArray = search.substring(qIndex).split('&');
+ var array = new Array();
+ for(var i = 0; i < paramsArray.length; i++) {
+ var eIndex = paramsArray[i].indexOf('=');
+ var key = paramsArray[i].substring(0,eIndex);
+ var value = paramsArray[i].substring(eIndex+1);
+
+ if(key == NetUIFilterList.FILTER_KEY) {
+ //alert('add filter: ' + value);
+ var filter = NetUIFilterList.parse(value);
+ this._filters[this._filters.length] = filter;
+ }
+ else {
+ //alert('add URL param: ' + value);
+ var param = new NetUIUrlParam(key,value);
+ this._urlParams[this._urlParams.length] = param;
+ }
+ }
+}
+
+/* todo: remove this method in favor of processing by the caller */
+NetUIFilterURL.prototype.removeUrlParam = function(key) {
+ for(var i = 0; i < this._urlParams.length; i++) {
+ if(this._urlParams[i].getKey() == key) {
+ /*
+ this is a hack to simulate removing an element from the array
+ todo: need to implement real delete here
+ */
+ this._urlParams[i].setKey('');
+ }
+ }
+}
+
+/* return NetUIFilterList */
+NetUIFilterURL.prototype.lookupFiltersForDataGrid = function(dataGridName) {
+
+ for(var i = 0; i < this._filters.length; i++) {
+ //alert('check filter: ' + this._filters[i].toUrlParam());
+ if(this._filters[i].getDataGridName() == dataGridName)
+ return this._filters[i];
+ }
+
+ return null;
+}
+
+NetUIFilterURL.prototype.hasFiltersForDataGrid = function(dataGridName) {
+ var filters = this.lookupFiltersForDataGrid(dataGridName);
+ return (filters != null ? true : false);
+}
+
+/* return String */
+NetUIFilterURL.prototype.toQueryString = function() {
+
+ qs = '?';
+ for(var i = 0; i < this._urlParams.length; i++) {
+ var p = this._urlParams[i].toUrlParam();
+ if(p == null)
+ continue;
+
+ if(i > 0)
+ qs += '&';
+ qs += this._urlParams[i].toUrlParam();
+ }
+
+ if(qs.length > 1)
+ qs += '&';
+
+ for(var i = 0; i < this._filters.length; i++) {
+ /* allow parameters to return null to indicate that there's no parameter
to add */
+ var p = this._filters[i].toUrlParam();
+ if(p == null)
+ continue;
+
+ if(i > 0)
+ qs += '&';
+ //alert('NetUIFilterURL::toQueryString:filter:\"' + p + '\"');
+ qs += p;
+ }
+
+ return qs;
+}
+
+NetUIFilterURL.prototype.addFilterList = function(netuiFilterList) {
+ this._filters[this._filters.length] = netuiFilterList;
+}
+
+/* ==========================================================
+ *
+ *
+ *
+ * ==========================================================
+ */
+function NetUIUrlParam(key,value) {
+ this._key = key;
+ this._value = value;
+}
+
+NetUIUrlParam.prototype.getKey = function() {
+ return this._key;
+}
+
+NetUIUrlParam.prototype.setKey = function(key) {
+ this._key = key;
+}
+
+NetUIUrlParam.prototype.getValue = function() {
+ return this._value;
+}
+
+NetUIUrlParam.prototype.setValue = function(value) {
+ this._value = value;
+}
+
+NetUIUrlParam.prototype.toUrlParam = function() {
+ if(this._key == null || this._key == '')
+ return null;
+ else return this._key + '=' + this._value;
+}
+
+/* ==========================================================
+ *
+ *
+ *
+ * ==========================================================
+ */
+function NetUIFilterList(dataGridName) {
+ this._dataGridName = dataGridName;
+ this._filters = new Array();
+}
+
+function NetUIFilterList_parse(value) {
+ var decodedValue = decodeURIComponent(value);
+ var scIndex = decodedValue.indexOf(';');
+ var dataGridName = decodedValue.substring(0, scIndex);
+ var filter = new NetUIFilterList(dataGridName);
+
+ var filterArray = decodedValue.substring(scIndex+1).split(',');
+ for(var i = 0; i < filterArray.length; i++) {
+ var parts = filterArray[i].split('~');
+ filter.addFilter(parts[0],parts[1],parts[2]);
+ }
+
+ return filter;
+}
+
+NetUIFilterList.parse = NetUIFilterList_parse;
+NetUIFilterList.FILTER_KEY = "netui_filter";
+
+NetUIFilterList.prototype.getDataGridName = function() {
+ return this._dataGridName;
+}
+
+/* return void */
+NetUIFilterList.prototype.addFilter = function(fExpr,fOp,fVal) {
+ this._filters[this._filters.length] = new NetUIFilter(fExpr,fOp,fVal);
+}
+
+NetUIFilterList.prototype.replaceFilters = function(netuiFilterArray) {
+ this._filters = netuiFilterArray;
+}
+
+/* return String */
+NetUIFilterList.prototype.toUrlParam = function() {
+ if(this._filters == null || this._filters.length == 0)
+ return null;
+
+ var paramValue = '';
+ var foundFilter = false;
+
+ paramValue += this._dataGridName;
+ paramValue += ';';
+ for(var i = 0; i < this._filters.length; i++) {
+ var p = this._filters[i].toUrlParam();
+ if(p == null)
+ continue;
+
+ if(foundFilter && i > 0)
+ paramValue += ',';
+ paramValue += p;
+ foundFilter = true;
+ }
+
+ if(!foundFilter)
+ return null;
+ else return NetUIFilterList.FILTER_KEY + '=' + paramValue;
+}
+
+/* return NetUIFilterList */
+NetUIFilterList.prototype.lookupFiltersForFilterExpression =
function(filterExpression) {
+ var filters = new Array();
+ for(var i = 0; i < this._filters.length; i++) {
+ if(this._filters[i].getFilterExpression() == filterExpression)
+ filters[filters.length] = this._filters[i];
+ }
+
+ return filters;
+}
+
+/* ==========================================================
+ *
+ *
+ *
+ * ==========================================================
+ */
+function NetUIFilter(fExpr,fOp,fVal) {
+ this._fExpr = fExpr;
+ this._fOp = fOp;
+ this._fVal = fVal;
+}
+
+NetUIFilter.prototype.getFilterExpression = function() {
+ return this._fExpr;
+}
+
+NetUIFilter.prototype.getFilterOperation = function() {
+ return this._fOp;
+}
+
+NetUIFilter.prototype.getFilterValue = function() {
+ return this._fVal;
+}
+
+NetUIFilter.prototype.toUrlParam = function() {
+ if(this._fVal == null || this._fVal == '' ||
+ this._fOp == null || this._fOp == '' ||
+ this._fExpr == null || this._fExpr == '')
+ return null;
+
+ var val = this._fVal;
+ if(this._fOp == 'isempty' || this._fOp == 'isnotempty')
+ val = '*';
+
+ var op = (this._fOp != null ? this._fOp : '');
+
+ var filter = this._fExpr + '~' + op + '~' + val
+
+ return filter;
+}
+
+/* ==========================================================
+ *
+ *
+ *
+ * ==========================================================
+ */
+ /*
+ todo: switch over to using this URL method once the urlParams / filters have
+ been merged in the NetUIFilterUrl class
+ */
+function buildURL(params) {
+ if(params == null || params.length == 0)
+ return '';
+
+ var qs = '?';
+ for(var i = 0; i < params.length; i++) {
+ var p = params[i].toUrlParam();
+ if(p == null)
+ continue;
+
+ if(i > 0)
+ qs += '&';
+ qs += params[i].toUrlParam();
+ }
+
+ return qs;
+}
+
+/* ==========================================================
+ *
+ * Utility method that will load a list of HTML form <inputs>
+ * with filter information out of the URL. The HTML ids of
+ * the <input> elements must match filter expressions in the
+ * URL's filter parameters.
+ *
+ * ==========================================================
+ */
+function doLoadNetUIFilters(formTagId, gridName) {
+ var form = document.getElementById(formTagId);
+ if(form == null)
+ alert('could not find form with id: ' + formTagId);
+
+ var netuiUrl = new NetUIFilterURL();
+ netuiUrl.init(window.location.search);
+ var gridFilters = netuiUrl.lookupFiltersForDataGrid(gridName);
+ if(gridFilters == null)
+ return;
+
+ var elems = form.elements.length;
+ for(var i = 0; i < elems; i++) {
+ var widget = form.elements[i];
+
+ if(widget.type == "submit" || widget.type == "hidden")
+ continue;
+
+ var id = widget.id;
+ var savedFilters = gridFilters.lookupFiltersForFilterExpression(id);
+ if(savedFilters != null)
+ widget.value = savedFilters[0].getFilterValue();
+ }
+ return;
+}
+
+/* ==========================================================
+ *
+ * Utility method that will create a filter URL from given
+ * an HTML form. This method walks the <input> elements
+ * in the form and builds a filter operation from the
+ * values therein. The default filter operation used here
+ * is 'contains'.
+ *
+ * Once the filters have been constructed, the filter URL
+ * is used to directly replace the URL in browser's current
+ * window.
+ *
+ * ==========================================================
+ */
+function doNetUIFilters(formTagId, gridName) {
+ var form = document.getElementById(formTagId);
+ if(form == null)
+ alert('could not find form with id: ' + formTagId);
+
+ var netuiUrl = new NetUIFilterURL();
+ netuiUrl.init(window.location.search);
+ var gridFilters = netuiUrl.lookupFiltersForDataGrid(gridName);
+ if(gridFilters == null) {
+ gridFilters = new NetUIFilterList(gridName);
+ netuiUrl.addFilterList(gridFilters);
+ }
+
+ var filters = new Array();
+ var elems = form.elements.length;
+ for(var i = 0; i < elems; i++) {
+ var widget = form.elements[i];
+
+ if(widget.type == "submit" || widget.type == "hidden")
+ continue;
+
+ var filter = new NetUIFilter(widget.id, 'contains', widget.value);
+ filters[filters.length] = filter;
+ }
+
+ gridFilters.replaceFilters(filters);
+ var search = netuiUrl.toQueryString();
+ /* set the window's location */
+ if(search != null && search.indexOf('?') < 0)
+ search += '?' + search;
+ window.location = window.location.protocol + "//" + location.host +
window.location.pathname + (search != null ? search : '');
+
+ return false;
+}
\ No newline at end of file
Propchange:
incubator/beehive/trunk/samples/netui-samples/resources/beehive/version1/javascript/netui-datagrid.js
------------------------------------------------------------------------------
svn:eol-style = native