Seam SVN: r7244 - branches/Seam_2_0/doc/reference/en/modules.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2008-01-25 20:47:52 -0500 (Fri, 25 Jan 2008)
New Revision: 7244
Modified:
branches/Seam_2_0/doc/reference/en/modules/itext.xml
Log:
JBSEAM-2392
Modified: branches/Seam_2_0/doc/reference/en/modules/itext.xml
===================================================================
--- branches/Seam_2_0/doc/reference/en/modules/itext.xml 2008-01-26 00:03:59 UTC (rev 7243)
+++ branches/Seam_2_0/doc/reference/en/modules/itext.xml 2008-01-26 01:47:52 UTC (rev 7244)
@@ -1,6 +1,6 @@
<chapter id="itext">
<title>iText PDF generation</title>
- <para>Seam now includes an component set for generating documents using iText. The primary focus of Seam's iText
+ <para>Seam now includes a component set for generating documents using iText. The primary focus of Seam's iText
document support is for the generation of PDF doucuments, but Seam also offers basic support for RTF document
generation.</para>
@@ -38,7 +38,7 @@
<para>
<emphasis>Description</emphasis>
</para>
- <para> Documents are generated by facelets documents using tags in the
+ <para> Documents are generated by facelet XHTML files using tags in the
<literal>http://jboss.com/products/seam/pdf</literal> namespace. Documents
should always have the <literal>document</literal> tag at the root of the document.
The <literal>document</literal> tag prepares Seam to generate a document into the
@@ -87,6 +87,15 @@
<literal>marginMirroring</literal> — Indicates that margin
settings should be reversed an alternating pages.</para>
</listitem>
+
+ <listitem>
+ <para>
+ <literal>disposition</literal> — When generating PDFs in a web browser, this determines the HTTP
+ <literal>Content-Disposition</literal> of the document. Valid values are <literal>inline</literal>, which
+ indicates the document should be displayed in the browser window if possible,
+ and <literal>attachment</literal>, which indicates that the document should be treated as a download.
+ The default value is <literal>inline</literal>.</para>
+ </listitem>
</itemizedlist>
@@ -288,7 +297,64 @@
</informaltable>
+ <informaltable>
+ <tgroup cols="2">
+ <colspec colnum="1" colwidth="1*"/>
+ <colspec colnum="2" colwidth="3*"/>
+ <tbody>
+ <row>
+ <entry valign="top">
+ <para>
+ <literal><p:html></literal>
+ </para>
+ </entry>
+ <entry valign="top">
+ <para>
+ <emphasis>Description</emphasis>
+ </para>
+
+ <para> The <literal>html</literal> tag renders HTML content into the PDF.
+ </para>
+
+ <para>
+ <emphasis>Attributes</emphasis>
+ </para>
+
+
+ <itemizedlist>
+ <listitem>
+ <para><literal>value</literal> — The text to be displayed.</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>
+ <emphasis>Usage</emphasis>
+ </para>
+
+ <programlisting>
+<p:html value="This is HTML with &lt;b&gt;some markup&lt;/b&gt;." />
+<p:html>
+ <h1>This is more complex HTML</h1>
+ <ul>
+ <li>one</li>
+ <li>two</li>
+ <li>three</li>
+ </ul>
+</p:html>
+
+<p:html>
+ <s:formattedText value="*This* is |Seam Text| as HTML. It's very^cool^." />
+</p:html>
+</programlisting>
+
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+
+
<informaltable>
<tgroup cols="2">
<colspec colnum="1" colwidth="1*"/>
@@ -341,7 +407,7 @@
<emphasis>Usage</emphasis>
</para>
- <programlisting><p:font family="courier" style="bold" size="24">
+ <programlisting><p:font name="courier" style="bold" size="24">
<p:paragraph>My Title</p:paragraph>
</p:font></programlisting>
@@ -1443,11 +1509,11 @@
<section id="itext.charting">
<title>Charting</title>
- <para> Charting support is also provided with <literal>jboss-seam-pdf.jar</literal>. Charts can be used in
- PDF documents or can be used as images in an HTML page.
- Charting requires the JFreeChart library (<literal>jfreechart.jar</literal> and <literal>jcommon.jar</literal>) to be added to the
- <literal>WEB-INF/lib</literal> directory. Three types of charts are currently supported: pie charts, bar charts and line charts.
- </para>
+ <para> Charting support is also provided with <literal>jboss-seam-pdf.jar</literal>. Charts can be used in PDF
+ documents or can be used as images in an HTML page. Charting requires the JFreeChart library
+ (<literal>jfreechart.jar</literal> and <literal>jcommon.jar</literal>) to be added to the
+ <literal>WEB-INF/lib</literal> directory. Three types of charts are currently supported: pie charts, bar
+ charts and line charts. </para>
<informaltable id="itext.barchart">
<tgroup cols="2">
@@ -1895,8 +1961,7 @@
<listitem>
<para>
- <literal>title</literal>— The chart title text.
- </para>
+ <literal>title</literal>— The chart title text. </para>
</listitem>
<listitem>
<para>
@@ -1905,13 +1970,13 @@
</listitem>
<listitem>
<para>
- <literal>legend</literal>— A boolean value indicating whether or not the chart should include a legend. Default value is true
- </para>
+ <literal>legend</literal>— A boolean value indicating whether or not
+ the chart should include a legend. Default value is true </para>
</listitem>
<listitem>
<para>
- <literal>is3D</literal>—A boolean value indicating that the chart should be rendered in 3D instead of 2D.
- </para>
+ <literal>is3D</literal>—A boolean value indicating that the chart
+ should be rendered in 3D instead of 2D. </para>
</listitem>
<listitem>
<para>
@@ -1920,98 +1985,97 @@
</listitem>
<listitem>
<para>
- <literal>labelLinkPaint</literal>— The paint used for the label linking lines.
- </para>
+ <literal>labelLinkPaint</literal>— The paint used for the label
+ linking lines. </para>
</listitem>
<listitem>
<para>
- <literal>labelLinkStroke</literal>— he stroke used for the label linking lines.
- </para>
+ <literal>labelLinkStroke</literal>— he stroke used for the label
+ linking lines. </para>
</listitem>
<listitem>
<para>
- <literal>labelLinksVisible</literal>— A flag that controls whether or not the label links are drawn.
- </para>
+ <literal>labelLinksVisible</literal>— A flag that controls whether or
+ not the label links are drawn. </para>
</listitem>
<listitem>
<para>
- <literal>labelOutlinePaint</literal>— The paint used to draw the outline of the section labels.
- </para>
+ <literal>labelOutlinePaint</literal>— The paint used to draw the
+ outline of the section labels. </para>
</listitem>
<listitem>
<para>
- <literal>labelOutlineStroke</literal>— The stroke used to draw the outline of the section labels.
- </para>
+ <literal>labelOutlineStroke</literal>— The stroke used to draw the
+ outline of the section labels. </para>
</listitem>
<listitem>
<para>
- <literal>labelShadowPaint</literal>— The paint used to draw the shadow for the section labels.
- </para>
+ <literal>labelShadowPaint</literal>— The paint used to draw the shadow
+ for the section labels. </para>
</listitem>
<listitem>
<para>
- <literal>labelPaint</literal>— The color used to draw the section labels
- </para>
+ <literal>labelPaint</literal>— The color used to draw the section
+ labels </para>
</listitem>
<listitem>
<para>
- <literal>labelGap</literal>— The gap between the labels and the plot as a percentage of the plot width.
- </para>
+ <literal>labelGap</literal>— The gap between the labels and the plot
+ as a percentage of the plot width. </para>
</listitem>
<listitem>
<para>
- <literal>labelBackgroundPaint</literal>— The color used to draw the background of the section labels. If this is null, the background is not filled.
+ <literal>labelBackgroundPaint</literal>— The color used to draw the
+ background of the section labels. If this is null, the background is not filled.
</para>
</listitem>
<listitem>
<para>
- <literal>startAngle</literal>— The starting angle of the first section.
- </para>
+ <literal>startAngle</literal>— The starting angle of the first
+ section. </para>
</listitem>
<listitem>
<para>
- <literal>circular</literal>— A boolean value indicating that the chart should be drawn as a circle.
- If false, the chart is drawn as an ellipse. The default is true.
- </para>
+ <literal>circular</literal>— A boolean value indicating that the chart
+ should be drawn as a circle. If false, the chart is drawn as an ellipse. The
+ default is true. </para>
</listitem>
<listitem>
<para>
- <literal>direction</literal>—
- The direction the pie section are drawn. One of: <literal>clockwise</literal> or <literal>anticlockwise</literal>.
- The default is <literal>clockwise</literal>.
- </para>
+ <literal>direction</literal>— The direction the pie section are drawn.
+ One of: <literal>clockwise</literal> or <literal>anticlockwise</literal>. The
+ default is <literal>clockwise</literal>. </para>
</listitem>
<listitem>
<para>
- <literal>sectionOutlinePaint</literal>— The outline paint for all sections.
- </para>
+ <literal>sectionOutlinePaint</literal>— The outline paint for all
+ sections. </para>
</listitem>
<listitem>
<para>
- <literal>sectionOutlineStroke</literal>— The outline stroke for all sections
- </para>
+ <literal>sectionOutlineStroke</literal>— The outline stroke for all
+ sections </para>
</listitem>
<listitem>
<para>
- <literal>sectionOutlinesVisible</literal>— Indicates whether an outline is drawn for each section in the plot.
- </para>
+ <literal>sectionOutlinesVisible</literal>— Indicates whether an
+ outline is drawn for each section in the plot. </para>
</listitem>
<listitem>
<para>
- <literal>baseSectionOutlinePaint</literal>— The base section outline paint.
- </para>
+ <literal>baseSectionOutlinePaint</literal>— The base section outline
+ paint. </para>
</listitem>
<listitem>
<para>
- <literal>baseSectionPaint</literal>— The base section paint.
- </para>
+ <literal>baseSectionPaint</literal>— The base section paint. </para>
</listitem>
<listitem>
<para>
- <literal>baseSectionOutlineStroke</literal>— The base section outline stroke.
- </para>
+ <literal>baseSectionOutlineStroke</literal>— The base section outline
+ stroke. </para>
</listitem>
</itemizedlist>
<para>
@@ -2167,15 +2231,18 @@
<listitem>
<para>
- <literal>sectionOutlinePaint</literal> — For bar charts, the color of the section outline.</para>
+ <literal>sectionOutlinePaint</literal> — For bar charts, the color of
+ the section outline.</para>
</listitem>
<listitem>
<para>
- <literal>sectionOutlineStroke</literal> — For bar charts, the stroke type for the section outline.</para>
+ <literal>sectionOutlineStroke</literal> — For bar charts, the stroke
+ type for the section outline.</para>
</listitem>
<listitem>
<para>
- <literal>sectionPaint</literal> — For bar charts, the color of the section.</para>
+ <literal>sectionPaint</literal> — For bar charts, the color of the
+ section.</para>
</listitem>
</itemizedlist>
<para>
@@ -2333,7 +2400,10 @@
<section id="itext.barcodes">
<title>Bar codes</title>
- <para>...</para>
+ <para>Seam can use iText to generate barcodes in a wide variety of formats. These barcodes can
+ be embedded in a PDF document or displayed as an image on a web page. Note that
+ when used with HTML images, barcodes can not currently display barcode text in the barcode.
+ </para>
<informaltable id="itext.barcode">
<tgroup cols="2">
@@ -2351,7 +2421,8 @@
<para>
<emphasis>Description</emphasis>
</para>
- <para/>
+ <para>Displays a barcode image.</para>
+
<para>
<emphasis>Attributes</emphasis>
</para>
@@ -2360,15 +2431,13 @@
<listitem>
<para>
- <literal>type</literal> — A barcode type supported by iText.
- Valid values include:
- <literal>EAN13</literal>, <literal>EAN8</literal>, <literal>UPCA</literal>,
- <literal>UPCE</literal>,
- <literal>SUPP2</literal>, <literal>SUPP5</literal>, <literal>POSTNET</literal>,
+ <literal>type</literal> — A barcode type supported by iText. Valid
+ values include: <literal>EAN13</literal>, <literal>EAN8</literal>,
+ <literal>UPCA</literal>, <literal>UPCE</literal>, <literal>SUPP2</literal>,
+ <literal>SUPP5</literal>, <literal>POSTNET</literal>,
<literal>PLANET</literal>, <literal>CODE128</literal>,
- <literal>CODE128_UCC</literal>, <literal>CODE128_RAW</literal> and <literal>CODABAR</literal>.
-
- </para>
+ <literal>CODE128_UCC</literal>, <literal>CODE128_RAW</literal> and
+ <literal>CODABAR</literal>. </para>
</listitem>
<listitem>
<para>
@@ -2377,18 +2446,18 @@
</listitem>
<listitem>
<para>
- <literal>xpos</literal>— For PDFs, the absolute y position of the barcode on the page.
- </para>
+ <literal>xpos</literal>— For PDFs, the absolute y position of the
+ barcode on the page. </para>
</listitem>
<listitem>
<para>
- <literal>ypos</literal>— For PDFs, the absolute y position of the barcode on the page.
- </para>
+ <literal>ypos</literal>— For PDFs, the absolute y position of the
+ barcode on the page. </para>
</listitem>
<listitem>
<para>
- <literal>rotDegrees</literal> — For PDFs, the rotation factor of the barcode in degrees.
- </para>
+ <literal>rotDegrees</literal> — For PDFs, the rotation factor of the
+ barcode in degrees. </para>
</listitem>
<listitem>
<para>
@@ -2398,34 +2467,36 @@
<listitem>
<para>
- <literal>minBarWidth</literal> — The minimum bar width.
- </para>
+ <literal>minBarWidth</literal> — The minimum bar width. </para>
</listitem>
<listitem>
<para>
- <literal>barMultiplier</literal> — The bar multiplier for wide bars or the
- distance between bars for <literal>POSTNET</literal> and <literal>PLANET</literal> code.
-
- </para>
+ <literal>barMultiplier</literal> — The bar multiplier for wide bars or
+ the distance between bars for <literal>POSTNET</literal> and
+ <literal>PLANET</literal> code. </para>
</listitem>
<listitem>
<para>
- <literal>barColor</literal> — The color to draw the bars.
- </para>
- </listitem>
-
+ <literal>barColor</literal> — The color to draw the bars. </para>
+ </listitem>
+
<listitem>
<para>
- <literal>textColor</literal> — The color of any text on the barcode.
+ <literal>textColor</literal> — The color of any text on the barcode.
</para>
</listitem>
- <listitem>
+ <listitem>
<para>
<literal>textSize</literal> — The size of the barcode text, if any.
</para>
</listitem>
-
-
+ <listitem>
+ <para>
+ <literal>altText</literal> — The <literal>alt</literal> text for HTML image links.
+ </para>
+ </listitem>
+
+
</itemizedlist>
<para>
<emphasis>Usage</emphasis>
@@ -2446,7 +2517,66 @@
</section>
+ <section id="itext.swingcomponents">
+ <title>Rendering Swing/AWT components</title>
+ <para>Seam now provides experimental support for rendering Swing components to into a PDF
+ image. Some Swing look and feels supports, notably ones that use native widgets, will not
+ render correctly.
+ </para>
+ <informaltable id="itext.swing">
+ <tgroup cols="2">
+ <colspec colnum="1" colwidth="1*"/>
+ <colspec colnum="2" colwidth="3*"/>
+
+ <tbody>
+ <row>
+ <entry valign="top">
+ <para>
+ <literal><p:swing></literal>
+ </para>
+ </entry>
+ <entry valign="top">
+ <para>
+ <emphasis>Description</emphasis>
+ </para>
+
+ <para>Renders a Swing component into a PDF document.</para>
+ <para>
+ <emphasis>Attributes</emphasis>
+ </para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ <literal>width</literal> — The width of the component to be rendered. </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>height</literal> — ..The height of the component to be rendered. </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>component</literal> — An expression whose value is a Swing or AWT component. </para>
+ </listitem>
+
+ </itemizedlist>
+ <para>
+ <emphasis>Usage</emphasis>
+ </para>
+ <programlisting>
+<p:swing width="310" height="120" component="#{aButton}" />
+ </programlisting>
+
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </section>
+
+
<section id="itext.links">
<title>Further documentation</title>
16 years, 3 months
Seam SVN: r7243 - branches/Seam_2_0/doc/reference/en/modules.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2008-01-25 19:03:59 -0500 (Fri, 25 Jan 2008)
New Revision: 7243
Modified:
branches/Seam_2_0/doc/reference/en/modules/security.xml
Log:
fixed incorrect message keys
Modified: branches/Seam_2_0/doc/reference/en/modules/security.xml
===================================================================
--- branches/Seam_2_0/doc/reference/en/modules/security.xml 2008-01-25 23:28:30 UTC (rev 7242)
+++ branches/Seam_2_0/doc/reference/en/modules/security.xml 2008-01-26 00:03:59 UTC (rev 7243)
@@ -541,7 +541,7 @@
<row>
<entry>
<para>
- <literal>org.jboss.seam.security.loginSuccessful</literal>
+ <literal>org.jboss.seam.loginSuccessful</literal>
</para>
</entry>
<entry>
@@ -553,7 +553,7 @@
<row>
<entry>
<para>
- <literal>org.jboss.seam.security.loginFailed</literal>
+ <literal>org.jboss.seam.loginFailed</literal>
</para>
</entry>
<entry>
@@ -566,7 +566,7 @@
<row>
<entry>
<para>
- <literal>org.jboss.seam.security.NotLoggedIn</literal>
+ <literal>org.jboss.seam.NotLoggedIn</literal>
</para>
</entry>
<entry>
16 years, 3 months
Seam SVN: r7242 - in branches/Seam_2_0/examples/itext: src/org/jboss/seam/example/pdf and 1 other directories.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2008-01-25 18:28:30 -0500 (Fri, 25 Jan 2008)
New Revision: 7242
Added:
branches/Seam_2_0/examples/itext/src/org/jboss/seam/example/pdf/SwingComponent.java
branches/Seam_2_0/examples/itext/view/html.xhtml
branches/Seam_2_0/examples/itext/view/swing.xhtml
Modified:
branches/Seam_2_0/examples/itext/resources/WEB-INF/components.xml
branches/Seam_2_0/examples/itext/view/index.xhtml
Log:
update html and swing examples
Modified: branches/Seam_2_0/examples/itext/resources/WEB-INF/components.xml
===================================================================
--- branches/Seam_2_0/examples/itext/resources/WEB-INF/components.xml 2008-01-25 20:36:19 UTC (rev 7241)
+++ branches/Seam_2_0/examples/itext/resources/WEB-INF/components.xml 2008-01-25 23:28:30 UTC (rev 7242)
@@ -17,4 +17,7 @@
<core:init debug="true" jndi-pattern="@jndiPattern@" />
+ <component name="sampleButton" class="javax.swing.JButton">
+ <property name="label">A JButton!</property>
+ </component>
</components>
Added: branches/Seam_2_0/examples/itext/src/org/jboss/seam/example/pdf/SwingComponent.java
===================================================================
--- branches/Seam_2_0/examples/itext/src/org/jboss/seam/example/pdf/SwingComponent.java (rev 0)
+++ branches/Seam_2_0/examples/itext/src/org/jboss/seam/example/pdf/SwingComponent.java 2008-01-25 23:28:30 UTC (rev 7242)
@@ -0,0 +1,29 @@
+package org.jboss.seam.example.pdf;
+
+import java.awt.*;
+import javax.swing.*;
+
+import org.jboss.seam.annotations.Create;
+import org.jboss.seam.annotations.Name;
+
+@Name("swing")
+public class SwingComponent
+{
+ @Create
+ public void init() {
+ try {
+ UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
+ } catch(Exception e) {
+ System.out.println("Error setting Java LAF: " + e);
+ }
+
+ System.out.println("** " + UIManager.getLookAndFeel());
+ }
+
+ public Component getButton() {
+ JLabel label = new JLabel("Hello, Seam", SwingConstants.CENTER);
+
+ return label;
+ }
+
+}
Added: branches/Seam_2_0/examples/itext/view/html.xhtml
===================================================================
--- branches/Seam_2_0/examples/itext/view/html.xhtml (rev 0)
+++ branches/Seam_2_0/examples/itext/view/html.xhtml 2008-01-25 23:28:30 UTC (rev 7242)
@@ -0,0 +1,29 @@
+<p:document xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:p="http://jboss.com/products/seam/pdf">
+
+ <p:paragraph>This is a regular paragraph.</p:paragraph>
+
+
+ <p:html value="This is HTML that is just plain text." />
+ <p:html value="This is HTML with <b>some markup</b>." />
+
+ <p:html>
+ This is HTML with text with text in the <b>body</b>.
+ </p:html>
+
+
+ <p:html>
+ <h1>This is more complex HTML</h1>
+ <ul>
+ <li>one</li>
+ <li>two</li>
+ <li>three</li>
+ </ul>
+ </p:html>
+
+
+ <p:html>
+ <s:formattedText value="*This* /is/ |Seam Text| as HTML. It's very^cool^." />
+ </p:html>
+</p:document>
Modified: branches/Seam_2_0/examples/itext/view/index.xhtml
===================================================================
--- branches/Seam_2_0/examples/itext/view/index.xhtml 2008-01-25 20:36:19 UTC (rev 7241)
+++ branches/Seam_2_0/examples/itext/view/index.xhtml 2008-01-25 23:28:30 UTC (rev 7242)
@@ -34,6 +34,8 @@
<li><s:link view="/table.xhtml" value="Tables" /></li>
<li><s:link view="/nested.xhtml" value="Nested Tables" /></li>
<li><s:link view="/html.xhtml" value="HTML Conversion" /></li>
+ <li><s:link view="/swing.xhtml" value="Swing Component" /></li>
+
<li><s:link view="/chart.xhtml" value="JFreeChart" />
[<s:link view="/chartimage.xhtml" value="HTML" />]
</li>
Added: branches/Seam_2_0/examples/itext/view/swing.xhtml
===================================================================
--- branches/Seam_2_0/examples/itext/view/swing.xhtml (rev 0)
+++ branches/Seam_2_0/examples/itext/view/swing.xhtml 2008-01-25 23:28:30 UTC (rev 7242)
@@ -0,0 +1,12 @@
+<p:document xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:p="http://jboss.com/products/seam/pdf">
+
+
+ <p:paragraph>A JLabel, from Java: </p:paragraph>
+ <p:swing width="310" height="120" component="#{swing.button}" />
+
+ <p:paragraph>A JButton, defined in components.xml: </p:paragraph>
+ <p:swing width="310" height="120" component="#{sampleButton}" />
+
+</p:document>
16 years, 3 months
Seam SVN: r7241 - branches/Seam_2_0/src/main/org/jboss/seam/persistence.
by seam-commits@lists.jboss.org
Author: epbernard
Date: 2008-01-25 15:36:19 -0500 (Fri, 25 Jan 2008)
New Revision: 7241
Modified:
branches/Seam_2_0/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java
branches/Seam_2_0/src/main/org/jboss/seam/persistence/HibernateSessionProxy.java
Log:
JBSEAM-2516 JBSEAM-2243 HibernateSessionProxy now implements EventSource
Modified: branches/Seam_2_0/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java
===================================================================
--- branches/Seam_2_0/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java 2008-01-25 20:36:00 UTC (rev 7240)
+++ branches/Seam_2_0/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java 2008-01-25 20:36:19 UTC (rev 7241)
@@ -258,8 +258,11 @@
{
try
{
- return (EntityManager) FULL_TEXT_ENTITYMANAGER_PROXY_CONSTRUCTOR.newInstance( FULL_TEXT_ENTITYMANAGER_CONSTRUCTOR.invoke(null, entityManager) );
- }
+ return (EntityManager) FULL_TEXT_ENTITYMANAGER_PROXY_CONSTRUCTOR.newInstance(
+ FULL_TEXT_ENTITYMANAGER_CONSTRUCTOR.invoke(null, super.proxyEntityManager( entityManager) )
+ //TODO is double wrapping the right choice? ie to wrap the session?
+ );
+ }
catch (Exception e)
{
//throw new RuntimeException("could not proxy FullTextEntityManager", e);
Modified: branches/Seam_2_0/src/main/org/jboss/seam/persistence/HibernateSessionProxy.java
===================================================================
--- branches/Seam_2_0/src/main/org/jboss/seam/persistence/HibernateSessionProxy.java 2008-01-25 20:36:00 UTC (rev 7240)
+++ branches/Seam_2_0/src/main/org/jboss/seam/persistence/HibernateSessionProxy.java 2008-01-25 20:36:19 UTC (rev 7241)
@@ -5,6 +5,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import org.hibernate.CacheMode;
import org.hibernate.Criteria;
@@ -28,8 +29,11 @@
import org.hibernate.engine.QueryParameters;
import org.hibernate.engine.SessionFactoryImplementor;
import org.hibernate.engine.SessionImplementor;
+import org.hibernate.engine.ActionQueue;
+import org.hibernate.engine.EntityEntry;
import org.hibernate.engine.query.sql.NativeSQLQuerySpecification;
import org.hibernate.event.EventListeners;
+import org.hibernate.event.EventSource;
import org.hibernate.impl.CriteriaImpl;
import org.hibernate.jdbc.Batcher;
import org.hibernate.jdbc.JDBCContext;
@@ -44,9 +48,11 @@
* DetachedCriteria casts the Session to SessionImplementor.
*
* @author Gavin King
+ * @author Emmanuel Bernard
+ * FIXME: EventSource should not really be there, remove once HSearch is fixed
*
*/
-public class HibernateSessionProxy implements Session, SessionImplementor
+public class HibernateSessionProxy implements Session, SessionImplementor, EventSource
{
private Session delegate;
@@ -405,6 +411,11 @@
return (SessionImplementor) delegate;
}
+ private EventSource getDelegateEventSource()
+ {
+ return (EventSource) delegate;
+ }
+
public void afterScrollOperation()
{
getDelegateSessionImplementor().afterScrollOperation();
@@ -619,5 +630,40 @@
{
getDelegateSessionImplementor().setFetchProfile(arg0);
}
-
+
+ public ActionQueue getActionQueue() {
+ return getDelegateEventSource().getActionQueue();
+ }
+
+ public Object instantiate(EntityPersister entityPersister, Serializable serializable) throws HibernateException {
+ return getDelegateEventSource().instantiate( entityPersister, serializable );
+ }
+
+ public void forceFlush(EntityEntry entityEntry) throws HibernateException {
+ getDelegateEventSource().forceFlush( entityEntry );
+ }
+
+ public void merge(String s, Object o, Map map) throws HibernateException {
+ getDelegateEventSource().merge( s, o, map );
+ }
+
+ public void persist(String s, Object o, Map map) throws HibernateException {
+ getDelegateEventSource().persist( s, o, map );
+ }
+
+ public void persistOnFlush(String s, Object o, Map map) {
+ getDelegateEventSource().persistOnFlush( s, o, map );
+ }
+
+ public void refresh(Object o, Map map) throws HibernateException {
+ getDelegateEventSource().refresh( o, map );
+ }
+
+ public void saveOrUpdateCopy(String s, Object o, Map map) throws HibernateException {
+ getDelegateEventSource().saveOrUpdateCopy( s, o , map );
+ }
+
+ public void delete(String s, Object o, boolean b, Set set) {
+ getDelegateEventSource().delete( s, o, b, set );
+ }
}
16 years, 3 months
Seam SVN: r7240 - trunk/src/main/org/jboss/seam/persistence.
by seam-commits@lists.jboss.org
Author: epbernard
Date: 2008-01-25 15:36:00 -0500 (Fri, 25 Jan 2008)
New Revision: 7240
Modified:
trunk/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java
trunk/src/main/org/jboss/seam/persistence/HibernateSessionProxy.java
Log:
JBSEAM-2516 JBSEAM-2243 HibernateSessionProxy now implements EventSource
Modified: trunk/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java
===================================================================
--- trunk/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java 2008-01-25 17:52:46 UTC (rev 7239)
+++ trunk/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java 2008-01-25 20:36:00 UTC (rev 7240)
@@ -258,8 +258,11 @@
{
try
{
- return (EntityManager) FULL_TEXT_ENTITYMANAGER_PROXY_CONSTRUCTOR.newInstance( FULL_TEXT_ENTITYMANAGER_CONSTRUCTOR.invoke(null, entityManager) );
- }
+ return (EntityManager) FULL_TEXT_ENTITYMANAGER_PROXY_CONSTRUCTOR.newInstance(
+ FULL_TEXT_ENTITYMANAGER_CONSTRUCTOR.invoke(null, super.proxyEntityManager( entityManager) )
+ //TODO is double wrapping the right choice? ie to wrap the session?
+ );
+ }
catch (Exception e)
{
//throw new RuntimeException("could not proxy FullTextEntityManager", e);
Modified: trunk/src/main/org/jboss/seam/persistence/HibernateSessionProxy.java
===================================================================
--- trunk/src/main/org/jboss/seam/persistence/HibernateSessionProxy.java 2008-01-25 17:52:46 UTC (rev 7239)
+++ trunk/src/main/org/jboss/seam/persistence/HibernateSessionProxy.java 2008-01-25 20:36:00 UTC (rev 7240)
@@ -5,6 +5,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import org.hibernate.CacheMode;
import org.hibernate.Criteria;
@@ -28,8 +29,11 @@
import org.hibernate.engine.QueryParameters;
import org.hibernate.engine.SessionFactoryImplementor;
import org.hibernate.engine.SessionImplementor;
+import org.hibernate.engine.ActionQueue;
+import org.hibernate.engine.EntityEntry;
import org.hibernate.engine.query.sql.NativeSQLQuerySpecification;
import org.hibernate.event.EventListeners;
+import org.hibernate.event.EventSource;
import org.hibernate.impl.CriteriaImpl;
import org.hibernate.jdbc.Batcher;
import org.hibernate.jdbc.JDBCContext;
@@ -44,9 +48,11 @@
* DetachedCriteria casts the Session to SessionImplementor.
*
* @author Gavin King
+ * @author Emmanuel Bernard
+ * FIXME: EventSource should not really be there, remove once HSearch is fixed
*
*/
-public class HibernateSessionProxy implements Session, SessionImplementor
+public class HibernateSessionProxy implements Session, SessionImplementor, EventSource
{
private Session delegate;
@@ -405,6 +411,11 @@
return (SessionImplementor) delegate;
}
+ private EventSource getDelegateEventSource()
+ {
+ return (EventSource) delegate;
+ }
+
public void afterScrollOperation()
{
getDelegateSessionImplementor().afterScrollOperation();
@@ -619,5 +630,40 @@
{
getDelegateSessionImplementor().setFetchProfile(arg0);
}
-
+
+ public ActionQueue getActionQueue() {
+ return getDelegateEventSource().getActionQueue();
+ }
+
+ public Object instantiate(EntityPersister entityPersister, Serializable serializable) throws HibernateException {
+ return getDelegateEventSource().instantiate( entityPersister, serializable );
+ }
+
+ public void forceFlush(EntityEntry entityEntry) throws HibernateException {
+ getDelegateEventSource().forceFlush( entityEntry );
+ }
+
+ public void merge(String s, Object o, Map map) throws HibernateException {
+ getDelegateEventSource().merge( s, o, map );
+ }
+
+ public void persist(String s, Object o, Map map) throws HibernateException {
+ getDelegateEventSource().persist( s, o, map );
+ }
+
+ public void persistOnFlush(String s, Object o, Map map) {
+ getDelegateEventSource().persistOnFlush( s, o, map );
+ }
+
+ public void refresh(Object o, Map map) throws HibernateException {
+ getDelegateEventSource().refresh( o, map );
+ }
+
+ public void saveOrUpdateCopy(String s, Object o, Map map) throws HibernateException {
+ getDelegateEventSource().saveOrUpdateCopy( s, o , map );
+ }
+
+ public void delete(String s, Object o, boolean b, Set set) {
+ getDelegateEventSource().delete( s, o, b, set );
+ }
}
16 years, 3 months
Seam SVN: r7239 - branches/Seam_2_0/doc/reference/en/modules.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-01-25 12:52:46 -0500 (Fri, 25 Jan 2008)
New Revision: 7239
Modified:
branches/Seam_2_0/doc/reference/en/modules/annotations.xml
Log:
backport r7238 (JBSEAM-2536)
Modified: branches/Seam_2_0/doc/reference/en/modules/annotations.xml
===================================================================
--- branches/Seam_2_0/doc/reference/en/modules/annotations.xml 2008-01-25 17:45:31 UTC (rev 7238)
+++ branches/Seam_2_0/doc/reference/en/modules/annotations.xml 2008-01-25 17:52:46 UTC (rev 7239)
@@ -733,8 +733,10 @@
default behavior of a session bean component. ie. method invocations should take place in a
transaction, and if no transaction exists when the method is called, a transaction will be
started just for that method. This annotation may be applied at either class or method level.
- <emphasis>Do not use this annotations on EJB 3.0 components, use <literal>@TransactionAttribute</literal>!</emphasis>
</para>
+ <para>
+ <emphasis>Do not use this annotation on EJB 3.0 components, use <literal>@TransactionAttribute</literal>!</emphasis>
+ </para>
</listitem>
</varlistentry>
<varlistentry>
@@ -742,10 +744,36 @@
<literal>@ApplicationException</literal>
</term>
<listitem>
- <programlisting><![CDATA[@Transactional]]></programlisting>
+ <programlisting><![CDATA[@ApplicationException]]></programlisting>
<para>
- TDB
+ Synonym for javax.ejb.ApplicationException, for use in a
+ pre Java EE 5 environment. Applied to an exception to
+ denote that it is an application exception and should be
+ reported to the client directly(i.e., unwrapped).
</para>
+ <para>
+ <emphasis>Do not use this
+ annotation on EJB 3.0 components, use
+ <literal>@javax.ejb.ApplicationException</literal> instead</emphasis>.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>rollback</literal> — by default
+ <literal>false</literal>, if <literal>true</literal>
+ this exception should set the transaction to
+ rollback only
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>end</literal> — by default
+ <literal>false</literal>, if <literal>true</literal>
+ this exception should end the current
+ long-running conversation
+ </para>
+ </listitem>
+ </itemizedlist>
</listitem>
</varlistentry>
<varlistentry>
@@ -753,17 +781,25 @@
<literal>@Interceptors</literal>
</term>
<listitem>
- <programlisting><![CDATA[@Transactional]]></programlisting>
+ <programlisting><![CDATA[@Interceptors({DVDInterceptor, CDInterceptor})]]></programlisting>
<para>
- TDB
+ Synonym for javax.interceptors.Interceptors, for use in
+ a pre Java EE 5 environment. Note that this may only be
+ used as a meta-annotation. Declares an ordered list of
+ interceptors for a class or method.
</para>
+ <para>
+ <emphasis>Do not use this
+ annotations on EJB 3.0 components, use
+ <literal>@javax.interceptor.Interceptors</literal> instead</emphasis>.
+ </para>
</listitem>
</varlistentry>
</variablelist>
<para>
These annotations are mostly useful for JavaBean Seam components. If you use EJB 3.0 components, you
- should use the standard <literal>@TransactionAttribute</literal> annotation.
+ should use the standard Java EE5 annotation.
</para>
</section>
16 years, 3 months
Seam SVN: r7238 - trunk/doc/reference/en/modules.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-01-25 12:45:31 -0500 (Fri, 25 Jan 2008)
New Revision: 7238
Modified:
trunk/doc/reference/en/modules/annotations.xml
Log:
JBSEAM-2536
Modified: trunk/doc/reference/en/modules/annotations.xml
===================================================================
--- trunk/doc/reference/en/modules/annotations.xml 2008-01-25 16:04:28 UTC (rev 7237)
+++ trunk/doc/reference/en/modules/annotations.xml 2008-01-25 17:45:31 UTC (rev 7238)
@@ -733,8 +733,10 @@
default behavior of a session bean component. ie. method invocations should take place in a
transaction, and if no transaction exists when the method is called, a transaction will be
started just for that method. This annotation may be applied at either class or method level.
- <emphasis>Do not use this annotations on EJB 3.0 components, use <literal>@TransactionAttribute</literal>!</emphasis>
</para>
+ <para>
+ <emphasis>Do not use this annotation on EJB 3.0 components, use <literal>@TransactionAttribute</literal>!</emphasis>
+ </para>
</listitem>
</varlistentry>
<varlistentry>
@@ -742,10 +744,36 @@
<literal>@ApplicationException</literal>
</term>
<listitem>
- <programlisting><![CDATA[@Transactional]]></programlisting>
+ <programlisting><![CDATA[@ApplicationException]]></programlisting>
<para>
- TDB
+ Synonym for javax.ejb.ApplicationException, for use in a
+ pre Java EE 5 environment. Applied to an exception to
+ denote that it is an application exception and should be
+ reported to the client directly(i.e., unwrapped).
</para>
+ <para>
+ <emphasis>Do not use this
+ annotation on EJB 3.0 components, use
+ <literal>@javax.ejb.ApplicationException</literal> instead</emphasis>.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>rollback</literal> — by default
+ <literal>false</literal>, if <literal>true</literal>
+ this exception should set the transaction to
+ rollback only
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>end</literal> — by default
+ <literal>false</literal>, if <literal>true</literal>
+ this exception should end the current
+ long-running conversation
+ </para>
+ </listitem>
+ </itemizedlist>
</listitem>
</varlistentry>
<varlistentry>
@@ -753,17 +781,25 @@
<literal>@Interceptors</literal>
</term>
<listitem>
- <programlisting><![CDATA[@Transactional]]></programlisting>
+ <programlisting><![CDATA[@Interceptors({DVDInterceptor, CDInterceptor})]]></programlisting>
<para>
- TDB
+ Synonym for javax.interceptors.Interceptors, for use in
+ a pre Java EE 5 environment. Note that this may only be
+ used as a meta-annotation. Declares an ordered list of
+ interceptors for a class or method.
</para>
+ <para>
+ <emphasis>Do not use this
+ annotations on EJB 3.0 components, use
+ <literal>@javax.interceptor.Interceptors</literal> instead</emphasis>.
+ </para>
</listitem>
</varlistentry>
</variablelist>
<para>
These annotations are mostly useful for JavaBean Seam components. If you use EJB 3.0 components, you
- should use the standard <literal>@TransactionAttribute</literal> annotation.
+ should use the standard Java EE5 annotation.
</para>
</section>
16 years, 3 months
Seam SVN: r7237 - trunk/src/jbas5/org/jboss/seam/as5/vfs.
by seam-commits@lists.jboss.org
Author: alesj
Date: 2008-01-25 11:04:28 -0500 (Fri, 25 Jan 2008)
New Revision: 7237
Modified:
trunk/src/jbas5/org/jboss/seam/as5/vfs/VFSScanner.java
Log:
Additional exception info.
Modified: trunk/src/jbas5/org/jboss/seam/as5/vfs/VFSScanner.java
===================================================================
--- trunk/src/jbas5/org/jboss/seam/as5/vfs/VFSScanner.java 2008-01-25 16:03:36 UTC (rev 7236)
+++ trunk/src/jbas5/org/jboss/seam/as5/vfs/VFSScanner.java 2008-01-25 16:04:28 UTC (rev 7237)
@@ -104,7 +104,7 @@
while(parentDepth > 0)
{
if (top == null)
- throw new IllegalArgumentException("Null parent: " + vfsurl);
+ throw new IllegalArgumentException("Null parent: " + vfsurl + ", relative: " + relative);
top = top.getParent();
parentDepth--;
}
16 years, 3 months
Seam SVN: r7236 - branches/Seam_2_0/doc/reference/en/modules.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-01-25 11:03:36 -0500 (Fri, 25 Jan 2008)
New Revision: 7236
Modified:
branches/Seam_2_0/doc/reference/en/modules/conversations.xml
Log:
Backport of r7233 (Remove explicit conversation id docs, merge in blog article to natural conversation docs)
Modified: branches/Seam_2_0/doc/reference/en/modules/conversations.xml
===================================================================
--- branches/Seam_2_0/doc/reference/en/modules/conversations.xml 2008-01-25 15:45:10 UTC (rev 7235)
+++ branches/Seam_2_0/doc/reference/en/modules/conversations.xml 2008-01-25 16:03:36 UTC (rev 7236)
@@ -559,61 +559,71 @@
</section>
<section>
- <title>Using an "explicit" conversation id</title>
- <para>
- Ordinarily, Seam generates a meaningless unique id for each conversation
- in each session. You can customize the id value when you begin the
- conversation.
- </para>
-
- <para>
- This feature can be used to customize the conversation id generation
- algorithm like so:
- </para>
-
- <programlisting><![CDATA[@Begin(id="#{myConversationIdGenerator.nextId}")
-public void editHotel() { ... }]]></programlisting>
-
- <para>
- Or it can be used to assign a meaningful conversation id:
- </para>
-
- <programlisting><![CDATA[@Begin(id="hotel#{hotel.id}")
-public String editHotel() { ... }]]></programlisting>
-
- <programlisting><![CDATA[@Begin(id="hotel#{hotelsDataModel.rowData.id}")
-public String selectHotel() { ... }]]></programlisting>
-
- <programlisting><![CDATA[@Begin(id="entry#{params['blogId']}")
-public String viewBlogEntry() { ... }]]></programlisting>
-
- <programlisting><![CDATA[@BeginTask(id="task#{taskInstance.id}")
-public String approveDocument() { ... }]]></programlisting>
-
- <para>
- Clearly, these example result in the same conversation id every time
- a particular hotel, blog or task is selected. So what happens if a conversation
- with the same conversation id already exists when the new conversation
- begins? Well, Seam detects the existing conversation and redirects
- to that conversation without running the <literal>@Begin</literal>
- method again. This feature helps control the number of workspaces
- that are created when using workspace management.
- </para>
-
- </section>
-
- <section>
<title>Natural conversation ids</title>
<para>
When working with conversations that deal with persistent objects, it may be
desirable to use the natural business key of the object instead of the standard,
- "surrogate" conversation id.
+ "surrogate" conversation id:
</para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis>Easy redirect to existing conversation</emphasis>
+ </para>
+ <para>
+ It can be useful to redirect to an existing conversation if
+ the user requests the same operation twice. Take this example:
+ </para>
+ <quote>
+ You are on ebay, half way through paying for an item you just
+ won as a Christmas present for your parents. Lets say you're
+ sending it straight to them - you enter your payment details
+ but you can't remember their address. You accidentally reuse
+ the same browser window finding out their address. Now you
+ need to return to the payment for the item.
+ </quote>
+ <para>
+ With a natural conversation its really easy to have the user
+ rejoin the existing conversation, and pick up where they left
+ off - just have them to rejoin the payForItem conversation
+ with the itemId as the conversation id.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>User friendly URLs</emphasis>
+ </para>
+
+ <para>
+ For me this consists of a navigable
+ hierarchy (I can navigate by editing the url) and a meaningful
+ URL (like this Wiki uses - so don't identify things by random
+ ids). For some applications user friendly URLs are less
+ important, of course.
+ </para>
+
+ <para>
+ With a natural conversations, when you are building your hotel
+ booking system (or, of course, whatever your app is) you can
+ generate a URL like
+ <literal>http://seam-hotels/book.seam?hotel=BestWesternAntwerpen</literal>
+ (of course, whatever parameter <literal>hotel</literal> maps
+ to on your domain model must be unique) and with URLRewrite
+ easily transform this to
+ http://seam-hotels/book/BestWesternAntwerpen.
+ </para>
+
+ <para>
+ Much better!
+ </para>
+ </listitem>
+ </itemizedlist>
+
<section>
- <title>Configuration</title>
+ <title>Creating a natural conversation</title>
<para>
- Natural conversations are configured in <literal>pages.xml</literal>:
+ Natural conversations are defined in <literal>pages.xml</literal>:
</para>
<programlisting><![CDATA[ <conversation name="PlaceBid"
@@ -621,7 +631,7 @@
parameter-value="#{auction.auctionId}"/>]]></programlisting>
<para>
- The first thing to note from the above configuration is that the conversation
+ The first thing to note from the above definition is that the conversation
has a name, in this case <literal>PlaceBid</literal>. This name uniquely
identifies this particular named conversation, and is used by the
<literal>page</literal> definition to identify a named conversation to participate
@@ -631,8 +641,7 @@
<para>
The next attribute, <literal>parameter-name</literal> defines the request parameter
that will contain the natural conversation id, in place of the default conversation
- id parameter (which is typically either <literal>cid</literal> or <literal>conversationId</literal>).
- In this example, the <literal>parameter-name</literal> is <literal>auctionId</literal>.
+ id parameter. In this example, the <literal>parameter-name</literal> is <literal>auctionId</literal>.
This means that instead of a conversation parameter like <literal>cid=123</literal>
appearing in the URL for your page, it will contain <literal>auctionId=765432</literal>
instead.
@@ -646,7 +655,7 @@
</para>
<para>
- The next step is to configure which pages will participate in the named conversation.
+ Next, we define which pages will participate in the named conversation.
This is done by specifying the <literal>conversation</literal> attribute for a
<literal>page</literal> definition:
</para>
@@ -669,7 +678,7 @@
<para>
When starting, or redirecting to, a natural conversation there are a number
of options for specifying the natural conversation name. Let's start by looking at
- the following page configuration:
+ the following page definition:
</para>
<programlisting><![CDATA[ <page view-id="/auction.xhtml">
@@ -683,7 +692,7 @@
<para>
From here, we can see that invoking the action <literal>#{bidAction.placeBid}</literal>
from our auction view (by the way, all these examples are taken from the seamBay example in Seam),
- that we will be redirected to <literal>/bid.xhtml</literal>, which as we saw previously
+ that we will be redirected to <literal>/bid.xhtml</literal>, which, as we saw previously,
is configured with the natural conversation <literal>PlaceBid</literal>. The declaration for
our action method looks like this:
</para>
@@ -696,7 +705,7 @@
redirection to the named conversation occurs as part of navigation rules, after the
action method has already been invoked. This is a problem when redirecting to an
existing conversation, as redirection needs to be occur before the action method is
- invoked. To cater for this, it is necessary to specify the conversation name when
+ invoked. Therefore it is necessary to specify the conversation name when
the action is invoked. One way of doing this is by using the <literal>s:conversationName</literal>
tag:
</para>
16 years, 3 months
Seam SVN: r7235 - trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/dao.
by seam-commits@lists.jboss.org
Author: christian.bauer(a)jboss.com
Date: 2008-01-25 10:45:10 -0500 (Fri, 25 Jan 2008)
New Revision: 7235
Modified:
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/dao/UserDAO.java
Log:
Fix NPE
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/dao/UserDAO.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/dao/UserDAO.java 2008-01-25 14:21:26 UTC (rev 7234)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/dao/UserDAO.java 2008-01-25 15:45:10 UTC (rev 7235)
@@ -65,10 +65,11 @@
}
public long findRatingPoints(Long userId) {
- return (Long)entityManager
+ Object ratingPoints = entityManager
.createQuery("select sum(n.rating) from WikiNode n where n.createdBy.id = :userId")
.setParameter("userId", userId)
.getSingleResult();
+ return ratingPoints != null ? (Long)ratingPoints : 0;
}
public void resetNodeCreatorToAdmin(User user) {
16 years, 3 months