JBoss Rich Faces SVN: r14105 - trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTable/examples.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2009-05-11 11:41:30 -0400 (Mon, 11 May 2009)
New Revision: 14105
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTable/examples/modifiableModel.xhtml
Log:
https://jira.jboss.org/jira/browse/RF-7039
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTable/examples/modifiableModel.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTable/examples/modifiableModel.xhtml 2009-05-11 15:37:18 UTC (rev 14104)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTable/examples/modifiableModel.xhtml 2009-05-11 15:41:30 UTC (rev 14105)
@@ -4,12 +4,18 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
+ <style>
+ .rich-filter-input{
+ width:50px;
+ }
+ </style>
<h:form>
<a4j:queue requestDelay="100" />
<rich:messages />
<rich:dataTable value="#{hibernateDataModel}" var="row" rows="10"
- rowKeyConverter="javax.faces.Long" reRender="datascroller" rendered="#{componentNavigator.currentComponent.activeTab == 'modifiableDataModel'}">
- <rich:columns value="#{hibernateBean.csvFields}" var="field"
+ rowKeyConverter="javax.faces.Long" reRender="datascroller" width="650"
+ rendered="#{componentNavigator.currentComponent.activeTab == 'modifiableDataModel'}">
+ <rich:columns value="#{hibernateBean.csvFields}" var="field"
sortBy="#{field}" filterBy="#{field}" filterEvent="onkeyup"
index="index" id="column#{index}"
sortOrder="#{dataTableStateHolder.sortOrders[field]}"
16 years, 4 months
JBoss Rich Faces SVN: r14104 - trunk/samples/richfaces-demo/src/main/webapp/richfaces/layouts/page/includes.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2009-05-11 11:37:18 -0400 (Mon, 11 May 2009)
New Revision: 14104
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/layouts/page/includes/sidebar.xhtml
Log:
https://jira.jboss.org/jira/browse/RF-7024
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/layouts/page/includes/sidebar.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/layouts/page/includes/sidebar.xhtml 2009-05-11 15:16:20 UTC (rev 14103)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/layouts/page/includes/sidebar.xhtml 2009-05-11 15:37:18 UTC (rev 14104)
@@ -10,7 +10,7 @@
<h:outputText value="Page Attributes"/>
</f:facet>
<h:outputLabel for="theme" value="Page Theme" />
- <h:selectOneMenu id="theme" style="width:75px"
+ <h:selectOneMenu id="theme" style="width:100px"
value="#{layoutBean.theme}">
<f:selectItem itemValue="" itemLabel="Default" />
<f:selectItem itemValue="simple" itemLabel="Simple" />
@@ -19,16 +19,16 @@
<f:selectItem itemValue="smooth" itemLabel="Smooth" />
</h:selectOneMenu>
<h:outputLabel for="width" value="Page Width" />
- <h:inputText id="width" value="#{layoutBean.width}" style="width:75px"/>
+ <h:inputText id="width" value="#{layoutBean.width}" style="width:100px"/>
<h:outputLabel for="sidebarwidth" value="Sidebar Width" />
- <h:inputText id="sidebarwidth" value="#{layoutBean.sidebarWidth}" style="width:75px"/>
+ <h:inputText id="sidebarwidth" value="#{layoutBean.sidebarWidth}" style="width:100px"/>
<h:outputLabel for="position" value="Side bar position" />
- <h:selectOneMenu value="#{layoutBean.position}" id="position" style="width:75px">
+ <h:selectOneMenu value="#{layoutBean.position}" id="position" style="width:100px">
<f:selectItem itemValue="left" />
<f:selectItem itemValue="right" />
</h:selectOneMenu>
<h:outputLabel for="skin" value="Current skin" />
- <h:selectOneMenu value="#{skinBean.skin}" id="skin" style="width:75px">
+ <h:selectOneMenu value="#{skinBean.skin}" id="skin" style="width:100px">
<f:selectItem itemValue="blueSky" itemLabel="blueSky" />
<f:selectItem itemValue="ruby" itemLabel="ruby" />
<f:selectItem itemValue="emeraldTown" itemLabel="emeraldTown" />
16 years, 4 months
JBoss Rich Faces SVN: r14103 - trunk/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2009-05-11 11:16:20 -0400 (Mon, 11 May 2009)
New Revision: 14103
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature/externalFilteringUsage.xhtml
Log:
https://jira.jboss.org/jira/browse/RF-7048
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature/externalFilteringUsage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature/externalFilteringUsage.xhtml 2009-05-11 14:41:38 UTC (rev 14102)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature/externalFilteringUsage.xhtml 2009-05-11 15:16:20 UTC (rev 14103)
@@ -43,10 +43,6 @@
</ui:include>
</div>
</fieldset>
- <p>
- DESCRIPTION
- </p>
-
</ui:define>
</ui:composition>
16 years, 4 months
JBoss Rich Faces SVN: r14102 - Reports/3.3.1 and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: tkuprevich
Date: 2009-05-11 10:41:38 -0400 (Mon, 11 May 2009)
New Revision: 14102
Modified:
trunk/test-applications/qa/Test Reports/3.3.1/RFTestReport3.3.1.CR3.xls
Log:
Modified: trunk/test-applications/qa/Test Reports/3.3.1/RFTestReport3.3.1.CR3.xls
===================================================================
(Binary files differ)
16 years, 4 months
JBoss Rich Faces SVN: r14101 - Reports/3.3.1 and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: tkuprevich
Date: 2009-05-11 10:34:43 -0400 (Mon, 11 May 2009)
New Revision: 14101
Modified:
trunk/test-applications/qa/Test Reports/3.3.1/RFTestReport3.3.1.CR3.xls
Log:
Modified: trunk/test-applications/qa/Test Reports/3.3.1/RFTestReport3.3.1.CR3.xls
===================================================================
(Binary files differ)
16 years, 4 months
JBoss Rich Faces SVN: r14100 - trunk/examples/photoalbum/source/ear.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2009-05-11 10:19:49 -0400 (Mon, 11 May 2009)
New Revision: 14100
Modified:
trunk/examples/photoalbum/source/ear/pom.xml
Log:
correct build script
Modified: trunk/examples/photoalbum/source/ear/pom.xml
===================================================================
--- trunk/examples/photoalbum/source/ear/pom.xml 2009-05-11 08:21:42 UTC (rev 14099)
+++ trunk/examples/photoalbum/source/ear/pom.xml 2009-05-11 14:19:49 UTC (rev 14100)
@@ -106,33 +106,33 @@
<profile>
<id>richfaces</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-resources-plugin</artifactId>
- <version>2.3</version>
- <executions>
- <execution>
- <id>copy-prod-resources</id>
- <phase>install</phase>
- <goals>
- <goal>copy-resources</goal>
- </goals>
- <configuration>
- <outputDirectory>dist</outputDirectory>
- <resources>
- <resource>
- <directory>target/*.ear</directory>
- <filtering>true</filtering>
- </resource>
- </resources>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <!--<build>-->
+ <!--<plugins>-->
+ <!--<plugin>-->
+ <!--<groupId>org.apache.maven.plugins</groupId>-->
+ <!--<artifactId>maven-resources-plugin</artifactId>-->
+ <!--<version>2.3</version>-->
+ <!--<executions>-->
+ <!--<execution>-->
+ <!--<id>copy-prod-resources</id>-->
+ <!--<phase>install</phase>-->
+ <!--<goals>-->
+ <!--<goal>copy-resources</goal>-->
+ <!--</goals>-->
+ <!--<configuration>-->
+ <!--<outputDirectory>dist</outputDirectory>-->
+ <!--<resources>-->
+ <!--<resource>-->
+ <!--<directory>target/*.ear</directory>-->
+ <!--<filtering>true</filtering>-->
+ <!--</resource>-->
+ <!--</resources>-->
+ <!--</configuration>-->
+ <!--</execution>-->
+ <!--</executions>-->
+ <!--</plugin>-->
+ <!--</plugins>-->
+ <!--</build>-->
</profile>
</profiles>
16 years, 4 months
JBoss Rich Faces SVN: r14099 - in trunk/ui/editor/src: main/java/org/richfaces/convert/seamtext/tags and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2009-05-11 04:21:42 -0400 (Mon, 11 May 2009)
New Revision: 14099
Added:
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/RootTag.java
Modified:
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/HtmlToSeamTransformer.java
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/HtmlTag.java
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/TagFactory.java
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/UnorderedListTag.java
trunk/ui/editor/src/test/java/org/richfaces/seamparser/HtmlSeamParserTest.java
Log:
Editor: exception if input html source in SeamTextMode.
https://jira.jboss.org/jira/browse/RF-7064
Modified: trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/HtmlToSeamTransformer.java
===================================================================
--- trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/HtmlToSeamTransformer.java 2009-05-10 14:31:42 UTC (rev 14098)
+++ trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/HtmlToSeamTransformer.java 2009-05-11 08:21:42 UTC (rev 14099)
@@ -147,8 +147,8 @@
case '\n':
final HtmlTag token = htmlElementStack.peek();
- if (!(token.isParagraph()
- || isHeaderProcessed
+ if (!(/*token.isParagraph()
+ ||*/ isHeaderProcessed
|| HtmlToSeamSAXParser.ROOT_TAG_NAME.equals(token.getName())
|| token.isList())) {
out(text, start, localLength);
Modified: trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/HtmlTag.java
===================================================================
--- trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/HtmlTag.java 2009-05-10 14:31:42 UTC (rev 14098)
+++ trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/HtmlTag.java 2009-05-11 08:21:42 UTC (rev 14099)
@@ -42,7 +42,7 @@
private String name;
private Map<String, String> attributes;
- protected List<Object> body;
+ protected LinkedList<Object> body;
private boolean isEmpty = true;
@@ -63,6 +63,14 @@
setAttributes(attributes);
}
+ protected boolean isBreakLineChild(Object child) {
+ if (!(child instanceof String)) {
+ return false;
+ }
+ final String str = (String) child;
+ return "\r".equals(str) || "\n".equals(str) || "\r\n".equals(str);
+ }
+
protected String printPlainStart(){
final StringBuilder builder = new StringBuilder();
builder.append('<').append(getName());
@@ -152,7 +160,15 @@
protected String printEnd(){
return printPlainEnd();
}
+
+ public boolean isLineTag() {
+ return this instanceof LineTag;
+ }
+ public boolean isQuote() {
+ return Q.equals(name);
+ }
+
public boolean isLink() {
return A.equals(name);
}
@@ -174,7 +190,7 @@
}
public boolean isPreFormattedElement() {
- return PRE.equals(name) || TT.equals(name);
+ return TT.equals(name);
}
public void setEmpty() {
Added: trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/RootTag.java
===================================================================
--- trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/RootTag.java (rev 0)
+++ trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/RootTag.java 2009-05-11 08:21:42 UTC (rev 14099)
@@ -0,0 +1,81 @@
+package org.richfaces.convert.seamtext.tags;
+
+import java.util.LinkedList;
+
+public class RootTag extends HtmlTag{
+
+ private static final long serialVersionUID = -5798300257186134777L;
+
+ RootTag () {
+ super("root");
+ }
+
+ @Override
+ protected String printEnd() {
+ return "";
+ }
+
+ @Override
+ protected String printStart() {
+ return "";
+ }
+
+ @Override
+ protected String printBody() {
+ body = prepareBody();
+ return super.printBody();
+ }
+
+ /*
+ * from seam-text.g
+ *
+ * startRule: (newline)* ( (heading (newline)* )? text (heading (newline)* text)* )?
+ * ;
+ *
+ * text : ( (paragraph|preformatted|blockquote|list|html) (newline)* )+
+ * ;
+ *
+ * After header alwas must be text.
+ *
+ * */
+ private LinkedList<Object> prepareBody() {
+ LinkedList<Object> res = new LinkedList<Object>();
+ StringBuilder builder = new StringBuilder("<span>");
+
+ for (int i = 0; i < body.size(); i++) {
+ Object child = body.get(i);
+ Object nextChild = i+1 < body.size() ? body.get(i+1) : null;
+
+ if (isChildString(child)) {
+ builder.append(child);
+ if (nextChild == null || !isChildString(nextChild)) {
+ builder.append("</span>");
+
+ res.add(builder.toString());
+
+ builder = new StringBuilder("<span>");
+ }
+ } else if (isChildHeader(child) && (isChildHeader(nextChild) || nextChild == null)) {
+ res.add(child);
+ res.add(" \n\n"); // empty paragraph
+ } else if (child instanceof HtmlTag && ((HtmlTag)child).isQuote()) {
+ res.add(child);
+ res.add("\n\n"); // empty paragraph
+ } else if (child instanceof HtmlTag) {
+ res.add(child);
+ } else {
+ throw new IllegalStateException("Unknow child element '" + child + "'");
+ }
+ }
+
+ return res;
+ }
+
+ private boolean isChildHeader(Object child) {
+ return child instanceof LineTag && ((LineTag)child).isHeader();
+ }
+
+ private boolean isChildString(Object child) {
+ return child instanceof String;
+ }
+}
Modified: trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/TagFactory.java
===================================================================
--- trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/TagFactory.java 2009-05-10 14:31:42 UTC (rev 14098)
+++ trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/TagFactory.java 2009-05-11 08:21:42 UTC (rev 14099)
@@ -28,7 +28,7 @@
* Collection of special Seam Tags
* */
private static final Collection<HtmlTag> TAGS = Arrays.asList(
- getNewTagDefinition("root", "", ""),
+ new RootTag(),
new EmptyHtmlTag(HR),
new EmptyHtmlTag(BR),
new EmptyHtmlTag(IMG),
@@ -54,8 +54,33 @@
return super.printBody();
}
},
- getNewTagDefinition(P, "", "\n\n"),
+ new HtmlTag(P) {
+ @Override
+ public String printStart() {
+ return "";
+ }
+
+ @Override
+ protected String printBody() {
+ while (isBreakLineChild(body.getLast())) {
+ body.removeLast();
+ }
+
+ return super.printBody();
+ }
+
+ @Override
+ public String printEnd() {
+ return "\n\n";
+ }
+
+ @Override
+ public String printStartSuffix() {
+ return "";
+ }
+ },
+
new FormattingTag(I, SEAM_STAR),
new FormattingTag(DEL, SEAM_TWIDDLE),
new FormattingTag(SUP, SEAM_HAT),
@@ -68,7 +93,7 @@
}
},
- getNewTagDefinition(PRE, SEAM_BACKTICK, SEAM_BACKTICK),
+// getNewTagDefinition(PRE, SEAM_BACKTICK, SEAM_BACKTICK),
getNewTagDefinition(Q, SEAM_DOUBLEQUOTE, SEAM_DOUBLEQUOTE),
new LinkTag(),
Modified: trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/UnorderedListTag.java
===================================================================
--- trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/UnorderedListTag.java 2009-05-10 14:31:42 UTC (rev 14098)
+++ trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/UnorderedListTag.java 2009-05-11 08:21:42 UTC (rev 14099)
@@ -21,6 +21,8 @@
return "\n";
}
+
+
@Override
protected void appendChildTag(StringBuilder res, HtmlTag child) {
if (LI.equals(child.getName()) && !isHtml) {
@@ -29,4 +31,9 @@
super.appendChildTag(res, child);
}
}
+
+ @Override
+ public void appendBody(String str) {
+ // Do nothing.
+ }
}
Modified: trunk/ui/editor/src/test/java/org/richfaces/seamparser/HtmlSeamParserTest.java
===================================================================
--- trunk/ui/editor/src/test/java/org/richfaces/seamparser/HtmlSeamParserTest.java 2009-05-10 14:31:42 UTC (rev 14098)
+++ trunk/ui/editor/src/test/java/org/richfaces/seamparser/HtmlSeamParserTest.java 2009-05-11 08:21:42 UTC (rev 14099)
@@ -122,7 +122,10 @@
assertSeamConverting(SEAM_TEXT_EXPRESSION_5);
}
- public void testStandartSeamTextConverting6() throws Exception {
+ /*
+ * Element <pre> not processed after https://jira.jboss.org/jira/browse/RF-7030
+ * */
+ public void standartSeamTextConverting6() throws Exception {
assertSeamConverting(SEAM_TEXT_EXPRESSION_6);
}
@@ -218,6 +221,13 @@
assertSeamConverting(SEAM_TEXT_EXPRESSION_29);
}
+ /*
+ * Element <pre> not processed after https://jira.jboss.org/jira/browse/RF-7030
+ * */
+ public void standartSeamTextConverting30() throws Exception {
+ assertSeamConverting("`for (int i=0; i<100; i--)\n{\n doSomething();\n}`");
+ }
+
public void testRF5717() throws Exception {
assertHtml2SeamConverting("<p>a<b a&b</p>");
}
@@ -254,12 +264,77 @@
}
public void testEmrtyTags02() throws Exception {
- final String html = " <br/>Hello <hr/><img/><area/> World! <col/>";
+ assertHtml2SeamConverting(" <br/>Hello <hr/><img/><area/> World! <col/>");
+ }
+
+ public void testPreformated() throws Exception {
+ final String html = "<pre>aaaaa<br/>bbbb<br/></pre>";
final String result = assertHtml2SeamConverting(html);
assertTrue(result.contains(html));
}
+ public void testPreformated02() throws Exception {
+ final String html = "<pre><br/><sup>sdsdf</sup></pre>";
+ final String result = assertHtml2SeamConverting(html);
+
+ assertTrue(result.contains(html));
+ }
+
+ public void testPreformated03() throws Exception {
+ final String html = "<pre><></pre>";
+ final String result = assertHtml2SeamConverting(html);
+
+ assertTrue(result.equals(html));
+ }
+
+ public void testHeading() throws Exception {
+ assertHtml2SeamConverting("<h1></h1><p>\nqwe<br/></p>\n\n\n<h2>adsfasdf</h2>qwe");
+ }
+
+ public void testHeading02() throws Exception {
+ assertHtml2SeamConverting("<h1></h1>");
+ }
+
+ public void testHeading03() throws Exception {
+ assertHtml2SeamConverting("<h1></h1>qwe\n<h1></h1><h1></h1>");
+ }
+
+ public void testHeading04() throws Exception {
+ assertHtml2SeamConverting("<h1></h1>qwe");
+ }
+
+ public void testList() throws Exception {
+ assertHtml2SeamConverting("<ol> \n\n<li>first item</li>\n\n<li>second item</li>\n\n<li>and even the <i>third</i> item</li>\n\n</ol>");
+ }
+
+ public void testFullList() throws Exception {
+ assertHtml2SeamConverting("<p>\n\nAn ordered list:\n\n</p>\n\n \n\n<ol> \n\n<li>first item</li>\n\n<li>second item</li>\n\n<li>and even the <i>third</i> item</li>\n\n</ol>\n\n\n\n<p>\n\nAn unordered list:\n\n</p>\n\n\n\n<ul>\n\n<li>an item</li>\n\n<li>another item</li>\n\n</ul>\n");
+ }
+
+ public void testBlockquote() throws Exception {
+ assertHtml2SeamConverting("<p>\n\nThe other guy said:\n\n</p>\n\n \n\n<q>Nyeah nyeah-nee\n<i>nyeah</i> nyeah!</q>\n\n\n\n<p>\n\nBut what do you think he means by <q>nyeah-nee</q>?\n\n</p>");
+ }
+
+ public void testBlockquote02() throws Exception {
+ assertHtml2SeamConverting("asdsadasd <q>word</q> my <span>red</span> ");
+ }
+
+ public void testText() throws Exception {
+ assertHtml2SeamConverting("test ");
+ }
+
+ public void testSeamDocumentation01() throws Exception {
+ assertHtml2SeamConverting("<p>\nIt's easy to make <i>emphasis</i>, <tt>monospace</tt>\n<del>deleted text</del>, super<sup>scripts</sup> or <u>underlines</u>.\n</p>");
+ }
+
+ public void testSeamDocumentation02() throws Exception {
+ final String content = "\nYou can write down equations like 2*3=6 and HTML tags\nlike <body> using the escape character: \\.\n";
+ final String result = assertHtml2SeamConverting("<p>"+content+"</p>");
+
+ assertTrue(result.contains(content));
+ }
+
public void testUglyTextFromWord() throws Exception {
final String str = "<p><meta content=\"text/html; charset=utf-8\" http-equiv=\"Content-Type\"/><meta content=\"Word.Document\" name=\"ProgId\"/><meta content=\"Microsoft Word 12\" name=\"Generator\"/><meta content=\"Microsoft Word 12\" name=\"Originator\"/><link href=\"file:///E:\\TEMP~1\\msohtmlclip1\\01\\clip_filelist.xml\" rel=\"File-List\"/><link href=\"file:///E:\\TEMP~1\\msohtmlclip1\\01\\clip_themedata.thmx\" rel=\"themeData\"/><link href=\"file:///E:\\TEMP~1\\msohtmlclip1\\01\\clip_colorschememapping.xml\" rel=\"colorSchemeMapping\"/>"
+ "<!--[if gte mso 9]><xml>\n"
@@ -740,26 +815,39 @@
}
private String assertHtml2SeamConverting(String htmlText) throws Exception {
+ System.out.println("Html -> SeamText -> Html");
+ System.out.println("------------------- Html -----------------------");
+ System.out.println("html = " + htmlText);
+
+ System.out.println("------------------- SeamText -------------------");
final String seamText = convertHtmlToSeamText(htmlText);
System.out.println("seamText = \n'" + seamText + "'");
- final SeamTextParser seamParser = new SeamTextParser(new SeamTextLexer(
- new StringReader(seamText)));
+ final SeamTextParser seamParser =
+ new SeamTextParser(new SeamTextLexer(new StringReader(seamText)));
seamParser.startRule();
- return seamParser.toString();
+ final String string = seamParser.toString();
+ System.out.println("------------------- Html -----------------------");
+ System.out.println("html = " + string);
+
+ return string;
}
private void assertSeamConverting(String seamTextExpression)
throws TokenStreamException, RecognitionException {
-
+ System.out.println("SeamText -> Html -> SeamText");
+ System.out.println("------------------- SeamText -------------------");
final SeamTextParser seamParser = new SeamTextParser(new SeamTextLexer(
new StringReader(seamTextExpression)));
seamParser.startRule();
+
+ System.out.println("------------------- Html -----------------------");
final String html = seamParser.toString();
System.out.println("html = " + html);
+ System.out.println("------------------- SeamText -------------------");
final String seamtext = convertHtmlToSeamText(html);
assertEquals(seamTextExpression, seamtext.trim());
16 years, 4 months
JBoss Rich Faces SVN: r14098 - in trunk/cdk/maven-resource-dependency-plugin: src/main/java/org/richfaces/cdk/rd and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-05-10 10:31:42 -0400 (Sun, 10 May 2009)
New Revision: 14098
Modified:
trunk/cdk/maven-resource-dependency-plugin/
trunk/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/Component.java
trunk/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/Components.java
trunk/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/generator/ScriptAssembler.java
trunk/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/ComponentsHandler.java
trunk/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/ResourceDependencyMojo.java
Log:
https://jira.jboss.org/jira/browse/RF-7076
Property changes on: trunk/cdk/maven-resource-dependency-plugin
___________________________________________________________________
Name: svn:ignore
- target
+ target
bin
.classpath
.project
.settings
Modified: trunk/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/Component.java
===================================================================
--- trunk/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/Component.java 2009-05-08 19:12:42 UTC (rev 14097)
+++ trunk/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/Component.java 2009-05-10 14:31:42 UTC (rev 14098)
@@ -101,4 +101,8 @@
return componentName.compareToIgnoreCase(o.getComponentName());
}
+ @Override
+ public String toString() {
+ return "Component: " + componentName;
+ }
}
Modified: trunk/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/Components.java
===================================================================
--- trunk/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/Components.java 2009-05-08 19:12:42 UTC (rev 14097)
+++ trunk/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/Components.java 2009-05-10 14:31:42 UTC (rev 14098)
@@ -79,4 +79,9 @@
return false;
return true;
}
+
+ @Override
+ public String toString() {
+ return "Components set: " + namespace;
+ }
}
Modified: trunk/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/generator/ScriptAssembler.java
===================================================================
--- trunk/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/generator/ScriptAssembler.java 2009-05-08 19:12:42 UTC (rev 14097)
+++ trunk/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/generator/ScriptAssembler.java 2009-05-10 14:31:42 UTC (rev 14098)
@@ -24,6 +24,7 @@
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
+import java.io.InputStream;
import java.net.URL;
import org.apache.maven.plugin.logging.Log;
@@ -37,21 +38,28 @@
protected Log log;
-
private StringBuilder builder = new StringBuilder();
-
public ScriptAssembler(Log log) {
this.log = log;
}
public void assembly(URL resource) {
-
+ InputStream inputStream = null;
try {
- builder.append(IOUtil.toString(resource.openStream()));
+ inputStream = resource.openStream();
+ builder.append(IOUtil.toString(inputStream));
builder.append("\n");
} catch (IOException e) {
log.error("Error read resource: " + resource.getFile());
+ } finally {
+ if (inputStream != null) {
+ try {
+ inputStream.close();
+ } catch (IOException e) {
+ log.error(e.getLocalizedMessage(), e);
+ }
+ }
}
}
Modified: trunk/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/ComponentsHandler.java
===================================================================
--- trunk/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/ComponentsHandler.java 2009-05-08 19:12:42 UTC (rev 14097)
+++ trunk/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/ComponentsHandler.java 2009-05-10 14:31:42 UTC (rev 14098)
@@ -25,6 +25,8 @@
import java.io.Reader;
import java.io.StringReader;
import java.net.URL;
+import java.util.HashMap;
+import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
@@ -43,110 +45,117 @@
*
*/
public class ComponentsHandler extends DefaultHandler{
-
+
private String [] INCLUDE_ALL_PATTERN = {"**"};
-
+
protected Log log;
+
+ private Map <String, Components> components;
+
+ private Map <String, Set<String>> processedComponents = new HashMap<String, Set<String>>();
- private Map <String,Components> components;
-
private Set <String> scripts = new LinkedHashSet<String>();
-
+
private Set <String> styles = new LinkedHashSet<String>();
-
+
private String [] scriptIncludes;
-
+
private String [] scriptExcludes;
-
+
private String [] styleIncludes;
-
+
private String [] styleExcludes;
-
+
private String [] namespaceIncludes;
-
+
private String [] namespaceExcludes;
-
+
private String [] componentIncludes;
-
+
private String [] componentExcludes;
public ComponentsHandler(Log log) {
this.log = log;
}
+
+ private Set<String> getProcessedComponentsSet(String uri) {
+ Set<String> result = processedComponents.get(uri);
+ if (result == null) {
+ result = new HashSet<String>();
+ processedComponents.put(uri, result);
+ }
+
+ return result;
+ }
+
@Override
public void endElement(String uri, String localName, String name) throws SAXException {
-
- if(components != null && components.containsKey(uri)) {
-
- if(namespaceIncludes == null) {
- namespaceIncludes = INCLUDE_ALL_PATTERN;
+ if (components != null) {
+
+ Components library = components.get(uri);
+ if (library != null) {
- if(log.isDebugEnabled()) {
- log.debug("use default include patterns for namespaces");
- }
- }
-
- if(doMatch(namespaceIncludes, uri, true)){
-
- if(!doMatch(namespaceExcludes, uri, true)) {
-
- Components library = components.get(uri);
- List <Component> components = library.getComponents();
-
- if (componentIncludes == null) {
-
- componentIncludes = INCLUDE_ALL_PATTERN;
-
- if(log.isDebugEnabled()) {
- log.debug("use default include patterns for components");
+ Set<String> processedComponentsSet = getProcessedComponentsSet(uri);
+ if (processedComponentsSet.add(localName)) {
+ if (namespaceIncludes == null) {
+ namespaceIncludes = INCLUDE_ALL_PATTERN;
+
+ if (log.isDebugEnabled()) {
+ log.debug("use default include patterns for namespaces");
}
-
}
-
- for(Component component : components ){
-
- String componentName = component.getComponentName();
- if(localName.equals(componentName)) {
-
- if(doMatch(componentIncludes, componentName,false)) {
-
- if(!doMatch(componentExcludes, componentName,false)) {
-
- log.info("process component: " + componentName);
-
- collectScripts(component);
- collectStyles(component);
+
+ if (doMatch(namespaceIncludes, uri, true)){
+ if (!doMatch(namespaceExcludes, uri, true)) {
+ List <Component> components = library.getComponents();
+
+ if (componentIncludes == null) {
+ componentIncludes = INCLUDE_ALL_PATTERN;
+
+ if(log.isDebugEnabled()) {
+ log.debug("use default include patterns for components");
}
-
- }
-
+ }
+
+ if (doMatch(componentIncludes, localName, false)) {
+ if (!doMatch(componentExcludes, localName, false)) {
+ for (Component component : components) {
+
+ String componentName = component.getComponentName();
+ if(localName.equals(componentName)) {
+ log.info("process component: " + componentName);
+
+ collectScripts(component);
+ collectStyles(component);
+ break;
+ }
+ }
+ }
+ }
+ } else if(log.isDebugEnabled()) {
+ log.debug("components from namespace " + uri + " are in excluded list");
}
-
+ } else if(log.isDebugEnabled()) {
+ log.debug("components from namespace " + uri + " aren't in include list");
}
-
- } else if(log.isDebugEnabled()) {
- log.debug("components from namespace " + uri + " are in excluded list");
}
- } else if(log.isDebugEnabled()) {
- log.debug("components from namespace " + uri + " aren't in include list");
}
}
}
-
+
private void collectStyles(Component component) {
-
+
if(styleIncludes == null) {
styleIncludes = INCLUDE_ALL_PATTERN;
}
-
+
if(log.isDebugEnabled()) {
log.debug("start collect styles from component: " + component.getComponentName() );
}
-
+
for(String style : component.getStyles()) {
-
if(doMatch(styleIncludes, style, true)) {
-
+
if(!doMatch(styleExcludes, style, true)) {
this.styles.add(style);
log.info("style " + style + " is collected");
@@ -156,62 +165,61 @@
log.info(styleExclude);
}
}
-
+
} else {
log.info("style files are not in included list");
for(String styleInclude: styleIncludes) {
log.info(styleInclude);
}
}
-
+
}
}
-
+
private boolean doMatch(String [] patterns, String str, boolean matchPath) {
boolean allow = false;
-
+
if(patterns != null) {
-
+
for(String excludePattern: patterns) {
-
+
if(matchPath) {
allow = SelectorUtils.matchPath(excludePattern, str);
} else {
allow = SelectorUtils.match(excludePattern, str);
}
-
+
if(allow) break;
}
-
+
}
-
+
return allow;
}
-
+
private void collectScripts(Component component) {
-
- if(scriptIncludes == null) {
+
+ if (scriptIncludes == null) {
scriptIncludes = INCLUDE_ALL_PATTERN;
}
-
- if(log.isDebugEnabled()) {
+
+ if (log.isDebugEnabled()) {
log.debug("start collect scripts from component: " + component.getComponentName() );
}
-
- for(String script : component.getScripts()) {
-
- if(doMatch(scriptIncludes, script, true)) {
-
- if(!doMatch(scriptExcludes, script, true)) {
+
+ for (String script : component.getScripts()) {
+
+ if (doMatch(scriptIncludes, script, true)) {
+ if (!doMatch(scriptExcludes, script, true)) {
this.scripts.add(script);
log.info("script " + script + " is collected");
- }else {
+ } else {
log.info("script files are in excluded list");
for(String styleExclude: scriptExcludes) {
log.info(styleExclude);
}
}
-
+
} else {
log.info("script files are not in included list");
for(String styleInclude: scriptIncludes) {
@@ -220,15 +228,15 @@
}
}
}
-
+
public Set <String> getStyles() {
return this.styles;
}
-
+
public Set <String> getScripts() {
return this.scripts;
}
-
+
public Map <String, Components> getComponents() {
return components;
}
@@ -236,7 +244,7 @@
public void setComponents(Map <String, Components> components) {
this.components = components;
}
-
+
public String[] getNamespaceExcludes() {
return namespaceExcludes;
}
@@ -300,51 +308,51 @@
public void setComponentIncludes(String[] componentIncludes) {
this.componentIncludes = componentIncludes;
}
-
+
private static final String DEFAULT_DTD_PATH = "org/richfaces/default.dtd";
-
+
private String defaultDtdContent;
-
+
private String readDtdContent(String path) throws IOException {
- URL url = Thread.currentThread().getContextClassLoader().getResource(path);
- if (url == null) {
- url = getClass().getClassLoader().getResource(path);
- }
+ URL url = Thread.currentThread().getContextClassLoader().getResource(path);
+ if (url == null) {
+ url = getClass().getClassLoader().getResource(path);
+ }
- Reader reader = new InputStreamReader(url.openStream());
- String dtdContent;
-
- try {
- StringBuilder builder = new StringBuilder(32);
- char[] cs = new char[512];
- int read;
-
- while ((read = reader.read(cs)) != -1) {
- builder.append(cs, 0, read);
- }
-
- dtdContent = builder.toString();
- } finally {
- if (reader != null) {
- try {
+ Reader reader = new InputStreamReader(url.openStream());
+ String dtdContent;
+
+ try {
+ StringBuilder builder = new StringBuilder(32);
+ char[] cs = new char[512];
+ int read;
+
+ while ((read = reader.read(cs)) != -1) {
+ builder.append(cs, 0, read);
+ }
+
+ dtdContent = builder.toString();
+ } finally {
+ if (reader != null) {
+ try {
reader.close();
} catch (IOException e) {
log.error(e.getLocalizedMessage(), e);
}
- }
- }
-
- return dtdContent;
+ }
+ }
+
+ return dtdContent;
}
-
+
@Override
public InputSource resolveEntity(String publicId, String systemId)
- throws IOException, SAXException {
-
+ throws IOException, SAXException {
+
if (defaultDtdContent == null) {
defaultDtdContent = readDtdContent(DEFAULT_DTD_PATH);
}
-
+
return new InputSource(new StringReader(defaultDtdContent));
}
}
Modified: trunk/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/ResourceDependencyMojo.java
===================================================================
--- trunk/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/ResourceDependencyMojo.java 2009-05-08 19:12:42 UTC (rev 14097)
+++ trunk/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/ResourceDependencyMojo.java 2009-05-10 14:31:42 UTC (rev 14098)
@@ -51,6 +51,7 @@
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugin.logging.Log;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.artifact.MavenMetadataSource;
import org.codehaus.classworlds.ClassRealm;
@@ -336,7 +337,7 @@
protected Set <Artifact> resolveDependenciesArtifacts() throws Exception {
ArtifactResolutionResult result = null;
-
+
List <Dependency> dependencies = project.getDependencies();
Set <Artifact> artifacts = MavenMetadataSource.createArtifacts(factory, dependencies, null, null, project);
@@ -384,24 +385,30 @@
SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
saxParserFactory.setNamespaceAware(true);
- SAXParser saxParser = saxParserFactory.newSAXParser();
- for(String processFile : collectedFiles) {
-
+ Log log = getLog();
+ for (String processFile : collectedFiles) {
+ SAXParser saxParser = saxParserFactory.newSAXParser();
File file = new File(webSourceDir,processFile);
- if(file.exists()) {
+ if (file.exists()) {
- getLog().info("start process file: " + file.getPath());
+ if (log.isDebugEnabled()) {
+ log.debug("start process file: " + file.getPath());
+ }
+
try {
saxParser.parse(file, handler);
} catch (Exception e) {
- getLog().error("Error process file: " + file.getPath() + "\n" + e.getMessage(), e);
+ if (log.isDebugEnabled()) {
+ log.error("Error process file: " + file.getPath() + "\n" + e.getMessage(), e);
+ } else {
+ log.error("Error process file: " + file.getPath() + "\n" + e.getMessage());
+ }
}
-
}
-
}
- return handler;
+
+ return handler;
}
protected FileObject resolveArtifact(Artifact artifact) {
16 years, 4 months
JBoss Rich Faces SVN: r14097 - in trunk/cdk/maven-resource-dependency-plugin/src/main: java/org/richfaces/cdk/rd/handler and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-05-08 15:12:42 -0400 (Fri, 08 May 2009)
New Revision: 14097
Added:
trunk/cdk/maven-resource-dependency-plugin/src/main/resources/
trunk/cdk/maven-resource-dependency-plugin/src/main/resources/org/
trunk/cdk/maven-resource-dependency-plugin/src/main/resources/org/richfaces/
trunk/cdk/maven-resource-dependency-plugin/src/main/resources/org/richfaces/default.dtd
Modified:
trunk/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/ComponentsHandler.java
Log:
https://jira.jboss.org/jira/browse/RF-7076
Modified: trunk/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/ComponentsHandler.java
===================================================================
--- trunk/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/ComponentsHandler.java 2009-05-08 18:27:57 UTC (rev 14096)
+++ trunk/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/ComponentsHandler.java 2009-05-08 19:12:42 UTC (rev 14097)
@@ -20,6 +20,11 @@
*/
package org.richfaces.cdk.rd.handler;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.io.StringReader;
+import java.net.URL;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
@@ -29,6 +34,7 @@
import org.codehaus.plexus.util.SelectorUtils;
import org.richfaces.cdk.rd.Component;
import org.richfaces.cdk.rd.Components;
+import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
@@ -294,4 +300,51 @@
public void setComponentIncludes(String[] componentIncludes) {
this.componentIncludes = componentIncludes;
}
+
+ private static final String DEFAULT_DTD_PATH = "org/richfaces/default.dtd";
+
+ private String defaultDtdContent;
+
+ private String readDtdContent(String path) throws IOException {
+ URL url = Thread.currentThread().getContextClassLoader().getResource(path);
+ if (url == null) {
+ url = getClass().getClassLoader().getResource(path);
+ }
+
+ Reader reader = new InputStreamReader(url.openStream());
+ String dtdContent;
+
+ try {
+ StringBuilder builder = new StringBuilder(32);
+ char[] cs = new char[512];
+ int read;
+
+ while ((read = reader.read(cs)) != -1) {
+ builder.append(cs, 0, read);
+ }
+
+ dtdContent = builder.toString();
+ } finally {
+ if (reader != null) {
+ try {
+ reader.close();
+ } catch (IOException e) {
+ log.error(e.getLocalizedMessage(), e);
+ }
+ }
+ }
+
+ return dtdContent;
+ }
+
+ @Override
+ public InputSource resolveEntity(String publicId, String systemId)
+ throws IOException, SAXException {
+
+ if (defaultDtdContent == null) {
+ defaultDtdContent = readDtdContent(DEFAULT_DTD_PATH);
+ }
+
+ return new InputSource(new StringReader(defaultDtdContent));
+ }
}
Added: trunk/cdk/maven-resource-dependency-plugin/src/main/resources/org/richfaces/default.dtd
===================================================================
--- trunk/cdk/maven-resource-dependency-plugin/src/main/resources/org/richfaces/default.dtd (rev 0)
+++ trunk/cdk/maven-resource-dependency-plugin/src/main/resources/org/richfaces/default.dtd 2009-05-08 19:12:42 UTC (rev 14097)
@@ -0,0 +1 @@
+<!ELEMENT default ANY>
\ No newline at end of file
16 years, 4 months
JBoss Rich Faces SVN: r14096 - in trunk/samples/richfaces-demo: src/main/java/org/richfaces/demo/modifiableModel and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-05-08 14:27:57 -0400 (Fri, 08 May 2009)
New Revision: 14096
Added:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/modifiableModel/DatatableStateHolder.java
Modified:
trunk/samples/richfaces-demo/
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/modifiableModel/HibernateDataModel.java
trunk/samples/richfaces-demo/src/main/resources/hibernate.cfg.xml
trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTable/examples/modifiableModel.xhtml
Log:
https://jira.jboss.org/jira/browse/RF-7049
Property changes on: trunk/samples/richfaces-demo
___________________________________________________________________
Name: svn:ignore
- target
.settings
.classpath
.exadelproject
.project
richfaces-demo.iws
richfaces-demo.ipr
richfaces-demo.iml
+ bin
.settings
target
.classpath
.project
Added: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/modifiableModel/DatatableStateHolder.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/modifiableModel/DatatableStateHolder.java (rev 0)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/modifiableModel/DatatableStateHolder.java 2009-05-08 18:27:57 UTC (rev 14096)
@@ -0,0 +1,55 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.demo.modifiableModel;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.richfaces.model.SortOrder;
+
+/**
+ * @author Nick Belaevski
+ * @since 3.3.1
+ */
+public class DatatableStateHolder {
+
+ private Map<String, SortOrder> sortOrders = new HashMap<String, SortOrder>();
+
+ private Map<String, Object> columnFilterValues = new HashMap<String, Object>();
+
+ public Map<String, Object> getColumnFilterValues() {
+ return columnFilterValues;
+ }
+
+ public void setColumnFilterValues(Map<String, Object> columnFilterValues) {
+ this.columnFilterValues = columnFilterValues;
+ }
+
+ public Map<String, SortOrder> getSortOrders() {
+ return sortOrders;
+ }
+
+ public void setSortOrders(Map<String, SortOrder> sortOrders) {
+ this.sortOrders = sortOrders;
+ }
+
+}
Modified: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/modifiableModel/HibernateDataModel.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/modifiableModel/HibernateDataModel.java 2009-05-08 18:25:52 UTC (rev 14095)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/modifiableModel/HibernateDataModel.java 2009-05-08 18:27:57 UTC (rev 14096)
@@ -1,9 +1,28 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
package org.richfaces.demo.modifiableModel;
import java.io.IOException;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
import javax.annotation.PreDestroy;
import javax.el.ELException;
@@ -27,8 +46,11 @@
import org.richfaces.model.Modifiable;
import org.richfaces.model.Ordering;
import org.richfaces.model.SortField2;
-import org.richfaces.model.SortOrder;
+/**
+ * @author Nick Belaevski
+ * @since 3.3.1
+ */
public class HibernateDataModel extends ExtendedDataModel implements Modifiable {
private SessionFactory sessionFactory;
@@ -56,8 +78,6 @@
private Long rowKey;
- private SortOrder sortOrder = new SortOrder();
-
private DataItem dataItem;
private SequenceRange cachedRange;
@@ -68,27 +88,6 @@
private List<SortField2> sortFields;
- private Map<String, SortOrder> sortOrders = new HashMap<String, SortOrder>();
-
- private Map<String, Object> columnFilterValues = new HashMap<String, Object>();
-
-
- public Map<String, Object> getColumnFilterValues() {
- return columnFilterValues;
- }
-
- public void setColumnFilterValues(Map<String, Object> columnFilterValues) {
- this.columnFilterValues = columnFilterValues;
- }
-
- public Map<String, SortOrder> getSortOrders() {
- return sortOrders;
- }
-
- public void setSortOrders(Map<String, SortOrder> sortOrders) {
- this.sortOrders = sortOrders;
- }
-
private static boolean areEqualRanges(SequenceRange range1, SequenceRange range2) {
if (range1 == null || range2 == null) {
return range1 == null && range2 == null;
@@ -232,11 +231,4 @@
this.cachedRange = null;
}
- public SortOrder getSortOrder() {
- return sortOrder;
- }
-
- public void setSortOrder(SortOrder sortOrder) {
- this.sortOrder = sortOrder;
- }
}
Modified: trunk/samples/richfaces-demo/src/main/resources/hibernate.cfg.xml
===================================================================
--- trunk/samples/richfaces-demo/src/main/resources/hibernate.cfg.xml 2009-05-08 18:25:52 UTC (rev 14095)
+++ trunk/samples/richfaces-demo/src/main/resources/hibernate.cfg.xml 2009-05-08 18:27:57 UTC (rev 14096)
@@ -6,11 +6,11 @@
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
- <property name="hibernate.connection.url">jdbc:hsqldb:mem:abc</property>
+ <property name="hibernate.connection.url">jdbc:hsqldb:mem:richfaces_demo</property>
<property name="hibernate.connection.username">sa</property>
<property name="hibernate.connection.password"></property>
<property name="hibernate.connection.pool_size">10</property>
- <property name="show_sql">true</property>
+ <property name="show_sql">false</property>
<property name="dialect">org.hibernate.dialect.HSQLDialect</property>
<property name="hibernate.hbm2ddl.auto">create</property>
</session-factory>
Modified: trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2009-05-08 18:25:52 UTC (rev 14095)
+++ trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2009-05-08 18:27:57 UTC (rev 14096)
@@ -3,10 +3,6 @@
xmlns:xi="http://www.w3.org/2001/XInclude"
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">
<converter>
- <converter-id>longConverter</converter-id>
- <converter-class>javax.faces.convert.LongConverter</converter-class>
- </converter>
- <converter>
<converter-id>listShuttleconverter</converter-id>
<converter-class>org.richfaces.demo.listShuttle.Converter</converter-class>
</converter>
@@ -20,9 +16,14 @@
<managed-bean-scope>application</managed-bean-scope>
</managed-bean>
<managed-bean>
+ <managed-bean-name>dataTableStateHolder</managed-bean-name>
+ <managed-bean-class>org.richfaces.demo.modifiableModel.DatatableStateHolder</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
<managed-bean-name>hibernateDataModel</managed-bean-name>
<managed-bean-class>org.richfaces.demo.modifiableModel.HibernateDataModel</managed-bean-class>
- <managed-bean-scope>session</managed-bean-scope>
+ <managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>sessionFactory</property-name>
<value>#{hibernateBean.sessionFactory}</value>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTable/examples/modifiableModel.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTable/examples/modifiableModel.xhtml 2009-05-08 18:25:52 UTC (rev 14095)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTable/examples/modifiableModel.xhtml 2009-05-08 18:27:57 UTC (rev 14096)
@@ -8,12 +8,12 @@
<a4j:queue requestDelay="100" />
<rich:messages />
<rich:dataTable value="#{hibernateDataModel}" var="row" rows="10"
- rowKeyConverter="#{longConverter}" reRender="datascroller" rendered="#{componentNavigator.currentComponent.activeTab == 'modifiableDataModel'}">
+ rowKeyConverter="javax.faces.Long" reRender="datascroller" rendered="#{componentNavigator.currentComponent.activeTab == 'modifiableDataModel'}">
<rich:columns value="#{hibernateBean.csvFields}" var="field"
sortBy="#{field}" filterBy="#{field}" filterEvent="onkeyup"
index="index" id="column#{index}"
- sortOrder="#{hibernateDataModel.sortOrders[field]}"
- filterValue="#{hibernateDataModel.columnFilterValues[field]}">
+ sortOrder="#{dataTableStateHolder.sortOrders[field]}"
+ filterValue="#{dataTableStateHolder.columnFilterValues[field]}">
<f:facet name="header">
<h:outputText value="#{field}" />
</f:facet>
16 years, 4 months