JBoss Rich Faces SVN: r11593 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2008-12-05 12:46:45 -0500 (Fri, 05 Dec 2008)
New Revision: 11593
Modified:
trunk/docs/userguide/en/src/main/docbook/included/editor.xml
Log:
RF-5042 - added info about skinning
Modified: trunk/docs/userguide/en/src/main/docbook/included/editor.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/editor.xml 2008-12-05 17:14:13 UTC (rev 11592)
+++ trunk/docs/userguide/en/src/main/docbook/included/editor.xml 2008-12-05 17:46:45 UTC (rev 11593)
@@ -65,8 +65,8 @@
<title>Details of Usage</title>
<para>The <emphasis role="bold"> <property><rich:editor></property></emphasis> is fully
- based on TinyMCE web based Javascript HTML WYSIWYG editor control and supports all of the features has.
-The rich:editor adjusts TinyMCE editor of JSF environment adding some functional capabilities.
+ based on TinyMCE web based Javascript HTML WYSIWYG editor control and supports all of the features it has.
+ The <emphasis role="bold"> <property><rich:editor></property></emphasis> adapts the TinyMCE editor for JSF environment and adds some functional capabilities.
</para>
@@ -89,21 +89,27 @@
</orderedlist>
- <para>The most important properties are implemented as attributes and you can define them as any other attribute.
+ <para>The three methods are described in details in the chapter.</para>
+
+ <para>The most important properties are implemented as attributes and you can define them as any other attribute.
The attributes of the <emphasis role="bold"> <property><rich:editor></property></emphasis> component
match the corresponding properties of TinyMCE editor.</para>
- <para>For example, a theme for the editor an be defined using the <property>"theme"</property> attribute like this: </para>
+ <para>For example, a theme for the editor can be defined using the <property>"theme"</property> attribute like this: </para>
<programlisting role="XML"><![CDATA[
<rich:editor value="#{bean.editorValue}" theme="advanced"/>
]]></programlisting>
+ <para>Setting a different skin for the editor can be done using the <property>"skin"</property> attribute.</para>
+
+ <para>Another useful property that is implemented at attribute level is <property>"viewmode"</property>.
+ The attribute switches between "visual" and "source" modes, toggling between modes is performed setting the attribute to "visual" and "source" respectively.</para>
<para>
- Apart from the attributes that define the editor's properties there are a some attributes that help handle events(custom event handlers).
+ Apart from the attributes that define the editor's properties there are some attributes that help handle events(custom event handlers).
</para>
<para>
- All custom event handlers can be found in the table of attributes and you can use them the same way as standard HTML event handlers. For example, like this:
+ All custom event handlers are listed in the table of attributes and you can use them the same way as standard HTML event handlers.
</para>
@@ -137,11 +143,11 @@
</figure>
- <para>The last way to configure the <emphasis role="bold"> <property><rich:editor></property></emphasis> is
+ <para>The third way to configure the <emphasis role="bold"> <property><rich:editor></property></emphasis> is
to use configuration file (.properties)</para>
- <para> This method is can easy your life if you need to configure multiple instances
- of the <emphasis role="bold"> <property><rich:editor></property></emphasis>. </para>
+ <para> This method eases your life if you need to configure multiple instances
+ of the <emphasis role="bold"> <property><rich:editor></property></emphasis>: you configure the editor once and in one spot and the configuration properties can be applied to any <emphasis role="bold"> <property><rich:editor></property></emphasis>in your application.</para>
<para>To implement this type of configuration you need to take a few steps:</para>
<itemizedlist>
@@ -157,15 +163,15 @@
</listitem>
<listitem><para>The properties stored in configuration file are passed to the
<emphasis role="bold"> <property><rich:editor></property></emphasis> via
- <property>"configuration"</property>attribute which takes the name of the configuration file as a value (with out .properties extension). </para></listitem>
- <para>For example, you named the configuration file "editorconfig", you would address it as follows:
+ <property>"configuration"</property>attribute which takes the name of the configuration file as a value (with out .properties extension). </para>
+ <para>For example, if you named the configuration file "editorconfig", you would address it as follows:
</para>
<programlisting role="XML"><![CDATA[...
<rich:editor value="#{bean.editorValue}" configuration="editorconfig"/>
...]]></programlisting>
-
+ </listitem>
<listitem><para>
Alternately, you can use a EL-binding to define a configuration file. This way you can dynamically change the sets of configuration properties. </para>
@@ -202,14 +208,15 @@
</para>
<para>
- Adding a custom plug-in also requires a few steps to take. Though the procedure is very similar to adding a configuration file.
+ Adding a custom plug-in also requires a few steps to take. Though, the procedure is very similar to adding a configuration file.
</para>
<para>This is what you need to add a plug-in:</para>
<itemizedlist>
- <listitem><para>Create a .properties file and put the name of the plug-in and a path to it there. The file can contain multiple plug-ins declarations. Your .properties file should be like this. </para>
+ <listitem><para>Create a .properties file and put the name of the plug-in and a path to it into the file.
+ The file can contain multiple plug-in declarations. Your .properties file should be like this. </para>
<programlisting role="XML"><![CDATA[...
pluginName=/mytinymceplugins/plugin1Name/editor_plugin.js
...]]></programlisting>
@@ -229,29 +236,39 @@
<para>
-Some plug-ins which available for download could have some dependencies to TinyMCE scripts.
-For example, dialog pop-ups requires tiny_mce_popup.js.
-Taking into consideration that developer will not plug our custom plugins to the RF jar with editor component
-(as opposite to standard tinyMCE plugins creation, which means that plugins will be put into tinyMCE corersponding directory) -
- the developer should manually add needed tinyMCE scripts to some folder and correct the js includes.
+Some plug-ins which available for download might have some dependencies on TinyMCE scripts.
+For example, dialog pop-ups require tiny_mce_popup.js script file.
+Assuming that you will not plug custom plugins to the RF jar with editor component
+(standard TinyMCE plugins creation implies that plugins are put into TinyMCE's corresponding directory)
+ you should manually add required TinyMCE scripts to some project folder and correct the js includes.
</para>
</note>
</itemizedlist>
+ <para>The <emphasis role="bold"> <property><rich:editor></property></emphasis>
+ component has a build-in converter that renders HTML code generated by the editor
+ to Seam text (you can read more Seam text <ulink url="http://docs.jboss.org/seam/1.1.5.GA/reference/en/html/text.html">here</ulink>.), it also interprets Seam text
+ passed to the <emphasis role="bold"> <property><rich:editor></property></emphasis> and renders it to HTML.
+ The converter can be enable with the <property>"seamTest"</property> attribute.</para>
+ <para>Example:</para>
+
+ <para>This HTML code generated by editor</para>
+ <programlisting role="XML"><![CDATA[...
+<p><a href="http://mysite.com">Lorem ipsum</a> <i>dolor sit</i> amet, ea <u>commodo</u> consequat.</p>
+...]]></programlisting>
+ <para>will be parsed to the following Seam text:</para>
+
+ <programlisting role="XML"><![CDATA[...
+[Lorem ipsum=>http://mysite.com] *dolor sit* amet, ea _commodo_ consequat.
+...]]></programlisting>
+ <para>Accordingly, if the Seam text is passed to the component it will be parsed to HTML code.</para>
+
</section>
-
- <!-- JavaScript API-->
- <section>
- <title>JavaScript API</title>
-
-
-
- </section>
- <!-- End of JavaScript API-->
+
<section>
<title>JavaScript API</title>
@@ -287,15 +304,421 @@
</itemizedlist>
</para>
</section>
-
+
<section>
<title>Skin Parameters Redefinition</title>
+
+ <table>
+ <title>Skin parameters redefinition for containers</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>additionalBackgroundColor</entry>
+
+ <entry>background</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
-
- <title>Skin parameters redefinition for a component</title>
-
- </section>
+
+ <table>
+ <title>Skin parameters redefinition for external controls</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>panelBorderColor</entry>
+
+ <entry>border-color</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+
+ <table>
+ <title>Skin parameters redefinition for layout</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>panelBorderColor</entry>
+
+ <entry>border-left-color</entry>
+ </row>
+
+
+ <row>
+ <entry>panelBorderColor</entry>
+
+ <entry>border-right-color</entry>
+ </row>
+
+
+
+ <row>
+ <entry>panelBorderColor</entry>
+
+ <entry>border-top-color</entry>
+ </row>
+
+
+ <row>
+ <entry>panelBorderColor</entry>
+
+ <entry>border-bottom-color</entry>
+ </row>
+
+ <row>
+
+ <entry>generalFamilyFont</entry>
+
+ <entry>font-family</entry>
+ </row>
+
+
+
+ <row>
+ <entry>generalTextColor</entry>
+
+ <entry>color</entry>
+ </row>
+
+
+ <row>
+ <entry>headerBackgroundColor</entry>
+
+ <entry>background-color</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+ <table>
+ <title>Skin parameters redefinition for buttons</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+
+ <tbody>
+
+
+ <row>
+ <entry>headerBackgroundColor</entry>
+
+ <entry>background-color</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+
+
+
+
+ <table>
+ <title>Skin parameters redefinition for list box</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+
+ <tbody>
+
+
+ <row>
+ <entry>tableBackgroundColor</entry>
+
+ <entry>background</entry>
+ </row>
+
+
+ <row>
+ <entry>panelBorderColor</entry>
+
+ <entry>border-color</entry>
+ </row>
+
+
+ <row>
+ <entry>generalFamilyFont</entry>
+
+ <entry>font-family</entry>
+ </row>
+
+
+
+
+ </tbody>
+ </tgroup>
+ </table>
+
+
+
+ <table>
+ <title>Skin parameters redefinition for color split button</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+
+ <tbody>
+
+
+ <row>
+ <entry>tableBackgroundColor</entry>
+
+ <entry>background</entry>
+ </row>
+
+
+ <row>
+ <entry>panelBorderColor</entry>
+
+ <entry>border-color</entry>
+ </row>
+
+
+ <row>
+ <entry>generalFamilyFont</entry>
+
+ <entry>font-family</entry>
+ </row>
+
+
+ <row>
+ <entry>additionalBackgroundColor</entry>
+
+ <entry>background-color</entry>
+ </row>
+
+
+ </tbody>
+ </tgroup>
+ </table>
+
+
+ <table>
+ <title>Skin parameters redefinition for hovered color split button</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+
+ <tbody>
+
+ <row>
+ <entry>headerBackgroundColor</entry>
+
+ <entry>border-color</entry>
+ </row>
+
+
+ </tbody>
+ </tgroup>
+ </table>
+
+
+
+ <table>
+ <title>Skin parameters redefinition for menu</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+
+ <tbody>
+
+ <row>
+ <entry>panelBorderColor</entry>
+
+ <entry>border-color</entry>
+ </row>
+
+ <row>
+ <entry>tableBackgroundColor</entry>
+
+ <entry>background</entry>
+ </row>
+
+
+ <row>
+ <entry>generalFamilyFont</entry>
+
+ <entry>font-family</entry>
+ </row>
+
+ <row>
+ <entry>generalTextColor</entry>
+
+ <entry>color</entry>
+ </row>
+
+ <row>
+ <entry>additionalBackgroundColor</entry>
+
+ <entry>background-color</entry>
+ </row>
+
+
+ <row>
+ <entry>additionalBackgroundColor</entry>
+
+ <entry>background-color</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table>
+ <title>Skin parameters redefinition for menu item</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+
+ <tbody>
+
+ <row>
+ <entry>additionalBackgroundColor</entry>
+
+ <entry>background</entry>
+ </row>
+
+ <row>
+ <entry>panelBorderColor</entry>
+
+ <entry>border-bottom-color</entry>
+ </row>
+
+
+ <row>
+ <entry>generalTextColor</entry>
+
+ <entry>color</entry>
+ </row>
+
+ <row>
+ <entry>generalTextColor</entry>
+
+ <entry>color</entry>
+ </row>
+
+ <row>
+ <entry>tabDisabledTextColor</entry>
+
+ <entry>color</entry>
+ </row>
+
+
+
+
+ </tbody>
+ </tgroup>
+ </table>
+
+
+
+ <table>
+ <title>Skin parameters redefinition for progress and resize states</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+
+ <tbody>
+
+ <row>
+ <entry>tableBackgroundColor</entry>
+
+ <entry>background</entry>
+ </row>
+
+ <row>
+ <entry>tableBorderColor</entry>
+
+ <entry>border-color</entry>
+ </row>
+
+
+
+
+
+
+ </tbody>
+ </tgroup>
+ </table>
+
+
+
+
<section>
<title>Definition of Custom Style Classes</title>
16 years, 1 month
JBoss Rich Faces SVN: r11592 - in trunk/test-applications/seleniumTest/richfaces: src/test/java/org/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-05 12:14:13 -0500 (Fri, 05 Dec 2008)
New Revision: 11592
Modified:
trunk/test-applications/seleniumTest/richfaces/pom.xml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
Log:
RF-5197
only for test
Modified: trunk/test-applications/seleniumTest/richfaces/pom.xml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/pom.xml 2008-12-05 17:05:13 UTC (rev 11591)
+++ trunk/test-applications/seleniumTest/richfaces/pom.xml 2008-12-05 17:14:13 UTC (rev 11592)
@@ -85,52 +85,6 @@
</plugin>
</plugins>
</build>
- <profiles>
- <profile>
- <id>linux</id>
- <activation>
- <os>
- <family>unix</family>
- </os>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>exec-maven-plugin</artifactId>
- <version>1.1</version>
- <executions>
- <execution>
- <phase>pre-integration-test</phase>
- <goals>
- <goal>exec</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <executable>
-#find firefox
-PATHS=( '/usr/lib/firefox-1.0.4/' '/usr/lib/firefox-1.5.0.10/' '/usr/lib/firefox-1.5.0.12/' '/usr/lib64/firefox-1.5.0.12/' '/usr/lib/firefox-3.0b5/' '/usr/lib64/firefox-3.0b5/' '/usr/lib/firefox-3.0.1/' '/usr/lib64/firefox-3.0.1/' '/usr/lib/firefox/' '/opt/MozillaFirefox/lib/')
-for ELEMENT in ${PATHS[@]}
- do
- if [ -f $ELEMENT/firefox ]
- then
- export FF_BIN=$ELEMENT/firefox
- export LD_LIBRARY_PATH=$ELEMENT
- fi
- if [ -f $ELEMENT/firefox-bin ]
- then
- export FF_BIN=$ELEMENT/firefox-bin
- export LD_LIBRARY_PATH=$ELEMENT
- fi
-done
- </executable>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
<repositories>
<repository>
<releases>
@@ -143,10 +97,4 @@
<url>http://snapshots.jboss.org/maven2</url>
</repository>
</repositories>
- <pluginRepositories>
- <pluginRepository>
- <id>codehaus</id>
- <url>http://repository.codehaus.org/</url>
- </pluginRepository>
- </pluginRepositories>
</project>
\ No newline at end of file
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-12-05 17:05:13 UTC (rev 11591)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-12-05 17:14:13 UTC (rev 11592)
@@ -141,6 +141,30 @@
@BeforeClass
@Parameters({"browser", "filterPrefix"})
public void startSelenium(String browser, String filterPrefix) {
+ String[] paths = {"/usr/lib/firefox-1.0.4/firefox",
+ "/usr/bin/firefox-1.5.0.10/firefox",
+ "/usr/bin/firefox-1.5.0.12/firefox",
+ "/usr/bin64/firefox-1.5.0.12/firefox",
+ "/usr/bin/firefox-3.0b5/firefox",
+ "/usr/bin64/firefox-3.0b5/firefox",
+ "/usr/bin/firefox-3.0.1/firefox",
+ "/usr/bin64/firefox-3.0.1/firefox",
+ "/usr/bin/firefox/firefox"
+ };
+ if ("*firefox".equals(browser)) {
+ for (int i = 0; i < paths.length && "*firefox".equals(browser); i++) {
+ String path = paths[i];
+ File file = new File(path);
+ if (file.isFile()) {
+ browser += " " + path;
+ } else {
+ file = new File(path + "-bin");
+ if (file.isFile()) {
+ browser += " " + path + "-bin";
+ }
+ }
+ }
+ }
synchronized (MUTEX) {
this.filterPrefix = filterPrefix;
selenium = createSeleniumClient(protocol + "://" + host + ":" + port + "/", browser);
16 years, 1 month
JBoss Rich Faces SVN: r11591 - trunk/test-applications/seamApp/web/src/main/webapp/pages/Rich.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-12-05 12:05:13 -0500 (Fri, 05 Dec 2008)
New Revision: 11591
Modified:
trunk/test-applications/seamApp/web/src/main/webapp/pages/Rich/Rich.xhtml
Log:
remove columns from panelGrid.
Modified: trunk/test-applications/seamApp/web/src/main/webapp/pages/Rich/Rich.xhtml
===================================================================
--- trunk/test-applications/seamApp/web/src/main/webapp/pages/Rich/Rich.xhtml 2008-12-05 16:45:29 UTC (rev 11590)
+++ trunk/test-applications/seamApp/web/src/main/webapp/pages/Rich/Rich.xhtml 2008-12-05 17:05:13 UTC (rev 11591)
@@ -41,18 +41,17 @@
<h:messages showDetail="true" showSummary="true"></h:messages>
<h:panelGrid id="richGridID" columns="1" width="100%">
- <h:column rendered="#{option.reComponent}">
- <ui:include src="#{richBean.pathComponent}" />
- </h:column>
+ <h:panelGroup rendered="#{option.reComponent}">
+ <ui:include src="#{richBean.pathComponent}"/>
+ </h:panelGroup>
- <h:column rendered="#{option.reStraightforward}">
+ <h:panelGroup rendered="#{option.reStraightforward}">
<ui:include src="#{richBean.pathStraightforward}" />
- </h:column>
+ </h:panelGroup>
- <h:column rendered="#{option.reProperty}">
+ <h:panelGroup rendered="#{option.reProperty}">
<ui:include src="#{richBean.pathProperty}" />
- </h:column>
-
+ </h:panelGroup>
</h:panelGrid>
<ui:include src="/pages/Info/Info.xhtml" />
16 years, 1 month
JBoss Rich Faces SVN: r11590 - trunk/samples/richfaces-demo/src/main/webapp/WEB-INF.
by richfaces-svn-commits@lists.jboss.org
Author: alevkovsky
Date: 2008-12-05 11:45:29 -0500 (Fri, 05 Dec 2008)
New Revision: 11590
Modified:
trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
Log:
Fix editor example
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 2008-12-05 16:37:52 UTC (rev 11589)
+++ trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2008-12-05 16:45:29 UTC (rev 11590)
@@ -411,7 +411,7 @@
<managed-bean>
<managed-bean-name>editorBean</managed-bean-name>
<managed-bean-class>org.richfaces.demo.editor.EditorBean</managed-bean-class>
- <managed-bean-scope>request</managed-bean-scope>
+ <managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<navigation-rule>
<from-view-id>/richfaces/include/examples/wstep1.xhtml</from-view-id>
16 years, 1 month
JBoss Rich Faces SVN: r11589 - in trunk/test-applications/seleniumTest/richfaces/src: main/webapp/pages/calendar and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-12-05 11:37:52 -0500 (Fri, 05 Dec 2008)
New Revision: 11589
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/CalendarTestBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/calendar/calendarTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java
Log:
RF-5152
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/CalendarTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/CalendarTestBean.java 2008-12-05 16:01:56 UTC (rev 11588)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/CalendarTestBean.java 2008-12-05 16:37:52 UTC (rev 11589)
@@ -73,6 +73,11 @@
private String mode = UICalendar.AJAX_MODE;
private String status;
+
+ private Date preloadDateRangeStart;
+
+ private Date preloadDateRangeEnd;
+
public CalendarTestBean() {
selectedDate = DEFAULT_DATE;
@@ -81,6 +86,11 @@
datePattern = DATE_PATTERN;
locale = LOCALE;
timeZone = TIME_ZONE;
+ Calendar c = getLocale()!=null ? Calendar.getInstance(getLocale()) : Calendar.getInstance();
+ c.set(c.get(Calendar.YEAR), c.get(Calendar.MONTH) - 1, 1);
+ preloadDateRangeStart = c.getTime(); // Set preloadBegin by the first day of the last month
+ c.set(c.get(Calendar.YEAR), c.get(Calendar.MONTH) + 3, 0);
+ preloadDateRangeEnd = c.getTime(); // Set preloadEnd by the last day of the next month
}
public Date getSelectedDate() {
@@ -204,6 +214,7 @@
status = "";
selectedDate = new Date();
isPopup = false;
+ currentDate = new Date();
}
public String resetAction() {
@@ -274,4 +285,32 @@
this.isPopup = isPopup;
}
+ /**
+ * @return the preloadDateRangeStart
+ */
+ public Date getPreloadDateRangeStart() {
+ return preloadDateRangeStart;
+ }
+
+ /**
+ * @param preloadDateRangeStart the preloadDateRangeStart to set
+ */
+ public void setPreloadDateRangeStart(Date preloadDateRangeStart) {
+ this.preloadDateRangeStart = preloadDateRangeStart;
+ }
+
+ /**
+ * @return the preloadDateRangeEnd
+ */
+ public Date getPreloadDateRangeEnd() {
+ return preloadDateRangeEnd;
+ }
+
+ /**
+ * @param preloadDateRangeEnd the preloadDateRangeEnd to set
+ */
+ public void setPreloadDateRangeEnd(Date preloadDateRangeEnd) {
+ this.preloadDateRangeEnd = preloadDateRangeEnd;
+ }
+
}
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/calendar/calendarTest.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java 2008-12-05 16:01:56 UTC (rev 11588)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java 2008-12-05 16:37:52 UTC (rev 11589)
@@ -152,13 +152,25 @@
String weekNumId = calendarId + "WeekNum2";
selenium.click("//tr[@id='" + weekNumId + "']/td[starts-with(@class, '" + availableDayCellClass + "')]");
}
-
+
void changeCurrentDate(boolean wait4ajax) {
selenium.click("//td[@id='" + calendarHeaderId + "']/table/tbody/tr/td/div");
if (wait4ajax) {
waitForAjaxCompletion();
}
}
+
+ Calendar changeCurrentDate(Calendar c, boolean wait4ajax) {
+ selenium.click("//td[@id='" + calendarHeaderId + "']/table/tbody/tr/td/div");
+ if (wait4ajax) {
+ waitForAjaxCompletion();
+ }
+ c.set(Calendar.YEAR, c.get(Calendar.YEAR) - 1);
+ if (getCalendarDate().indexOf(c.get(Calendar.YEAR)) == -1) {
+ Assert.fail("Date is incorrect");
+ }
+ return c;
+ }
void reset() {
clickCommandAndWait(resetActionId);
@@ -172,7 +184,27 @@
selenium.click(timeSelectionXpath);
}
- void _testModelDataAppliedToClient() {
+ String getCalendarDate() {
+ return selenium.getText(currentDateHeaderXpath);
+ }
+
+ Calendar nextMonth(Calendar c) {
+ String date = getCalendarDate();
+ selenium.click("//td[@id='" + calendarHeaderId + "']/table/tbody/tr/td[@class='rich-calendar-tool'][3]/div");
+ Assert.assertFalse(getCalendarDate().equals(date), "Current date has not been changed after next month clicked");
+ c.set(Calendar.MONTH, c.get(Calendar.MONTH) + 1);
+ return c;
+ }
+
+ Calendar previousMonth(Calendar c) {
+ String date = getCalendarDate();
+ selenium.click("//td[@id='" + calendarHeaderId + "']/table/tbody/tr/td[@class='rich-calendar-tool'][2]/div");
+ Assert.assertFalse(getCalendarDate().equals(date), "Current date has not been changed after previous month clicked");
+ c.set(Calendar.MONTH, c.get(Calendar.MONTH) - 1);
+ return c;
+ }
+
+ void _testModelDataAppliedToClient(Calendar c) {
String currentDate = selenium.getText(dateSelectionXpath);
selenium.click("//table[@id='"+calendarId+"']/tbody/tr/td[text() = '13']");
@@ -180,8 +212,6 @@
Assert.fail("Enabled attribute of data model was not applied for client data. 13th day should disabled and should force date change after click.");
}
- Calendar c = Calendar.getInstance();
- c.setTime(new Date());
int currentMonth = c.get(Calendar.MONTH);
String cellDay7StyleClass = selenium.getAttribute("//table[@id='"+calendarId+"']/tbody/tr/td[text() = '7']/@class");
@@ -198,19 +228,55 @@
}
@Test
+ public void testClientMode(Template template) {
+ renderPage(template, RESET_METHOD);
+ initIds(getParentId());
+ switchToClientMode();
+
+ Calendar c = Calendar.getInstance();
+ c = previousMonth(c);
+ Assert.assertTrue(runScript("window.done").equals(Boolean.FALSE.toString().toLowerCase()), "Change of current date should not force ajax request in client mode.");
+
+ try {
+ _testModelDataAppliedToClient(c);
+ c = nextMonth(c);
+ _testModelDataAppliedToClient(c);
+ c = nextMonth(c);
+ _testModelDataAppliedToClient(c);
+ } catch (AssertionError e) {
+ Assert.fail("Calendar does not preload data in client mode for interval defined by 'preloadDateRangeBegin' & 'preloadDateRangeEnd'. It should preload data for last, current & next month. " + e);
+ }
+
+ boolean error = false;
+ c = nextMonth(c);
+ try {
+ _testModelDataAppliedToClient(c);
+ }catch (AssertionError e) {
+ error = true;
+ }
+
+ if (!error) {
+ Assert.fail("Calendar pre-loaded data for interval that not defined by 'preloadDateRangeBegin' & 'preloadDateRangeEnd'");
+ }
+
+ }
+
+ @Test
public void testDataModelAttribute(Template template) {
renderPage(template, RESET_METHOD);
initIds(getParentId());
- _testModelDataAppliedToClient();
+ Calendar c = Calendar.getInstance();
+ _testModelDataAppliedToClient(c);
+
try {
- changeCurrentDate(true);
+ c = changeCurrentDate(c, true);
}catch (SeleniumException exception) {
Assert.fail("Celendar in ajax mode does not request for the next portion of data after current date has been changed");
}
- _testModelDataAppliedToClient();
+ _testModelDataAppliedToClient(c);
}
@@ -378,7 +444,7 @@
@Test
public void testValueAndCurrentDateOfCalendarInCaseOfPopupTrue(Template template) {
- renderPage(template);
+ renderPage(template, RESET_METHOD);
initIds(getParentId());
String expectedSelectedDate = "03/03/2007 11:00";
String expectedCurrentDate = "04/04/2008 13:00";
@@ -425,7 +491,7 @@
@Test
public void testValueAndCurrentDateOfCalendarWithPopupFalse(Template template) {
- renderPage(template, null);
+ renderPage(template, RESET_METHOD);
initIds(getParentId());
String expectedSelectedDate = "03/03/2007 11:00";
String expectedCurrentDate = "04/04/2008 13:00";
16 years, 1 month
JBoss Rich Faces SVN: r11588 - trunk/test-applications/seleniumTest/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-05 11:01:56 -0500 (Fri, 05 Dec 2008)
New Revision: 11588
Modified:
trunk/test-applications/seleniumTest/richfaces/pom.xml
Log:
RF-5197
Modified: trunk/test-applications/seleniumTest/richfaces/pom.xml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/pom.xml 2008-12-05 15:47:37 UTC (rev 11587)
+++ trunk/test-applications/seleniumTest/richfaces/pom.xml 2008-12-05 16:01:56 UTC (rev 11588)
@@ -108,7 +108,23 @@
</execution>
</executions>
<configuration>
- <executable>src/find_firefox.sh</executable>
+ <executable>
+#find firefox
+PATHS=( '/usr/lib/firefox-1.0.4/' '/usr/lib/firefox-1.5.0.10/' '/usr/lib/firefox-1.5.0.12/' '/usr/lib64/firefox-1.5.0.12/' '/usr/lib/firefox-3.0b5/' '/usr/lib64/firefox-3.0b5/' '/usr/lib/firefox-3.0.1/' '/usr/lib64/firefox-3.0.1/' '/usr/lib/firefox/' '/opt/MozillaFirefox/lib/')
+for ELEMENT in ${PATHS[@]}
+ do
+ if [ -f $ELEMENT/firefox ]
+ then
+ export FF_BIN=$ELEMENT/firefox
+ export LD_LIBRARY_PATH=$ELEMENT
+ fi
+ if [ -f $ELEMENT/firefox-bin ]
+ then
+ export FF_BIN=$ELEMENT/firefox-bin
+ export LD_LIBRARY_PATH=$ELEMENT
+ fi
+done
+ </executable>
</configuration>
</plugin>
</plugins>
16 years, 1 month
JBoss Rich Faces SVN: r11587 - trunk/docs/userguide/en/src/main/resources/images.
by richfaces-svn-commits@lists.jboss.org
Author: atsebro
Date: 2008-12-05 10:47:37 -0500 (Fri, 05 Dec 2008)
New Revision: 11587
Removed:
trunk/docs/userguide/en/src/main/resources/images/GettingStarted_RFGtreeterApp.png
Log:
Updating the image
Deleted: trunk/docs/userguide/en/src/main/resources/images/GettingStarted_RFGtreeterApp.png
===================================================================
(Binary files differ)
16 years, 1 month
JBoss Rich Faces SVN: r11586 - trunk/docs/userguide/en/src/main/docbook/modules.
by richfaces-svn-commits@lists.jboss.org
Author: atsebro
Date: 2008-12-05 10:45:52 -0500 (Fri, 05 Dec 2008)
New Revision: 11586
Modified:
trunk/docs/userguide/en/src/main/docbook/modules/RFCGettingStarted.xml
Log:
RF-2063: outside information resources
Modified: trunk/docs/userguide/en/src/main/docbook/modules/RFCGettingStarted.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/modules/RFCGettingStarted.xml 2008-12-05 15:38:49 UTC (rev 11585)
+++ trunk/docs/userguide/en/src/main/docbook/modules/RFCGettingStarted.xml 2008-12-05 15:45:52 UTC (rev 11586)
@@ -18,12 +18,7 @@
downloading the libraries to running the application in a browser. The process
of application creation described here is common and does not depend on used
IDE. </para>
- <para>See "<ulink
- url="http://docs.jboss.org/tools/movies/demos/rich_faces_demo/rich_faces_demo.htm"
- > RichFaces Toolkit for developing Web application</ulink>"
- video tutorial for benefits that gives the JBoss Developer Studio for developing
- applications using RichFaces. </para>
-
+
<section id="DownloadingRichFaces">
<?dbhtml filename="DownloadingRichFaces.html" ?>
@@ -45,7 +40,7 @@
</para>
</section>
- <section id="Simple JSF application with RichFaces">
+ <section id="SimpleJSFapplicationwithRichFaces">
<?dbhtml filename="Installation.html" ?>
<title>Simple JSF application with RichFaces</title>
<para> "RichFaces Greeter"—the simple application—is hello-world like
@@ -55,7 +50,7 @@
<para> Create standard JSF 1.2 project with all necessary libraries; name the project
"Greeter" and follow the decription. </para>
- <section id="Adding RichFaces libraries into the project">
+ <section id="AddingRichFaceslibrariesintotheproject">
<title>Adding RichFaces libraries into the project</title>
<para>Pass to the folder with unzipped earlier RichFaces binary files
and open <code>lib</code> folder. This folder contains three
@@ -65,7 +60,7 @@
of "Greeter" JSF application. </para>
</section>
- <section id="Registering RichFaces in web.xml">
+ <section id="RegisteringRichFacesinwebxml">
<title>Registering RichFaces in web.xml</title>
<para> After RichFaces libraries where added into the project it is
necessary to register them in project <code>web.xml</code>
@@ -147,7 +142,7 @@
</web-app>]]></programlisting>
</section>
- <section id="Managed bean">
+ <section id="Managedbean">
<title>Managed bean</title>
<para>The "RichFaces Greeter" application needs a managed bean. In
project <code>JavaSource</code> folder create a new managed
@@ -166,7 +161,7 @@
}</programlisting>
</section>
- <section id="Registering bean in faces-cofig.xml">
+ <section id="Registeringbeaninfacescofig">
<title>Registering bean in faces-cofig.xml</title>
<para>With the next step the <code>user</code> bean should be
registered in <code>faces-config.xml</code> file: </para>
@@ -191,7 +186,7 @@
]]></programlisting>
</section>
- <section id="RichFaces Greeter index.jsp">
+ <section id="RichFacesGreeterindex">
<title>RichFaces Greeter index.jsp</title>
<para> The "RichFaces Greeter" application has only one JSP page.
Create <code>index.jsp</code> page in root of <code>WEB
@@ -250,11 +245,40 @@
<mediaobject>
<imageobject>
<imagedata
- fileref="images/RichFaces Greeter.png"
+ fileref="images/GettingStarted_RFGreeterApp.png"
/>
</imageobject>
</mediaobject>
</figure>
</section>
</section>
+
+<!-- RELEVANT RESOURCES LINKS -->
+
+ <section id="RelevantResourcesLinks">
+ <title>Relevant Resources Links</title>
+ <para><ulink url="https://www.redhat.com/apps/store/developers/jboss_developer_studio.html">JBoss Developer Studio</ulink> comes with a tight integration with RichFaces component framework.
+ Following links might be useful for those who already use this IDE and RichFaces for developing applications and those who wish to improve their development process:</para>
+ <itemizedlist>
+ <listitem>
+ <para>"<ulink url="http://download.jboss.org/jbosstools/nightly-docs/en/GettingStartedGuide/...">Rich Components</ulink>" chapter
+ in "Getting Started with JBoss Developer Studio Guide" describes how to add RichFaces components into a CRUD application;
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ "<ulink url="http://download.jboss.org/jbosstools/nightly-docs/en/jsf/html/palette.html">JBoss Tools Palette</ulink>" chapter in "Visual Web Tools Reference Guide"
+ describes advantages that gives Tools Pallete (comes together with JBDS) for quick and easy pages creation processs including RichFaces applications;
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ "<ulink url="http://docs.jboss.org/tools/movies/demos/rich_faces_demo/rich_faces_demo.htm">RichFaces Toolkit for developing Web application</ulink>" video tutorial
+ demonstrates some aspects of interaction with JBoss Developer Studio while working with RichFaces.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>Read also the <ulink url="http://mkblog.exadel.com/?p=110">quick overview</ulink> to "Practical RichFaces " book by Max Katz at his blog.</para>
+ </section>
+
</chapter>
16 years, 1 month
JBoss Rich Faces SVN: r11585 - in trunk/test-applications/seleniumTest/richfaces: src and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-05 10:38:49 -0500 (Fri, 05 Dec 2008)
New Revision: 11585
Added:
trunk/test-applications/seleniumTest/richfaces/src/find_firefox.sh
Modified:
trunk/test-applications/seleniumTest/richfaces/pom.xml
Log:
RF-5197
Modified: trunk/test-applications/seleniumTest/richfaces/pom.xml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/pom.xml 2008-12-05 15:38:09 UTC (rev 11584)
+++ trunk/test-applications/seleniumTest/richfaces/pom.xml 2008-12-05 15:38:49 UTC (rev 11585)
@@ -85,6 +85,36 @@
</plugin>
</plugins>
</build>
+ <profiles>
+ <profile>
+ <id>linux</id>
+ <activation>
+ <os>
+ <family>unix</family>
+ </os>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>1.1</version>
+ <executions>
+ <execution>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>exec</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <executable>src/find_firefox.sh</executable>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
<repositories>
<repository>
<releases>
@@ -97,4 +127,10 @@
<url>http://snapshots.jboss.org/maven2</url>
</repository>
</repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>codehaus</id>
+ <url>http://repository.codehaus.org/</url>
+ </pluginRepository>
+ </pluginRepositories>
</project>
\ No newline at end of file
Added: trunk/test-applications/seleniumTest/richfaces/src/find_firefox.sh
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/find_firefox.sh (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/find_firefox.sh 2008-12-05 15:38:49 UTC (rev 11585)
@@ -0,0 +1,15 @@
+#find firefox
+PATHS=( '/usr/lib/firefox-1.0.4/' '/usr/lib/firefox-1.5.0.10/' '/usr/lib/firefox-1.5.0.12/' '/usr/lib64/firefox-1.5.0.12/' '/usr/lib/firefox-3.0b5/' '/usr/lib64/firefox-3.0b5/' '/usr/lib/firefox-3.0.1/' '/usr/lib64/firefox-3.0.1/' '/usr/lib/firefox/' '/opt/MozillaFirefox/lib/')
+for ELEMENT in ${PATHS[@]}
+ do
+ if [ -f $ELEMENT/firefox ]
+ then
+ export FF_BIN=$ELEMENT/firefox
+ export LD_LIBRARY_PATH=$ELEMENT
+ fi
+ if [ -f $ELEMENT/firefox-bin ]
+ then
+ export FF_BIN=$ELEMENT/firefox-bin
+ export LD_LIBRARY_PATH=$ELEMENT
+ fi
+done
\ No newline at end of file
16 years, 1 month
JBoss Rich Faces SVN: r11584 - in trunk/test-applications/realworld: ear and 19 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2008-12-05 10:38:09 -0500 (Fri, 05 Dec 2008)
New Revision: 11584
Added:
trunk/test-applications/realworld/ear/src/main/jboss-app.xml
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/FriendshipRequest.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/ISearchService.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/SearchService.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/search/
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/search/SearchBean.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/search/SearchBeanHelper.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/RatingHelper.java
trunk/test-applications/realworld/web/src/main/webapp/img/Thumbs.db
trunk/test-applications/realworld/web/src/main/webapp/layout/menuShared.xhtml
trunk/test-applications/realworld/web/src/main/webapp/sharedAlbum.xhtml
Removed:
trunk/test-applications/realworld/ear/src/main/application/jboss-app.xml
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileTest.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileTestTest.java
Modified:
trunk/test-applications/realworld/ear/pom.xml
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Image.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Message.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/MetaTag.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/User.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/AlbumAction.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IImageAction.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IMessageAction.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IUserAction.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/MessageAction.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/UserAction.java
trunk/test-applications/realworld/ejb/src/main/resources/META-INF/persistence.xml
trunk/test-applications/realworld/ejb/src/main/resources/import.sql
trunk/test-applications/realworld/ejb/src/main/resources/realworld-ds.xml
trunk/test-applications/realworld/pom.xml
trunk/test-applications/realworld/web/META-INF/MANIFEST.MF
trunk/test-applications/realworld/web/pom.xml
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/AvatarUpload.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileUploadBean.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/session/Authenticator.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeActionManager.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeSelectionManager.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ModalPanelHelper.java
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/components.xml
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/message.xhtml
trunk/test-applications/realworld/web/src/main/webapp/imagePreview.xhtml
trunk/test-applications/realworld/web/src/main/webapp/layout/menu.xhtml
trunk/test-applications/realworld/web/src/main/webapp/main.xhtml
trunk/test-applications/realworld/web/src/main/webapp/navigation.xhtml
trunk/test-applications/realworld/web/src/main/webapp/readMessages.xhtml
trunk/test-applications/realworld/web/src/main/webapp/register.xhtml
trunk/test-applications/realworld/web/src/main/webapp/search.xhtml
Log:
Modified: trunk/test-applications/realworld/ear/pom.xml
===================================================================
--- trunk/test-applications/realworld/ear/pom.xml 2008-12-05 15:26:04 UTC (rev 11583)
+++ trunk/test-applications/realworld/ear/pom.xml 2008-12-05 15:38:09 UTC (rev 11584)
@@ -28,6 +28,7 @@
<version>1.0-SNAPSHOT</version>
<type>ejb</type>
</dependency>
+
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-core</artifactId>
Deleted: trunk/test-applications/realworld/ear/src/main/application/jboss-app.xml
===================================================================
--- trunk/test-applications/realworld/ear/src/main/application/jboss-app.xml 2008-12-05 15:26:04 UTC (rev 11583)
+++ trunk/test-applications/realworld/ear/src/main/application/jboss-app.xml 2008-12-05 15:38:09 UTC (rev 11584)
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE jboss-app
- PUBLIC "-//JBoss//DTD J2EE Application 4.2//EN"
- "http://www.jboss.org/j2ee/dtd/jboss-app_4_2.dtd">
-
-<jboss-app>
- <loader-repository>
- seam.jboss.org:loader=realworld-ear-1.0-SNAPSHOT.ear
- </loader-repository>
-</jboss-app>
\ No newline at end of file
Added: trunk/test-applications/realworld/ear/src/main/jboss-app.xml
===================================================================
--- trunk/test-applications/realworld/ear/src/main/jboss-app.xml (rev 0)
+++ trunk/test-applications/realworld/ear/src/main/jboss-app.xml 2008-12-05 15:38:09 UTC (rev 11584)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+ <!DOCTYPE jboss-app
+ PUBLIC "-//JBoss//DTD J2EE Application 4.2//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-app_4_2.dtd">
+
+<jboss-app>
+ <loader-repository>
+ seam.jboss.org:loader=realworld-ear-1.0-SNAPSHOT.ear
+ </loader-repository>
+</jboss-app>
\ No newline at end of file
Property changes on: trunk/test-applications/realworld/ear/src/main/jboss-app.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/FriendshipRequest.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/FriendshipRequest.java (rev 0)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/FriendshipRequest.java 2008-12-05 15:38:09 UTC (rev 11584)
@@ -0,0 +1,56 @@
+package org.richfaces.realworld.domain;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+
+import org.hibernate.validator.Length;
+import org.hibernate.validator.NotEmpty;
+import org.hibernate.validator.NotNull;
+import org.jboss.seam.annotations.Name;
+
+@Entity
+@Name("friendshipRequest")
+@Table(name = "friendship_requests")
+public class FriendshipRequest {
+
+ @Id
+ @GeneratedValue
+ @Column(name = "REQUEST_ID")
+ private Long id;
+
+ @ManyToOne(fetch = FetchType.LAZY)
+ @JoinColumn(name = "USER_ID", nullable = false, updatable = false)
+ @org.hibernate.annotations.ForeignKey(name = "FK_FROM_USERSFRIEND_ID")
+ private User user;
+
+ @ManyToOne(fetch = FetchType.EAGER)
+ @JoinColumn(name = "FRIEND_ID", nullable = false, updatable = false)
+ @org.hibernate.annotations.ForeignKey(name = "FK_FROM_USERSFRIEND2_ID")
+ private User friend;
+
+ public User getUser() {
+ return user;
+ }
+
+ public void setUser(User user) {
+ this.user = user;
+ }
+
+ public User getFriend() {
+ return friend;
+ }
+
+ public void setFriend(User friend) {
+ this.friend = friend;
+ }
+
+ public Long getId() {
+ return id;
+ }
+}
Property changes on: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/FriendshipRequest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Image.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Image.java 2008-12-05 15:26:04 UTC (rev 11583)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Image.java 2008-12-05 15:38:09 UTC (rev 11584)
@@ -8,9 +8,7 @@
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
-import java.util.HashSet;
import java.util.List;
-import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
@@ -18,7 +16,6 @@
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
-import javax.persistence.JoinTable;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Message.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Message.java 2008-12-05 15:26:04 UTC (rev 11583)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Message.java 2008-12-05 15:38:09 UTC (rev 11584)
@@ -13,6 +13,7 @@
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
+import javax.persistence.Transient;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotEmpty;
@@ -36,6 +37,11 @@
private boolean readed;
+ private boolean friendshipRequest;
+
+ @Transient
+ private String ownerLogin;
+
@Column(length = 256, nullable = false)
@NotNull
@NotEmpty
@@ -110,4 +116,20 @@
this.theme = theme;
}
+ public boolean isFriendshipRequest() {
+ return friendshipRequest;
+ }
+
+ public void setFriendshipRequest(boolean friendshipRequest) {
+ this.friendshipRequest = friendshipRequest;
+ }
+
+ public String getOwnerLogin() {
+ return ownerLogin;
+ }
+
+ public void setOwnerLogin(String ownerLogin) {
+ this.ownerLogin = ownerLogin;
+ }
+
}
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/MetaTag.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/MetaTag.java 2008-12-05 15:26:04 UTC (rev 11583)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/MetaTag.java 2008-12-05 15:38:09 UTC (rev 11584)
@@ -9,14 +9,11 @@
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
-import javax.persistence.Version;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotEmpty;
import org.hibernate.validator.NotNull;
-import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
@Entity
@Name("metaTag")
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/User.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/User.java 2008-12-05 15:26:04 UTC (rev 11583)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/User.java 2008-12-05 15:38:09 UTC (rev 11584)
@@ -120,7 +120,9 @@
@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.EXTRA)
@org.hibernate.annotations.OrderBy(clause = "Date desc")
private List<Message> messages = new ArrayList<Message>();
- //private Address address;
+
+ @OneToMany(mappedBy = "user", cascade = { CascadeType.ALL }, fetch = FetchType.LAZY)
+ private List<FriendshipRequest> friendshipRequests = new ArrayList<FriendshipRequest>();
/**
* No-arg constructor for JavaBean tools
@@ -284,4 +286,37 @@
public void setMessages(List<Message> messages) {
this.messages = messages;
}
+
+ public List<FriendshipRequest> getFriendshipRequests() {
+ return friendshipRequests;
+ }
+
+ public void setFriendshipRequests(List<FriendshipRequest> friendshipRequests) {
+ this.friendshipRequests = friendshipRequests;
+ }
+
+ public void addFriendshipRequest(User owner) {
+ FriendshipRequest request = new FriendshipRequest();
+ request.setUser(this);
+ request.setFriend(owner);
+ this.friendshipRequests.add(request);
+ }
+
+ public void removeFriendshipRequest(FriendshipRequest request) {
+ this.friendshipRequests.remove(request);
+ }
+
+ public void addFriend(User friend) {
+ this.friends.add(friend);
+ }
+
+ public FriendshipRequest getFriendshipRequest(User friend, User user) {
+ for(FriendshipRequest req: this.friendshipRequests){
+ if(req.getUser().getLogin().equals(user.getLogin()) && req.getFriend().getLogin().equals(friend.getLogin())){
+ return req;
+ }
+ }
+ return null;
+ }
+
}
\ No newline at end of file
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/AlbumAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/AlbumAction.java 2008-12-05 15:26:04 UTC (rev 11583)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/AlbumAction.java 2008-12-05 15:38:09 UTC (rev 11584)
@@ -16,7 +16,8 @@
@Stateful
@Name("albumAction")
public class AlbumAction implements IAlbumAction {
- @PersistenceContext(unitName = "realworld", type=PersistenceContextType.EXTENDED)
+ //@PersistenceContext(unitName = "entityManager", type=PersistenceContextType.EXTENDED)
+ @In(value="entityManager")
EntityManager em;
@In @Out
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IImageAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IImageAction.java 2008-12-05 15:26:04 UTC (rev 11583)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IImageAction.java 2008-12-05 15:38:09 UTC (rev 11584)
@@ -33,4 +33,6 @@
public abstract void editComment(Comment comment);
+ public abstract void vote(Image image, Long value);
+
}
\ No newline at end of file
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IMessageAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IMessageAction.java 2008-12-05 15:26:04 UTC (rev 11583)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IMessageAction.java 2008-12-05 15:38:09 UTC (rev 11584)
@@ -1,11 +1,13 @@
package org.richfaces.realworld.service;
+import javax.ejb.Local;
import javax.ejb.Remove;
import org.jboss.seam.annotations.Destroy;
import org.richfaces.realworld.domain.Comment;
import org.richfaces.realworld.domain.Message;
+@Local
public interface IMessageAction {
public abstract void sendMessage(Message message);
Added: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/ISearchService.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/ISearchService.java (rev 0)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/ISearchService.java 2008-12-05 15:38:09 UTC (rev 11584)
@@ -0,0 +1,24 @@
+package org.richfaces.realworld.service;
+
+import java.util.List;
+
+import javax.ejb.Local;
+import javax.ejb.Remove;
+
+import org.jboss.seam.annotations.Destroy;
+import org.richfaces.realworld.domain.Image;
+@Local
+public interface ISearchService {
+
+ public abstract List<Image> searchImages(String searchPattern);
+
+ public List<Image> popularImages();
+
+ public List<Image> worstImages();
+
+ @Remove
+ public void remove();
+
+ @Destroy
+ public void destroy();
+}
\ No newline at end of file
Property changes on: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/ISearchService.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IUserAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IUserAction.java 2008-12-05 15:26:04 UTC (rev 11583)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IUserAction.java 2008-12-05 15:38:09 UTC (rev 11584)
@@ -8,6 +8,7 @@
import javax.ejb.Remove;
import org.jboss.seam.annotations.Destroy;
+import org.richfaces.realworld.domain.FriendshipRequest;
import org.richfaces.realworld.domain.User;
@Local
@@ -24,7 +25,9 @@
public void updateUser(User user);
public void resetUser(User user);
- public List<User> getUsers(String suggest);
+ public List<String> getUsers(String suggest);
public long countNotReadedMessages(User user);
public void removeFromFriends(User owner, User removed);
+ public boolean friendExist(User user, User friend);
+ public void addFriend(User user, User friend, FriendshipRequest request);
}
\ No newline at end of file
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java 2008-12-05 15:26:04 UTC (rev 11583)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java 2008-12-05 15:38:09 UTC (rev 11584)
@@ -15,10 +15,10 @@
import org.richfaces.realworld.domain.Image;
import org.richfaces.realworld.domain.User;
-@Stateful
@Name("imageAction")
public class ImageAction implements IImageAction {
- @PersistenceContext(unitName = "realworld", type=PersistenceContextType.EXTENDED)
+ //@PersistenceContext(unitName = "entityManager", type=PersistenceContextType.EXTENDED)
+ @In(value="entityManager")
EntityManager em;
/* (non-Javadoc)
@@ -83,4 +83,15 @@
em.merge(comment);
em.flush();
}
+
+ public void vote(Image image, Long value) {
+ image = em.merge(image);
+ Long total = image.getRank().getTotal();
+ Long votes = image.getRank().getHits();
+ total += value;
+ votes++;
+ image.getRank().setHits(votes);
+ image.getRank().setTotal(total);
+ em.flush();
+ }
}
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/MessageAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/MessageAction.java 2008-12-05 15:26:04 UTC (rev 11583)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/MessageAction.java 2008-12-05 15:38:09 UTC (rev 11584)
@@ -7,20 +7,32 @@
import javax.persistence.PersistenceContextType;
import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.richfaces.realworld.domain.Comment;
import org.richfaces.realworld.domain.Message;
+import org.richfaces.realworld.domain.User;
-@Stateful
@Name("messageAction")
public class MessageAction implements IMessageAction {
- @PersistenceContext(unitName = "realworld", type=PersistenceContextType.EXTENDED)
+ //@PersistenceContext(unitName = "entityManager", type=PersistenceContextType.EXTENDED)
+ @In(value="entityManager")
EntityManager em;
/* (non-Javadoc)
* @see org.richfaces.realworld.service.IMessageAction#sendMessage(org.richfaces.realworld.domain.Message)
*/
public void sendMessage(Message message){
+ if(message.getOwnerLogin() != null){
+ User user = (User)em.createQuery("from User u where u.login = :login")
+ .setParameter("login", message.getOwnerLogin())
+ .getSingleResult();
+ message.setOwner(user);
+ message.setOwnerLogin(null);
+ }
+ if(message.isFriendshipRequest()){
+ message.getAuthor().addFriendshipRequest(message.getOwner());
+ }
em.persist(message);
em.flush();
}
@@ -30,8 +42,8 @@
*/
public void deleteMessage(Message message){
message = em.merge(message);
+ em.remove(message);
message.getOwner().removeMessage(message);
- em.remove(message);
em.flush();
}
Added: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/SearchService.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/SearchService.java (rev 0)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/SearchService.java 2008-12-05 15:38:09 UTC (rev 11584)
@@ -0,0 +1,66 @@
+package org.richfaces.realworld.service;
+
+import java.io.Serializable;
+import java.util.List;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceContextType;
+
+import org.jboss.seam.annotations.Begin;
+import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.richfaces.realworld.domain.Image;
+
+@Name("searchService")
+public class SearchService implements ISearchService, Serializable
+ {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -2750591521413940277L;
+ //@PersistenceContext(unitName = "entityManager", type=PersistenceContextType.EXTENDED)
+ @In(value="entityManager")
+ EntityManager em;
+
+ /* (non-Javadoc)
+ * @see org.richfaces.realworld.service.ISearchService#searchImages(java.lang.String)
+ */
+ @Begin(join=true)
+ public List<Image> searchImages(String searchPattern){
+ List<Image> images = em.createQuery("select i from MetaTag t join t.parent i where t.tag like:metatag and i.album.shared=true order by i.rank.total/i.rank.hits desc").setParameter("metatag", searchPattern+"%").getResultList();
+ return images;
+ }
+
+ @Begin(join=true)
+ public List<Image> popularImages(){
+ List<Image> images = em.createQuery("select i from Image i join i.rank r where i.album.shared=true order by r.total/r.hits desc").setMaxResults(10).getResultList();
+ return images;
+ }
+
+ @Begin(join=true)
+ public List<Image> worstImages(){
+ List<Image> images = em.createQuery("select i from Image i join i.rank r where i.album.shared=true order by r.total/r.hits asc").setMaxResults(10).getResultList();
+ return images;
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.realworld.service.IAlbumAction#remove()
+ */
+ @Remove
+ public void remove(){
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.realworld.service.IAlbumAction#destroy()
+ */
+ @Destroy
+ public void destroy(){
+
+ }
+}
Property changes on: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/SearchService.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/UserAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/UserAction.java 2008-12-05 15:26:04 UTC (rev 11583)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/UserAction.java 2008-12-05 15:38:09 UTC (rev 11584)
@@ -21,14 +21,15 @@
import org.jboss.seam.annotations.Scope;
import org.richfaces.realworld.domain.Album;
import org.richfaces.realworld.domain.Comment;
+import org.richfaces.realworld.domain.FriendshipRequest;
import org.richfaces.realworld.domain.Image;
import org.richfaces.realworld.domain.User;
-@Stateful
@Name("userAction")
public class UserAction implements IUserAction {
- @PersistenceContext(unitName = "realworld", type=PersistenceContextType.EXTENDED)
+ //@PersistenceContext(unitName = "entityManager", type=PersistenceContextType.EXTENDED)
+ @In(value="entityManager")
EntityManager em;
@In(create = true, required = true) @Out
@@ -39,7 +40,6 @@
.setParameter("username", username)
.setParameter("password", password)
.getSingleResult();
- long result = countNotReadedMessages(user);
return user != null;
}
@@ -81,8 +81,8 @@
return true;
}
- public List<User> getUsers(String suggest) {
- List<User> users = em.createQuery("from User u where u.login like :login").setParameter("login", suggest + "%").setMaxResults(10).getResultList();
+ public List<String> getUsers(String suggest) {
+ List<String> users = em.createQuery("select u.login from User u where u.login like :login").setParameter("login", suggest + "%").setMaxResults(10).getResultList();
return users;
}
@@ -93,6 +93,17 @@
public void removeFromFriends(User owner, User removed) {
owner.removeFriend(removed);
- em.flush();
+ removed.removeFriend(owner);
}
+
+ public boolean friendExist(User user, User friend) {
+ Long result = (Long)em.createQuery("SELECT count(u) FROM User u JOIN u.friendshipRequests fr WHERE u.login=:login and fr.friend.login=:friend").setParameter("login", user.getLogin()).setParameter("friend", friend.getLogin()).getSingleResult();
+ return result > 0;
+ }
+
+ public void addFriend(User user, User friend, FriendshipRequest request) {
+ friend.removeFriendshipRequest(request);
+ user.addFriend(friend);
+ friend.addFriend(user);
+ }
}
\ No newline at end of file
Modified: trunk/test-applications/realworld/ejb/src/main/resources/META-INF/persistence.xml
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/resources/META-INF/persistence.xml 2008-12-05 15:26:04 UTC (rev 11583)
+++ trunk/test-applications/realworld/ejb/src/main/resources/META-INF/persistence.xml 2008-12-05 15:38:09 UTC (rev 11584)
@@ -5,21 +5,23 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
- <persistence-unit name="realworld">
+ <persistence-unit name="entityManager">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/realWorldDatasource</jta-data-source>
- <!--<properties>
+ <properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true"/>
- </properties>-->
- <properties>
+ <property name="jboss.entity.manager.factory.jndi.name"
+ value="java:/realWorldEntityManager"/>
+ </properties>
+ <!--<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true"/>
- </properties>
+ </properties>-->
</persistence-unit>
</persistence>
Modified: trunk/test-applications/realworld/ejb/src/main/resources/import.sql
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/resources/import.sql 2008-12-05 15:26:04 UTC (rev 11583)
+++ trunk/test-applications/realworld/ejb/src/main/resources/import.sql 2008-12-05 15:38:09 UTC (rev 11584)
@@ -9,25 +9,25 @@
INSERT INTO albums(album_id, obj_version, name, description, shared, album_user_id) VALUES (6, 0, 'Album 3', 'Simple Album 3', false, 2);
INSERT INTO albums(album_id, obj_version, name, description, shared, album_user_id) VALUES (7, 0, 'Album 1', 'Simple Album', true, 3);
INSERT INTO Ranks(rank_id, total, hits) VALUES (1, 100, 21);
-INSERT INTO Ranks(rank_id, total, hits) VALUES (2, 100, 21);
-INSERT INTO Ranks(rank_id, total, hits) VALUES (3, 100, 21);
+INSERT INTO Ranks(rank_id, total, hits) VALUES (2, 200, 21);
+INSERT INTO Ranks(rank_id, total, hits) VALUES (3, 100, 31);
INSERT INTO Ranks(rank_id, total, hits) VALUES (4, 100, 21);
INSERT INTO Ranks(rank_id, total, hits) VALUES (5, 100, 21);
-INSERT INTO Ranks(rank_id, total, hits) VALUES (6, 100, 21);
-INSERT INTO Ranks(rank_id, total, hits) VALUES (7, 100, 21);
-INSERT INTO Ranks(rank_id, total, hits) VALUES (8, 100, 21);
+INSERT INTO Ranks(rank_id, total, hits) VALUES (6, 100, 41);
+INSERT INTO Ranks(rank_id, total, hits) VALUES (7, 100, 20);
+INSERT INTO Ranks(rank_id, total, hits) VALUES (8, 55, 11);
INSERT INTO Ranks(rank_id, total, hits) VALUES (9, 100, 21);
INSERT INTO Ranks(rank_id, total, hits) VALUES (10, 100, 21);
-INSERT INTO Ranks(rank_id, total, hits) VALUES (11, 100, 21);
-INSERT INTO Ranks(rank_id, total, hits) VALUES (12, 100, 21);
-INSERT INTO Ranks(rank_id, total, hits) VALUES (13, 100, 21);
-INSERT INTO Ranks(rank_id, total, hits) VALUES (14, 100, 21);
-INSERT INTO Ranks(rank_id, total, hits) VALUES (15, 100, 21);
-INSERT INTO Ranks(rank_id, total, hits) VALUES (16, 100, 21);
-INSERT INTO Ranks(rank_id, total, hits) VALUES (17, 100, 21);
+INSERT INTO Ranks(rank_id, total, hits) VALUES (11, 100, 25);
+INSERT INTO Ranks(rank_id, total, hits) VALUES (12, 110, 21);
+INSERT INTO Ranks(rank_id, total, hits) VALUES (13, 100, 19);
+INSERT INTO Ranks(rank_id, total, hits) VALUES (14, 101, 21);
+INSERT INTO Ranks(rank_id, total, hits) VALUES (15, 102, 17);
+INSERT INTO Ranks(rank_id, total, hits) VALUES (16, 103, 21);
+INSERT INTO Ranks(rank_id, total, hits) VALUES (17, 104, 15);
INSERT INTO Ranks(rank_id, total, hits) VALUES (18, 100, 21);
-INSERT INTO Ranks(rank_id, total, hits) VALUES (19, 100, 21);
-INSERT INTO Ranks(rank_id, total, hits) VALUES (20, 100, 21);
+INSERT INTO Ranks(rank_id, total, hits) VALUES (19, 110, 13);
+INSERT INTO Ranks(rank_id, total, hits) VALUES (20, 160, 21);
INSERT INTO Ranks(rank_id, total, hits) VALUES (21, 100, 21);
INSERT INTO images(image_id, obj_version, name, path, description, shared, created, img_album_id, rank_id) VALUES (1, 0, 'Picture 1', 'pic1.jpg', 'Just picture', true, '1985-01-08', 1, 1);
INSERT INTO images(image_id, obj_version, name, path, description, shared, created, img_album_id, rank_id) VALUES (2, 0, 'Picture 2', 'pic2.jpg', 'Just picture', true, '1985-01-08', 1, 2);
@@ -52,28 +52,30 @@
INSERT INTO images(image_id, obj_version, name, path, description, shared, created, img_album_id, rank_id) VALUES (21, 0, 'Picture 33', 'pic3.jpg', 'Just picture', true, '1985-01-08', 7, 21);
INSERT INTO metatags(metatag_id, tag, image_metatag_id) VALUES (1, 'Cool', 1);
INSERT INTO metatags(metatag_id, tag, image_metatag_id) VALUES (2, 'Cool2', 1);
-INSERT INTO metatags(metatag_id, tag, image_metatag_id) VALUES (3, 'Cool', 2);
+INSERT INTO metatags(metatag_id, tag, image_metatag_id) VALUES (3, 'richfaces', 2);
INSERT INTO metatags(metatag_id, tag, image_metatag_id) VALUES (4, 'Cool', 3);
-INSERT INTO metatags(metatag_id, tag, image_metatag_id) VALUES (5, 'Cool', 4);
+INSERT INTO metatags(metatag_id, tag, image_metatag_id) VALUES (5, 'theCool', 4);
INSERT INTO metatags(metatag_id, tag, image_metatag_id) VALUES (6, 'Cool', 5);
-INSERT INTO metatags(metatag_id, tag, image_metatag_id) VALUES (7, 'Cool', 6);
+INSERT INTO metatags(metatag_id, tag, image_metatag_id) VALUES (7, 'rich', 6);
INSERT INTO metatags(metatag_id, tag, image_metatag_id) VALUES (8, 'Cool', 7);
-INSERT INTO metatags(metatag_id, tag, image_metatag_id) VALUES (9, 'Cool', 8);
+INSERT INTO metatags(metatag_id, tag, image_metatag_id) VALUES (9, 'New year', 8);
INSERT INTO metatags(metatag_id, tag, image_metatag_id) VALUES (10, 'Cool', 9);
INSERT INTO metatags(metatag_id, tag, image_metatag_id) VALUES (11, 'Cool', 10);
-INSERT INTO metatags(metatag_id, tag, image_metatag_id) VALUES (12, 'Cool', 11);
+INSERT INTO metatags(metatag_id, tag, image_metatag_id) VALUES (12, 'Minsk', 11);
INSERT INTO metatags(metatag_id, tag, image_metatag_id) VALUES (13, 'Cool', 12);
-INSERT INTO metatags(metatag_id, tag, image_metatag_id) VALUES (14, 'Cool', 13);
+INSERT INTO metatags(metatag_id, tag, image_metatag_id) VALUES (14, 'Minsk', 13);
INSERT INTO metatags(metatag_id, tag, image_metatag_id) VALUES (15, 'Cool', 14);
INSERT INTO metatags(metatag_id, tag, image_metatag_id) VALUES (16, 'Cool', 15);
-INSERT INTO metatags(metatag_id, tag, image_metatag_id) VALUES (17, 'Cool', 16);
+INSERT INTO metatags(metatag_id, tag, image_metatag_id) VALUES (17, 'Minsk', 16);
INSERT INTO metatags(metatag_id, tag, image_metatag_id) VALUES (18, 'Cool', 17);
-INSERT INTO metatags(metatag_id, tag, image_metatag_id) VALUES (19, 'Cool', 18);
+INSERT INTO metatags(metatag_id, tag, image_metatag_id) VALUES (19, 'friend', 18);
INSERT INTO metatags(metatag_id, tag, image_metatag_id) VALUES (20, 'Cool', 19);
-INSERT INTO metatags(metatag_id, tag, image_metatag_id) VALUES (21, 'Cool', 20);
+INSERT INTO metatags(metatag_id, tag, image_metatag_id) VALUES (21, 'Cool2', 20);
INSERT INTO comments(comment_id, date, message, image_comment_id, from_user_id) VALUES (1, '1985-01-08', 'Hello I am user', 1, 2);
INSERT INTO comments(comment_id, date, message, image_comment_id, from_user_id) VALUES (2, '1985-01-08', 'Hello I am user2', 1, 3);
-INSERT INTO messages(message_id, date, message, author_id, owner_id, readed, theme) VALUES (1, '1985-01-08', 'Hello I am user', 2, 1, false, 'Hello, amarkhel');
+INSERT INTO messages(message_id, date, message, author_id, owner_id, readed, theme, friendshipRequest) VALUES (1, '1985-01-08', 'Hello I am user', 2, 1, false, 'Hello, amarkhel', false);
+INSERT INTO messages(message_id, date, message, author_id, owner_id, readed, theme, friendshipRequest) VALUES (2, '1985-01-08', 'Please, add meto your friends', 3, 1, false, 'Request for friendship', true);
INSERT INTO shared_albums(album_id, user_id) VALUES(4, 1);
INSERT INTO shared_albums(album_id, user_id) VALUES(7, 1);
-INSERT INTO user_friends(user1_id, user2_id) VALUES(1, 2);
\ No newline at end of file
+INSERT INTO user_friends(user1_id, user2_id) VALUES(1, 2);
+INSERT INTO friendship_requests(REQUEST_ID, USER_ID, FRIEND_ID) VALUES(1, 3, 1);
\ No newline at end of file
Modified: trunk/test-applications/realworld/ejb/src/main/resources/realworld-ds.xml
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/resources/realworld-ds.xml 2008-12-05 15:26:04 UTC (rev 11583)
+++ trunk/test-applications/realworld/ejb/src/main/resources/realworld-ds.xml 2008-12-05 15:38:09 UTC (rev 11584)
@@ -7,14 +7,14 @@
<datasources>
<local-tx-datasource>
<jndi-name>realWorldDatasource</jndi-name>
- <connection-url>jdbc:postgresql://localhost:5432/realworld</connection-url>
+ <!-- <connection-url>jdbc:postgresql://localhost:5432/realworld</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<user-name>realworld</user-name>
- <password>realworld</password>
- <!--<connection-url>jdbc:hsqldb:.</connection-url>
+ <password>realworld</password>-->
+ <connection-url>jdbc:hsqldb:.</connection-url>
<driver-class>org.hsqldb.jdbcDriver</driver-class>
<user-name>sa</user-name>
- <password></password>-->
+ <password></password>
</local-tx-datasource>
</datasources>
Modified: trunk/test-applications/realworld/pom.xml
===================================================================
--- trunk/test-applications/realworld/pom.xml 2008-12-05 15:26:04 UTC (rev 11583)
+++ trunk/test-applications/realworld/pom.xml 2008-12-05 15:38:09 UTC (rev 11584)
@@ -9,13 +9,13 @@
<parent>
<groupId>org.jboss.seam</groupId>
<artifactId>root</artifactId>
- <version>2.0.1.GA</version>
+ <version>2.1.0.SP1</version>
</parent>
<properties>
<projectName>realworld</projectName>
<richfacesVersion>3.3.0-SNAPSHOT</richfacesVersion>
- <seamVersion>2.0.1.GA</seamVersion>
+ <seamVersion>2.1.0.SP1</seamVersion>
<jbossDownloadURL>http://downloads.sourceforge.net/jboss/jboss-4.2.3.GA.zip</jbossDownloadURL>
<jbossDeployDir>jboss-4.2.3.GA/jboss-4.2.3.GA/server/default/</jbossDeployDir>
<droolsVersion>4.0.0</droolsVersion>
@@ -39,7 +39,6 @@
<module>ejb</module>
<module>web</module>
</modules>
-
<build>
<plugins>
<plugin>
Modified: trunk/test-applications/realworld/web/META-INF/MANIFEST.MF
===================================================================
--- trunk/test-applications/realworld/web/META-INF/MANIFEST.MF 2008-12-05 15:26:04 UTC (rev 11583)
+++ trunk/test-applications/realworld/web/META-INF/MANIFEST.MF 2008-12-05 15:38:09 UTC (rev 11584)
@@ -1,7 +1,8 @@
Manifest-Version: 1.0
Class-Path: avalon-framework-4.1.3.jar commons-beanutils-1.7.0.jar com
- mons-digester-1.8.jar commons-logging-1.1.jar jboss-seam-debug-2.0.1.
- GA.jar jboss-seam-remoting-2.0.1.GA.jar jboss-seam-ui-2.0.1.GA.jar js
- f-facelets-1.1.14.jar log4j-1.2.14.jar logkit-1.0.1.jar richfaces-imp
- l-3.3.0-SNAPSHOT.jar richfaces-ui-3.3.0-SNAPSHOT.jar
+ mons-digester-1.8.jar commons-logging-1.1.jar jboss-seam-debug-2.1.0.
+ SP1.jar jboss-seam-jul-2.1.0.SP1.jar jboss-seam-remoting-2.1.0.SP1.ja
+ r jboss-seam-ui-2.1.0.SP1.jar jsf-facelets-1.1.14.jar log4j-1.2.14.ja
+ r logkit-1.0.1.jar richfaces-impl-3.3.0-SNAPSHOT.jar richfaces-ui-3.3
+ .0-SNAPSHOT.jar
Modified: trunk/test-applications/realworld/web/pom.xml
===================================================================
--- trunk/test-applications/realworld/web/pom.xml 2008-12-05 15:26:04 UTC (rev 11583)
+++ trunk/test-applications/realworld/web/pom.xml 2008-12-05 15:38:09 UTC (rev 11584)
@@ -35,7 +35,7 @@
<version>3.0.0.ga</version>
<scope>provided</scope>
</dependency>
- <dependency>
+ <dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.3.0.ga</version>
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/AvatarUpload.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/AvatarUpload.java 2008-12-05 15:26:04 UTC (rev 11583)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/AvatarUpload.java 2008-12-05 15:38:09 UTC (rev 11584)
@@ -7,6 +7,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
+import java.io.Serializable;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.In;
@@ -20,7 +21,7 @@
@Name("avatarUpload")
@Scope(ScopeType.PAGE)
-public class AvatarUpload {
+public class AvatarUpload implements Serializable{
@In(create=true)
private FileManager fileManager;
Deleted: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileTest.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileTest.java 2008-12-05 15:26:04 UTC (rev 11583)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileTest.java 2008-12-05 15:38:09 UTC (rev 11584)
@@ -1,104 +0,0 @@
-package org.richfaces.realworld.fileupload;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-
-public class FileTest {
-
- private String uploadRoot = "F:/Upload/";
-
- public String getUploadRoot() {
- return uploadRoot;
- }
-
- private String getFileSeparator() {
- return System.getProperty("file.separator");
- }
-
- public boolean isDirectoryPresent(String directory) {
- String fullPath = getAbsolutePath(directory);
- File file = new File(fullPath);
- return file.exists() && file.isDirectory();
- }
-
- public void deleteDirectory(String directory) {
- String fullPath = getAbsolutePath(directory);
- File file = new File(fullPath);
- if(file.exists()){
- for(String f :file.list()){
- File temp = new File(fullPath+getFileSeparator()+f);
- temp.delete();
- }
- file.delete();
- }
- }
-
- public void renameDirectory(String directoryOld, String directoryNew) throws Exception {
- String fullPath = getAbsolutePath(directoryOld);
- File fileOld = new File(fullPath);
- File fileNew = new File(getUploadRoot() + directoryNew);
- createDirectoryIfNotExist(directoryNew);
- if(fileNew.exists())
- if( fileNew.isDirectory() ){
- throw new Exception("exc");
- }else{
- fileNew.delete();
- }
- fileOld.renameTo(fileNew);
- }
-
- public void addDirectory(String directory) {
- String fullPath = getAbsolutePath(directory);
- File file = new File(fullPath);
- file.mkdirs();
- }
-
- public void addImage(String fileName, byte[] data) throws IOException {
- createDirectoryIfNotExist(fileName);
- FileOutputStream b = new FileOutputStream(getUploadRoot() + fileName);
- b.write(data);
- b.close();
- }
-
- public void deleteImage(String fileName) {
- String fullPath = getAbsolutePath(fileName);
- File file = new File(fullPath);
- if(file.exists()){
- file.delete();
- }
- }
-
- public void renameImage(String fileNameOld, String fileNameNew) {
- createDirectoryIfNotExist(fileNameNew);
- String fullPath = getAbsolutePath(fileNameOld);
- File fileOld = new File(fullPath);
- File fileNew = new File(getAbsolutePath(fileNameNew));
- if(fileNew.exists()){
- fileNew.delete();
- }
- fileOld.renameTo(fileNew);
- }
-
- private void createDirectoryIfNotExist(String fileNameNew) {
- int lastIndexOf = fileNameNew.lastIndexOf(getFileSeparator());
- if(lastIndexOf > 0){
- String directory = fileNameNew.substring(0, lastIndexOf);
- File file = new File(getUploadRoot()+directory);
- if(!file.exists()){
- file.mkdirs();
- }
- }
- }
-
- public boolean isImagePresent(String fileName) {
- String fullPath = getAbsolutePath(fileName);
- File file = new File(fullPath);
- return file.exists() && !file.isDirectory();
- }
-
- private String getAbsolutePath(String fileName) {
- return getUploadRoot() + fileName;
- }
-
-}
Deleted: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileTestTest.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileTestTest.java 2008-12-05 15:26:04 UTC (rev 11583)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileTestTest.java 2008-12-05 15:38:09 UTC (rev 11584)
@@ -1,129 +0,0 @@
-package org.richfaces.realworld.fileupload;
-
-import java.io.IOException;
-
-import junit.framework.TestCase;
-
-public class FileTestTest extends TestCase {
-
- FileTest fileManager = new FileTest();
-
- private byte[] image = new byte[40];
-
- public void testIsDirectoryPresent() {
- fileManager.addDirectory("amarkhel");
- assertEquals(fileManager.isDirectoryPresent("amarkhel"), true);
- assertEquals(fileManager.isDirectoryPresent("amarkhel2"), false);
- fileManager.deleteDirectory("amarkhel");
- }
-
- public void testDeleteDirectory() {
- fileManager.addDirectory("amarkhel");
- assertEquals(fileManager.isDirectoryPresent("amarkhel"), true);
- fileManager.deleteDirectory("amarkhel");
- assertEquals(fileManager.isDirectoryPresent("amarkhel"), false);
- }
-
- public void testRenameDirectory() throws Exception {
- fileManager.addDirectory("amarkhel");
- assertEquals(fileManager.isDirectoryPresent("amarkhel"), true);
- fileManager.renameDirectory("amarkhel", "amarkhel2");
- assertEquals(fileManager.isDirectoryPresent("amarkhel"), false);
- assertEquals(fileManager.isDirectoryPresent("amarkhel2"), true);
- fileManager.deleteDirectory("amarkhel2");
- }
-
- public void testRenameDirectory2(){
- fileManager.addDirectory("amarkhel");
- fileManager.addDirectory("amarkhel2");
- assertEquals(fileManager.isDirectoryPresent("amarkhel"), true);
- try {
- fileManager.renameDirectory("amarkhel", "amarkhel2");
- } catch (Exception e) {
- assertTrue(true);
- }
-
- assertEquals(fileManager.isDirectoryPresent("amarkhel"), true);
- assertEquals(fileManager.isDirectoryPresent("amarkhel2"), true);
- fileManager.deleteDirectory("amarkhel");
- fileManager.deleteDirectory("amarkhel2");
- }
-
- public void testRenameDirectory3() throws Exception {
- fileManager.addDirectory("a"+System.getProperty("file.separator")+"amarkhel");
- assertEquals(fileManager.isDirectoryPresent("a"+System.getProperty("file.separator")+"amarkhel"), true);
- fileManager.renameDirectory("a"+System.getProperty("file.separator")+"amarkhel", "b"+System.getProperty("file.separator")+"amarkhel");
- assertEquals(fileManager.isDirectoryPresent("a"+System.getProperty("file.separator")+"amarkhel"), false);
- assertEquals(fileManager.isDirectoryPresent("b"+System.getProperty("file.separator")+"amarkhel"), true);
- fileManager.deleteDirectory("b"+System.getProperty("file.separator")+"amarkhel");
- }
-
- public void testRenameDirectory4() throws Exception {
- fileManager.addDirectory("a"+System.getProperty("file.separator")+"a"+System.getProperty("file.separator")+"amarkhel");
- assertEquals(fileManager.isDirectoryPresent("a"+System.getProperty("file.separator")+"a"+System.getProperty("file.separator")+"amarkhel"), true);
- fileManager.renameDirectory("a"+System.getProperty("file.separator")+"a"+System.getProperty("file.separator")+"amarkhel", "b"+System.getProperty("file.separator")+"b"+System.getProperty("file.separator")+"amarkhel");
- assertEquals(fileManager.isDirectoryPresent("a"+System.getProperty("file.separator")+"a"+System.getProperty("file.separator")+"amarkhel"), false);
- assertEquals(fileManager.isDirectoryPresent("b"+System.getProperty("file.separator")+"b"+System.getProperty("file.separator")+"amarkhel"), true);
- fileManager.deleteDirectory("b"+System.getProperty("file.separator")+"b"+System.getProperty("file.separator")+"amarkhel");
- }
-
- public void testAddDirectory() {
- assertEquals(fileManager.isDirectoryPresent("amarkhel"), false);
- fileManager.addDirectory("amarkhel");
- assertEquals(fileManager.isDirectoryPresent("amarkhel"), true);
- fileManager.deleteDirectory("amarkhel");
- }
-
- public void testAddDirectory2() {
- assertEquals(fileManager.isDirectoryPresent("a"+System.getProperty("file.separator")+"amarkhel"), false);
- fileManager.addDirectory("a"+System.getProperty("file.separator")+"amarkhel");
- assertEquals(fileManager.isDirectoryPresent("a"+System.getProperty("file.separator")+"amarkhel"), true);
- fileManager.deleteDirectory("a"+System.getProperty("file.separator")+"amarkhel");
- }
-
- public void testAddImage() throws IOException {
- assertEquals(fileManager.isImagePresent("amarkhel.gif"), false);
- fileManager.addImage("amarkhel.gif", image);
- assertEquals(fileManager.isImagePresent("amarkhel.gif"), true);
- fileManager.deleteImage("amarkhel.gif");
- }
-
- public void testDeleteImage() throws IOException {
- fileManager.addImage("amarkhel.gif", image);
- assertEquals(fileManager.isImagePresent("amarkhel.gif"), true);
- fileManager.deleteImage("amarkhel.gif");
- assertEquals(fileManager.isImagePresent("amarkhel.gif"), false);
- }
-
- public void testRenameImage() throws IOException {
- fileManager.addImage("amarkhel.gif", image);
- assertEquals(fileManager.isImagePresent("amarkhel.gif"), true);
- fileManager.renameImage("amarkhel.gif", "amarkhel2.gif");
- assertEquals(fileManager.isImagePresent("amarkhel.gif"), false);
- assertEquals(fileManager.isImagePresent("amarkhel2.gif"), true);
- fileManager.deleteImage("amarkhel2.gif");
- }
-
- public void testRenameImage2() throws IOException {
- fileManager.addImage("a"+System.getProperty("file.separator")+"amarkhel.gif", image);
- assertEquals(fileManager.isImagePresent("a"+System.getProperty("file.separator")+"amarkhel.gif"), true);
- fileManager.renameImage("a"+System.getProperty("file.separator")+"amarkhel.gif", "b"+System.getProperty("file.separator")+"amarkhel2.gif");
- assertEquals(fileManager.isImagePresent("a"+System.getProperty("file.separator")+"amarkhel.gif"), false);
- assertEquals(fileManager.isImagePresent("b"+System.getProperty("file.separator")+"amarkhel2.gif"), true);
- fileManager.deleteImage("b"+System.getProperty("file.separator")+"amarkhel2.gif");
- fileManager.deleteDirectory("b");
- fileManager.deleteDirectory("a");
- }
-
- public void testIsImagePresent() throws IOException {
- fileManager.addImage("amarkhel.gif", image);
- assertEquals(fileManager.isImagePresent("amarkhel.gif"), true);
- assertEquals(fileManager.isImagePresent("amarkhel3.gif"), false);
- fileManager.deleteImage("amarkhel.gif");
- fileManager.addImage("am"+System.getProperty("file.separator")+"amarkhel.gif", image);
- assertEquals(fileManager.isImagePresent("am"+System.getProperty("file.separator")+"amarkhel.gif"), true);
- fileManager.deleteImage("am"+System.getProperty("file.separator")+"amarkhel.gif");
- fileManager.deleteDirectory("am");
- }
-
-}
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileUploadBean.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileUploadBean.java 2008-12-05 15:26:04 UTC (rev 11583)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileUploadBean.java 2008-12-05 15:38:09 UTC (rev 11584)
@@ -23,6 +23,7 @@
import java.io.IOException;
import java.io.OutputStream;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
@@ -47,7 +48,7 @@
@Name("fileUploadBean")
@Scope(ScopeType.SESSION)
@Synchronized(timeout=2000)
-public class FileUploadBean {
+public class FileUploadBean implements Serializable{
@In @Out
private User user;
Added: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/search/SearchBean.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/search/SearchBean.java (rev 0)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/search/SearchBean.java 2008-12-05 15:38:09 UTC (rev 11584)
@@ -0,0 +1,182 @@
+package org.richfaces.realworld.search;
+
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import javax.faces.model.SelectItem;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.AutoCreate;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.Scope;
+import org.richfaces.component.UIInputNumberSpinner;
+import org.richfaces.realworld.domain.Image;
+import org.richfaces.realworld.fileupload.FileManager;
+import org.richfaces.realworld.service.ISearchService;
+
+@Name("searchBean")
+public class SearchBean implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 5071655218132021316L;
+
+ @In(required=false)
+ private SearchBeanHelper helper;
+
+ @In(create=true)
+ private ISearchService searchService;
+
+ @In(create=true)
+ private FileManager fileManager;
+
+ private String searchPattern;
+
+ private Long spinnerChoice;
+
+ private Long dateChoice;
+
+ private Long votesChoice;
+
+ private Long numberOfVotes;
+
+ private Date date;
+
+ private List<Image> findedImages = new ArrayList<Image>();
+
+ public List<SelectItem> getItems() {
+ List<SelectItem> list = new ArrayList<SelectItem>(4);
+ list.add(new SelectItem(Long.valueOf(1L), "More"));
+ list.add(new SelectItem(Long.valueOf(2L), "Less"));
+ list.add(new SelectItem(Long.valueOf(3L), "Equals"));
+ return list;
+ }
+
+ public synchronized void paint(OutputStream stream, Object object) throws IOException {
+ Image painted = (Image)object;
+
+ File image = fileManager.getImage(painted.getAlbum().getOwner().getLogin() + fileManager.getFileSeparator() + painted.getAlbum().getName()+ fileManager.getFileSeparator() + painted.getPath());
+ InputStream paintData = null;
+ byte[] data = new byte[(int)image.length() - 1];
+ FileInputStream fileInputStream = null;
+ BufferedInputStream bufferedInputStream = null;
+ if (image != null) {
+ try {
+ fileInputStream = new FileInputStream(image);
+ bufferedInputStream = new BufferedInputStream(fileInputStream);
+ paintData = bufferedInputStream;
+ paintData.read(data);
+ } catch (FileNotFoundException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }finally{
+ try {
+ fileInputStream.close();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ try {
+ bufferedInputStream.close();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ try {
+ paintData.close();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ }
+ stream.write(data);
+ }
+
+ public List<Image> searchImages(){
+ findedImages = searchService.searchImages(this.searchPattern);
+ return findedImages;
+ }
+
+ public List<Image> popularImages(){
+ findedImages = searchService.popularImages();
+ return findedImages;
+ }
+
+ public List<Image> worstImages(){
+ findedImages = searchService.worstImages();
+ return findedImages;
+ }
+
+ public String getSearchPattern() {
+ return searchPattern;
+ }
+
+ public void setSearchPattern(String searchPattern) {
+ this.searchPattern = searchPattern;
+ }
+
+ public Long getSpinnerChoice() {
+ return spinnerChoice;
+ }
+
+ public void setSpinnerChoice(Long spinnerChoice) {
+ this.spinnerChoice = spinnerChoice;
+ }
+
+ public Long getDateChoice() {
+ return dateChoice;
+ }
+
+ public void setDateChoice(Long dateChoice) {
+ this.dateChoice = dateChoice;
+ }
+
+ public Long getVotesChoice() {
+ return votesChoice;
+ }
+
+ public void setVotesChoice(Long votesChoice) {
+ this.votesChoice = votesChoice;
+ }
+
+ public Long getNumberOfVotes() {
+ return numberOfVotes;
+ }
+
+ public void setNumberOfVotes(Long numberOfVotes) {
+ this.numberOfVotes = numberOfVotes;
+ }
+
+ public Date getDate() {
+ return date;
+ }
+
+ public void setDate(Date date) {
+ this.date = date;
+ }
+
+ public List<Image> getFindedImages() {
+ return findedImages;
+ }
+
+ public void setFindedImages(List<Image> findedImages) {
+ this.findedImages = findedImages;
+ }
+}
Property changes on: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/search/SearchBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/search/SearchBeanHelper.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/search/SearchBeanHelper.java (rev 0)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/search/SearchBeanHelper.java 2008-12-05 15:38:09 UTC (rev 11584)
@@ -0,0 +1,22 @@
+package org.richfaces.realworld.search;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.richfaces.component.UIInputNumberSpinner;
+
+@Name("helper")
+(a)Scope(ScopeType.EVENT)
+public class SearchBeanHelper {
+
+ private UIInputNumberSpinner inputSpinner;
+
+ public UIInputNumberSpinner getInputSpinner() {
+ return inputSpinner;
+ }
+
+ public void setInputSpinner(UIInputNumberSpinner inputSpinner) {
+ this.inputSpinner = inputSpinner;
+ }
+
+}
Property changes on: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/search/SearchBeanHelper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/session/Authenticator.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/session/Authenticator.java 2008-12-05 15:26:04 UTC (rev 11583)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/session/Authenticator.java 2008-12-05 15:38:09 UTC (rev 11584)
@@ -6,6 +6,7 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
+import org.jboss.seam.annotations.Begin;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Logger;
import org.jboss.seam.annotations.Name;
@@ -39,6 +40,7 @@
/* (non-Javadoc)
* @see org.richfaces.realworld.service.IAuthenticator#authenticate()
*/
+ @Begin
public boolean authenticate()
{
log.info("authenticating #0", identity.getUsername());
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeActionManager.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeActionManager.java 2008-12-05 15:26:04 UTC (rev 11583)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeActionManager.java 2008-12-05 15:38:09 UTC (rev 11584)
@@ -1,5 +1,6 @@
package org.richfaces.realworld.tree;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -13,6 +14,7 @@
import org.jboss.seam.annotations.Scope;
import org.richfaces.realworld.domain.Album;
import org.richfaces.realworld.domain.Comment;
+import org.richfaces.realworld.domain.FriendshipRequest;
import org.richfaces.realworld.domain.Image;
import org.richfaces.realworld.domain.Message;
import org.richfaces.realworld.domain.User;
@@ -21,20 +23,22 @@
import org.richfaces.realworld.service.IImageAction;
import org.richfaces.realworld.service.IMessageAction;
import org.richfaces.realworld.service.IUserAction;
+import org.richfaces.realworld.util.RatingHelper;
@Name("treeActionManager")
@Scope(ScopeType.PAGE)
-public class TreeActionManager {
+public class TreeActionManager implements Serializable{
@In
private User user;
- private long countUnreadedMessages;
-
@In(create=true, required=true)
private IAlbumAction albumAction;
@In(create=true, required=true)
+ private RatingHelper ratingHelper;
+
+ @In(create=true, required=true)
private IMessageAction messageAction;
@In(create=true, required=true)
@@ -65,8 +69,8 @@
}
- public List<User> availableUsers(Object suggest){
- List<User> suggestions = userAction.getUsers((String)suggest);
+ public List<String> availableUserLogins(Object suggest){
+ List<String> suggestions = userAction.getUsers((String)suggest);
return suggestions;
}
@@ -161,11 +165,45 @@
messageAction.sendMessage(message);
}
- public long getCountUnreadedMessages() {
- return userAction.countNotReadedMessages(user);
+ public Long getCountUnreadedMessages() {
+ Long count = userAction.countNotReadedMessages(user);
+ return count!= null? count:0;
}
public void removeFromFriends(User owner, User removed){
userAction.removeFromFriends(owner, removed);
+ Message message = new Message();
+ message.setAuthor(user);
+ message.setDate(new Date());
+ message.setOwner(removed);
+ message.setFriendshipRequest(false);
+ message.setReaded(false);
+ message.setMessage("You are were removed from friends of "+ user.getLogin());
+ message.setTheme("You are were removed from friends");
+ messageAction.sendMessage(message);
}
+
+ public void addToFriends(User friend){
+ FriendshipRequest request = friend.getFriendshipRequest(user, friend);
+ if(request != null){
+ if(!userAction.friendExist(user, friend)){
+ userAction.addFriend(user, friend, request);
+ Message message = new Message();
+ message.setAuthor(user);
+ message.setDate(new Date());
+ message.setOwner(friend);
+ message.setFriendshipRequest(false);
+ message.setReaded(false);
+ message.setMessage("You are were added to friends by User "+ user.getLogin());
+ message.setTheme("You are were added to friends");
+ messageAction.sendMessage(message);
+ }
+ }/*else{
+ throw new Exception("This user won't be your friend!");
+ }*/
+ }
+
+ public void vote(Image image){
+ imageAction.vote(image, (Long)Long.valueOf(ratingHelper.getInputSlider().getValue().toString()));
+ }
}
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeSelectionManager.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeSelectionManager.java 2008-12-05 15:26:04 UTC (rev 11583)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeSelectionManager.java 2008-12-05 15:38:09 UTC (rev 11584)
@@ -7,6 +7,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
+import java.io.Serializable;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@@ -46,7 +47,7 @@
@Name("treeSelectionManager")
@Synchronized(timeout=2000)
@Scope(ScopeType.SESSION)
-public class TreeSelectionManager {
+public class TreeSelectionManager implements Serializable{
private static final FacesContext FacesContext = null;
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ModalPanelHelper.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ModalPanelHelper.java 2008-12-05 15:26:04 UTC (rev 11583)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ModalPanelHelper.java 2008-12-05 15:38:09 UTC (rev 11584)
@@ -1,5 +1,6 @@
package org.richfaces.realworld.util;
+import java.io.Serializable;
import java.util.Date;
import javax.faces.event.ActionEvent;
@@ -18,7 +19,7 @@
@Name("modalPanelHelper")
@Scope(ScopeType.SESSION)
-public class ModalPanelHelper {
+public class ModalPanelHelper implements Serializable{
private String caption;
@@ -105,6 +106,7 @@
public void initMessage(boolean sendRequired, Message message){
this.sendRequired = sendRequired;
this.message = message;
+ this.message.setReaded(true);
this.searchRequired = false;
}
@@ -130,6 +132,19 @@
this.searchRequired = false;
}
+ public void initModalPanelData( String actionName, boolean sendRequired, User owner, String theme, String message, boolean friendshipRequest){
+ this.actionName = actionName;
+ this.sendRequired = sendRequired;
+ this.message = new Message();
+ this.message.setAuthor(user);
+ this.message.setOwner(owner);
+ this.message.setReaded(false);
+ this.message.setTheme(theme);
+ this.message.setMessage(message);
+ this.message.setFriendshipRequest(friendshipRequest);
+ this.searchRequired = false;
+ }
+
public void initModalPanelData( String actionName, String caption, Comment comment, User user, Image image){
this.caption = caption;
this.actionName = actionName;
Added: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/RatingHelper.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/RatingHelper.java (rev 0)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/RatingHelper.java 2008-12-05 15:38:09 UTC (rev 11584)
@@ -0,0 +1,24 @@
+package org.richfaces.realworld.util;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.AutoCreate;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.richfaces.component.UIInputNumberSlider;
+import org.richfaces.realworld.domain.Image;
+import org.richfaces.realworld.service.IImageAction;
+
+@Name("ratingHelper")
+public class RatingHelper {
+
+ private UIInputNumberSlider inputSlider;
+
+ public UIInputNumberSlider getInputSlider() {
+ return inputSlider;
+ }
+
+ public void setInputSlider(UIInputNumberSlider inputSlider) {
+ this.inputSlider = inputSlider;
+ }
+}
Property changes on: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/RatingHelper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/components.xml
===================================================================
--- trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/components.xml 2008-12-05 15:26:04 UTC (rev 11583)
+++ trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/components.xml 2008-12-05 15:38:09 UTC (rev 11584)
@@ -9,33 +9,30 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:transaction="http://jboss.com/products/seam/transaction"
xsi:schemaLocation=
- "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
- http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.0.xsd
- http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd
- http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.0.xsd
- http://jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.0.xsd
- http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.0.xsd
- http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.0.xsd
- http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd">
+ "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.1.0.xsd
+ http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.1.0.xsd
+ http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.1.0.xsd
+ http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.1.0.xsd
+ http://jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.1.0.xsd
+ http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.1.0.xsd
+ http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.1.0.xsd
+ http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.1.0.xsd">
<core:init debug="true" jndi-pattern="@jndiPattern@"/>
<core:manager concurrent-request-timeout="500"
conversation-timeout="120000"
conversation-id-parameter="cid"/>
-
-<drools:rule-base name="securityRules">
- <drools:rule-files>
- <value>/security.drl</value>
- </drools:rule-files>
- </drools:rule-base>
-
- <security:identity security-rules="#{securityRules}" authenticate-method="#{authenticator.authenticate}"/>
+ <persistence:managed-persistence-context name="entityManager"
+ auto-create="true"
+ persistence-unit-jndi-name="java:/realWorldEntityManager"/>
+ <transaction:ejb-transaction />
+ <security:identity authenticate-method="#{authenticator.authenticate}"/>
<event type="org.jboss.seam.security.notLoggedIn">
- <action execute="#{redirect.captureCurrentView}"/>
- </event>
- <event type="org.jboss.seam.security.loginSuccessful">
- <action execute="#{redirect.returnToCapturedView}"/>
- </event>
-
+ <action execute="#{redirect.captureCurrentView}"/>
+ <action execute="#{identity.tryLogin()}"/>
+ </event>
+ <event type="org.jboss.seam.security.loginSuccessful">
+ <action execute="#{redirect.returnToCapturedView}"/>
+ </event>
</components>
Modified: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/message.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/imagePreview.xhtml
===================================================================
(Binary files differ)
Added: trunk/test-applications/realworld/web/src/main/webapp/img/Thumbs.db
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/img/Thumbs.db
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/test-applications/realworld/web/src/main/webapp/layout/menu.xhtml
===================================================================
(Binary files differ)
Added: trunk/test-applications/realworld/web/src/main/webapp/layout/menuShared.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/layout/menuShared.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Modified: trunk/test-applications/realworld/web/src/main/webapp/main.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/navigation.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/readMessages.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/register.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/search.xhtml
===================================================================
(Binary files differ)
Added: trunk/test-applications/realworld/web/src/main/webapp/sharedAlbum.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/sharedAlbum.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
16 years, 1 month