Author: noe...@jb... Date: 2006-01-03 08:13:53 -0500 (Tue, 03 Jan 2006) New Revision: 1976 Added: trunk/labs/reportingservices/reporting-services/bin/ trunk/labs/reportingservices/reporting-services/doc/logo.png trunk/labs/reportingservices/reporting-services/doc/report-services.xcf trunk/labs/reportingservices/reporting-services/doc/reporting-services.xcf trunk/labs/reportingservices/reporting-services/lib/apache-myfaces/myfaces-extensions.jar trunk/labs/reportingservices/reporting-services/lib/jboss-serialization/ trunk/labs/reportingservices/reporting-services/lib/jboss-serialization/jboss-serialization.jar trunk/labs/reportingservices/reporting-services/lib/junit/ trunk/labs/reportingservices/reporting-services/lib/junit/README.txt trunk/labs/reportingservices/reporting-services/lib/junit/junit.jar trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/distribute/DistributeByFileCopy.java trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/metadata/ trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/metadata/DistributeMetaData.java trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/metadata/OutputFormatMetaData.java trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/metadata/ReportMetaData.java trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/metadata/ScheduleMetaData.java trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/server/distribute/DistributeByFileCopy.java trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/server/metadata/ReportsMetaData.java trunk/labs/reportingservices/reporting-services/src/main/report.xsd trunk/labs/reportingservices/reporting-services/src/tests/org/jboss/test/reporting/metadata/ trunk/labs/reportingservices/reporting-services/src/tests/org/jboss/test/reporting/metadata/TestMarshallSchemaless.java trunk/labs/reportingservices/reporting-services/src/tests/org/jboss/test/reporting/simple/SimpleClientTest.java trunk/labs/reportingservices/reporting-services/src/webapp/WEB-INF/lib/myfaces-examples.jar trunk/labs/reportingservices/reporting-services/src/webapp/WEB-INF/lib/portlet-api-1.0.jar trunk/labs/reportingservices/reporting-services/src/webapp/WEB-INF/lib/struts.jar Removed: trunk/labs/reportingservices/reporting-services/build.bat trunk/labs/reportingservices/reporting-services/build.sh trunk/labs/reportingservices/reporting-services/lib/jfreereport/gnujaxp.jar trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/server/metadata/ReportMetaData.java Modified: trunk/labs/reportingservices/reporting-services/.classpath trunk/labs/reportingservices/reporting-services/build.xml trunk/labs/reportingservices/reporting-services/lib/jboss-remoting/jboss-remoting.jar trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/ReportTaskFactory.java trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/ReportTaskImpl.java trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/distribute/Distribute.java trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/output/OutputFormat.java trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/schedule/Schedule.java trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/schedule/SchedulePeriodic.java trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/server/engine/ReportEngine.java trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/server/repository/RepositoryEntry.java trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/server/request/ReportRequestProcessor.java trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/server/scheduler/SchedulerService.java trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/server/scheduler/SchedulerSessionBean.java trunk/labs/reportingservices/reporting-services/src/resources/META-INF/jboss-service.xml trunk/labs/reportingservices/reporting-services/src/tests/org/jboss/test/reporting/simple/SimpleClient.java Log: fixed scheduling / started metadata Modified: trunk/labs/reportingservices/reporting-services/.classpath =================================================================== --- trunk/labs/reportingservices/reporting-services/.classpath 2006-01-03 12:46:31 UTC (rev 1975) +++ trunk/labs/reportingservices/reporting-services/.classpath 2006-01-03 13:13:53 UTC (rev 1976) @@ -3,7 +3,6 @@ <classpathentry kind="src" path="src/main"/> <classpathentry kind="src" path="src/tests"/> <classpathentry kind="src" path="output/gen-src"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="src" path="/jmx"/> <classpathentry kind="src" path="/common"/> <classpathentry kind="src" path="/j2ee"/> @@ -25,11 +24,17 @@ <classpathentry kind="lib" path="lib/apache-commons/lib/commons-vfs.jar"/> <classpathentry kind="lib" path="lib/apache-myfaces/jstl.jar"/> <classpathentry kind="lib" path="lib/apache-myfaces/myfaces.jar"/> + <classpathentry kind="lib" path="lib/apache-myfaces/myfaces-extensions.jar"/> <classpathentry kind="lib" path="lib/apache-myfaces/myfaces-impl.jar"/> <classpathentry kind="lib" path="lib/apache-myfaces/myfaces-jsf-api.jar"/> - <classpathentry kind="lib" path="lib/jasperreports/itext-1.01.jar"/> <classpathentry kind="lib" path="lib/jasperreports/jasperreports-0.6.8.jar"/> <classpathentry kind="lib" path="lib/jboss/javax.servlet.jar"/> + <classpathentry kind="lib" path="lib/jboss-remoting/jboss-remoting.jar"/> + <classpathentry kind="lib" path="lib/jboss-serialization/jboss-serialization.jar"/> + <classpathentry kind="lib" path="lib/junit/junit.jar"/> + <classpathentry kind="lib" path="lib/sun-jaf/activation.jar"/> + <classpathentry kind="lib" path="lib/sun-mail/mail.jar"/> + <classpathentry kind="lib" path="lib/xdoclet/commons-logging.jar"/> <classpathentry kind="lib" path="lib/jboss/jboss.jar"/> <classpathentry kind="lib" path="lib/jboss/jboss-common.jar"/> <classpathentry kind="lib" path="lib/jboss/jboss-j2ee.jar"/> @@ -38,10 +43,6 @@ <classpathentry kind="lib" path="lib/jboss/jboss-system.jar"/> <classpathentry kind="lib" path="lib/jboss/jmx-adaptor-plugin.jar"/> <classpathentry kind="lib" path="lib/jboss/jnpserver.jar"/> - <classpathentry kind="lib" path="lib/jboss-remoting/jboss-remoting.jar"/> - <classpathentry kind="lib" path="lib/oswego-concurrent/lib/concurrent.jar"/> - <classpathentry kind="lib" path="lib/sun-jaf/activation.jar"/> - <classpathentry kind="lib" path="lib/sun-mail/mail.jar"/> <classpathentry kind="lib" path="lib/xdoclet/xdoclet-bea-module-jb4.jar"/> <classpathentry kind="lib" path="lib/xdoclet/xdoclet-ejb-module-jb4.jar"/> <classpathentry kind="lib" path="lib/xdoclet/xdoclet-java-module-jb4.jar"/> @@ -52,7 +53,8 @@ <classpathentry kind="lib" path="lib/xdoclet/xdoclet-web-module-jb4.jar"/> <classpathentry kind="lib" path="lib/xdoclet/xdoclet-xdoclet-module-jb4.jar"/> <classpathentry kind="lib" path="lib/xdoclet/xdoclet-xjavadoc-jb4.jar"/> - <classpathentry kind="lib" path="lib/jfreereport/gnujaxp.jar"/> + <classpathentry kind="lib" path="lib/oswego-concurrent/lib/concurrent.jar"/> + <classpathentry kind="lib" path="lib/oswego-concurrent/lib/concurrent-src.zip"/> <classpathentry kind="lib" path="lib/jfreereport/itext-1.2.3.jar"/> <classpathentry kind="lib" path="lib/jfreereport/jcommon-1.0.0-rc1.jar"/> <classpathentry kind="lib" path="lib/jfreereport/jcommon-xml-1.0.0-rc1.jar"/> @@ -60,6 +62,6 @@ <classpathentry kind="lib" path="lib/jfreereport/jlfgr-1_0.jar"/> <classpathentry kind="lib" path="lib/jfreereport/pixie-0.8.4.jar"/> <classpathentry kind="lib" path="lib/jfreereport/poi-2.5.1-final-20040804.jar"/> - <classpathentry sourcepath="ECLIPSE_HOME/plugins/org.eclipse.jdt.source_3.1.0/src/org.junit_3.8.1/junitsrc.zip" kind="var" path="JUNIT_HOME/junit.jar"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="output" path="bin"/> </classpath> Deleted: trunk/labs/reportingservices/reporting-services/build.bat =================================================================== --- trunk/labs/reportingservices/reporting-services/build.bat 2006-01-03 12:46:31 UTC (rev 1975) +++ trunk/labs/reportingservices/reporting-services/build.bat 2006-01-03 13:13:53 UTC (rev 1976) @@ -1,94 +0,0 @@ -@echo off -REM ====================================================================== -REM -REM This is the main entry point for the build system. -REM -REM Users should be sure to execute this file rather than 'ant' to ensure -REM the correct version is being used with the correct configuration. -REM -REM ====================================================================== -REM -REM $Id: build.bat,v 1.1.1.1 2004/04/22 17:21:12 tdiesler Exp $ -REM -REM Authors: -REM Jason Dillon <ja...@pl...> -REM Sacha Labourey <sac...@co...> -REM - -REM ****************************************************** -REM Ignore the ANT_HOME variable: we want to use *our* -REM ANT version and associated JARs. -REM ****************************************************** -REM Ignore the users classpath, cause it might mess -REM things up -REM ****************************************************** - -SETLOCAL - -set CLASSPATH= -set ANT_HOME= -set JAXP_DOM_FACTORY=org.apache.crimson.jaxp.DocumentBuilderFactoryImpl -set JAXP_SAX_FACTORY=org.apache.crimson.jaxp.SAXParserFactoryImpl -REM set JAXP_DOM_FACTORY=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl -REM set JAXP_SAX_FACTORY=org.apache.xerces.jaxp.SAXParserFactoryImpl - -set ANT_OPTS=-Djava.protocol.handler.pkgs=org.jboss.net.protocol -Djavax.xml.parsers.DocumentBuilderFactory=%JAXP_DOM_FACTORY% -Djavax.xml.parsers.SAXParserFactory=%JAXP_SAX_FACTORY% -Dbuild.script=build.bat - -REM ****************************************************** -REM - "for" loops have been unrolled for compatibility -REM with some WIN32 systems. -REM ****************************************************** - -set NAMES=tools;tools\ant;tools\apache\ant -set SUBFOLDERS=..;..\..;..\..\..;..\..\..\.. - -REM ****************************************************** -REM ****************************************************** - -SET EXECUTED=FALSE -for %%i in (%NAMES%) do call :subLoop %%i %1 %2 %3 %4 %5 %6 - -goto :EOF - - -REM ****************************************************** -REM ********* Search for names in the subfolders ********* -REM ****************************************************** - -:subLoop -for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\ant.bat %2 %3 %4 %5 %6 %7 - -goto :EOF - - -REM ****************************************************** -REM ************ Test if ANT Batch file exists *********** -REM ****************************************************** - -:testIfExists -if exist %1 call :BatchFound %1 %2 %3 %4 %5 %6 %7 %8 - -goto :EOF - - -REM ****************************************************** -REM ************** Batch file has been found ************* -REM ****************************************************** - -:BatchFound -if (%EXECUTED%)==(FALSE) call :ExecuteBatch %1 %2 %3 %4 %5 %6 %7 %8 -set EXECUTED=TRUE - -goto :EOF - -REM ****************************************************** -REM ************* Execute Batch file only once *********** -REM ****************************************************** - -:ExecuteBatch -echo Calling %1 %2 %3 %4 %5 %6 %7 %8 -call %1 %2 %3 %4 %5 %6 %7 %8 - -:end - -if "%NOPAUSE%" == "" pause Deleted: trunk/labs/reportingservices/reporting-services/build.sh =================================================================== --- trunk/labs/reportingservices/reporting-services/build.sh 2006-01-03 12:46:31 UTC (rev 1975) +++ trunk/labs/reportingservices/reporting-services/build.sh 2006-01-03 13:13:53 UTC (rev 1976) @@ -1,198 +0,0 @@ -#!/bin/sh -### ====================================================================== ### -## ## -## This is the main entry point for the build system. ## -## ## -## Users should be sure to execute this file rather than 'ant' to ensure ## -## the correct version is being used with the correct configuration. ## -## ## -### ====================================================================== ### - -# $Id: build.sh,v 1.1.1.1 2004/04/22 17:21:12 tdiesler Exp $ - -PROGNAME=`basename $0` -DIRNAME=`dirname $0` -GREP="grep" -ROOT="/" - -# Ignore user's ANT_HOME if it is set -ANT_HOME="" - -# the default search path for ant -ANT_SEARCH_PATH="\ - tools - tools/ant \ - tools/apache/ant \ - ant" - -# the default build file name -ANT_BUILD_FILE="build.xml" - -# the default arguments -ANT_OPTIONS="-find $ANT_BUILD_FILE" - -# Use the maximum available, or set MAX_FD != -1 to use that -MAX_FD="maximum" - -# OS specific support (must be 'true' or 'false'). -cygwin=false; -darwin=false; -case "`uname`" in - CYGWIN*) - cygwin=true - ;; - - Darwin*) - darwin=true - ;; -esac - -# the jaxp parser to use -if [ "x$JAXP" = "x" ]; then - # Default to crimson - JAXP="crimson" -fi - -# -# Helper to complain. -# -die() { - echo "${PROGNAME}: $*" - exit 1 -} - -# -# Helper to complain. -# -warn() { - echo "${PROGNAME}: $*" -} - -# -# Helper to source a file if it exists. -# -maybe_source() { - for file in $*; do - if [ -f "$file" ]; then - . $file - fi - done -} - -search() { - search="$*" - for d in $search; do - ANT_HOME="`pwd`/$d" - ANT="$ANT_HOME/bin/ant" - if [ -x "$ANT" ]; then - # found one - echo $ANT_HOME - break - fi - done -} - -# -# Main function. -# -main() { - # if there is a build config file. then source it - maybe_source "$DIRNAME/build.conf" "$HOME/.build.conf" - - # Increase the maximum file descriptors if we can - if [ $cygwin = "false" ]; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ]; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ]; then - # use the system max - MAX_FD="$MAX_FD_LIMIT" - fi - - ulimit -n $MAX_FD - if [ $? -ne 0 ]; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query system maximum file descriptor limit: $MAX_FD_LIMIT" - fi - fi - - # try the search path - ANT_HOME=`search $ANT_SEARCH_PATH` - - # try looking up to root - if [ "x$ANT_HOME" = "x" ]; then - target="build" - _cwd=`pwd` - - while [ "x$ANT_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do - cd .. - cwd=`pwd` - ANT_HOME=`search $ANT_SEARCH_PATH` - done - - # make sure we get back - cd $_cwd - - if [ "$cwd" != "$ROOT" ]; then - found="true" - fi - - # complain if we did not find anything - if [ "$found" != "true" ]; then - die "Could not locate Ant; check \$ANT or \$ANT_HOME." - fi - fi - - # make sure we have one - ANT=$ANT_HOME/bin/ant - if [ ! -x "$ANT" ]; then - die "Ant file is not executable: $ANT" - fi - - # specify the jaxp parser impls to use - case "$JAXP" in - crimson) - JAXP_DOM_FACTORY="org.apache.crimson.jaxp.DocumentBuilderFactoryImpl" - JAXP_SAX_FACTORY="org.apache.crimson.jaxp.SAXParserFactoryImpl" - ;; - - xerces) - JAXP_DOM_FACTORY="org.apache.xerces.jaxp.DocumentBuilderFactoryImpl" - JAXP_SAX_FACTORY="org.apache.xerces.jaxp.SAXParserFactoryImpl" - ;; - esac - - if [ "x$JAXP_DOM_FACTORY" != "x" ]; then - ANT_OPTS="$ANT_OPTS -Djavax.xml.parsers.DocumentBuilderFactory=$JAXP_DOM_FACTORY" - fi - if [ "x$JAXP_SAX_FACTORY" != "x" ]; then - ANT_OPTS="$ANT_OPTS -Djavax.xml.parsers.SAXParserFactory=$JAXP_SAX_FACTORY" - fi - - # need to specify planet57/buildmagic protocol handler package - ANT_OPTS="$ANT_OPTS -Djava.protocol.handler.pkgs=org.jboss.net.protocol" - - # setup some build properties - ANT_OPTS="$ANT_OPTS -Dbuild.script=$0" - - # change to the directory where the script lives so users are not forced - # to be in the same directory as build.xml - cd $DIRNAME - - # export some stuff for ant - export ANT ANT_HOME ANT_OPTS - - # execute in debug mode, or simply execute - if [ "x$ANT_DEBUG" != "x" ]; then - /bin/sh -x $ANT $ANT_OPTIONS "$@" - else - exec $ANT $ANT_OPTIONS "$@" - fi -} - -## -## Bootstrap -## - -main "$@" Modified: trunk/labs/reportingservices/reporting-services/build.xml =================================================================== --- trunk/labs/reportingservices/reporting-services/build.xml 2006-01-03 12:46:31 UTC (rev 1975) +++ trunk/labs/reportingservices/reporting-services/build.xml 2006-01-03 13:13:53 UTC (rev 1976) @@ -47,19 +47,32 @@ <property name="tests.src.dir" value="${tests.dir}"/> <property name="tests.compile.dir" value="${output.dir}/tests/classes"/> - <!-- The combined library classpath --> + <!-- deploy dir from JBoss AS install --> + <property name="jboss.dir" value="../jboss" /> + <property name="jboss.conf.dir" value="${jboss.dir}/server/default" /> + <property name="jboss.deploy.dir" value="${jboss.conf.dir}/deploy" /> + + <!-- The combined library classpath --> <path id="library.classpath"> <pathelement location="${compile.dir}"/> <pathelement location="${etc.dir}"/> + <fileset dir="${jboss.dir}/lib"> + <include name="**/*.jar"/> + </fileset> + <fileset dir="${jboss.conf.dir}/lib"> + <include name="**/*.jar"/> + </fileset> <fileset dir="${lib.dir}"> <include name="**/*.jar"/> + <exclude name="**/jboss/**/*.jar"/> </fileset> </path> - <path id="tests.classpath"> - <path refid="library.classpath"/> - <pathelement path="${output.lib.dir}/xmas-reporting.jar"/> - </path> + <path id="tests.classpath"> + <path refid="library.classpath"/> + <pathelement path="${output.lib.dir}/reporting-services.jar"/> + <pathelement path="${output.lib.dir}/reporting-services-tests.jar"/> + </path> </target> @@ -206,6 +219,9 @@ <fileset dir="${lib.dir}/jboss-remoting"> <include name="*.jar"/> </fileset> + <fileset dir="${lib.dir}/jboss-serialization"> + <include name="*.jar"/> + </fileset> <fileset dir="${lib.dir}/jasperreports"> <include name="*.jar"/> <exclude name="itext*.jar"/> @@ -256,7 +272,8 @@ debug="on" deprecation="on" optimize="off" - includes="**/*.java" + includes="**/*.java" + excludes="**/metadata/*.java" failonerror="true"> <src path="${tests.src.dir}"/> <classpath refid="library.classpath"/> @@ -271,6 +288,7 @@ manifest="${manifest.file}"> <fileset dir="${tests.compile.dir}"> <include name="org/jboss/test/reporting/**"/> + <exclude name="org/jboss/test/reporting/metadata/**"/> </fileset> </jar> </target> @@ -278,32 +296,40 @@ <target name="tests" description="Runs reporting functional tests." depends="jars, tests.jars"> <java classname="org.jboss.test.reporting.simple.SimpleClient" > - <arg value="${output.dir}/tests"/> - <classpath> - <fileset dir="${output.lib.dir}"> - <include name="reporting-services-client.jar"/> - <include name="reporting-services-tests.jar"/> - </fileset> - <fileset dir="${lib.dir}/jboss-remoting"> - <include name="*.jar"/> - </fileset> - <fileset dir="${lib.dir}/jboss"> - <include name="jboss-common.jar"/> - <include name="jboss-j2se.jar"/> - <include name="javax.servlet.jar"/> - </fileset> - <fileset dir="${lib.dir}/apache-commons/lib"> - <include name="commons-httpclient.jar"/> - </fileset> - <fileset dir="${lib.dir}/oswego-concurrent/lib"> - <include name="*.jar"/> - </fileset> - </classpath> + <arg value="${output.dir}/tests"/> + <classpath refid="tests.classpath"/> </java> - </target> + <!--target name="testsMetadata" depends="configure"> + <mkdir dir="${tests.compile.dir}"/> + <path id="testsmetadata.classpath"> + <path refid="library.classpath"/> + <pathelement path="${output.lib.dir}/reporting-services.jar"/> + <pathelement path="${output.lib.dir}/reporting-services-tests.jar"/> + <fileset dir="${lib.dir}"> + <include name="**/jboss/**/*.jar"/> + </fileset> + <pathelement location="${tests.compile.dir}"/> + </path> + + + <javac destdir="${tests.compile.dir}" + debug="on" + deprecation="on" + optimize="off" + includes="**/*.java" + failonerror="true"> + <src path="${tests.src.dir}"/> + <classpath refid="testsmetadata.classpath"/> + </javac> + <java classname="org.jboss.test.reporting.metadata.TestMarshallSchemaless" > + <arg value="${output.dir}/tests"/> + <classpath refid="testsmetadata.classpath"/> + </java> + </target--> + <!-- ================================================================== --> <!-- General --> <!-- ================================================================== --> @@ -331,17 +357,14 @@ <!-- Misc. --> <!-- ================================================================== --> - <target name="z_deploy-env"> - <property name="deploy.dir" value="C:/_app/JAVA/JBOSS/reporting-services/jboss4/server/default/deploy" /> - </target> - <target name="z_deploy" depends="z_deploy-env, most"> + <target name="z_deploy" depends="configure, most"> <delete> - <fileset dir="${deploy.dir}"> + <fileset dir="${jboss.deploy.dir}"> <include name="reporting-services.sar/**/*"/> </fileset> </delete> - <copy todir="${deploy.dir}"> + <copy todir="${jboss.deploy.dir}"> <fileset dir="${output.lib.dir}"> <include name="reporting-services.sar/**/*"/> </fileset> @@ -351,15 +374,15 @@ </target> - <target name="z_deploy-reports" depends="configure, z_deploy-env"> + <target name="z_deploy-reports" depends="configure"> <delete> - <fileset dir="${deploy.dir}"> + <fileset dir="${jboss.deploy.dir}"> <include name="*.era"/> <include name="*.jrxml"/> <include name="*.jfxml"/> </fileset> </delete> - <copy todir="${deploy.dir}"> + <copy todir="${jboss.deploy.dir}"> <fileset dir="${root.dir}/sample/era"> <include name="*.era"/> </fileset> Added: trunk/labs/reportingservices/reporting-services/doc/logo.png =================================================================== (Binary files differ) Property changes on: trunk/labs/reportingservices/reporting-services/doc/logo.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/labs/reportingservices/reporting-services/doc/report-services.xcf =================================================================== (Binary files differ) Property changes on: trunk/labs/reportingservices/reporting-services/doc/report-services.xcf ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/labs/reportingservices/reporting-services/doc/reporting-services.xcf =================================================================== (Binary files differ) Property changes on: trunk/labs/reportingservices/reporting-services/doc/reporting-services.xcf ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/labs/reportingservices/reporting-services/lib/apache-myfaces/myfaces-extensions.jar =================================================================== (Binary files differ) Property changes on: trunk/labs/reportingservices/reporting-services/lib/apache-myfaces/myfaces-extensions.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/labs/reportingservices/reporting-services/lib/jboss-remoting/jboss-remoting.jar =================================================================== (Binary files differ) Added: trunk/labs/reportingservices/reporting-services/lib/jboss-serialization/jboss-serialization.jar =================================================================== (Binary files differ) Property changes on: trunk/labs/reportingservices/reporting-services/lib/jboss-serialization/jboss-serialization.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Deleted: trunk/labs/reportingservices/reporting-services/lib/jfreereport/gnujaxp.jar =================================================================== (Binary files differ) Added: trunk/labs/reportingservices/reporting-services/lib/junit/README.txt =================================================================== --- trunk/labs/reportingservices/reporting-services/lib/junit/README.txt 2006-01-03 12:46:31 UTC (rev 1975) +++ trunk/labs/reportingservices/reporting-services/lib/junit/README.txt 2006-01-03 13:13:53 UTC (rev 1976) @@ -0,0 +1 @@ +Version 3.8.1 of JUnit from http://www.junit.org/index.htm Added: trunk/labs/reportingservices/reporting-services/lib/junit/junit.jar =================================================================== (Binary files differ) Property changes on: trunk/labs/reportingservices/reporting-services/lib/junit/junit.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/ReportTaskFactory.java =================================================================== --- trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/ReportTaskFactory.java 2006-01-03 12:46:31 UTC (rev 1975) +++ trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/ReportTaskFactory.java 2006-01-03 13:13:53 UTC (rev 1976) @@ -92,10 +92,18 @@ public static ReportTask getInstance() { ReportTaskImpl result=null; - result = new ReportTaskImpl(new GUID().toString()); + result = new ReportTaskImpl(newReportTaskID()); return result; } + /** + * Return a ReportTask ID + */ + public static String newReportTaskID() + { + return new GUID().toString(); + } + } Modified: trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/ReportTaskImpl.java =================================================================== --- trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/ReportTaskImpl.java 2006-01-03 12:46:31 UTC (rev 1975) +++ trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/ReportTaskImpl.java 2006-01-03 13:13:53 UTC (rev 1976) @@ -21,11 +21,6 @@ */ public class ReportTaskImpl implements ReportTask, Serializable { - - - /** - * - */ private static final long serialVersionUID = -3943314104014993256L; @@ -34,6 +29,7 @@ private int outputFormat = 0; private Schedule schedule = null; private String ID = ""; + private boolean requiresNewID=false; // keep this for later // private SecurityThing securityInfo=null; @@ -55,16 +51,33 @@ /** trigger the execution of the report */ public void submit() throws Exception { + String previousID=this.ID; + boolean error=false; try { + // when submitted, the RT ID is used as the timer ID + // if the RT is used several times, its ID will change + if (this.requiresNewID == true) + { + this.ID = ReportTaskFactory.newReportTaskID(); + } ReportTaskFactory.reportClient.invoke(this); + this.requiresNewID = true; } catch (Throwable e) { + error=true; Exception ee=new Exception("Invocation error."); ee.initCause(e); throw ee; } + finally + { + if (error) + { + this.ID=previousID; + } + } } /** @@ -150,10 +163,11 @@ { String result= "\n\n******************** ReportTask ***********************\n" + - "** report \t= " + this.report + "\n" + + "** ID \t= " + this.ID + "\n" + + "** report \t= " + this.report.toString() + "\n" + "** output \t= " + OutputFormat.toString(this.outputFormat) + "\n" + - "** schedule \t= " + this.schedule + "\n" + - "** distribute \t= " + this.distribute + "\n"; + "** schedule \t= " + this.schedule.toString() + "\n" + + "** distribute \t= " + this.distribute.toString() + "\n"; if (report.getData() != null) result = result + "** data columns = " + report.getData().toString() + "\n"; @@ -199,12 +213,12 @@ public Schedule getSchedule() { - return schedule; + return this.schedule; } public void setSchedule(Schedule in_value) { - schedule = in_value; + this.schedule = in_value; } Modified: trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/distribute/Distribute.java =================================================================== --- trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/distribute/Distribute.java 2006-01-03 12:46:31 UTC (rev 1975) +++ trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/distribute/Distribute.java 2006-01-03 13:13:53 UTC (rev 1976) @@ -6,8 +6,12 @@ */ package org.jboss.reporting.api.distribute; -public class Distribute +import java.io.Serializable; + +public class Distribute implements Serializable { + + private static final long serialVersionUID = 181723683354366173L; public final static int TYPE_NONE=0; public final static int TYPE_BY_METHOD_RETURN=100; public final static int TYPE_BY_MAIL=200; Added: trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/distribute/DistributeByFileCopy.java =================================================================== --- trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/distribute/DistributeByFileCopy.java 2006-01-03 12:46:31 UTC (rev 1975) +++ trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/distribute/DistributeByFileCopy.java 2006-01-03 13:13:53 UTC (rev 1976) @@ -0,0 +1,71 @@ +/* + * JBoss, Home of Professional Open Source + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +package org.jboss.reporting.api.distribute; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @author noel + * + */ +public class DistributeByFileCopy extends Distribute implements Serializable +{ + + /** + * + */ + private static final long serialVersionUID = 1996230093509472886L; + + private String pathName=""; + private String fileName=""; + + + static + { + TYPE=TYPE_BY_FILE_COPY; + } + + + public DistributeByFileCopy() + { + } + + public DistributeByFileCopy(String in_pathName, String in_fileName) + { + this.pathName = in_pathName; + this.fileName = in_fileName; + } + + public String toString() + { + return "DistributeByFileCopy: \n" + + "\tpathName = " + this.pathName + "\n" + + "\tfileName = " + this.fileName + "\n"; + } + + public String getFileName() + { + return fileName; + } + + public void setFileName(String fileName) + { + this.fileName = fileName; + } + + public String getPathName() + { + return pathName; + } + + public void setPathName(String pathName) + { + this.pathName = pathName; + } +} Added: trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/metadata/DistributeMetaData.java =================================================================== --- trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/metadata/DistributeMetaData.java 2006-01-03 12:46:31 UTC (rev 1975) +++ trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/metadata/DistributeMetaData.java 2006-01-03 13:13:53 UTC (rev 1976) @@ -0,0 +1,56 @@ +/* + * JBoss, Home of Professional Open Source + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +package org.jboss.reporting.api.metadata; + +import java.io.Serializable; +import org.jboss.logging.Logger; +import org.jboss.reporting.api.distribute.*; + +/** + * A representation of the <distribute> element in + * jboss-report.xml deployment descriptors . + * + * @author <a href="mailto:noe...@jb...">Noel Rocher</a> + * @version $Revision: 1.0 $ + */ +public class DistributeMetaData implements Serializable +{ + +private static final long serialVersionUID = 1L; + +private static Logger log = Logger.getLogger(DistributeMetaData.class); + + private DistributeByFileCopy byFileCopy = null; + private DistributeByMail byMail = null; + private DistributeByMethodReturn byMethodReturn = null; + + public DistributeByFileCopy getByFileCopy() + { + return byFileCopy; + } + public void setByFileCopy(DistributeByFileCopy byFileCopy) + { + this.byFileCopy = byFileCopy; + } + public DistributeByMail getByMail() + { + return byMail; + } + public void setByMail(DistributeByMail byMail) + { + this.byMail = byMail; + } + public DistributeByMethodReturn getByMethodReturn() + { + return byMethodReturn; + } + public void setByMethodReturn(DistributeByMethodReturn byMethodReturn) + { + this.byMethodReturn = byMethodReturn; + } + +} Added: trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/metadata/OutputFormatMetaData.java =================================================================== --- trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/metadata/OutputFormatMetaData.java 2006-01-03 12:46:31 UTC (rev 1975) +++ trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/metadata/OutputFormatMetaData.java 2006-01-03 13:13:53 UTC (rev 1976) @@ -0,0 +1,41 @@ +/* + * JBoss, Home of Professional Open Source + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +package org.jboss.reporting.api.metadata; + +import java.util.Map; + +import org.jboss.logging.Logger; +import org.jboss.reporting.api.schedule.Schedule; + +/** + * A representation of the <outputFormat> element in + * jboss-report.xml deployment descriptors . + * + * @author <a href="mailto:noe...@jb...">Noel Rocher</a> + * @version $Revision: 1.0 $ + */ +public class OutputFormatMetaData +{ + private static Logger log = Logger.getLogger(OutputFormatMetaData.class); + + private String value=""; + + public OutputFormatMetaData(){} + public OutputFormatMetaData(String in_value){this.value = in_value;} + + + public String getValue() + { + return value; + } + + public void setValue(String value) + { + this.value = value; + } + +} Added: trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/metadata/ReportMetaData.java =================================================================== --- trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/metadata/ReportMetaData.java 2006-01-03 12:46:31 UTC (rev 1975) +++ trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/metadata/ReportMetaData.java 2006-01-03 13:13:53 UTC (rev 1976) @@ -0,0 +1,86 @@ +/* + * JBoss, Home of Professional Open Source + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +package org.jboss.reporting.api +.metadata; + +import java.io.Serializable; +import java.util.Map; + +import org.jboss.logging.Logger; +import org.jboss.reporting.api.schedule.Schedule; + +/** + * A representation of the <report> element in + * jboss-report.xml deployment descriptors . + * + * @author <a href="mailto:noe...@jb...">Noel Rocher</a> + * @version $Revision: 1.0 $ + */ +public class ReportMetaData implements Serializable +{ + +private static final long serialVersionUID = 1L; + +private static Logger log = Logger.getLogger(ReportMetaData.class); + + private String name = ""; + private String datasource = ""; + private Map parameters = null; + private ScheduleMetaData schedule = null; + private OutputFormatMetaData outputFormat = null; + private DistributeMetaData distribute = null; + + public String getDatasource() + { + return datasource; + } + public void setDatasource(String datasource) + { + this.datasource = datasource; + } + public DistributeMetaData getDistribute() + { + return distribute; + } + public void setDistribute(DistributeMetaData distribute) + { + this.distribute = distribute; + } + public String getName() + { + return name; + } + public void setName(String name) + { + this.name = name; + } + public OutputFormatMetaData getOutputFormat() + { + return outputFormat; + } + public void setOutputFormat(OutputFormatMetaData outputFormat) + { + this.outputFormat = outputFormat; + } + public Map getParameters() + { + return parameters; + } + public void setParameters(Map parameters) + { + this.parameters = parameters; + } + public ScheduleMetaData getSchedule() + { + return schedule; + } + public void setSchedule(ScheduleMetaData schedule) + { + this.schedule = schedule; + } + +} \ No newline at end of file Added: trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/metadata/ScheduleMetaData.java =================================================================== --- trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/metadata/ScheduleMetaData.java 2006-01-03 12:46:31 UTC (rev 1975) +++ trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/metadata/ScheduleMetaData.java 2006-01-03 13:13:53 UTC (rev 1976) @@ -0,0 +1,54 @@ +/* + * JBoss, Home of Professional Open Source + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +package org.jboss.reporting.api.metadata; + +import java.io.Serializable; + +import org.jboss.logging.Logger; +import org.jboss.reporting.api.schedule.*; + +/** + * A representation of the <report> element in + * jboss-report.xml deployment descriptors . + * + * @author <a href="mailto:noe...@jb...">Noel Rocher</a> + * @version $Revision: 1.0 $ + */ +public class ScheduleMetaData implements Serializable +{ + private static final long serialVersionUID = 1L; + private static Logger log = Logger.getLogger(ScheduleMetaData.class); + + private ScheduleOnce scheduleOnce=null; + private ScheduleNow scheduleNow=null; + private SchedulePeriodic schedulePeriodic=null; + public ScheduleNow getScheduleNow() + { + return scheduleNow; + } + public void setScheduleNow(ScheduleNow scheduleNow) + { + this.scheduleNow = scheduleNow; + } + public ScheduleOnce getScheduleOnce() + { + return scheduleOnce; + } + public void setScheduleOnce(ScheduleOnce scheduleOnce) + { + this.scheduleOnce = scheduleOnce; + } + public SchedulePeriodic getSchedulePeriodic() + { + return schedulePeriodic; + } + public void setSchedulePeriodic(SchedulePeriodic schedulePeriodic) + { + this.schedulePeriodic = schedulePeriodic; + } + +} Modified: trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/output/OutputFormat.java =================================================================== --- trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/output/OutputFormat.java 2006-01-03 12:46:31 UTC (rev 1975) +++ trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/output/OutputFormat.java 2006-01-03 13:13:53 UTC (rev 1976) @@ -81,4 +81,35 @@ return result; } + + + public final static int toInt(String in_value) + { + int result=0; + String trim_value = in_value.trim().toUpperCase(); + if ("PDF".equals(trim_value) ) + { + result = OutputFormat.PDF; + } + else if ("HTML".equals(trim_value) ) + { + result = OutputFormat.HTML; + } + else if ("XML".equals(trim_value) ) + { + result = OutputFormat.PDF; + } + else if ("XLS".equals(trim_value) ) + { + result = OutputFormat.XLS; + } + else if ("CSV".equals(trim_value) ) + { + result = OutputFormat.CSV; + } + + return result; + } + + } Modified: trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/schedule/Schedule.java =================================================================== --- trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/schedule/Schedule.java 2006-01-03 12:46:31 UTC (rev 1975) +++ trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/schedule/Schedule.java 2006-01-03 13:13:53 UTC (rev 1976) @@ -6,21 +6,26 @@ */ package org.jboss.reporting.api.schedule; +import java.io.Serializable; import java.util.Calendar; /** * @author noel * */ -public class Schedule +public class Schedule implements Serializable { + + private static final long serialVersionUID = 181723683354366172L; + + public final static int TYPE_NONE=0; public final static int TYPE_ONCE=100; public final static int TYPE_NOW=200; public final static int TYPE_PERIODIC=300; public static int TYPE=TYPE_NONE; - private Calendar startDate=null; + protected Calendar startDate=null; public int getType() { @@ -29,7 +34,7 @@ public Calendar getStartDate() { - return startDate; + return this.startDate; } public void setStartDate(Calendar in_startDate) Modified: trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/schedule/SchedulePeriodic.java =================================================================== --- trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/schedule/SchedulePeriodic.java 2006-01-03 12:46:31 UTC (rev 1975) +++ trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/api/schedule/SchedulePeriodic.java 2006-01-03 13:13:53 UTC (rev 1976) @@ -36,7 +36,7 @@ /** day of week exceptions - * when <b>execute</b> or <b>schedule next</b>, we should verify + * when <b>execute</b>, we should verify * we are not in this list. * Contains Calendar.SATURDAY and Calendar.SUNDAY by default. */ Added: trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/server/distribute/DistributeByFileCopy.java =================================================================== --- trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/server/distribute/DistributeByFileCopy.java 2006-01-03 12:46:31 UTC (rev 1975) +++ trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/server/distribute/DistributeByFileCopy.java 2006-01-03 13:13:53 UTC (rev 1976) @@ -0,0 +1,149 @@ +/* + * JBoss, Home of Professional Open Source + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ + +package org.jboss.reporting.server.distribute; + +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.Calendar; +import java.util.Iterator; + +import javax.activation.DataHandler; +import javax.activation.FileDataSource; +import javax.mail.Message; +import javax.mail.Multipart; +import javax.mail.Session; +import javax.mail.Transport; +import javax.mail.internet.InternetAddress; +import javax.mail.internet.MimeBodyPart; +import javax.mail.internet.MimeMessage; +import javax.mail.internet.MimeMultipart; +import javax.management.ObjectName; +import javax.naming.InitialContext; + +import org.jboss.logging.Logger; +import org.jboss.mx.util.MBeanProxyExt; +import org.jboss.mx.util.ObjectNameFactory; +import org.jboss.reporting.api.ReportTask; +import org.jboss.reporting.api.output.OutputFormat; +import org.jboss.system.ServiceMBeanSupport; +import org.jboss.system.server.ServerConfig; + +/** + * + * @author noe...@jb... + * @version $Revision: 1.0 $ + * + * + * @jmx:mbean + * description="Distribute a report by copy into a dir" + * name="reporting:service=Distribute,type=ByFileCopy" + * extends="org.jboss.system.ServiceMBean" + * + */ +public class DistributeByFileCopy extends ServiceMBeanSupport +implements DistributeByFileCopyMBean, DistributeModule +{ + // provide logging + private final Logger log = Logger.getLogger(DistributeByFileCopy.class); + // MBean name + public static final ObjectName OBJECT_NAME = ObjectNameFactory.create("reporting:service=Distribute,type=ByFileCopy"); + + // tmp dir name to work + private final String TEMP_DIR_NAME = "distribute-byMail"; + + // server config MBean + ServerConfig serverConfig = null; + + // base directory + private String baseDirectoryName; + private File baseDirectory; + + + + /** @jmx:managed-attribute */ + public String getBaseDirectoryName() + { + return baseDirectoryName; + } + /** @jmx:managed-attribute */ + public void setBaseDirectoryName(String baseDirectoryName) + { + this.baseDirectoryName = baseDirectoryName; + } + + + /** @jmx:managed-operation */ + public void distribute(ReportTask in_reportTask, Object in_result) throws Exception + { + log.info("Recieved reportTask" +in_reportTask); + String distributePathName=""; + File distributePath; + String fileSeparator = System.getProperty("file.separator"); + String fileName=""; + + org.jboss.reporting.api.distribute.DistributeByFileCopy distribute = (org.jboss.reporting.api.distribute.DistributeByFileCopy)in_reportTask.getDistribute(); + + distributePathName = distribute.getPathName(); +// distributePathName = distribute.getPathName().replaceAll("\\", fileSeparator).replaceAll("/", fileSeparator); +// distributePathName = distribute.getPathName().replaceAll("//", "/").replaceAll("\\", "\\").replaceAll("\\", fileSeparator).replaceAll("/", fileSeparator); + distributePath = new File(baseDirectory, distributePathName); + if (distributePath.exists() == false) distributePath.mkdir(); + + fileName = distribute.getFileName(); + if (fileName == null || fileName.length() == 0) + { + fileName = in_reportTask.getReport().getJndi_name() + "_" + System.currentTimeMillis() + OutputFormat.getFileExtension(in_reportTask.getOutputFormat()); + } + else + { + fileName = fileName + "_" + System.currentTimeMillis() + OutputFormat.getFileExtension(in_reportTask.getOutputFormat()); + } + + + try + { + // write result into a file + File file = new File(distributePath,fileName); + BufferedInputStream in = new BufferedInputStream((InputStream)in_result); + OutputStream out = new BufferedOutputStream( new FileOutputStream(file)); + int b=0; + while ( (b=in.read()) >= 0) out.write( b ); + in.close(); + out.close(); + + log.debug("File " + file.getAbsolutePath() + " created. ReportTask ID = " + in_reportTask.getID()); + } + catch (Exception e) + { + log.error(e); + throw e; + } + } + + + + + + /** + * Configure required properties from server config info + */ + public void startService() throws Exception + { + serverConfig = (ServerConfig) + MBeanProxyExt.create(ServerConfig.class, + "jboss.system:type=ServerConfig", server); + baseDirectory = new File(serverConfig.getServerHomeDir(),baseDirectoryName); + if (baseDirectory.exists() == false) baseDirectory.mkdir(); + } + + +} \ No newline at end of file Modified: trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/server/engine/ReportEngine.java =================================================================== --- trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/server/engine/ReportEngine.java 2006-01-03 12:46:31 UTC (rev 1975) +++ trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/server/engine/ReportEngine.java 2006-01-03 13:13:53 UTC (rev 1976) @@ -23,7 +23,7 @@ import org.jboss.system.ServiceMBeanSupport; import org.jboss.reporting.api.Report; import org.jboss.reporting.api.ReportTask; -import org.jboss.reporting.server.metadata.ReportMetaData; +import org.jboss.reporting.api.metadata.ReportMetaData; import org.jboss.reporting.server.repository.RepositoryEntry; import org.jboss.reporting.server.repository.RepositoryServiceMBean; Deleted: trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/server/metadata/ReportMetaData.java =================================================================== --- trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/server/metadata/ReportMetaData.java 2006-01-03 12:46:31 UTC (rev 1975) +++ trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/server/metadata/ReportMetaData.java 2006-01-03 13:13:53 UTC (rev 1976) @@ -1,269 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * - * Distributable under LGPL license. - * See terms of license at gnu.org. - */ -package org.jboss.reporting.server.metadata; - -import java.net.URLClassLoader; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; -import javax.management.MalformedObjectNameException; - -import org.jboss.deployment.DeploymentException; -import org.jboss.logging.Logger; -import org.jboss.metadata.MetaData; -import org.jboss.metadata.SecurityRoleMetaData; -import org.jboss.mx.loading.LoaderRepositoryFactory; -import org.jboss.mx.loading.LoaderRepositoryFactory.LoaderRepositoryConfig; -import org.jboss.mx.util.ObjectNameFactory; -import org.w3c.dom.Element; - -/** A representation of the jboss-report.xml deployment - * descriptors. - * - * @see XmlLoadable - * - * @author <a href="mailto:noe...@jb...">Noel Rocher</a> - * @version $Revision: 1.0 $ - */ -public class ReportMetaData extends MetaData -{ - private static Logger log = Logger.getLogger(ReportMetaData.class); - - /** The JNDI name of the security domain implementation */ - private String securityDomain; - /** security-constraint */ - private ArrayList securityContraints = new ArrayList(); - /** The security-roles */ - private HashMap securityRoles = new HashMap(); - /** security-role-refs */ - private ArrayList securityRoleReferences = new ArrayList(); - - - /** The web context class loader used to create the java:comp context */ - private ClassLoader encLoader; - /** The web context class loader, used to create the ws4ee service endpoint */ - private ClassLoader cxtLoader; - - /** The ClassLoader to load additional resources */ - private URLClassLoader resourceCl; - - /** Set the ClassLoader to load additional resources */ - public void setResourceClassLoader(URLClassLoader resourceCl) - { - this.resourceCl = resourceCl; - } - - - /** Return the optional security-domain element. - @return The jndiName of the security manager implementation that is - responsible for security of the reports. May be null if - there was no security-domain specified in the jboss-report.xml - descriptor. - */ - public String getSecurityDomain() - { - return securityDomain; - } - - /** Set the security domain for this web application - */ - public void setSecurityDomain(String securityDomain) - { - this.securityDomain = securityDomain; - } - - /** Get the security-constraint settings - */ - public Iterator getSecurityContraints() - { - return securityContraints.iterator(); - } - - /** Get the optional map of security role/user mapping. - */ - public Map getSecurityRoles() - { - return new HashMap(securityRoles); - } - - - /** - * Merge the security role/principal mapping defined in jboss-web.xml - * with the one defined at jboss-app.xml. - */ - public void mergeSecurityRoles(Map applRoles) - { - Iterator it = applRoles.entrySet().iterator(); - while (it.hasNext()) - { - Map.Entry entry = (Map.Entry) it.next(); - String roleName = (String)entry.getKey(); - SecurityRoleMetaData appRole = (SecurityRoleMetaData)entry.getValue(); - SecurityRoleMetaData srMetaData = (SecurityRoleMetaData)securityRoles.get(roleName); - if (srMetaData != null) - { - Set principalNames = appRole.getPrincipals(); - srMetaData.addPrincipalNames(principalNames); - } - else - { - securityRoles.put(roleName, entry.getValue()); - } - } - } - - - public ClassLoader getENCLoader() - { - return encLoader; - } - public void setENCLoader(ClassLoader encLoader) - { - this.encLoader = encLoader; - } - - public ClassLoader getContextLoader() - { - return cxtLoader; - } - - /** Make sure this is called during performDeploy */ - public void setContextLoader(ClassLoader cxtLoader) - { - this.cxtLoader = cxtLoader; - } - - - public void importXml(Element element) throws DeploymentException - { - String rootTag = element.getOwnerDocument().getDocumentElement().getTagName(); - if( rootTag.equals("jboss-report") ) - { - importReportXml(element); - } - } - - /** Parse the elements of the web-app element used by the integration layer. - */ - protected void importReportXml(Element webApp) throws DeploymentException - { - - // Get the security-constraints - Iterator iterator = getChildrenByTagName(webApp, "security-constraint"); - while (iterator.hasNext()) - { - Element contraints = (Element) iterator.next(); - ReportSecurityMetaData rsmd = new ReportSecurityMetaData(); - securityContraints.add(rsmd); - // Process the report-resource-collections - Iterator iter2 = getChildrenByTagName(contraints, "report-resource-collection"); - while( iter2.hasNext() ) - { - Element wrcElement = (Element) iter2.next(); - Element wrName = getUniqueChild(wrcElement, "report-resource-name"); - String name = getElementContent(wrName); - ReportSecurityMetaData.ReportResourceCollection rrc = rsmd.addReportResource(name); - Iterator iter21 = getChildrenByTagName(wrcElement, "url-pattern"); - while( iter21.hasNext() ) - { - Element urlPattern = (Element) iter21.next(); - String pattern = getElementContent(urlPattern); - rrc.addPattern(pattern); - } - - Iterator iter22 = getChildrenByTagName(wrcElement, "http-method"); - while( iter22.hasNext() ) - { - Element httpMethod = (Element) iter22.next(); - String method = getElementContent(httpMethod); - rrc.addHttpMethod(method); - } - } - - // Process the auth-constraints - Element authContraint = getOptionalChild(contraints, "auth-constraint"); - if( authContraint != null ) - { - Iterator iter3 = getChildrenByTagName(authContraint, "role-name"); - while( iter3.hasNext() ) - { - Element roleName = (Element) iter3.next(); - String name = getElementContent(roleName); - rsmd.addRole(name); - } - if( rsmd.getRoles().size() == 0 ) - rsmd.setExcluded(true); - } - else - { - rsmd.setUnchecked(true); - } - - // Process the user-data-constraint - Element userData = getOptionalChild(contraints, "user-data-constraint"); - if( userData != null ) - { - Element transport = getUniqueChild(userData, "transport-guarantee"); - String type = getElementContent(transport); - rsmd.setTransportGuarantee(type); - } - } - - // set the security roles (optional) - iterator = getChildrenByTagName(webApp, "security-role"); - while (iterator.hasNext()) - { - Element securityRole = (Element) iterator.next(); - String roleName = getElementContent(getUniqueChild(securityRole, "role-name")); - securityRoles.put(roleName, new SecurityRoleMetaData(roleName)); - } - - - } - - /** Parse the elements of the jboss-web element used by the integration layer. - */ - protected void importJBossWebXml(Element jbossWeb) throws DeploymentException - { - - // Parse the jboss-web/security-domain element - Element securityDomainElement = getOptionalChild(jbossWeb, "security-domain"); - if( securityDomainElement != null ) - { - securityDomain = getElementContent(securityDomainElement); - } - - - - // set the security roles (optional) - Iterator iterator = getChildrenByTagName(jbossWeb, "security-role"); - while (iterator.hasNext()) - { - Element securityRole = (Element) iterator.next(); - String roleName = getElementContent(getUniqueChild(securityRole, "role-name")); - SecurityRoleMetaData securityRoleMetaData = (SecurityRoleMetaData)securityRoles.get(roleName); - if (securityRoleMetaData == null) - throw new DeploymentException("Security role '" + roleName + "' defined in jboss-web.xml" + - "is not defined in web.xml"); - - Iterator itPrincipalNames = getChildrenByTagName(securityRole, "principal-name"); - while (itPrincipalNames.hasNext()) - { - String principalName = getElementContent((Element) itPrincipalNames.next()); - securityRoleMetaData.addPrincipalName(principalName); - } - } - - - - - - } -} Added: trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/server/metadata/ReportsMetaData.java =================================================================== --- trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/server/metadata/ReportsMetaData.java 2006-01-03 12:46:31 UTC (rev 1975) +++ trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/server/metadata/ReportsMetaData.java 2006-01-03 13:13:53 UTC (rev 1976) @@ -0,0 +1,40 @@ +/* + * JBoss, Home of Professional Open Source + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +package org.jboss.reporting.server.metadata; + +import java.io.Serializable; +import java.util.Map; +import org.jboss.reporting.api.metadata.ReportMetaData; + +/** + * @author <a href="mailto:noe...@jb...">Noel Rocher</a> + * + */ +public class ReportsMetaData implements Serializable +{ + + private static final long serialVersionUID = 1L; + private ReportMetaData defaultMetaData=null; + private Map reports=null; + public ReportMetaData getDefaultMetaData() + { + return defaultMetaData; + } + public void setDefaultMetaData(ReportMetaData defaultMetaData) + { + this.defaultMetaData = defaultMetaData; + } + public Map getReports() + { + return reports; + } + public void setReports(Map reports) + { + this.reports = reports; + } + +} Modified: trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/server/repository/RepositoryEntry.java =================================================================== --- trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/server/repository/RepositoryEntry.java 2006-01-03 12:46:31 UTC (rev 1975) +++ trunk/labs/reportingservices/reporting-services/src/main/org/jboss/reporting/server/repository/Rep... [truncated message content] |