Author: snjeza
Date: 2009-10-17 18:47:19 -0400 (Sat, 17 Oct 2009)
New Revision: 18153
Added:
workspace/snjeza/JBossBirtIntegration/.project
workspace/snjeza/JBossBirtIntegration/.settings/
workspace/snjeza/JBossBirtIntegration/.settings/org.maven.ide.eclipse.prefs
workspace/snjeza/JBossBirtIntegration/birtservlet/
workspace/snjeza/JBossBirtIntegration/birtservlet/.classpath
workspace/snjeza/JBossBirtIntegration/birtservlet/.project
workspace/snjeza/JBossBirtIntegration/birtservlet/.settings/
workspace/snjeza/JBossBirtIntegration/birtservlet/.settings/org.eclipse.jdt.core.prefs
workspace/snjeza/JBossBirtIntegration/birtservlet/.settings/org.maven.ide.eclipse.prefs
workspace/snjeza/JBossBirtIntegration/birtservlet/pom.xml
workspace/snjeza/JBossBirtIntegration/birtservlet/src/
workspace/snjeza/JBossBirtIntegration/birtservlet/src/main/
workspace/snjeza/JBossBirtIntegration/birtservlet/src/main/java/
workspace/snjeza/JBossBirtIntegration/birtservlet/src/main/java/org/
workspace/snjeza/JBossBirtIntegration/birtservlet/src/main/java/org/jboss/
workspace/snjeza/JBossBirtIntegration/birtservlet/src/main/java/org/jboss/tools/
workspace/snjeza/JBossBirtIntegration/birtservlet/src/main/java/org/jboss/tools/birt/
workspace/snjeza/JBossBirtIntegration/birtservlet/src/main/java/org/jboss/tools/birt/servlet/
workspace/snjeza/JBossBirtIntegration/birtservlet/src/main/java/org/jboss/tools/birt/servlet/BirtEngine.java
workspace/snjeza/JBossBirtIntegration/birtservlet/src/main/java/org/jboss/tools/birt/servlet/JBossBirtServlet.java
workspace/snjeza/JBossBirtIntegration/birtservlet/src/test/
workspace/snjeza/JBossBirtIntegration/birttag/
workspace/snjeza/JBossBirtIntegration/birttag/.classpath
workspace/snjeza/JBossBirtIntegration/birttag/.project
workspace/snjeza/JBossBirtIntegration/birttag/.settings/
workspace/snjeza/JBossBirtIntegration/birttag/.settings/org.eclipse.jdt.core.prefs
workspace/snjeza/JBossBirtIntegration/birttag/.settings/org.maven.ide.eclipse.prefs
workspace/snjeza/JBossBirtIntegration/birttag/pom.xml
workspace/snjeza/JBossBirtIntegration/birttag/src/
workspace/snjeza/JBossBirtIntegration/birttag/src/main/
workspace/snjeza/JBossBirtIntegration/birttag/src/main/java/
workspace/snjeza/JBossBirtIntegration/birttag/src/main/java/org/
workspace/snjeza/JBossBirtIntegration/birttag/src/main/java/org/jboss/
workspace/snjeza/JBossBirtIntegration/birttag/src/main/java/org/jboss/seam/
workspace/snjeza/JBossBirtIntegration/birttag/src/main/java/org/jboss/seam/birt/
workspace/snjeza/JBossBirtIntegration/birttag/src/main/java/org/jboss/seam/birt/ui/
workspace/snjeza/JBossBirtIntegration/birttag/src/main/java/org/jboss/seam/birt/ui/UIDocument.java
workspace/snjeza/JBossBirtIntegration/birttag/src/main/java/org/jboss/seam/birt/ui/UIParameter.java
workspace/snjeza/JBossBirtIntegration/birttag/src/main/resources/
workspace/snjeza/JBossBirtIntegration/birttag/src/main/resources/META-INF/
workspace/snjeza/JBossBirtIntegration/birttag/src/main/resources/META-INF/MANIFEST.MF
workspace/snjeza/JBossBirtIntegration/birttag/src/main/resources/META-INF/faces-config.xml
workspace/snjeza/JBossBirtIntegration/birttag/src/main/resources/META-INF/seam-birt.taglib.xml
workspace/snjeza/JBossBirtIntegration/birttag/src/main/resources/org/
workspace/snjeza/JBossBirtIntegration/birttag/src/main/resources/org/jboss/
workspace/snjeza/JBossBirtIntegration/birttag/src/main/resources/org/jboss/seam/
workspace/snjeza/JBossBirtIntegration/birttag/src/main/resources/org/jboss/seam/birt/
workspace/snjeza/JBossBirtIntegration/birttag/src/main/resources/org/jboss/seam/birt/birt-1.0.xsd
workspace/snjeza/JBossBirtIntegration/birttag/src/main/resources/seam.properties
workspace/snjeza/JBossBirtIntegration/birttag/src/test/
workspace/snjeza/JBossBirtIntegration/pom.xml
workspace/snjeza/JBossBirtIntegration/src/
workspace/snjeza/JBossBirtIntegration/src/site/
Log:
https://jira.jboss.org/jira/browse/JBIDE-4937 Initial import
Added: workspace/snjeza/JBossBirtIntegration/.project
===================================================================
--- workspace/snjeza/JBossBirtIntegration/.project (rev 0)
+++ workspace/snjeza/JBossBirtIntegration/.project 2009-10-17 22:47:19 UTC (rev 18153)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>JBossBirtIntegration</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Added: workspace/snjeza/JBossBirtIntegration/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- workspace/snjeza/JBossBirtIntegration/.settings/org.maven.ide.eclipse.prefs
(rev 0)
+++ workspace/snjeza/JBossBirtIntegration/.settings/org.maven.ide.eclipse.prefs 2009-10-17
22:47:19 UTC (rev 18153)
@@ -0,0 +1,9 @@
+#Sat Oct 17 23:17:36 CEST 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1
Added: workspace/snjeza/JBossBirtIntegration/birtservlet/.classpath
===================================================================
--- workspace/snjeza/JBossBirtIntegration/birtservlet/.classpath
(rev 0)
+++ workspace/snjeza/JBossBirtIntegration/birtservlet/.classpath 2009-10-17 22:47:19 UTC
(rev 18153)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes"
path="src/main/java"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con"
path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: workspace/snjeza/JBossBirtIntegration/birtservlet/.project
===================================================================
--- workspace/snjeza/JBossBirtIntegration/birtservlet/.project
(rev 0)
+++ workspace/snjeza/JBossBirtIntegration/birtservlet/.project 2009-10-17 22:47:19 UTC
(rev 18153)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>birtservlet</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Added:
workspace/snjeza/JBossBirtIntegration/birtservlet/.settings/org.eclipse.jdt.core.prefs
===================================================================
---
workspace/snjeza/JBossBirtIntegration/birtservlet/.settings/org.eclipse.jdt.core.prefs
(rev 0)
+++
workspace/snjeza/JBossBirtIntegration/birtservlet/.settings/org.eclipse.jdt.core.prefs 2009-10-17
22:47:19 UTC (rev 18153)
@@ -0,0 +1,6 @@
+#Sat Oct 17 23:38:38 CEST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.source=1.5
Added:
workspace/snjeza/JBossBirtIntegration/birtservlet/.settings/org.maven.ide.eclipse.prefs
===================================================================
---
workspace/snjeza/JBossBirtIntegration/birtservlet/.settings/org.maven.ide.eclipse.prefs
(rev 0)
+++
workspace/snjeza/JBossBirtIntegration/birtservlet/.settings/org.maven.ide.eclipse.prefs 2009-10-17
22:47:19 UTC (rev 18153)
@@ -0,0 +1,9 @@
+#Sat Oct 17 23:38:38 CEST 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1
Added: workspace/snjeza/JBossBirtIntegration/birtservlet/pom.xml
===================================================================
--- workspace/snjeza/JBossBirtIntegration/birtservlet/pom.xml (rev
0)
+++ workspace/snjeza/JBossBirtIntegration/birtservlet/pom.xml 2009-10-17 22:47:19 UTC (rev
18153)
@@ -0,0 +1,94 @@
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>parent</artifactId>
+ <groupId>org.jboss.tools.birt</groupId>
+ <version>1.0.0</version>
+ </parent>
+
+ <groupId>org.jboss.tools.birt</groupId>
+ <artifactId>birtservlet</artifactId>
+ <version>1.0.0</version>
+
+ <properties>
+ <birt.version>2.3.2</birt.version>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.eclipse.birt</groupId>
+ <artifactId>chartengineapi</artifactId>
+ <version>${birt.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.birt</groupId>
+ <artifactId>coreapi</artifactId>
+ <version>${birt.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.birt</groupId>
+ <artifactId>dataadapterapi</artifactId>
+ <version>${birt.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.birt</groupId>
+ <artifactId>engineapi</artifactId>
+ <version>${birt.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.birt</groupId>
+ <artifactId>modelapi</artifactId>
+ <version>${birt.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.birt</groupId>
+ <artifactId>scriptapi</artifactId>
+ <version>${birt.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.birt</groupId>
+ <artifactId>dteapi</artifactId>
+ <version>${birt.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.ibm.icu</groupId>
+ <artifactId>icu4j</artifactId>
+ <version>3.8.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>rhino</groupId>
+ <artifactId>js</artifactId>
+ <version>1.6R7</version>
+ </dependency>
+
+ <dependency>
+ <groupId>apache-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ <version>1.2</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>jboss-birt-servlet</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
Added:
workspace/snjeza/JBossBirtIntegration/birtservlet/src/main/java/org/jboss/tools/birt/servlet/BirtEngine.java
===================================================================
---
workspace/snjeza/JBossBirtIntegration/birtservlet/src/main/java/org/jboss/tools/birt/servlet/BirtEngine.java
(rev 0)
+++
workspace/snjeza/JBossBirtIntegration/birtservlet/src/main/java/org/jboss/tools/birt/servlet/BirtEngine.java 2009-10-17
22:47:19 UTC (rev 18153)
@@ -0,0 +1,82 @@
+package org.jboss.tools.birt.servlet;
+
+import java.util.logging.Level;
+
+import javax.servlet.ServletContext;
+
+import org.eclipse.birt.core.exception.BirtException;
+import org.eclipse.birt.core.framework.IPlatformContext;
+import org.eclipse.birt.core.framework.Platform;
+import org.eclipse.birt.core.framework.PlatformServletContext;
+import org.eclipse.birt.report.engine.api.EngineConfig;
+import org.eclipse.birt.report.engine.api.IReportEngine;
+import org.eclipse.birt.report.engine.api.IReportEngineFactory;
+
+public class BirtEngine {
+
+ private static final String BIRT_VIEWER_LOG_LEVEL = "BIRT_VIEWER_LOG_LEVEL";
+ private static final String BIRT_VIEWER_LOG_DIR = "BIRT_VIEWER_LOG_DIR";
+
+ private static IReportEngine birtEngine = null;
+
+ public static synchronized void initBirtConfig() {
+
+ }
+
+ public static synchronized IReportEngine getBirtEngine(ServletContext sc) {
+ if (birtEngine == null) {
+ EngineConfig config = new EngineConfig();
+ String logLevel = sc.getInitParameter(BIRT_VIEWER_LOG_LEVEL);
+ Level level = Level.OFF;
+ if ("SEVERE".equalsIgnoreCase(logLevel)) {
+ level = Level.SEVERE;
+ } else if ("WARNING".equalsIgnoreCase(logLevel)) {
+ level = Level.WARNING;
+ } else if ("INFO".equalsIgnoreCase(logLevel)) {
+ level = Level.INFO;
+ } else if ("CONFIG".equalsIgnoreCase(logLevel)) {
+ level = Level.CONFIG;
+ } else if ("FINE".equalsIgnoreCase(logLevel)) {
+ level = Level.FINE;
+ } else if ("FINER".equalsIgnoreCase(logLevel)) {
+ level = Level.FINER;
+ } else if ("FINEST".equalsIgnoreCase(logLevel)) {
+ level = Level.FINEST;
+ } else if ("OFF".equalsIgnoreCase(logLevel)) {
+ level = Level.OFF;
+ }
+ String logDirectory = sc.getInitParameter(BIRT_VIEWER_LOG_DIR);
+ config.setLogConfig(logDirectory, level);
+
+ config.setEngineHome("");
+ IPlatformContext context = new PlatformServletContext(sc);
+ config.setPlatformContext(context);
+
+ try {
+ Platform.startup(config);
+ } catch (BirtException e) {
+ e.printStackTrace();
+ }
+
+ IReportEngineFactory factory = (IReportEngineFactory) Platform
+ .createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
+ birtEngine = factory.createReportEngine(config);
+
+ }
+ return birtEngine;
+ }
+
+ public static synchronized void destroyBirtEngine() {
+ if (birtEngine == null) {
+ return;
+ }
+ birtEngine.destroy();
+ Platform.shutdown();
+ birtEngine = null;
+ }
+
+ public Object clone() throws CloneNotSupportedException {
+ throw new CloneNotSupportedException();
+ }
+
+}
\ No newline at end of file
Added:
workspace/snjeza/JBossBirtIntegration/birtservlet/src/main/java/org/jboss/tools/birt/servlet/JBossBirtServlet.java
===================================================================
---
workspace/snjeza/JBossBirtIntegration/birtservlet/src/main/java/org/jboss/tools/birt/servlet/JBossBirtServlet.java
(rev 0)
+++
workspace/snjeza/JBossBirtIntegration/birtservlet/src/main/java/org/jboss/tools/birt/servlet/JBossBirtServlet.java 2009-10-17
22:47:19 UTC (rev 18153)
@@ -0,0 +1,208 @@
+package org.jboss.tools.birt.servlet;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.eclipse.birt.core.data.DataTypeUtil;
+import org.eclipse.birt.core.exception.BirtException;
+import org.eclipse.birt.report.engine.api.EngineConfig;
+import org.eclipse.birt.report.engine.api.EngineConstants;
+import org.eclipse.birt.report.engine.api.HTMLRenderOption;
+import org.eclipse.birt.report.engine.api.HTMLServerImageHandler;
+import org.eclipse.birt.report.engine.api.IGetParameterDefinitionTask;
+import org.eclipse.birt.report.engine.api.IParameterDefnBase;
+import org.eclipse.birt.report.engine.api.IReportEngine;
+import org.eclipse.birt.report.engine.api.IReportRunnable;
+import org.eclipse.birt.report.engine.api.IRunAndRenderTask;
+import org.eclipse.birt.report.engine.api.IScalarParameterDefn;
+
+public class JBossBirtServlet extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+ private IReportEngine birtReportEngine = null;
+ protected static Logger logger = Logger.getLogger("org.jboss.tools.birt");
+
+ public JBossBirtServlet() {
+ super();
+ }
+
+ /**
+ * Destruction of the servlet.
+ */
+ public void destroy() {
+ super.destroy();
+ // FIXME
+ BirtEngine.destroyBirtEngine();
+ }
+
+ /**
+ * The doGet method of the servlet.
+ *
+ *
+ */
+ public void doGet(HttpServletRequest req, HttpServletResponse resp)
+ throws ServletException, IOException {
+
+ //resp.setContentType("text/html");
+ String reportName = req.getParameter("__report");
+ String embeddable = req.getParameter("__embeddable");
+ String masterpage = req.getParameter("__masterpage");
+ ServletContext sc = req.getSession().getServletContext();
+ if (req.getCharacterEncoding() == null) {
+ req.setCharacterEncoding("UTF-8");
+ }
+ this.birtReportEngine = BirtEngine.getBirtEngine(sc);
+
+ IReportRunnable design;
+ try {
+ EngineConfig config = birtReportEngine.getConfig();
+ HashMap appContext = (HashMap) config.getAppContext();
+ appContext.put(EngineConstants.APPCONTEXT_CLASSLOADER_KEY, JBossBirtServlet.class
+ .getClassLoader());
+ appContext.put(EngineConstants.APPCONTEXT_BIRT_VIEWER_HTTPSERVET_REQUEST, req);
+ config.setAppContext(appContext);
+
+ // Open report design
+ design = birtReportEngine.openReportDesign(sc.getRealPath("/")
+ + reportName);
+ // create task to run and render report
+ IRunAndRenderTask task = birtReportEngine
+ .createRunAndRenderTask(design);
+ // set output options
+ HTMLRenderOption options = new HTMLRenderOption();
+ // set the image handler to a HTMLServerImageHandler if you plan on
+ // using the base image url.
+ options.setImageHandler(new HTMLServerImageHandler());
+ options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_HTML);
+ if ("true".equals(embeddable)) {
+ options.setEmbeddable(true);
+ }
+ if ("false".equals(masterpage)) {
+ options.setMasterPageContent(false);
+ }
+ options.setOutputStream(resp.getOutputStream());
+
+ options.setBaseImageURL(req.getContextPath() + "/images");
+ options.setImageDirectory(sc.getRealPath("/images"));
+ task.setRenderOption(options);
+
+ // add parameters
+ Map parameterValues = evaluateParameterValues(design, req);
+ task.setParameterValues(parameterValues);
+
+ // run report
+ task.run();
+ task.close();
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new ServletException(e);
+ }
+ }
+
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+
+ response.setContentType("text/html");
+ PrintWriter out = response.getWriter();
+ out
+ .println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01
Transitional//EN\">");
+ out.println("<HTML>");
+ out.println(" <HEAD><TITLE>A
Servlet</TITLE></HEAD>");
+ out.println(" <BODY>");
+ out.println(" Post Not Supported");
+ out.println(" </BODY>");
+ out.println("</HTML>");
+ out.flush();
+ out.close();
+ }
+
+ private Map evaluateParameterValues(IReportRunnable runnable,
+ HttpServletRequest req) {
+ Map<String, Object> inputValues = new HashMap<String, Object>();
+ IGetParameterDefinitionTask task = this.birtReportEngine
+ .createGetParameterDefinitionTask(runnable);
+ Collection paramDefns = task.getParameterDefns(false);
+ Iterator iter = paramDefns.iterator();
+ while (iter.hasNext()) {
+ // now only support scalar parameter
+ IParameterDefnBase pBase = (IParameterDefnBase) iter.next();
+ if (pBase instanceof IScalarParameterDefn) {
+ IScalarParameterDefn paramDefn = (IScalarParameterDefn) pBase;
+ String paramName = paramDefn.getName();
+ String inputValue = req.getParameter(paramName);
+ int paramType = paramDefn.getDataType();
+ try {
+ Object paramValue = stringToObject(paramType, inputValue);
+ if (paramValue != null) {
+ inputValues.put(paramName, paramValue);
+ }
+ } catch (BirtException ex) {
+ logger.log(Level.SEVERE, "the value of parameter "
+ + paramName + " is invalid", ex);
+ }
+ }
+ }
+ return inputValues;
+ }
+
+ protected Object stringToObject(int type, String value)
+ throws BirtException {
+ if (value == null) {
+ return null;
+ }
+ switch (type) {
+ case IScalarParameterDefn.TYPE_BOOLEAN:
+ return DataTypeUtil.toBoolean(value);
+
+ case IScalarParameterDefn.TYPE_DATE_TIME:
+ return DataTypeUtil.toDate(value);
+
+ case IScalarParameterDefn.TYPE_DATE:
+ return DataTypeUtil.toDate(value);
+
+ case IScalarParameterDefn.TYPE_TIME:
+ return DataTypeUtil.toDate(value);
+
+ case IScalarParameterDefn.TYPE_DECIMAL:
+ return DataTypeUtil.toBigDecimal(value);
+
+ case IScalarParameterDefn.TYPE_FLOAT:
+ return DataTypeUtil.toDouble(value);
+
+ case IScalarParameterDefn.TYPE_STRING:
+ return DataTypeUtil.toString(value);
+
+ case IScalarParameterDefn.TYPE_INTEGER:
+ return DataTypeUtil.toInteger(value);
+
+ case IScalarParameterDefn.TYPE_ANY:
+ return DataTypeUtil.toString(value);
+ }
+ return null;
+ }
+
+ /**
+ * Initialization of the servlet.
+ *
+ *
+ * @throws ServletException
+ * if an error occure
+ */
+ public void init() throws ServletException {
+ BirtEngine.initBirtConfig();
+
+ }
+
+}
Added: workspace/snjeza/JBossBirtIntegration/birttag/.classpath
===================================================================
--- workspace/snjeza/JBossBirtIntegration/birttag/.classpath (rev
0)
+++ workspace/snjeza/JBossBirtIntegration/birttag/.classpath 2009-10-17 22:47:19 UTC (rev
18153)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes"
path="src/main/java"/>
+ <classpathentry excluding="**" kind="src"
output="target/classes" path="src/main/resources"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con"
path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: workspace/snjeza/JBossBirtIntegration/birttag/.project
===================================================================
--- workspace/snjeza/JBossBirtIntegration/birttag/.project (rev
0)
+++ workspace/snjeza/JBossBirtIntegration/birttag/.project 2009-10-17 22:47:19 UTC (rev
18153)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>birttag</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Added: workspace/snjeza/JBossBirtIntegration/birttag/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- workspace/snjeza/JBossBirtIntegration/birttag/.settings/org.eclipse.jdt.core.prefs
(rev 0)
+++
workspace/snjeza/JBossBirtIntegration/birttag/.settings/org.eclipse.jdt.core.prefs 2009-10-17
22:47:19 UTC (rev 18153)
@@ -0,0 +1,13 @@
+#Sat Oct 17 23:28:18 CEST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.source=1.5
Added:
workspace/snjeza/JBossBirtIntegration/birttag/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- workspace/snjeza/JBossBirtIntegration/birttag/.settings/org.maven.ide.eclipse.prefs
(rev 0)
+++
workspace/snjeza/JBossBirtIntegration/birttag/.settings/org.maven.ide.eclipse.prefs 2009-10-17
22:47:19 UTC (rev 18153)
@@ -0,0 +1,9 @@
+#Sat Oct 17 23:19:27 CEST 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1
Added: workspace/snjeza/JBossBirtIntegration/birttag/pom.xml
===================================================================
--- workspace/snjeza/JBossBirtIntegration/birttag/pom.xml (rev 0)
+++ workspace/snjeza/JBossBirtIntegration/birttag/pom.xml 2009-10-17 22:47:19 UTC (rev
18153)
@@ -0,0 +1,45 @@
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>parent</artifactId>
+ <groupId>org.jboss.tools.birt</groupId>
+ <version>1.0.0</version>
+ </parent>
+ <groupId>org.jboss.tools.birt</groupId>
+ <artifactId>birt</artifactId>
+ <version>1.0.0</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>1.2_12</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <version>1.2_12</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <version>1.0</version>
+ </dependency>
+
+ </dependencies>
+ <build>
+ <finalName>jboss-seam-birt</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
Added:
workspace/snjeza/JBossBirtIntegration/birttag/src/main/java/org/jboss/seam/birt/ui/UIDocument.java
===================================================================
---
workspace/snjeza/JBossBirtIntegration/birttag/src/main/java/org/jboss/seam/birt/ui/UIDocument.java
(rev 0)
+++
workspace/snjeza/JBossBirtIntegration/birttag/src/main/java/org/jboss/seam/birt/ui/UIDocument.java 2009-10-17
22:47:19 UTC (rev 18153)
@@ -0,0 +1,582 @@
+package org.jboss.seam.birt.ui;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.io.UnsupportedEncodingException;
+import java.io.Writer;
+import java.net.URLEncoder;
+
+import javax.el.ValueExpression;
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIComponentBase;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletException;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpServletResponseWrapper;
+
+public class UIDocument extends UIComponentBase
+{
+ public static final String COMPONENT_FAMILY = "org.jboss.seam.birt";
+
+ public static final String COMPONENT_TYPE =
"org.jboss.seam.birt.ui.UIDocument";
+
+ private String url;
+ private String format;
+ private String designType = "run";
+ private String designName;
+ private String title;
+ private String showtitle;
+ private String toolbar;
+ private String navigationbar;
+ private String parameterpage;
+ private String document;
+ private String locale;
+ private String svg;
+ private String page;
+ private String pagerange;
+ private String masterpage;
+ private String overwrite;
+ private String bookmark;
+ private String rtl;
+ private String fittopage;
+ private String resourceFolder;
+ private String embeddable;
+ private Object[] values;
+
+ public void setFormat(String format)
+ {
+ this.format = format;
+ }
+
+ public Object valueBinding(FacesContext context, String property, Object
defaultValue)
+ {
+ Object value = defaultValue;
+ ValueExpression expression = getValueExpression(property);
+
+ if (expression != null)
+ {
+ value = expression.getValue(context.getELContext());
+ }
+ return value;
+ }
+
+ public Object valueBinding(String property, Object defaultValue)
+ {
+ return valueBinding(FacesContext.getCurrentInstance(), property, defaultValue);
+ }
+
+ @Override
+ public boolean getRendersChildren()
+ {
+ return true;
+ }
+
+ @Override
+ public void encodeBegin(FacesContext context) throws IOException
+ {
+ super.encodeBegin(context);
+ url = null;
+ String designTypeValue = (String) valueBinding(context, "designType",
designType);
+ String designNameValue = (String) valueBinding(context, "designName",
designName);
+ if (designNameValue == null || designNameValue.trim().length() <= 0) {
+ return;
+ }
+ String embeddableValue = (String) valueBinding(context, "embeddable",
embeddable);
+ String formatValue = null;
+ if (!"true".equals(embeddableValue))
+ {
+ formatValue = (String) valueBinding(context, "format", format);
+ if (formatValue == null || formatValue.trim().length() <= 0)
+ {
+ if (!"frameset".equals(designTypeValue))
+ formatValue = "pdf";
+ }
+ }
+ else
+ {
+ designTypeValue = "embed";
+ }
+ StringBuffer buffer = new StringBuffer();
+ // buffer.append(contextPath);
+ buffer.append("/");
+ buffer.append(designTypeValue);
+ buffer.append("?__report=");
+ buffer.append(URLEncoder.encode(designNameValue,"UTF-8"));
+
+ if (formatValue != null && formatValue.trim().length() > 0)
+ {
+ buffer.append("&__format=");
+ buffer.append(formatValue);
+ }
+
+ addViewerParameter(context, buffer, "title", title);
+ addViewerParameter(context, buffer, "showtitle", showtitle);
+ addViewerParameter(context, buffer, "toolbar", toolbar);
+ addViewerParameter(context, buffer, "navigationbar", navigationbar);
+ addViewerParameter(context, buffer, "document", document);
+ addViewerParameter(context, buffer, "locale", locale);
+ addViewerParameter(context, buffer, "svg", svg);
+ addViewerParameter(context, buffer, "page", page);
+ addViewerParameter(context, buffer, "pagerange", pagerange);
+ addViewerParameter(context, buffer, "masterpage", masterpage);
+ addViewerParameter(context, buffer, "overwrite", overwrite);
+ addViewerParameter(context, buffer, "bookmark", bookmark);
+ addViewerParameter(context, buffer, "rtl", rtl);
+ addViewerParameter(context, buffer, "fittopage", fittopage);
+ addViewerParameter(context, buffer, "resourceFolder", resourceFolder);
+ if ("true".equals(embeddableValue))
+ {
+ addViewerParameter(context, buffer, "embeddable", embeddableValue);
+ }
+ url = buffer.toString();
+ encodeParameter(context, this);
+ }
+
+ public void encodeParameter(FacesContext context, UIComponent component) throws
IOException, FacesException
+ {
+ if (component.getChildCount() > 0)
+ {
+ StringBuffer buffer = new StringBuffer();
+ buffer.append(url);
+ for (UIComponent child : component.getChildren())
+ {
+ if (child instanceof UIParameter)
+ {
+ UIParameter parameter = (UIParameter) child;
+ buffer.append("&");
+ String name = null;
+ try
+ {
+ name = URLEncoder.encode(parameter.getName(),"UTF-8");
+ }
+ catch (UnsupportedEncodingException e)
+ {
+ name = URLEncoder.encode(parameter.getName());
+ }
+ buffer.append(name);
+ buffer.append("=");
+ // FIXME
+ // String value = (String) valueBinding(context,
+ // parameter.getName(), parameter.getValue());
+ String value = parameter.getValue();
+ try
+ {
+ value = URLEncoder.encode(value,"UTF-8");
+ }
+ catch (UnsupportedEncodingException e)
+ {
+ value = URLEncoder.encode(value);
+ }
+ buffer.append(value);
+
+ if ("true".equals(parameter.getLocale()))
+ {
+ buffer.append("&__islocale=");
+ buffer.append(parameter.getName());
+ }
+ if ("true".equals(parameter.getIsnull()))
+ {
+ buffer.append("&__isnull=");
+ buffer.append(parameter.getName());
+ }
+ }
+ }
+ url = buffer.toString();
+ }
+ }
+
+ protected String baseNameForViewId(String viewId)
+ {
+ int pos = viewId.lastIndexOf("/");
+ if (pos != -1)
+ {
+ viewId = viewId.substring(pos + 1);
+ }
+
+ pos = viewId.lastIndexOf(".");
+ if (pos != -1)
+ {
+ viewId = viewId.substring(0, pos);
+ }
+ return viewId;
+ }
+
+ @Override
+ public void encodeEnd(FacesContext context) throws IOException
+ {
+ if (url == null || !isRendered())
+ {
+ return;
+ }
+ ExternalContext e = context.getExternalContext();
+ if (!"true".equals(getEmbeddable()))
+ {
+ e.redirect(e.encodeResourceURL(e.getRequestContextPath() + url));
+ }
+ else
+ {
+ ResponseWriter fw = context.getResponseWriter();
+ HttpServletRequest request = (HttpServletRequest)
context.getExternalContext().getRequest();
+ HttpServletResponse response = (HttpServletResponse) e.getResponse();
+ if (fw != null)
+ {
+ try
+ {
+ RequestDispatcher rd = request.getRequestDispatcher(url);
+ JSFResponseWrapper responseWrapper = new JSFResponseWrapper(response);
+ rd.include(request, responseWrapper);
+ fw.append(responseWrapper.getResponseContent());
+ }
+ catch (ServletException ex)
+ {
+ ex.printStackTrace();
+ }
+ }
+ }
+ }
+
+ private void addViewerParameter(FacesContext context, StringBuffer buffer, String
name, String value)
+ {
+ String finalValue = (String) valueBinding(context, name, value);
+ if (finalValue == null || finalValue.trim().length() <= 0)
+ return;
+ buffer.append("&__");
+ buffer.append(name);
+ buffer.append("=");
+
+ try
+ {
+ finalValue = URLEncoder.encode(finalValue,"UTF-8");
+ }
+ catch (UnsupportedEncodingException e)
+ {
+ finalValue = URLEncoder.encode(finalValue);
+ }
+ buffer.append(finalValue);
+ }
+
+ @Override
+ public String getFamily()
+ {
+ return COMPONENT_FAMILY;
+ }
+
+ public String getDesignType()
+ {
+ return designType;
+ }
+
+ public void setDesignType(String designType)
+ {
+ this.designType = designType;
+ }
+
+ public String getDesignName()
+ {
+ return designName;
+ }
+
+ public void setDesignName(String designName)
+ {
+ this.designName = designName;
+ }
+
+ public String getTitle()
+ {
+ return title;
+ }
+
+ public void setTitle(String title)
+ {
+ this.title = title;
+ }
+
+ public String getShowtitle()
+ {
+ return showtitle;
+ }
+
+ public void setShowtitle(String showtitle)
+ {
+ this.showtitle = showtitle;
+ }
+
+ public String getToolbar()
+ {
+ return toolbar;
+ }
+
+ public void setToolbar(String toolbar)
+ {
+ this.toolbar = toolbar;
+ }
+
+ public String getNavigationbar()
+ {
+ return navigationbar;
+ }
+
+ public void setNavigationbar(String navigationbar)
+ {
+ this.navigationbar = navigationbar;
+ }
+
+ public String getParameterpage()
+ {
+ return parameterpage;
+ }
+
+ public void setParameterpage(String parameterpage)
+ {
+ this.parameterpage = parameterpage;
+ }
+
+ public String getDocument()
+ {
+ return document;
+ }
+
+ public void setDocument(String document)
+ {
+ this.document = document;
+ }
+
+ public String getLocale()
+ {
+ return locale;
+ }
+
+ public void setLocale(String locale)
+ {
+ this.locale = locale;
+ }
+
+ public String getSvg()
+ {
+ return svg;
+ }
+
+ public void setSvg(String svg)
+ {
+ this.svg = svg;
+ }
+
+ public String getPage()
+ {
+ return page;
+ }
+
+ public void setPage(String page)
+ {
+ this.page = page;
+ }
+
+ public String getPagerange()
+ {
+ return pagerange;
+ }
+
+ public void setPagerange(String pagerange)
+ {
+ this.pagerange = pagerange;
+ }
+
+ public String getMasterpage()
+ {
+ return masterpage;
+ }
+
+ public void setMasterpage(String masterpage)
+ {
+ this.masterpage = masterpage;
+ }
+
+ public String getOverwrite()
+ {
+ return overwrite;
+ }
+
+ public void setOverwrite(String overwrite)
+ {
+ this.overwrite = overwrite;
+ }
+
+ public String getBookmark()
+ {
+ return bookmark;
+ }
+
+ public void setBookmark(String bookmark)
+ {
+ this.bookmark = bookmark;
+ }
+
+ public String getRtl()
+ {
+ return rtl;
+ }
+
+ public void setRtl(String rtl)
+ {
+ this.rtl = rtl;
+ }
+
+ public String getFittopage()
+ {
+ return fittopage;
+ }
+
+ public void setFittopage(String fittopage)
+ {
+ this.fittopage = fittopage;
+ }
+
+ public String getResourceFolder()
+ {
+ return resourceFolder;
+ }
+
+ public void setResourceFolder(String resourceFolder)
+ {
+ this.resourceFolder = resourceFolder;
+ }
+
+ public String getEmbeddable()
+ {
+ return embeddable;
+ }
+
+ public void setEmbeddable(String embeddable)
+ {
+ this.embeddable = embeddable;
+ }
+
+ @Override
+ public Object saveState(FacesContext context)
+ {
+
+ if (values == null)
+ {
+ values = new Object[22];
+ }
+ values[0] = super.saveState(context);
+ values[1] = url;
+ values[2] = format;
+ values[3] = designType;
+ values[4] = designName;
+ values[5] = title;
+ values[6] = showtitle;
+ values[7] = toolbar;
+ values[8] = navigationbar;
+ values[9] = parameterpage;
+ values[10] = document;
+ values[11] = locale;
+ values[12] = svg;
+ values[13] = page;
+ values[14] = pagerange;
+ values[15] = masterpage;
+ values[16] = overwrite;
+ values[17] = bookmark;
+ values[18] = rtl;
+ values[19] = fittopage;
+ values[20] = resourceFolder;
+ values[21] = embeddable;
+ return (values);
+
+ }
+
+ @Override
+ public void restoreState(FacesContext context, Object state)
+ {
+
+ values = (Object[]) state;
+ super.restoreState(context, values[0]);
+ url = (String) values[1];
+ format = (String) values[2];
+ designType = (String) values[3];
+ designName = (String) values[4];
+ title = (String) values[5];
+ showtitle = (String) values[6];
+ toolbar = (String) values[7];
+ navigationbar = (String) values[8];
+ parameterpage = (String) values[9];
+ document = (String) values[10];
+ locale = (String) values[11];
+ svg = (String) values[12];
+ page = (String) values[13];
+ pagerange = (String) values[14];
+ masterpage = (String) values[15];
+ overwrite = (String) values[16];
+ bookmark = (String) values[17];
+ rtl = (String) values[18];
+ fittopage = (String) values[19];
+ resourceFolder = (String) values[20];
+ embeddable = (String) values[21];
+ }
+
+ public class JSFResponseWrapper extends HttpServletResponseWrapper
+ {
+
+ private ServletOutputStreamWrapper servletOutputStreamWrapper = new
ServletOutputStreamWrapper();
+ private PrintWriter printWriter = new PrintWriter(servletOutputStreamWrapper);
+
+ public JSFResponseWrapper(HttpServletResponse response)
+ {
+ super(response);
+ }
+
+ @Override
+ public ServletOutputStream getOutputStream() throws IOException
+ {
+ return servletOutputStreamWrapper;
+ }
+
+ @Override
+ public PrintWriter getWriter() throws IOException
+ {
+ return printWriter;
+ }
+
+ public String getResponseContent()
+ {
+ return servletOutputStreamWrapper.toString();
+ }
+ }
+
+ private class ServletOutputStreamWrapper extends ServletOutputStream
+ {
+ StringWriter writer = new StringWriter();
+
+ @Override
+ public void write(int c) throws IOException
+ {
+ if (c < 0x80)
+ writer.write(c);
+ else if (c < 0x800)
+ {
+ writer.write(0xc0 + (c >> 6));
+ writer.write(0x80 + (c & 0x3f));
+ }
+ else
+ {
+ writer.write(0xe0 + (c >> 12));
+ writer.write(0x80 + ((c >> 6) & 0x3f));
+ writer.write(0x80 + (c & 0x3f));
+ }
+ }
+
+ @Override
+ public String toString()
+ {
+ return writer.toString();
+ }
+ }
+}
Added:
workspace/snjeza/JBossBirtIntegration/birttag/src/main/java/org/jboss/seam/birt/ui/UIParameter.java
===================================================================
---
workspace/snjeza/JBossBirtIntegration/birttag/src/main/java/org/jboss/seam/birt/ui/UIParameter.java
(rev 0)
+++
workspace/snjeza/JBossBirtIntegration/birttag/src/main/java/org/jboss/seam/birt/ui/UIParameter.java 2009-10-17
22:47:19 UTC (rev 18153)
@@ -0,0 +1,163 @@
+package org.jboss.seam.birt.ui;
+
+import javax.el.ELException;
+import javax.el.ValueExpression;
+import javax.faces.FacesException;
+import javax.faces.component.UIComponentBase;
+import javax.faces.context.FacesContext;
+
+public class UIParameter extends UIComponentBase
+{
+
+ public static final String COMPONENT_FAMILY = "org.jboss.seam.birt";
+
+ public static final String COMPONENT_TYPE =
"org.jboss.seam.birt.ui.UIParameter";
+
+ private String name;
+ private String value;
+ private String locale;
+ private String isnull;
+
+ public String getName()
+ {
+ if (this.name != null)
+ {
+ return (this.name);
+ }
+ ValueExpression ve = getValueExpression("name");
+ if (ve != null)
+ {
+ try
+ {
+ return ((String) ve.getValue(getFacesContext().getELContext()));
+ }
+ catch (ELException e)
+ {
+ throw new FacesException(e);
+ }
+ }
+ else
+ {
+ return (null);
+ }
+
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public String getValue()
+ {
+ if (this.value != null)
+ {
+ return (this.value);
+ }
+ ValueExpression ve = getValueExpression("value");
+ if (ve != null)
+ {
+ try
+ {
+ return (ve.getValue(getFacesContext().getELContext())).toString();
+ }
+ catch (ELException e)
+ {
+ throw new FacesException(e);
+ }
+ }
+ else
+ {
+ return (null);
+ }
+
+ }
+
+ public void setValue(String value)
+ {
+ this.value = value;
+ }
+
+ public String getLocale()
+ {
+ if (this.locale != null)
+ {
+ return (this.locale);
+ }
+ ValueExpression ve = getValueExpression("locale");
+ if (ve != null)
+ {
+ try
+ {
+ return ((String) ve.getValue(getFacesContext().getELContext()));
+ }
+ catch (ELException e)
+ {
+ throw new FacesException(e);
+ }
+ }
+ else
+ {
+ return (null);
+ }
+ }
+
+ public void setLocale(String locale)
+ {
+ this.locale = locale;
+ }
+
+ public String getIsnull()
+ {
+ return isnull;
+ }
+
+ public void setIsnull(String isnull)
+ {
+ this.isnull = isnull;
+ }
+
+ @Override
+ public String getFamily()
+ {
+ return COMPONENT_FAMILY;
+ }
+
+ private Object[] values;
+
+ @Override
+ public Object saveState(FacesContext context)
+ {
+
+ if (values == null)
+ {
+ values = new Object[5];
+ }
+
+ values[0] = super.saveState(context);
+ values[1] = name;
+ values[2] = value;
+ values[3] = locale;
+ values[4] = isnull;
+
+ return (values);
+
+ }
+
+ @Override
+ public void restoreState(FacesContext context, Object state)
+ {
+
+ values = (Object[]) state;
+ super.restoreState(context, values[0]);
+ name = (String) values[1];
+ if (values[2] != null) {
+ value = values[2].toString();
+ } else {
+ value="";
+ }
+ locale = (String) values[3];
+ isnull = (String) values[4];
+ }
+
+}
Added:
workspace/snjeza/JBossBirtIntegration/birttag/src/main/resources/META-INF/MANIFEST.MF
===================================================================
--- workspace/snjeza/JBossBirtIntegration/birttag/src/main/resources/META-INF/MANIFEST.MF
(rev 0)
+++
workspace/snjeza/JBossBirtIntegration/birttag/src/main/resources/META-INF/MANIFEST.MF 2009-10-17
22:47:19 UTC (rev 18153)
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+
Added:
workspace/snjeza/JBossBirtIntegration/birttag/src/main/resources/META-INF/faces-config.xml
===================================================================
---
workspace/snjeza/JBossBirtIntegration/birttag/src/main/resources/META-INF/faces-config.xml
(rev 0)
+++
workspace/snjeza/JBossBirtIntegration/birttag/src/main/resources/META-INF/faces-config.xml 2009-10-17
22:47:19 UTC (rev 18153)
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<faces-config version="1.2"
+
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+
+ <component>
+ <component-type>org.jboss.seam.birt.ui.UIDocument</component-type>
+ <component-class>org.jboss.seam.birt.ui.UIDocument</component-class>
+ </component>
+
+ <component>
+ <component-type>org.jboss.seam.birt.ui.UIParameter</component-type>
+
<component-class>org.jboss.seam.birt.ui.UIParameter</component-class>
+ </component>
+
+ <!--
+ <lifecycle>
+
<phase-listener>org.jboss.seam.birt.DocumentStorePhaseListener</phase-listener>
+ </lifecycle>
+ -->
+</faces-config>
Added:
workspace/snjeza/JBossBirtIntegration/birttag/src/main/resources/META-INF/seam-birt.taglib.xml
===================================================================
---
workspace/snjeza/JBossBirtIntegration/birttag/src/main/resources/META-INF/seam-birt.taglib.xml
(rev 0)
+++
workspace/snjeza/JBossBirtIntegration/birttag/src/main/resources/META-INF/seam-birt.taglib.xml 2009-10-17
22:47:19 UTC (rev 18153)
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<!DOCTYPE facelet-taglib PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
+ "facelet-taglib_1_0.dtd">
+
+<facelet-taglib>
+ <
namespace>http://jboss.com/products/seam/birt</namespace>
+
+ <tag>
+ <tag-name>birt</tag-name>
+ <component>
+
<component-type>org.jboss.seam.birt.ui.UIDocument</component-type>
+ </component>
+ </tag>
+
+ <tag>
+ <tag-name>param</tag-name>
+ <component>
+
<component-type>org.jboss.seam.birt.ui.UIParameter</component-type>
+ </component>
+ </tag>
+
+</facelet-taglib>
Added:
workspace/snjeza/JBossBirtIntegration/birttag/src/main/resources/org/jboss/seam/birt/birt-1.0.xsd
===================================================================
---
workspace/snjeza/JBossBirtIntegration/birttag/src/main/resources/org/jboss/seam/birt/birt-1.0.xsd
(rev 0)
+++
workspace/snjeza/JBossBirtIntegration/birttag/src/main/resources/org/jboss/seam/birt/birt-1.0.xsd 2009-10-17
22:47:19 UTC (rev 18153)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified"
+
targetNamespace="http://jboss.com/products/seam/birt"
+
xmlns:birt="http://jboss.com/products/seam/birt"
+
xmlns:components="http://jboss.com/products/seam/components"
+ attributeFormDefault="unqualified">
+ <xs:import
namespace="http://jboss.com/products/seam/components"
+ schemaLocation="components-2.0.xsd"/>
+
+ <xs:element name="document-store">
+ <xs:complexType mixed="true">
+ <xs:attributeGroup ref="components:attlist.component"/>
+ <xs:attributeGroup ref="birt:attlist.docstore"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:attributeGroup name="attlist.docstore">
+ <xs:attribute name="error-page" type="xs:string"/>
+ <xs:attribute name="use-extensions" type="xs:string"/>
+ </xs:attributeGroup>
+
+ <xs:element name="key-store-config">
+ <xs:complexType mixed="true">
+ <xs:attributeGroup ref="components:attlist.component"/>
+ <xs:attributeGroup ref="birt:attlist.UseExtensions"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:attributeGroup name="attlist.UseExtensions">
+ <xs:attribute name="key-store" type="xs:string"/>
+ <xs:attribute name="key-store-password"
type="xs:string"/>
+ <xs:attribute name="key-password" type="xs:string"/>
+ <xs:attribute name="key-alias" type="xs:string"/>
+ </xs:attributeGroup>
+</xs:schema>
Added: workspace/snjeza/JBossBirtIntegration/birttag/src/main/resources/seam.properties
===================================================================
--- workspace/snjeza/JBossBirtIntegration/birttag/src/main/resources/seam.properties
(rev 0)
+++
workspace/snjeza/JBossBirtIntegration/birttag/src/main/resources/seam.properties 2009-10-17
22:47:19 UTC (rev 18153)
@@ -0,0 +1 @@
+
Added: workspace/snjeza/JBossBirtIntegration/pom.xml
===================================================================
--- workspace/snjeza/JBossBirtIntegration/pom.xml (rev 0)
+++ workspace/snjeza/JBossBirtIntegration/pom.xml 2009-10-17 22:47:19 UTC (rev 18153)
@@ -0,0 +1,56 @@
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.tools.birt</groupId>
+ <artifactId>parent</artifactId>
+ <version>1.0.0</version>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>birttag</module>
+ <module>birtservlet</module>
+ </modules>
+
+ <repositories>
+ <repository>
+ <id>jboss</id>
+ <name>JBoss Repository</name>
+ <
url>http://repository.jboss.org/maven2</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ <repository>
+ <id>jboss-snapshots</id>
+ <name>JBoss Snapshot Repository</name>
+ <
url>http://snapshots.jboss.org/maven2</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+
+ <dependencies>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file