[seam-commits] Seam SVN: r7431 - in trunk/examples/wiki: src/main/org/jboss/seam/wiki/core/action and 10 other directories.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Sat Feb 16 10:37:42 EST 2008


Author: christian.bauer at jboss.com
Date: 2008-02-16 10:37:41 -0500 (Sat, 16 Feb 2008)
New Revision: 7431

Added:
   trunk/examples/wiki/view/themes/inrelationto/mailtemplates/resetPassword.xhtml
Modified:
   trunk/examples/wiki/src/etc/i18n/messages_tags_en.properties
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/TagEditor.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/FeedServlet.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/feedAggregator/FeedAggregator.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/tags/TagsAggregator.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/tags/TagsPreferences.java
   trunk/examples/wiki/view/includes/tagEditor.xhtml
   trunk/examples/wiki/view/plugins/feedAggregator/plugin.xhtml
   trunk/examples/wiki/view/tagDisplay_d.xhtml
   trunk/examples/wiki/view/themes/default/css/template.css
   trunk/examples/wiki/view/themes/inrelationto/css/inrelationto.css
   trunk/examples/wiki/view/themes/sfwkorg/css/sfwk.css
Log:
Implemented tag cloud

Modified: trunk/examples/wiki/src/etc/i18n/messages_tags_en.properties
===================================================================
--- trunk/examples/wiki/src/etc/i18n/messages_tags_en.properties	2008-02-16 15:30:10 UTC (rev 7430)
+++ trunk/examples/wiki/src/etc/i18n/messages_tags_en.properties	2008-02-16 15:37:41 UTC (rev 7431)
@@ -2,6 +2,7 @@
 tags.preferences.LinkToCurrentDocument=Link to current (aggregator) document
 tags.preferences.MaxNumberOfTags=Maximum number of tags displayed
 tags.preferences.MinimumCount=Minimum number of occurences of a tag
+tags.preferences.Cloud=Display tags as cloud (not list)
 
 tags.label.Tags=Tags
 tags.label.All=All...

Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/TagEditor.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/TagEditor.java	2008-02-16 15:30:10 UTC (rev 7430)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/TagEditor.java	2008-02-16 15:37:41 UTC (rev 7431)
@@ -88,7 +88,7 @@
 
     public List<DisplayTagCount> getPopularTags() {
         // Load 6 most popular tags
-        if (popularTags == null) popularTags = tagDAO.findTagCounts(wikiRoot, null, 6, 1l);
+        if (popularTags == null) popularTags = tagDAO.findTagCounts(wikiRoot, null, 12, 1l);
 
         // Filter out the ones we already have
         List<DisplayTagCount> filtered = new ArrayList<DisplayTagCount>();

Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/FeedServlet.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/FeedServlet.java	2008-02-16 15:30:10 UTC (rev 7430)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/FeedServlet.java	2008-02-16 15:37:41 UTC (rev 7431)
@@ -231,8 +231,10 @@
             if (startedTx) userTx.commit();
         } catch (Exception ex) {
             try {
-                if (startedTx && userTx.getStatus() != javax.transaction.Status.STATUS_MARKED_ROLLBACK)
+                if (startedTx && userTx.getStatus() != javax.transaction.Status.STATUS_MARKED_ROLLBACK) {
+                    log.error("error serving feed, setting transaction to rollback only");
                     userTx.setRollbackOnly();
+                }
             } catch (Exception rbEx) {
                 rbEx.printStackTrace();
             }

Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/feedAggregator/FeedAggregator.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/feedAggregator/FeedAggregator.java	2008-02-16 15:30:10 UTC (rev 7430)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/feedAggregator/FeedAggregator.java	2008-02-16 15:37:41 UTC (rev 7431)
@@ -58,9 +58,12 @@
             log.debug("aggregating under subscribable identifier: "+ aggregateId);
         }
 
+        int numberOfEntries =
+                prefs.getNumberOfFeedEntries() != null ? prefs.getNumberOfFeedEntries().intValue() : 10;
+
         feedEntries =
             feedAggregatorDAO.getLatestFeedEntries(
-                prefs.getNumberOfFeedEntries().intValue(),
+                numberOfEntries,
                 validURLs.toArray(new URL[validURLs.size()]),
                 aggregateId
             );

Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/tags/TagsAggregator.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/tags/TagsAggregator.java	2008-02-16 15:30:10 UTC (rev 7430)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/tags/TagsAggregator.java	2008-02-16 15:37:41 UTC (rev 7431)
@@ -41,6 +41,21 @@
                         prefs.getMaxNumberOfTags() != null ? prefs.getMaxNumberOfTags().intValue() : 0,
                         prefs.getMinimumCount() != null ? prefs.getMinimumCount() : 1l
                 );
+        for (DisplayTagCount tagCount : tagsSortedByCount) {
+            if (tagCount.getCount() < lowestTagCount) lowestTagCount = tagCount.getCount();
+            if (tagCount.getCount() > highestTagCount) highestTagCount= tagCount.getCount();
+        }
     }
 
+    private long highestTagCount = 0l;
+    private long lowestTagCount = 0l;
+    public long getHighestTagCount() {
+        return highestTagCount;
+    }
+
+    public long getLowestTagCount() {
+        return lowestTagCount;
+    }
+
+    
 }

Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/tags/TagsPreferences.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/tags/TagsPreferences.java	2008-02-16 15:30:10 UTC (rev 7430)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/tags/TagsPreferences.java	2008-02-16 15:37:41 UTC (rev 7431)
@@ -41,6 +41,12 @@
     @Range(min = 1l, max = 99l)
     private Long minimumCount;
 
+    @PreferenceProperty(
+        description = "#{messages['tags.preferences.Cloud']}",
+        visibility = {PreferenceVisibility.INSTANCE}
+    )
+    private Boolean cloud;
+
     public Boolean getLinkToCurrentDocument() {
         return linkToCurrentDocument;
     }
@@ -52,4 +58,8 @@
     public Long getMinimumCount() {
         return minimumCount;
     }
+
+    public Boolean getCloud() {
+        return cloud;
+    }
 }

Modified: trunk/examples/wiki/view/includes/tagEditor.xhtml
===================================================================
--- trunk/examples/wiki/view/includes/tagEditor.xhtml	2008-02-16 15:30:10 UTC (rev 7430)
+++ trunk/examples/wiki/view/includes/tagEditor.xhtml	2008-02-16 15:37:41 UTC (rev 7431)
@@ -8,43 +8,50 @@
        xmlns:s="http://jboss.com/products/seam/taglib">
 
     <a:region>
-        <s:decorate id="removeTagsDecorate" template="formFieldDecorate.xhtml">
-            <ui:define name="label">#{messages['lacewiki.label.tagEdit.RemoveTags']}</ui:define>
+        <s:div id="removeTags" styleClass="entry">
+            <s:div styleClass="label">
+                <h:outputText value="#{messages['lacewiki.label.tagEdit.RemoveTags']}:"/>
+            </s:div>
+            <s:div styleClass="multiLineInput">
+                <s:fragment rendered="#{empty tagEditor.tags}">
+                    <h:outputText value="#{messages['lacewiki.label.tagEdit.NoTags']}"/>
+                </s:fragment>
+                <ui:repeat var="tag" value="#{tagEditor.tagsAsList}">
+                    <s:span styleClass="undecoratedLink">
+                        <a:commandLink tabindex="1" oncomplete="onAjaxRequestComplete()" status="globalStatus"
+                                       action="#{tagEditor.removeTag(tag)}"
+                                       reRender="removeTags, popularTags, newTagDecorate">
+                            <h:outputText styleClass="noWrapWhitespace" value="#{tag}"/>
+                        </a:commandLink>
+                    </s:span>
+                    <h:outputText rendered="#{not wiki:isLastItemInList(tagEditor.tagsAsList, tag)}" value="&#160;| "/>
+                </ui:repeat>
+            </s:div>
+        </s:div>
 
-            <s:fragment rendered="#{empty tagEditor.tags}">
-                <h:outputText value="#{messages['lacewiki.label.tagEdit.NoTags']}"/>
-            </s:fragment>
-            <ui:repeat var="tag" value="#{tagEditor.tagsAsList}">
-                <s:span styleClass="undecoratedLink">
-                    <a:commandLink tabindex="1" oncomplete="onAjaxRequestComplete()" status="globalStatus"
-                                   action="#{tagEditor.removeTag(tag)}"
-                                   reRender="removeTagsDecorate, popularTagsDecorate, newTagDecorate">
-                        <h:outputText value="#{tag}"/>
-                    </a:commandLink>
-                </s:span>
-                <h:outputText rendered="#{not wiki:isLastItemInList(tagEditor.tagsAsList, tag)}" value="&#160;|&#160;"/>
-            </ui:repeat>
+        <s:div id="popularTags" styleClass="entry">
+            <s:div styleClass="label">
+                <h:outputText value="#{messages['lacewiki.label.tagEdit.AddPopularTags']}:"/>
+            </s:div>
+            <s:div styleClass="multiLineInput">
+                <s:fragment rendered="#{empty tagEditor.popularTags}">
+                    <h:outputText value="#{messages['lacewiki.label.tagEdit.NoPopularTags']}"/>
+                </s:fragment>
+                <s:div>
+                    <ui:repeat var="tagCount" value="#{tagEditor.popularTags}">
+                        <s:span styleClass="undecoratedLink">
+                            <a:commandLink tabindex="1" oncomplete="onAjaxRequestComplete()" status="globalStatus"
+                                           action="#{tagEditor.addTag(tagCount.tag)}"
+                                           reRender="removeTags, popularTags, newTagDecorate">
+                                <h:outputText styleClass="noWrapWhitespace" value="#{tagCount.tag}"/>
+                            </a:commandLink>
+                        </s:span>
+                        <h:outputText rendered="#{not wiki:isLastItemInList(tagEditor.popularTags, tagCount)}" value="&#160;| "/>
+                    </ui:repeat>
+                </s:div>
+            </s:div>
+        </s:div>
 
-        </s:decorate>
-
-        <s:decorate id="popularTagsDecorate" template="formFieldDecorate.xhtml">
-            <ui:define name="label">#{messages['lacewiki.label.tagEdit.AddPopularTags']}</ui:define>
-
-            <s:fragment rendered="#{empty tagEditor.popularTags}">
-                <h:outputText value="#{messages['lacewiki.label.tagEdit.NoPopularTags']}"/>
-            </s:fragment>
-            <ui:repeat var="tagCount" value="#{tagEditor.popularTags}">
-                <s:span styleClass="undecoratedLink">
-                    <a:commandLink tabindex="1" oncomplete="onAjaxRequestComplete()" status="globalStatus"
-                                   action="#{tagEditor.addTag(tagCount.tag)}"
-                                   reRender="removeTagsDecorate, popularTagsDecorate, newTagDecorate">
-                        <h:outputText value="#{tagCount.tag}"/>
-                    </a:commandLink>
-                </s:span>
-                <h:outputText rendered="#{not wiki:isLastItemInList(tagEditor.popularTags, tagCount)}" value="&#160;|&#160;"/>
-            </ui:repeat>
-        </s:decorate>
-
         <s:decorate id="newTagDecorate" template="formFieldDecorate.xhtml">
             <ui:define name="label">#{messages['lacewiki.label.tagEdit.NewTag']}</ui:define>
                 <h:panelGroup>
@@ -53,7 +60,7 @@
                     <a:commandLink tabindex="1" styleClass="buttonNonpersistent" oncomplete="onAjaxRequestComplete()"
                                    status="globalStatus"
                                    action="#{tagEditor.addNewTag}"
-                                   reRender="removeTagsDecorate, popularTagsDecorate, newTagDecorate">
+                                   reRender="removeTags, popularTags, newTagDecorate">
                         <h:outputText styleClass="buttonLabel" value="#{messages['lacewiki.button.tagEdit.Add']}"/>
                     </a:commandLink>
 

Modified: trunk/examples/wiki/view/plugins/feedAggregator/plugin.xhtml
===================================================================
--- trunk/examples/wiki/view/plugins/feedAggregator/plugin.xhtml	2008-02-16 15:30:10 UTC (rev 7430)
+++ trunk/examples/wiki/view/plugins/feedAggregator/plugin.xhtml	2008-02-16 15:37:41 UTC (rev 7431)
@@ -40,7 +40,7 @@
                 <h:column>
                     <s:div styleClass="feedEntryInfo smallFont">
 
-                        <s:span rendered="#{not preferences.get('FeedAggregator', currentMacro).hideDate}">
+                        <s:span rendered="#{not preferences.get('FeedAggregator', currentMacro).hideDate}" styleClass="noWrapWhitespace">
                             <h:outputText value="#{feDTO.feedEntry.publishedDate}" rendered="#{empty feDTO.feedEntry.updatedDate}">
                                 <f:convertDateTime pattern="dd. MMM yyyy, HH:mm" timeZone="#{preferences.get('Wiki').timeZone}"/>
                             </h:outputText>
@@ -50,13 +50,13 @@
                             <h:outputText value="&#160;#{preferences.get('Wiki').timeZone}"/>
                         </s:span>
 
-                        <s:span styleClass="undecoratedLink"
+                        <s:span styleClass="undecoratedLink noWrapWhitespace"
                                 rendered="#{not preferences.get('FeedAggregator', currentMacro).hideAuthor}">
                             <h:outputText value=",&#160;#{messages['feedAggregator.label.By']}&#160;"/>
                             <h:outputText styleClass="feedEntryAuthor" value="#{wiki:escapeAtSymbol(feDTO.feedEntry.author)}"/>
                         </s:span>
 
-                        <s:span styleClass="undecoratedLink"
+                        <s:span styleClass="undecoratedLink noWrapWhitespace"
                                 rendered="#{not preferences.get('FeedAggregator', currentMacro).hideFeedInfo}">
                             <h:outputText value="&#160;#{messages['feedAggregator.label.On']}&#160;"/>
                             <h:outputLink value="#{feDTO.feed.link}">

Modified: trunk/examples/wiki/view/tagDisplay_d.xhtml
===================================================================
--- trunk/examples/wiki/view/tagDisplay_d.xhtml	2008-02-16 15:30:10 UTC (rev 7430)
+++ trunk/examples/wiki/view/tagDisplay_d.xhtml	2008-02-16 15:37:41 UTC (rev 7431)
@@ -70,15 +70,15 @@
             <f:facet name="header">
                 <h:outputText value="#{messages['lacewiki.label.tagDisplay.InDirectory']}"/>
             </f:facet>
-            <h:graphicImage value="#{themePath}/img/icon.dir.gif"
-                            width="18" height="20" style="vertical-align: middle; margin-right: 5px;"/>
-            <s:link value="#{wiki:truncateString(file.parent.name, 20, '...')}" propagation="none"
-                    view="/dirDisplay_#{skin}.xhtml"
-                    rendered="#{s:hasPermission('Node','read',file.parent)}" tabindex="1">
-                <f:param name="directoryId" value="#{file.parent.id}"/>
-            </s:link>
+            <s:fragment rendered="#{s:hasPermission('Node','read',file.parent)}">
+                <h:graphicImage value="#{themePath}/img/icon.dir.gif"
+                                width="18" height="20" style="vertical-align: middle; margin-right: 5px;"/>
+                <h:outputLink value="#{wikiURLRenderer.renderURL(file.parent)}" tabindex="1">
+                    <h:outputText value="#{wiki:truncateString(file.parent.name, 20, '...')}"/>
+                </h:outputLink>
+            </s:fragment>
             <h:outputText value="#{wiki:truncateString(file.parent.name, 20, '...')}"
-                          rendered="#{!s:hasPermission('Node','read',file)}"/>
+                          rendered="#{!s:hasPermission('Node','read',file.parent)}"/>
         </h:column>
         <h:column>
             <f:facet name="header">

Modified: trunk/examples/wiki/view/themes/default/css/template.css
===================================================================
--- trunk/examples/wiki/view/themes/default/css/template.css	2008-02-16 15:30:10 UTC (rev 7430)
+++ trunk/examples/wiki/view/themes/default/css/template.css	2008-02-16 15:37:41 UTC (rev 7431)
@@ -604,10 +604,19 @@
     text-align: left;
 }
 
+.entry .multiLineInput {
+    text-align: left;
+    margin-left: 155px;
+}
+
 .wideLabels .entry .label {
     width: 220px;
 }
 
+.wideLabels .entry .multiLineInput {
+    margin-left: 240px;
+}
+
 .errorEntry {
     background-color: #ffeeee;
 }

Modified: trunk/examples/wiki/view/themes/inrelationto/css/inrelationto.css
===================================================================
--- trunk/examples/wiki/view/themes/inrelationto/css/inrelationto.css	2008-02-16 15:30:10 UTC (rev 7430)
+++ trunk/examples/wiki/view/themes/inrelationto/css/inrelationto.css	2008-02-16 15:37:41 UTC (rev 7431)
@@ -615,10 +615,19 @@
     text-align: left;
 }
 
+.entry .multiLineInput {
+    text-align: left;
+    margin-left: 155px;
+}
+
 .wideLabels .entry .label {
     width: 220px;
 }
 
+.wideLabels .entry .multiLineInput {
+    margin-left: 240px;
+}
+
 .errorEntry {
     background-color: #ffeeee;
 }

Copied: trunk/examples/wiki/view/themes/inrelationto/mailtemplates/resetPassword.xhtml (from rev 7424, trunk/examples/wiki/view/themes/default/mailtemplates/resetPassword.xhtml)
===================================================================
--- trunk/examples/wiki/view/themes/inrelationto/mailtemplates/resetPassword.xhtml	                        (rev 0)
+++ trunk/examples/wiki/view/themes/inrelationto/mailtemplates/resetPassword.xhtml	2008-02-16 15:37:41 UTC (rev 7431)
@@ -0,0 +1,49 @@
+<m:message xmlns="http://www.w3.org/1999/xhtml"
+            xmlns:m="http://jboss.com/products/seam/mail"
+            xmlns:h="http://java.sun.com/jsf/html"
+            xmlns:f="http://java.sun.com/jsf/core">
+    <m:header name="X-Sent-From" value="JBoss Seam" />
+    <m:header name="Precedence" value="list"/>
+    <m:from name="Seam Wiki" address="do-not-reply at jboss.com" />
+    <m:to name="#{resetPasswordOfUser.fullname}">#{resetPasswordOfUser.email}</m:to>
+    <m:subject>[LaceWiki] Password Reset Request</m:subject>
+    <m:body>
+        <html>
+            <body>
+            <p>Hello #{resetPasswordOfUser.fullname},</p>
+
+            <p>
+            you (or someone else) requested a password reset on LaceWiki. You need to click the following link to confirm the
+            validity of your e-mail address and to enter a new password:</p>
+
+            <h:outputLink value="#{preferences.get('Wiki').baseUrl}/resetPassword.seam?activationCode=#{resetPasswordOfUser.activationCode}">Click this link to reset the password of the account '#{resetPasswordOfUser.username}'</h:outputLink>
+
+            <p>
+                If you did not request a password reset, or if you do not reset your password, your account will still be active
+                with your old password.
+            </p>
+
+            <p>
+            Regards,<br/>
+            LaceWiki
+            </p>
+    </body>
+        </html>
+        <f:facet name="alternative">
+            <h:outputText>
+Hello #{resetPasswordOfUser.fullname},
+
+you (or someone else) requested a password reset on LaceWiki. You need to use the following link to confirm the
+validity of your e-mail address and to enter a new password for the account '#{resetPasswordOfUser.username}':
+
+#{preferences.get('Wiki').baseUrl}/resetPassword.seam?activationCode=#{resetPasswordOfUser.activationCode}
+
+If you did not request a password reset, or if you do not reset your password, your account will still
+be active with your old password.
+
+Regards,
+LaceWiki
+            </h:outputText>
+        </f:facet>
+    </m:body>
+</m:message>

Modified: trunk/examples/wiki/view/themes/sfwkorg/css/sfwk.css
===================================================================
--- trunk/examples/wiki/view/themes/sfwkorg/css/sfwk.css	2008-02-16 15:30:10 UTC (rev 7430)
+++ trunk/examples/wiki/view/themes/sfwkorg/css/sfwk.css	2008-02-16 15:37:41 UTC (rev 7431)
@@ -898,10 +898,19 @@
     text-align: left;
 }
 
+.entry .multiLineInput {
+    text-align: left;
+    margin-left: 155px;
+}
+
 .wideLabels .entry .label {
     width: 220px;
 }
 
+.wideLabels .entry .multiLineInput {
+    margin-left: 240px;
+}
+
 .errorEntry {
     background-color: #ffeeee;
 }




More information about the seam-commits mailing list