From: <id...@us...> - 2008-10-07 20:43:47
|
Revision: 4825 http://openuss.svn.sourceforge.net/openuss/?rev=4825&view=rev Author: idueppe Date: 2008-10-07 20:43:42 +0000 (Tue, 07 Oct 2008) Log Message: ----------- started to integrate the formula editor Modified Paths: -------------- branches/openuss-plexus-3.1/openformula/formula-editor/src/test/resources/FormulaEdit.html branches/openuss-plexus-3.1/openformula/pom.xml Added Paths: ----------- branches/openuss-plexus-3.1/openformula/formula-jsf/ branches/openuss-plexus-3.1/openformula/formula-jsf/.classpath branches/openuss-plexus-3.1/openformula/formula-jsf/.project branches/openuss-plexus-3.1/openformula/formula-jsf/pom.xml branches/openuss-plexus-3.1/openformula/formula-jsf/src/ branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/ branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/java/ branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/java/org/ branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/java/org/openuss/ branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/java/org/openuss/openformula/ branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/java/org/openuss/openformula/component/ branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/java/org/openuss/openformula/component/formula/ branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/java/org/openuss/openformula/component/formula/Editor.java branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/java/org/openuss/openformula/component/formula/EditorRenderer.java branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/java/org/openuss/openformula/component/formula/EditorTag.java branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/resources/ branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/resources/META-INF/ branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/resources/META-INF/faces-config.xml branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/resources/META-INF/openformula.tld branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/resources/log4j.properties branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/resources/templates/ branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/resources/templates/editor.vsl branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/tld/ branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/tld/misc/ branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/tld/misc/resolve_entities-tlddoc.xsl branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/tld/misc/resolve_entities.xsl branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/tld/misc/web-jsptaglibrary_1_2.dtd branches/openuss-plexus-3.1/openformula/formula-jsf/src/test/ branches/openuss-plexus-3.1/openformula/formula-jsf/src/test/java/ branches/openuss-plexus-3.1/openformula/formula-jsf/src/test/java/org/ branches/openuss-plexus-3.1/openformula/formula-jsf/src/test/java/org/openuss/ branches/openuss-plexus-3.1/openformula/formula-jsf/src/test/java/org/openuss/openformula/ branches/openuss-plexus-3.1/openformula/formula-jsf/src/test/java/org/openuss/openformula/component/ branches/openuss-plexus-3.1/openformula/formula-jsf/src/test/java/org/openuss/openformula/component/formula/ branches/openuss-plexus-3.1/openformula/formula-jsf/src/test/java/org/openuss/openformula/component/formula/EditorRendererTest.java branches/openuss-plexus-3.1/openformula/formula-jsf/velocity.log.1 branches/openuss-plexus-3.1/openformula/formula-web/ branches/openuss-plexus-3.1/openformula/formula-web/.classpath branches/openuss-plexus-3.1/openformula/formula-web/.project branches/openuss-plexus-3.1/openformula/formula-web/pom.xml branches/openuss-plexus-3.1/openformula/formula-web/src/ branches/openuss-plexus-3.1/openformula/formula-web/src/main/ branches/openuss-plexus-3.1/openformula/formula-web/src/main/java/ branches/openuss-plexus-3.1/openformula/formula-web/src/main/java/org/ branches/openuss-plexus-3.1/openformula/formula-web/src/main/java/org/openuss/ branches/openuss-plexus-3.1/openformula/formula-web/src/main/java/org/openuss/openformula/ branches/openuss-plexus-3.1/openformula/formula-web/src/main/java/org/openuss/openformula/sample/ branches/openuss-plexus-3.1/openformula/formula-web/src/main/java/org/openuss/openformula/sample/EditorBean.java branches/openuss-plexus-3.1/openformula/formula-web/src/main/webapp/ branches/openuss-plexus-3.1/openformula/formula-web/src/main/webapp/WEB-INF/ branches/openuss-plexus-3.1/openformula/formula-web/src/main/webapp/WEB-INF/faces-config.xml branches/openuss-plexus-3.1/openformula/formula-web/src/main/webapp/WEB-INF/web.xml branches/openuss-plexus-3.1/openformula/formula-web/src/main/webapp/applet/ branches/openuss-plexus-3.1/openformula/formula-web/src/main/webapp/applet/formula-editor-3.1.jar branches/openuss-plexus-3.1/openformula/formula-web/src/main/webapp/editor.jsp branches/openuss-plexus-3.1/openformula/formula-web/src/main/webapp/index.html Modified: branches/openuss-plexus-3.1/openformula/formula-editor/src/test/resources/FormulaEdit.html =================================================================== --- branches/openuss-plexus-3.1/openformula/formula-editor/src/test/resources/FormulaEdit.html 2008-10-07 19:18:08 UTC (rev 4824) +++ branches/openuss-plexus-3.1/openformula/formula-editor/src/test/resources/FormulaEdit.html 2008-10-07 20:43:42 UTC (rev 4825) @@ -7,6 +7,7 @@ <body> <script type="text/javascript"> <!-- + // Clear all. function clearAll() { document.formulaEditor.reset(); @@ -16,7 +17,6 @@ // Pass function pass() { document.formula.formula.value=document.formulaEditor.getFormula(); - alert("Hello"); } // Save the formula @@ -32,6 +32,10 @@ } document.FileUpload.Ids.value = daten; } + + function + + addEvent(window, 'load', construct_${clientId}); //--> </script> <applet name="formulaEditor" code="org/openuss/openformula/io/FormulaApplet.class" archive="../../../target/formula-editor-3.1-SNAPSHOT.jar" width="800" height="600"> Property changes on: branches/openuss-plexus-3.1/openformula/formula-jsf ___________________________________________________________________ Added: svn:ignore + .settings Added: branches/openuss-plexus-3.1/openformula/formula-jsf/.classpath =================================================================== --- branches/openuss-plexus-3.1/openformula/formula-jsf/.classpath (rev 0) +++ branches/openuss-plexus-3.1/openformula/formula-jsf/.classpath 2008-10-07 20:43:42 UTC (rev 4825) @@ -0,0 +1,55 @@ +<classpath> + <classpathentry kind="src" path="src/main/java"/> + <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/> + <classpathentry kind="src" path="src/test/java" output="target/test-classes"/> + <classpathentry kind="output" path="target/classes"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> + <classpathentry kind="var" path="M2_REPO/cglib/cglib-nodep/2.1_3/cglib-nodep-2.1_3.jar" sourcepath="M2_REPO/cglib/cglib-nodep/2.1_3/cglib-nodep-2.1_3-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar" sourcepath="M2_REPO/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0-sources.jar"> + <attributes> + <attribute value="jar:file:/D:/Development/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0-javadoc.jar!/" name="javadoc_location"/> + </attributes> + </classpathentry> + <classpathentry kind="var" path="M2_REPO/commons-codec/commons-codec/1.3/commons-codec-1.3.jar" sourcepath="M2_REPO/commons-codec/commons-codec/1.3/commons-codec-1.3-sources.jar"> + <attributes> + <attribute value="jar:file:/D:/Development/repository/commons-codec/commons-codec/1.3/commons-codec-1.3-javadoc.jar!/" name="javadoc_location"/> + </attributes> + </classpathentry> + <classpathentry kind="var" path="M2_REPO/commons-collections/commons-collections/3.2/commons-collections-3.2.jar" sourcepath="M2_REPO/commons-collections/commons-collections/3.2/commons-collections-3.2-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/commons-digester/commons-digester/1.6/commons-digester-1.6.jar" sourcepath="M2_REPO/commons-digester/commons-digester/1.6/commons-digester-1.6-sources.jar"> + <attributes> + <attribute value="jar:file:/D:/Development/repository/commons-digester/commons-digester/1.6/commons-digester-1.6-javadoc.jar!/" name="javadoc_location"/> + </attributes> + </classpathentry> + <classpathentry kind="var" path="M2_REPO/commons-lang/commons-lang/2.3/commons-lang-2.3.jar" sourcepath="M2_REPO/commons-lang/commons-lang/2.3/commons-lang-2.3-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar" sourcepath="M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1-sources.jar"> + <attributes> + <attribute value="jar:file:/D:/Development/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1-javadoc.jar!/" name="javadoc_location"/> + </attributes> + </classpathentry> + <classpathentry kind="var" path="M2_REPO/commons-validator/commons-validator/1.3.1/commons-validator-1.3.1.jar" sourcepath="M2_REPO/commons-validator/commons-validator/1.3.1/commons-validator-1.3.1-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/easymock/easymock/2.2/easymock-2.2.jar" sourcepath="M2_REPO/org/easymock/easymock/2.2/easymock-2.2-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/easymock/easymockclassextension/2.2/easymockclassextension-2.2.jar" sourcepath="M2_REPO/org/easymock/easymockclassextension/2.2/easymockclassextension-2.2-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/javax/servlet/jsp/jsp-api/2.1/jsp-api-2.1.jar" sourcepath="M2_REPO/javax/servlet/jsp/jsp-api/2.1/jsp-api-2.1-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/javax/servlet/jstl/1.1.2/jstl-1.1.2.jar" sourcepath="M2_REPO/javax/servlet/jstl/1.1.2/jstl-1.1.2-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.2/junit-3.8.2.jar" sourcepath="M2_REPO/junit/junit/3.8.2/junit-3.8.2-sources.jar"> + <attributes> + <attribute value="jar:file:/D:/Development/repository/junit/junit/3.8.2/junit-3.8.2-javadoc.jar!/" name="javadoc_location"/> + </attributes> + </classpathentry> + <classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14.jar" sourcepath="M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/myfaces/core/myfaces-api/1.1.5/myfaces-api-1.1.5.jar" sourcepath="M2_REPO/org/apache/myfaces/core/myfaces-api/1.1.5/myfaces-api-1.1.5-sources.jar"> + <attributes> + <attribute value="jar:file:/D:/Development/repository/org/apache/myfaces/core/myfaces-api/1.1.5/myfaces-api-1.1.5-javadoc.jar!/" name="javadoc_location"/> + </attributes> + </classpathentry> + <classpathentry kind="var" path="M2_REPO/oro/oro/2.0.8/oro-2.0.8.jar" sourcepath="M2_REPO/oro/oro/2.0.8/oro-2.0.8-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar" sourcepath="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/shale/shale-test/1.0.4/shale-test-1.0.4.jar" sourcepath="M2_REPO/org/apache/shale/shale-test/1.0.4/shale-test-1.0.4-sources.jar"> + <attributes> + <attribute value="jar:file:/D:/Development/repository/org/apache/shale/shale-test/1.0.4/shale-test-1.0.4-javadoc.jar!/" name="javadoc_location"/> + </attributes> + </classpathentry> + <classpathentry kind="var" path="M2_REPO/org/apache/velocity/velocity/1.5/velocity-1.5.jar"/> + <classpathentry kind="var" path="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar" sourcepath="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2-sources.jar"/> +</classpath> \ No newline at end of file Property changes on: branches/openuss-plexus-3.1/openformula/formula-jsf/.classpath ___________________________________________________________________ Added: svn:mime-type + text/plain Added: branches/openuss-plexus-3.1/openformula/formula-jsf/.project =================================================================== --- branches/openuss-plexus-3.1/openformula/formula-jsf/.project (rev 0) +++ branches/openuss-plexus-3.1/openformula/formula-jsf/.project 2008-10-07 20:43:42 UTC (rev 4825) @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>formula-jsf</name> + <comment>This is the OpenFormula JSF-Component</comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.wst.common.project.facet.core.builder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.wst.validation.validationbuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.wst.common.project.facet.core.nature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature> + <nature>org.eclipse.jem.workbench.JavaEMFNature</nature> + </natures> +</projectDescription> Property changes on: branches/openuss-plexus-3.1/openformula/formula-jsf/.project ___________________________________________________________________ Added: svn:mime-type + text/plain Added: branches/openuss-plexus-3.1/openformula/formula-jsf/pom.xml =================================================================== --- branches/openuss-plexus-3.1/openformula/formula-jsf/pom.xml (rev 0) +++ branches/openuss-plexus-3.1/openformula/formula-jsf/pom.xml 2008-10-07 20:43:42 UTC (rev 4825) @@ -0,0 +1,272 @@ +<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> + <groupId>org.openuss.openformula</groupId> + <artifactId>openformula</artifactId> + <version>3.1-SNAPSHOT</version> + </parent> + + <artifactId>formula-jsf</artifactId> + <packaging>jar</packaging> + <name>OpenUSS OpenFormula JSF-Component</name> + + <description> + This is the OpenFormula JSF-Component + </description> + + + <dependencies> + <dependency> + <groupId>org.apache.velocity</groupId> + <artifactId>velocity</artifactId> + </dependency> + + <!-- compile --> + <dependency> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + <scope>compile</scope> + </dependency> + + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <scope>compile</scope> + </dependency> + + <dependency> + <groupId>commons-validator</groupId> + <artifactId>commons-validator</artifactId> + <scope>compile</scope> + </dependency> + + <dependency> + <groupId>commons-collections</groupId> + <artifactId>commons-collections</artifactId> + <scope>compile</scope> + </dependency> + + <dependency> + <groupId>commons-codec</groupId> + <artifactId>commons-codec</artifactId> + <scope>compile</scope> + </dependency> + + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </dependency> + + <!-- provided dependencies --> + + <dependency> + <groupId>org.apache.myfaces.core</groupId> + <artifactId>myfaces-api</artifactId> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>javax.servlet.jsp</groupId> + <artifactId>jsp-api</artifactId> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + <scope>provided</scope> + </dependency> + + <!-- test dependencies --> + + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.apache.shale</groupId> + <artifactId>shale-test</artifactId> + <scope>test</scope> + </dependency> + + </dependencies> + + <reporting> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>changelog-maven-plugin</artifactId> + <version>2.0-beta-1</version> + <reportSets> + <reportSet> + <id>dual-report</id> + <configuration> + <type>range</type> + <range>30</range> + </configuration> + <reports> + <report>changelog</report> + <report>file-activity</report> + <report>dev-activity</report> + </reports> + </reportSet> + </reportSets> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <version>2.0-beta-3</version> + </plugin> + + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>jxr-maven-plugin</artifactId> + </plugin> + + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>taglist-maven-plugin</artifactId> + <version>2.0-beta-1</version> + <configuration> + <tags>TODO, FIXME, XXX, @deprecated</tags> + </configuration> + </plugin> + + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>surefire-report-maven-plugin</artifactId> + </plugin> + + </plugins> + </reporting> + + <profiles> + <profile> + <id>generate-site</id> + <build> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>xslt-maven-plugin</artifactId> + <version>1.0</version> + <executions> + <execution> + <id>generate-tld-for-tlddoc</id> + <goals> + <goal>transform</goal> + </goals> + <configuration> + <xslFile>src/main/tld/misc/resolve_entities-tlddoc.xsl</xslFile> + <srcIncludes>**/*.tld</srcIncludes> + <srcDir>src/main/tld</srcDir> + <destDir>target/tlddoc-site</destDir> + </configuration> + </execution> + <execution> + <id>generate-tld-for-jar</id> + <goals> + <goal>transform</goal> + </goals> + <configuration> + <xslFile>src/main/tld/misc/resolve_entities.xsl</xslFile> + <srcIncludes>**/*.tld</srcIncludes> + <srcDir>src/main/tld</srcDir> + <destDir>target/classes/META-INF</destDir> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + + </build> + <reporting> + <plugins> + <plugin> + <groupId>net.sourceforge.maven-taglib</groupId> + <artifactId>maven-taglib-plugin</artifactId> + <configuration> + <taglib.src.dir>/openformula/target/tlddoc-site</taglib.src.dir> + <tldDocDir>/openformula/target/site/tlddoc</tldDocDir> + </configuration> + </plugin> + </plugins> + </reporting> + </profile> + <profile> + <id>generate-assembly</id> + <activation> + <property> + <name>performRelease</name> + <value>true</value> + </property> + </activation> + <build> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>xslt-maven-plugin</artifactId> + <version>1.0</version> + <executions> + <execution> + <id>generate-tld-for-tlddoc</id> + <goals> + <goal>transform</goal> + </goals> + <configuration> + <xslFile>src/main/tld/misc/resolve_entities-tlddoc.xsl</xslFile> + <srcIncludes>**/*.tld</srcIncludes> + <srcDir>src/main/tld</srcDir> + <destDir>target/tlddoc-site</destDir> + </configuration> + </execution> + <execution> + <id>generate-tld-for-jar</id> + <goals> + <goal>transform</goal> + </goals> + <configuration> + <xslFile>src/main/tld/misc/resolve_entities.xsl</xslFile> + <srcIncludes>**/*.tld</srcIncludes> + <srcDir>src/main/tld</srcDir> + <destDir>target/classes/META-INF</destDir> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <executions> + <execution> + <id>attach-javadoc</id> + <goals><goal>jar</goal></goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>net.sourceforge.maven-taglib</groupId> + <artifactId>maven-taglib-plugin</artifactId> + <configuration> + <taglib.src.dir>${pom.dir}/target/tlddoc-site</taglib.src.dir> + <tldDocDir>${pom.dir}/openformula/target/tlddoc</tldDocDir> + </configuration> + <executions> + <execution> + <id>attach-javadoc</id> + <goals><goal>taglibdocjar</goal></goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + </profiles> + +</project> Property changes on: branches/openuss-plexus-3.1/openformula/formula-jsf/pom.xml ___________________________________________________________________ Added: svn:mime-type + text/plain Added: branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/java/org/openuss/openformula/component/formula/Editor.java =================================================================== --- branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/java/org/openuss/openformula/component/formula/Editor.java (rev 0) +++ branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/java/org/openuss/openformula/component/formula/Editor.java 2008-10-07 20:43:42 UTC (rev 4825) @@ -0,0 +1,59 @@ +package org.openuss.openformula.component.formula; + +import javax.faces.component.UIInput; +import javax.faces.component.ValueHolder; +import javax.faces.context.FacesContext; + +/** + * The OpenUSS OpenFormula component + * @author Ingo D\xFCppe + */ +public class Editor extends UIInput implements ValueHolder { + + public static final String COMPONENT_TYPE = "org.openuss.openformula.component.formula.Editor"; + public static final String DEFAULT_RENDERER_TYPE = "org.openuss.openformula.component.formula.EditorRenderer"; + public static final String COMPONENT_FAMILY = "javax.faces.Input"; + + private String width; + private String height; + + public Editor() { + // do nothing + } + + public String getFamily() { + return COMPONENT_FAMILY; + } + + public void restoreState(FacesContext context, Object state) { + Object values[] = (Object[]) state; + width = (String) values[1]; + height = (String) values[2]; + super.restoreState(context, values[0]); + } + + public Object saveState(FacesContext context) { + Object values[] = new Object[3]; + values[0] = super.saveState(context); + values[1] = width; + values[2] = height; + return values; + } + + public String getWidth() { + return width; + } + + public void setWidth(String width) { + this.width = width; + } + + public String getHeight() { + return height; + } + + public void setHeight(String height) { + this.height = height; + } + +} Property changes on: branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/java/org/openuss/openformula/component/formula/Editor.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/java/org/openuss/openformula/component/formula/EditorRenderer.java =================================================================== --- branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/java/org/openuss/openformula/component/formula/EditorRenderer.java (rev 0) +++ branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/java/org/openuss/openformula/component/formula/EditorRenderer.java 2008-10-07 20:43:42 UTC (rev 4825) @@ -0,0 +1,85 @@ +package org.openuss.openformula.component.formula; + +import java.io.IOException; +import java.io.StringWriter; +import java.util.Map; +import java.util.Properties; +import java.util.logging.Level; +import java.util.logging.Logger; + +import javax.faces.component.UIComponent; +import javax.faces.context.FacesContext; +import javax.faces.context.ResponseWriter; +import javax.faces.render.Renderer; + +import org.apache.velocity.Template; +import org.apache.velocity.VelocityContext; +import org.apache.velocity.app.Velocity; +import org.apache.velocity.exception.ParseErrorException; +import org.apache.velocity.exception.ResourceNotFoundException; + +/** + * The renderer for my component + */ +public class EditorRenderer extends Renderer { + + private static final Logger logger = Logger.getLogger(EditorRenderer.class.getName()); + + private VelocityContext velocityContext; + + public EditorRenderer () { + super(); + Properties properties = new Properties(); + properties.put("file.resource.loader.path", "d:/development/workspaces/plexus-branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/resources"); +// properties.put("resource.loader", "class"); +// properties.put("class.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader"); +// properties.put("velocimarco.lirary", ""); + + try { + Velocity.init(properties); + } catch (Exception ex) { + logger.log(Level.SEVERE,ex.getMessage(),ex); + } + velocityContext = new VelocityContext(); + + } + + public void decode(FacesContext facesContext, UIComponent uiComponent) { + super.decode(facesContext, uiComponent); + Map paramMap = facesContext.getExternalContext().getRequestParameterMap(); + String clientId = uiComponent.getClientId(facesContext); + String value = (String) paramMap.get(clientId); + Editor editor = (Editor) uiComponent; + editor.setValue(value); + editor.setValid(true); + } + + public void encodeBegin(FacesContext facesContext, UIComponent uiComponent) throws IOException { + super.encodeBegin(facesContext, uiComponent); + // no need to use encodeBegin. + } + + public void encodeChildren(FacesContext facesContext, UIComponent uiComponent) throws IOException { + super.encodeChildren(facesContext, uiComponent); + // this component does not have children + } + + public void encodeEnd(FacesContext facesContext, UIComponent uiComponent) throws IOException { + try { + Template template = Velocity.getTemplate("templates/editor.vsl"); + StringWriter sw = new StringWriter(); + velocityContext.put("component", uiComponent); + velocityContext.put("clientId", uiComponent.getId()); + template.merge(velocityContext, sw); + ResponseWriter writer = facesContext.getResponseWriter(); + logger.log(Level.FINER,sw.toString()); + writer.write(sw.toString()); + } catch (ResourceNotFoundException ex) { + logger.log(Level.SEVERE,ex.getMessage(),ex); + } catch (ParseErrorException ex) { + logger.log(Level.SEVERE,ex.getMessage(),ex); + } catch (Exception ex) { + logger.log(Level.SEVERE,ex.getMessage(),ex); + } + } +} Property changes on: branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/java/org/openuss/openformula/component/formula/EditorRenderer.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/java/org/openuss/openformula/component/formula/EditorTag.java =================================================================== --- branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/java/org/openuss/openformula/component/formula/EditorTag.java (rev 0) +++ branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/java/org/openuss/openformula/component/formula/EditorTag.java 2008-10-07 20:43:42 UTC (rev 4825) @@ -0,0 +1,89 @@ +package org.openuss.openformula.component.formula; + +import javax.faces.application.Application; +import javax.faces.component.UIComponent; +import javax.faces.context.FacesContext; +import javax.faces.webapp.UIComponentTag; + +/** + * The tag for my component + */ +public class EditorTag extends UIComponentTag { + + private String value; + private String width; + private String height; + + /** + * @see javax.faces.webapp.UIComponentTag#getComponentType() + */ + public String getComponentType() { + return Editor.COMPONENT_TYPE; + } + + /** + * @see javax.faces.webapp.UIComponentTag#getRendererType() + */ + public String getRendererType() { + return Editor.DEFAULT_RENDERER_TYPE; + } + + /** + * @see javax.faces.webapp.UIComponentTag#setProperties + */ + protected void setProperties(UIComponent component) { + super.setProperties(component); + + Editor editor = (Editor) component; + + FacesContext context = FacesContext.getCurrentInstance(); + Application application = context.getApplication(); + + // value + if (value != null) { + if (UIComponentTag.isValueReference(value)) { + component.setValueBinding("value", application.createValueBinding(value)); + } else { + component.getAttributes().put("value", value); + } + } + + if (width != null) { + editor.setWidth(width); + } + + if (height != null) { + editor.setHeight(height); + } + + } + + public void release() { + super.release(); + this.value = null; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getWidth() { + return width; + } + + public void setWidth(String width) { + this.width = width; + } + + public String getHeight() { + return height; + } + + public void setHeight(String height) { + this.height = height; + } +} Property changes on: branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/java/org/openuss/openformula/component/formula/EditorTag.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/resources/META-INF/faces-config.xml =================================================================== --- branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/resources/META-INF/faces-config.xml (rev 0) +++ branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/resources/META-INF/faces-config.xml 2008-10-07 20:43:42 UTC (rev 4825) @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> + +<!DOCTYPE faces-config PUBLIC + "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN" + "http://java.sun.com/dtd/web-facesconfig_1_1.dtd"> + +<faces-config xmlns="http://java.sun.com/JSF/Configuration"> + + <!-- components --> + + <component> + <component-type>org.openuss.openformula.component.formula.Editor</component-type> + <component-class>org.openuss.openformula.component.formula.Editor</component-class> + </component> + + + <!-- renderkit --> + + <render-kit> + + <renderer> + <component-family>javax.faces.Input</component-family> + <renderer-type>org.openuss.openformula.component.formula.EditorRenderer</renderer-type> + <renderer-class>org.openuss.openformula.component.formula.EditorRenderer</renderer-class> + </renderer> + + </render-kit> + +</faces-config> Property changes on: branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/resources/META-INF/faces-config.xml ___________________________________________________________________ Added: svn:mime-type + text/plain Added: branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/resources/META-INF/openformula.tld =================================================================== --- branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/resources/META-INF/openformula.tld (rev 0) +++ branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/resources/META-INF/openformula.tld 2008-10-07 20:43:42 UTC (rev 4825) @@ -0,0 +1,86 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> + +<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" + "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd"> + +<taglib> + + <tlib-version>1.2</tlib-version> + <jsp-version>1.2</jsp-version> + <short-name>formula-jsf</short-name> + <uri>http://www.openuss.org/openformula</uri> + <description> + OpenFormula JSF Components + </description> + + <tag> + <name>editor</name> + <tag-class>org.openuss.openformula.component.formula.EditorTag</tag-class> + <body-content>JSP</body-content> + <description>OpenFormula Editor</description> + + <!-- import the entities for that component here--> + <attribute> + <name>value</name> + <required>false</required> + <rtexprvalue>false</rtexprvalue> + <type>java.lang.String</type> + <description>The initial value of this component</description> + </attribute> + + <attribute> + <name>id</name> + <required>false</required> + <rtexprvalue>false</rtexprvalue> + <type>java.lang.String</type> + <description> + The developer-assigned ID of this component. The ID must be unique + within the scope of the tag's enclosing naming container (e.g. + h:form or f:subview). This value must be a static value. + </description> + </attribute> + + <attribute> + <name>binding</name> + <required>false</required> + <rtexprvalue>false</rtexprvalue> + <type>java.lang.String</type> + <description> + Identifies a backing bean property (of type UIComponent or appropriate + subclass) to bind to this component instance. This value must be an + EL expression. + </description> + </attribute> + + <attribute> + <name>rendered</name> + <required>false</required> + <rtexprvalue>false</rtexprvalue> + <type>java.lang.String</type> + <description> + A boolean value that indicates whether this component should be rendered. + Default value: true. + </description> + </attribute> + + <attribute> + <name>width</name> + <required>false</required> + <rtexprvalue>false</rtexprvalue> + <type>java.lang.String</type> + <description> + HTML Tag + </description> + </attribute> + + <attribute> + <name>height</name> + <required>false</required> + <rtexprvalue>false</rtexprvalue> + <type>java.lang.String</type> + <description> + HTML Tag + </description> + </attribute> + </tag> +</taglib> \ No newline at end of file Property changes on: branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/resources/META-INF/openformula.tld ___________________________________________________________________ Added: svn:mime-type + text/plain Added: branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/resources/log4j.properties =================================================================== --- branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/resources/log4j.properties (rev 0) +++ branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/resources/log4j.properties 2008-10-07 20:43:42 UTC (rev 4825) @@ -0,0 +1,34 @@ +#Created by JInto - www.guh-software.de +#Thu Mar 06 13:57:41 CET 2008 +log4j.appender.R=org.apache.log4j.RollingFileAppender +log4j.appender.R.MaxFileSize=10MB +log4j.appender.R.file=${catalina.base}/logs/openuss-plexus.log +log4j.appender.R.layout=org.apache.log4j.PatternLayout +log4j.appender.R.layout.ConversionPattern=%d{ISO8601} %p %c{1}. %m%n +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} %p %c{1}. %m%n +log4j.logger.com.sun.facelets=ERROR +log4j.logger.net.sf.ehcache=TRACE +log4j.logger.org.acegisecurity=ERROR +log4j.logger.org.apache.commons=ERROR +log4j.logger.org.apache.myfaces=ERROR +log4j.logger.org.apache.shale=ERROR +log4j.logger.org.hibernate=INFO +log4j.logger.org.hibernate.SQL=DEBUG +log4j.logger.org.hibernate.cache=TRACE +log4j.logger.org.hibernate.hql.ast.AST=WARN +log4j.logger.org.hibernate.jdbc=INFO +log4j.logger.org.hibernate.pretty=DEBUG +log4j.logger.org.hibernate.secure=WARN +log4j.logger.org.hibernate.tool.hbm2ddl=WARN +log4j.logger.org.hibernate.transaction=INFO +log4j.logger.org.hibernate.type=INFO +log4j.logger.org.openuss=TRACE +log4j.logger.org.openuss.commands=DEBUG +log4j.logger.org.openuss.framework=TRACE +log4j.logger.org.openuss.framework.jsfcontrols=INFO +log4j.logger.org.openuss.framework.web.facelets=INFO +log4j.logger.org.quartz=ERROR +log4j.logger.org.springframework=ERROR +log4j.rootCategory=INFO, stdout, R Property changes on: branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/resources/log4j.properties ___________________________________________________________________ Added: svn:mime-type + text/plain Added: branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/resources/templates/editor.vsl =================================================================== --- branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/resources/templates/editor.vsl (rev 0) +++ branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/resources/templates/editor.vsl 2008-10-07 20:43:42 UTC (rev 4825) @@ -0,0 +1,42 @@ +<input type="text" name="${clientId}" > + <script type="text/javascript"> + <!-- + function clearAll() { + document.formulaEditor.reset(); + } + function pass() { + document.formula.${clientId}.value=document.formulaEditor_${clientId}.getFormula(); + } + function sendData() { + alert("sendData") + var daten = ""; + for (var i = 0; i < document.applets.length; i++) { + var get = document.applets[i].submit(); + if (get != "") { + if (daten != "") + daten = daten + ","; + daten = daten + get; + } + } + document.FileUpload.Ids.value = daten; + } + + function construct_${clientId}(event) { + alert("construct"); + addEvent(document.formula,'submit', sendData); + } + + alert("load"); + addEventListener("load",construct_${clientId}); + --> +</script> +</input> +<red><h1>${clientId}</h1></red> +<applet name="formulaEditor_${clientId}" code="org/openuss/openformula/io/FormulaApplet.class" archive="./applet/formula-editor-3.1.jar" width="${component.width}" height="${component.height}"> +#if ($component.value) + <param name="formula" value="${component.value}"/> +#else + <param name="formula" value=""/> +#end +</applet> + Property changes on: branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/resources/templates/editor.vsl ___________________________________________________________________ Added: svn:mime-type + text/plain Added: branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/tld/misc/resolve_entities-tlddoc.xsl =================================================================== --- branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/tld/misc/resolve_entities-tlddoc.xsl (rev 0) +++ branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/tld/misc/resolve_entities-tlddoc.xsl 2008-10-07 20:43:42 UTC (rev 4825) @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!-- + - Stylesheet to expand xml entity references inline. + - + - This is a temporary workaround for a bug in the tlddoc application which means that + - a (valid) xmlns attribute is rejected; tlddoc v1.3 only accepts input that (incorrectly) + - puts the tld elements in no namespace. This stylesheet therefore generates a special + - version of the tld for feeding to the tlddoc app, until such time as tlddoc is fixed. + --> +<xsl:stylesheet version="1.1" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + + <xsl:output method="xml" + encoding="ISO-8859-1" + doctype-public="-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" + doctype-system="http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd" + indent="yes"/> + + <xsl:template match="*" priority="2"> + <!-- avoiding copy to get get rid of namespace attribute --> + <xsl:element name="{name(.)}"> + <xsl:apply-templates select="@*|node()"/> + </xsl:element> + </xsl:template> + + <xsl:template match="@*|node()"> + <xsl:copy> + <xsl:apply-templates select="@*|node()"/> + </xsl:copy> + </xsl:template> + +</xsl:stylesheet> Property changes on: branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/tld/misc/resolve_entities-tlddoc.xsl ___________________________________________________________________ Added: svn:mime-type + text/plain Added: branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/tld/misc/resolve_entities.xsl =================================================================== --- branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/tld/misc/resolve_entities.xsl (rev 0) +++ branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/tld/misc/resolve_entities.xsl 2008-10-07 20:43:42 UTC (rev 4825) @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!-- + - Stylesheet to pretty-print an xml document. In addition, if the input + - document contains any xml entity references, then those are expanded + - inline. + - + - Based on a stylesheet by John Mongan. + --> +<xsl:stylesheet version="1.1" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + + <xsl:output method="xml" + encoding="ISO-8859-1" + doctype-public="-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" + doctype-system="http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd"/> + + <xsl:param name="indent-increment" select="' '" /> + + <xsl:template match="*"> + <xsl:param name="indent" select="'
'"/> + + <xsl:value-of select="$indent"/> + <xsl:copy> + <xsl:copy-of select="@*" /> + <xsl:apply-templates> + <xsl:with-param name="indent" + select="concat($indent, $indent-increment)"/> + </xsl:apply-templates> + <xsl:if test="*"> + <xsl:value-of select="$indent"/> + </xsl:if> + </xsl:copy> + </xsl:template> + + <xsl:template match="comment()|processing-instruction()"> + <xsl:param name="indent" select="'
'"/> + <xsl:value-of select="$indent"/> + <xsl:copy /> + </xsl:template> + + <!-- + - Discard the text content of a node where the text content + - is nothing but whitespace. When this rule isn't matched + - the default xml processing applies, which is to copy the + - text directly to the output. + - + - WARNING: this is dangerous. Handle with care + --> + <xsl:template match="text()[normalize-space(.)='']"/> + +</xsl:stylesheet> Property changes on: branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/tld/misc/resolve_entities.xsl ___________________________________________________________________ Added: svn:mime-type + text/plain Added: branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/tld/misc/web-jsptaglibrary_1_2.dtd =================================================================== --- branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/tld/misc/web-jsptaglibrary_1_2.dtd (rev 0) +++ branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/tld/misc/web-jsptaglibrary_1_2.dtd 2008-10-07 20:43:42 UTC (rev 4825) @@ -0,0 +1,108 @@ +<!-- + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. +--> + +<!-- + + This is the DTD defining the JavaServer Pages 1.2 Tag Library + descriptor (.tld) (XML) file format/syntax. + + A Tag Library is a JAR file containing a valid instance of a Tag Library + Descriptor (taglib.tld) file in the META-INF subdirectory, along with the + appropriate implementing classes, and other resources required to + implement the tags defined therein. + + --> + +<!NOTATION WEB-JSPTAGLIB.1_2 PUBLIC + "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"> + +<!-- +This is the XML DTD for the JSP 1.2 Tag Library Descriptor. +All JSP 1.2 tag library descriptors must include a DOCTYPE +of the following form: + + <!DOCTYPE taglib + PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" + "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd"> + +--> + +<!ELEMENT taglib (tlib-version, jsp-version, short-name, uri?, + display-name?, small-icon?, large-icon?, description?, + validator?, listener*, tag+) > + +<!ATTLIST taglib id ID #IMPLIED + xmlns CDATA #FIXED + "http://java.sun.com/JSP/TagLibraryDescriptor"> + +<!ELEMENT tlib-version (#PCDATA) > +<!ELEMENT jsp-version (#PCDATA) > +<!ELEMENT short-name (#PCDATA) > +<!ELEMENT uri (#PCDATA) > +<!ELEMENT description (#PCDATA) > +<!ELEMENT validator (validator-class, init-param*, description?) > +<!ELEMENT validator-class (#PCDATA) > +<!ELEMENT init-param (param-name, param-value, description?)> +<!ELEMENT param-name (#PCDATA)> +<!ELEMENT param-value (#PCDATA)> +<!ELEMENT listener (listener-class) > +<!ELEMENT listener-class (#PCDATA) > +<!ELEMENT tag (name, tag-class, tei-class?, body-content?, display-name?, + small-icon?, large-icon?, description?, variable*, attribute*, + example?) > +<!ELEMENT tag-class (#PCDATA) > +<!ELEMENT tei-class (#PCDATA) > +<!ELEMENT body-content (#PCDATA) > +<!ELEMENT display-name (#PCDATA) > +<!ELEMENT large-icon (#PCDATA) > +<!ELEMENT small-icon (#PCDATA) > +<!ELEMENT example (#PCDATA) > +<!ELEMENT variable ( (name-given | name-from-attribute), variable-class?, + declare?, scope?, description?) > +<!ELEMENT name-given (#PCDATA) > +<!ELEMENT name-from-attribute (#PCDATA) > +<!ELEMENT variable-class (#PCDATA) > +<!ELEMENT declare (#PCDATA) > +<!ELEMENT scope (#PCDATA) > +<!ELEMENT attribute (name, required? , rtexprvalue?, type?, description?) > +<!ELEMENT name (#PCDATA) > +<!ELEMENT required (#PCDATA) > +<!ELEMENT rtexprvalue (#PCDATA) > +<!ELEMENT type (#PCDATA) > + +<!-- ID attributes --> + +<!ATTLIST tlib-version id ID #IMPLIED> +<!ATTLIST jsp-version id ID #IMPLIED> +<!ATTLIST short-name id ID #IMPLIED> +<!ATTLIST uri id ID #IMPLIED> +<!ATTLIST description id ID #IMPLIED> +<!ATTLIST example id ID #IMPLIED> +<!ATTLIST tag id ID #IMPLIED> +<!ATTLIST tag-class id ID #IMPLIED> +<!ATTLIST tei-class id ID #IMPLIED> +<!ATTLIST body-content id ID #IMPLIED> +<!ATTLIST attribute id ID #IMPLIED> +<!ATTLIST name id ID #IMPLIED> +<!ATTLIST required id ID #IMPLIED> +<!ATTLIST rtexprvalue id ID #IMPLIED> +<!ATTLIST param-name id ID #IMPLIED> +<!ATTLIST param-value id ID #IMPLIED> +<!ATTLIST listener id ID #IMPLIED> +<!ATTLIST listener-class id ID #IMPLIED> Property changes on: branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/tld/misc/web-jsptaglibrary_1_2.dtd ___________________________________________________________________ Added: svn:mime-type + text/plain Added: branches/openuss-plexus-3.1/openformula/formula-jsf/src/test/java/org/openuss/openformula/component/formula/EditorRendererTest.java =================================================================== --- branches/openuss-plexus-3.1/openformula/formula-jsf/src/test/java/org/openuss/openformula/component/formula/EditorRendererTest.java (rev 0) +++ branches/openuss-plexus-3.1/openformula/formula-jsf/src/test/java/org/openuss/openformula/component/formula/EditorRendererTest.java 2008-10-07 20:43:42 UTC (rev 4825) @@ -0,0 +1,53 @@ +package org.openuss.openformula.component.formula; + +import java.io.IOException; +import java.io.StringWriter; + +import org.apache.shale.test.base.AbstractJsfTestCase; +import org.apache.shale.test.mock.MockRenderKitFactory; +import org.apache.shale.test.mock.MockResponseWriter; + +/** + * Class to test the behaviour of the SayHello renderer + */ +public class EditorRendererTest extends AbstractJsfTestCase { + + private MockResponseWriter writer; + private Editor editor; + + public EditorRendererTest(String name) { + super(name); + } + + public void setUp() throws Exception { + super.setUp(); + + editor = new Editor(); + editor.setValue("<xmath></xmath>"); + editor.setId("editorId"); + editor.setWidth("200"); + editor.setHeight("200"); + + writer = new MockResponseWriter(new StringWriter(), null, null); + facesContext.setResponseWriter(writer); + facesContext.getViewRoot().setRenderKitId(MockRenderKitFactory.HTML_BASIC_RENDER_KIT); + facesContext.getRenderKit().addRenderer(editor.getFamily(), editor.getRendererType(), new EditorRenderer()); + } + + public void tearDown() throws Exception { + super.tearDown(); + editor = null; + writer = null; + } + + public void testEncodeEnd() throws IOException { + editor.encodeEnd(facesContext); + facesContext.renderResponse(); + + String output = writer.getWriter().toString(); + assertTrue(output.contains("editorId")); + + assertFalse(output.contains("${clientId}")); + } + +} Property changes on: branches/openuss-plexus-3.1/openformula/formula-jsf/src/test/java/org/openuss/openformula/component/formula/EditorRendererTest.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: branches/openuss-plexus-3.1/openformula/formula-jsf/velocity.log.1 =================================================================== --- branches/openuss-plexus-3.1/openformula/formula-jsf/velocity.log.1 (rev 0) +++ branches/openuss-plexus-3.1/openformula/formula-jsf/velocity.log.1 2008-10-07 20:43:42 UTC (rev 4825) @@ -0,0 +1,1222 @@ +2008-08-14 19:45:29,202 - Log4JLogChute initialized using file 'velocity.log' +2008-08-14 19:45:29,202 - Starting Apache Velocity v1.5 (compiled: 2007-02-22 08:52:29) +2008-08-14 19:45:29,202 - Default Properties File: org\apache\velocity\runtime\defaults\velocity.properties +2008-08-14 19:45:29,202 - Trying to use logger class org.apache.velocity.runtime.log.AvalonLogChute +2008-08-14 19:45:29,204 - Couldn't find class org.apache.velocity.runtime.log.AvalonLogChute or necessary supporting classes in classpath. +java.lang.NoClassDefFoundError: org/apache/log/format/Formatter + at java.lang.Class.forName0(Native Method) + at java.lang.Class.forName(Class.java:247) + at org.apache.velocity.util.ClassUtils.getClass(ClassUtils.java:63) + at org.apache.velocity.util.ClassUtils.getNewInstance(ClassUtils.java:95) + at org.apache.velocity.runtime.log.LogManager.createLogChute(LogManager.java:147) + at org.apache.velocity.runtime.log.LogManager.updateLog(LogManager.java:208) + at org.apache.velocity.runtime.RuntimeInstance.initializeLog(RuntimeInstance.java:728) + at org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:240) + at org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:534) + at org.apache.velocity.runtime.RuntimeSingleton.init(RuntimeSingleton.java:227) + at org.apache.velocity.app.Velocity.init(Velocity.java:111) + at org.openuss.openformula.component.formula.EditorRenderer.<init>(EditorRenderer.java:39) + at org.openuss.openformula.component.formula.EditorRendererTest.setUp(EditorRendererTest.java:34) + at junit.framework.TestCase.runBare(TestCase.java:128) + at junit.framework.TestResult$1.protect(TestResult.java:106) + at junit.framework.TestResult.runProtected(TestResult.java:124) + at junit.framework.TestResult.run(TestResult.java:109) + at junit.framework.TestCase.run(TestCase.java:120) + at junit.framework.TestSuite.runTest(TestSuite.java:230) + at junit.framework.TestSuite.run(TestSuite.java:225) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) + at java.lang.reflect.Method.invoke(Method.java:597) + at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213) + at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140) + at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127) + at org.apache.maven.surefire.Surefire.run(Surefire.java:177) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) + at java.lang.reflect.Method.invoke(Method.java:597) + at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338) + at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997) +Caused by: java.lang.ClassNotFoundException: org.apache.log.format.Formatter + at java.net.URLClassLoader$1.run(URLClassLoader.java:200) + at java.security.AccessController.doPrivileged(Native Method) + at java.net.URLClassLoader.findClass(URLClassLoader.java:188) + at java.lang.ClassLoader.loadClass(ClassLoader.java:306) + at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276) + at java.lang.ClassLoader.loadClass(ClassLoader.java:251) + at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) + ... 34 more +2008-08-14 19:45:29,206 - Trying to use logger class org.apache.velocity.runtime.log.Log4JLogChute +2008-08-14 19:45:29,206 - Using logger class org.apache.velocity.runtime.log.Log4JLogChute +2008-08-14 19:45:29,209 - Default ResourceManager initializing. (class org.apache.velocity.runtime.resource.ResourceManagerImpl) +2008-08-14 19:45:29,213 - ResourceLoader instantiated: org.apache.velocity.runtime.resource.loader.FileResourceLoader +2008-08-14 19:45:29,215 - Do unicode file recognition: false +2008-08-14 19:45:29,215 - FileResourceLoader : adding path 'd:/development/workspaces/plexus-branches/openuss-plexus-3.1/openformula/formula-jsf/src/main/resources' +2008-08-14 19:45:29,234 - ResourceCache: initialized (class org.apache.velocity.runtime.resource.ResourceCacheImpl) +2008-08-14 19:45:29,235 - Loaded System Directive: org.apache.velocity.runtime.directive.Literal +2008-08-14 19:45:29,237 - Loaded System Directive: org.apache.velocity.runtime.directive.Macro +2008-08-14 19:45:29,240 - Loaded System Directive: org.apache.velocity.runtime.directive.Parse +2008-08-14 19:45:29,242 - Loaded System Directive: org.apache.velocity.runtime.directive.Include +2008-08-14 19:45:29,243 - Loaded System Directive: org.apache.velocity.runtime.directive.Foreach +2008-08-14 19:45:29,290 - Created '20' parsers. +2008-08-14 19:45:29,299 - Velocimacro : "velocimacro.library" is not set. Trying default library: VM_global_library.vm +2008-08-14 19:45:29,299 - Velocimacro : Default library not found. +2008-08-14 19:45:29,299 - Velocimacro : allowInline = true : VMs can be defined inline in templates +2008-08-14 19:45:29,299 - Velocimacro : allowInlineToOverride = false : VMs defined inline may NOT replace previous VM definitions +2008-08-14 19:45:29,299 - Velocimacro : allowInlineLocal = false : VMs defined inline will be global in scope if allowed. +2008-08-14 19:45:29,299 - Velocimacro : autoload off : VM system will not automatically reload global library macros +2008-08-14 19:45:29,325 - ResourceManager : found templates/editor.vsl with loader org.apache.velocity.runtime.resource.loader.FileResourceLoader +2008-08-14 19:50:48,637 - Log4JLogChute initialized using file 'velocity.log' +2008-08-14 19:50:48,658 - Starting Apache Velocity v1.5 (compiled: 2007-02-22 08:52:29) +2008-08-14 19:50:48,658 - Default Properties File: org\apache\velocity\runtime\defaults\velocity.properties +2008-08-14 19:50:48,659 - Trying to use logger class org.apache.velocity.runtime.log.AvalonLogChute +2008-08-14 19:50:48,660 - Couldn't find class org.apache.velocity.runtime.log.AvalonLogChute or necessary supporting cl... [truncated message content] |