Seam SVN: r10402 - in trunk/examples/wiki: src/main/org/jboss/seam/wiki/admin and 8 other directories.
by seam-commits@lists.jboss.org
Author: christian.bauer(a)jboss.com
Date: 2009-04-14 11:51:10 -0400 (Tue, 14 Apr 2009)
New Revision: 10402
Added:
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/WikiFaceletViewHandler.java
Modified:
trunk/examples/wiki/src/etc/WEB-INF/faces-config.xml
trunk/examples/wiki/src/main/org/jboss/seam/wiki/admin/WikiHttpSessionManager.java
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/CommentHome.java
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/DocumentHistory.java
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/DocumentHome.java
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/dao/WikiNodeDAO.java
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/HistoricalWikiFile.hbm.xml
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/WikiFile.java
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/nestedset/listener/NestedSetFlushEventListener.java
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/WikiURLRenderer.java
trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/helloWorld/templates/helloWorld.xhtml
trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/helloWorld/themes/default/css/helloWorld.css
trunk/examples/wiki/view/themes/sfwkorg/template.xhtml
Log:
Various minor bugfixes and improvements on wiki
Modified: trunk/examples/wiki/src/etc/WEB-INF/faces-config.xml
===================================================================
--- trunk/examples/wiki/src/etc/WEB-INF/faces-config.xml 2009-04-14 15:47:38 UTC (rev 10401)
+++ trunk/examples/wiki/src/etc/WEB-INF/faces-config.xml 2009-04-14 15:51:10 UTC (rev 10402)
@@ -5,7 +5,12 @@
<locale-config>
<default-locale>en</default-locale>
</locale-config>
+
+ <view-handler>org.jboss.seam.wiki.core.ui.WikiFaceletViewHandler</view-handler>
+ <!-- Better exception handling overrides
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
+ -->
+
</application>
<!-- Needed because WikiFormattedTextHandler instantiates these, asking the JSF infrastructure -->
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/admin/WikiHttpSessionManager.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/admin/WikiHttpSessionManager.java 2009-04-14 15:47:38 UTC (rev 10401)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/admin/WikiHttpSessionManager.java 2009-04-14 15:51:10 UTC (rev 10402)
@@ -211,9 +211,11 @@
)
);
}
+
+ Collections.sort(onlineMembers);
}
- public static class OnlineUser {
+ public static class OnlineUser implements Comparable {
private User user;
private long lastAccessedTime;
@@ -241,6 +243,12 @@
public String getIdleTime() {
return WikiUtil.getTimeDifferenceToCurrent(WikiUtil.toDate(lastAccessedTime));
}
+
+ public int compareTo(Object o) {
+ OnlineUser other = (OnlineUser) o;
+ if (getLastAccessedTime() > other.getLastAccessedTime()) return -1;
+ return (getLastAccessedTime() == other.getLastAccessedTime() ? 0 : 1);
+ }
}
}
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/CommentHome.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/CommentHome.java 2009-04-14 15:47:38 UTC (rev 10401)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/CommentHome.java 2009-04-14 15:51:10 UTC (rev 10402)
@@ -144,6 +144,10 @@
getEntityManager().flush();
}
+ getLog().debug("updating last comment aggregation for: " + documentHome.getInstance());
+ getWikiNodeDAO().updateWikiDocumentLastComment(documentHome.getInstance());
+ getEntityManager().flush();
+
Events.instance().raiseEvent("Comment.persisted");
endConversation();
WikiRedirect.instance()
@@ -174,7 +178,12 @@
remove();
getEntityManager().clear();
- Events.instance().raiseEvent("Comment.removed");
+
+ getLog().debug("updating last comment aggregation for: " + documentHome.getInstance());
+ getWikiNodeDAO().updateWikiDocumentLastComment(documentHome.getInstance());
+ getEntityManager().flush();
+
+ getEntityManager().clear();
Events.instance().raiseEvent("Comment.commentListRefresh");
}
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/DocumentHistory.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/DocumentHistory.java 2009-04-14 15:47:38 UTC (rev 10401)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/DocumentHistory.java 2009-04-14 15:51:10 UTC (rev 10402)
@@ -197,7 +197,7 @@
displayedHistoricalFile = null;
if (historicalFileId == null) return;
- selectedHistoricalFile = wikiNodeDAO.findHistoricalFile(getCurrentFile().getHistoricalEntityName(), historicalFileId);
+ selectedHistoricalFile = wikiNodeDAO.findHistoricalDocumentAndDetach(getCurrentFile().getHistoricalEntityName(), historicalFileId);
if (selectedHistoricalFile == null) {
statusMessages.addFromResourceBundleOrDefault(
ERROR,
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/DocumentHome.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/DocumentHome.java 2009-04-14 15:47:38 UTC (rev 10401)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/DocumentHome.java 2009-04-14 15:51:10 UTC (rev 10402)
@@ -25,6 +25,7 @@
import org.jboss.seam.wiki.core.template.WikiDocumentEditorDefaults;
import org.jboss.seam.wiki.core.wikitext.editor.WikiTextEditor;
import org.jboss.seam.wiki.preferences.Preferences;
+import org.jboss.seam.wiki.util.WikiUtil;
import static org.jboss.seam.international.StatusMessage.Severity.INFO;
@@ -150,7 +151,9 @@
if (documentHistory != null && documentHistory.getSelectedHistoricalFile() != null) {
getLog().debug("rolling back to revision: " + documentHistory.getSelectedHistoricalFile().getRevision());
// TODO: Avoid cast, make history polymorphic
- doc.rollback((WikiDocument)documentHistory.getSelectedHistoricalFile());
+ WikiDocument oldRevision = (WikiDocument)documentHistory.getSelectedHistoricalFile();
+ doc.rollback(oldRevision);
+ doc.setWikiname(WikiUtil.convertToWikiName(doc.getName()));
}
isOnSiteFeed = feedDAO.isOnSiteFeed(doc);
@@ -430,11 +433,4 @@
return textEditor;
}
- /* TODO: Performance Optimizations */
-
- @org.jboss.seam.annotations.Observer(value = {"Comment.persisted", "Comment.removed"}, create = false)
- public void updateLastComment() {
- getWikiNodeDAO().updateWikiDocumentLastComment(getInstance());
- getEntityManager().flush();
- }
}
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/dao/WikiNodeDAO.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/dao/WikiNodeDAO.java 2009-04-14 15:47:38 UTC (rev 10401)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/dao/WikiNodeDAO.java 2009-04-14 15:51:10 UTC (rev 10402)
@@ -484,11 +484,22 @@
return null;
}
+ // TODO: This method is a mess...
// Returns a detached object
- public WikiFile findHistoricalFile(String entityName, Long historyId) {
- WikiFile historicalFile = (WikiFile)getSession(true).get(entityName, historyId);
- getSession(true).evict(historicalFile);
- return historicalFile;
+ public WikiDocument findHistoricalDocumentAndDetach(String entityName, Long historyId) {
+ // Initialize bytecode-enhanced fields with 'fetch all properties'!
+ log.debug("fetching WikiFile historical revision with id: " + historyId + " and initializing all properties");
+ WikiDocument historicalFile = (WikiDocument)
+ getSession(true).createQuery("select f from " + entityName + " f fetch all properties where f.historicalFileId = :id")
+ .setParameter("id", historyId)
+ .uniqueResult();
+ if (historicalFile != null) {
+ historicalFile.getContent(); // TODO: the fetch all properties doesn't work for some reason..
+ getSession(true).evict(historicalFile);
+ return historicalFile;
+ } else {
+ return null;
+ }
}
public List<WikiFile> findHistoricalFiles(WikiFile file) {
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/HistoricalWikiFile.hbm.xml
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/HistoricalWikiFile.hbm.xml 2009-04-14 15:47:38 UTC (rev 10401)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/HistoricalWikiFile.hbm.xml 2009-04-14 15:51:10 UTC (rev 10402)
@@ -25,7 +25,7 @@
<property name="lastModifiedByUsername" column="LAST_MODIFIED_BY_USERNAME" not-null="false"/>
<!-- Optional WikiFile subclass properties -->
- <property name="content" column="CONTENT" length="32767"/>
+ <property name="content" column="CONTENT" length="32767" lazy="true"/>
</class>
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/WikiFile.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/WikiFile.java 2009-04-14 15:47:38 UTC (rev 10401)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/WikiFile.java 2009-04-14 15:51:10 UTC (rev 10402)
@@ -84,7 +84,6 @@
public void rollback(WikiFile revision) {
this.name = revision.name;
- this.wikiname = revision.wikiname;
}
public List<String> getTagsAsList() {
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/nestedset/listener/NestedSetFlushEventListener.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/nestedset/listener/NestedSetFlushEventListener.java 2009-04-14 15:47:38 UTC (rev 10401)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/nestedset/listener/NestedSetFlushEventListener.java 2009-04-14 15:51:10 UTC (rev 10402)
@@ -80,7 +80,7 @@
if (eventSource.getActionQueue().areInsertionsOrDeletionsQueued()) {
try {
- log.debug("######################### trying to obtain exclusive lock for " + LOCK_TIMEOUT_SECONDS +
+ log.debug("trying to obtain exclusive lock for " + LOCK_TIMEOUT_SECONDS +
" seconds before performing database modifications during flush");
if (lock.tryLock(LOCK_TIMEOUT_SECONDS, TimeUnit.SECONDS)) {
log.debug("successfully obtained lock, executing flush");
Added: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/WikiFaceletViewHandler.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/WikiFaceletViewHandler.java (rev 0)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/WikiFaceletViewHandler.java 2009-04-14 15:51:10 UTC (rev 10402)
@@ -0,0 +1,73 @@
+package org.jboss.seam.wiki.core.ui;
+
+import com.sun.facelets.FaceletViewHandler;
+import com.sun.facelets.util.DevTools;
+
+import javax.el.ELException;
+import javax.faces.FacesException;
+import javax.faces.application.ViewHandler;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.Writer;
+
+/**
+ * @author Christian Bauer
+ */
+public class WikiFaceletViewHandler extends FaceletViewHandler {
+
+ protected boolean developmentMode; // Private in superclass, hurray!
+
+ public WikiFaceletViewHandler(ViewHandler viewHandler) {
+ super(viewHandler);
+ }
+
+ @Override
+ protected void initialize(FacesContext context) {
+ super.initialize(context);
+
+ ExternalContext external = context.getExternalContext();
+ String param = external.getInitParameter(PARAM_DEVELOPMENT);
+ this.developmentMode = "true".equals(param);
+ }
+
+ @Override
+ protected void handleRenderException(FacesContext context, Exception e)
+ throws IOException, ELException, FacesException {
+
+ Object resp = context.getExternalContext().getResponse();
+
+/* This is what we don't like: log and rethrow! Makes Facelets nasty in production use...
+ // always log
+ if (log.isLoggable(Level.SEVERE)) {
+ UIViewRoot root = context.getViewRoot();
+ StringBuffer sb = new StringBuffer(64);
+ sb.append("Error Rendering View");
+ if (root != null) {
+ sb.append('[');
+ sb.append(root.getViewId());
+ sb.append(']');
+ }
+ log.log(Level.SEVERE, sb.toString(), e);
+ }
+*/
+ // handle dev response
+ if (this.developmentMode && !context.getResponseComplete()
+ && resp instanceof HttpServletResponse) {
+ HttpServletResponse httpResp = (HttpServletResponse) resp;
+ httpResp.reset();
+ httpResp.setContentType("text/html; charset=UTF-8");
+ Writer w = httpResp.getWriter();
+ DevTools.debugHtml(w, context, e);
+ w.flush();
+ context.responseComplete();
+ } else if (e instanceof RuntimeException) {
+ throw (RuntimeException) e;
+ } else if (e instanceof IOException) {
+ throw (IOException) e;
+ } else {
+ throw new FacesException(e.getMessage(), e);
+ }
+ }
+}
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/WikiURLRenderer.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/WikiURLRenderer.java 2009-04-14 15:47:38 UTC (rev 10401)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/WikiURLRenderer.java 2009-04-14 15:51:10 UTC (rev 10402)
@@ -7,11 +7,9 @@
package org.jboss.seam.wiki.core.ui;
import org.jboss.seam.Component;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.AutoCreate;
+import org.jboss.seam.annotations.*;
import org.jboss.seam.ScopeType;
+import org.jboss.seam.log.Log;
import org.jboss.seam.wiki.util.WikiUtil;
import org.jboss.seam.wiki.core.action.prefs.WikiPreferences;
import org.jboss.seam.wiki.core.model.WikiNode;
@@ -35,6 +33,9 @@
@AutoCreate
public class WikiURLRenderer implements Serializable {
+ @Logger
+ Log log;
+
@In
String contextPath;
@@ -138,8 +139,11 @@
}
public String renderPermURL(WikiNode node, boolean usePrefsPath) {
+ log.debug("rendering perm URL for node: " + node);
if (node == null || node.getId() == null) return "";
- return (usePrefsPath ? prefs.getBaseUrl() : contextPath) + "/" + node.getPermURL(prefs.getPermlinkSuffix());
+ String url = (usePrefsPath ? prefs.getBaseUrl() : contextPath) + "/" + node.getPermURL(prefs.getPermlinkSuffix());
+ log.debug("rendered URL: " + url);
+ return url;
}
public String renderWikiURL(WikiNode node) {
@@ -147,8 +151,11 @@
}
public String renderWikiURL(WikiNode node, boolean usePrefsPath) {
+ log.debug("rendering wiki URL for node: " + node);
if (node == null || node.getId() == null) return "";
- return (usePrefsPath ? prefs.getBaseUrl() : contextPath) + "/" + node.getWikiURL();
+ String url = (usePrefsPath ? prefs.getBaseUrl() : contextPath) + "/" + node.getWikiURL();
+ log.debug("rendered URL: " + url);
+ return url;
}
// TODO: We need more methods here, rendering year/month/day/tag/etc. on WikiURL (not perm url)
Modified: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/helloWorld/templates/helloWorld.xhtml
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/helloWorld/templates/helloWorld.xhtml 2009-04-14 15:47:38 UTC (rev 10401)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/helloWorld/templates/helloWorld.xhtml 2009-04-14 15:51:10 UTC (rev 10402)
@@ -63,6 +63,6 @@
</h:panelGrid>
- <wiki:loadStyle src="#{currentMacro.requestCSSPath}/anotherOne.css"/>
+ <wiki:loadStyle src="#{currentMacro.requestStylesheetPath}/anotherOne.css"/>
</wiki:plugin>
\ No newline at end of file
Modified: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/helloWorld/themes/default/css/helloWorld.css
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/helloWorld/themes/default/css/helloWorld.css 2009-04-14 15:47:38 UTC (rev 10401)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/helloWorld/themes/default/css/helloWorld.css 2009-04-14 15:51:10 UTC (rev 10402)
@@ -1,5 +1,5 @@
.justABox {
- background: #fff url(#{currentMacro.requestImagePath}/background.gif) 0 0 repeat-x;
+ background: #fff url(#{request.contextPath}#{currentPluginModule.imagePath}/background.gif) 0 0 repeat-x;
border: 1px solid green;
margin: 20px;
}
Modified: trunk/examples/wiki/view/themes/sfwkorg/template.xhtml
===================================================================
--- trunk/examples/wiki/view/themes/sfwkorg/template.xhtml 2009-04-14 15:47:38 UTC (rev 10401)
+++ trunk/examples/wiki/view/themes/sfwkorg/template.xhtml 2009-04-14 15:51:10 UTC (rev 10402)
@@ -401,7 +401,7 @@
</div>
<div id="footer" class="undecoratedLink">
- <p> © Copyright 2008, Red Hat Middleware, LLC. All rights reserved. JBoss and Seam are registered trademarks
+ <p> © Copyright 2009, Red Hat Middleware, LLC. All rights reserved. JBoss and Seam are registered trademarks
and servicemarks of <a href="http://www.redhat.com/">Red Hat, Inc</a>.
[<a href="http://www.redhat.com/legal/privacy_statement.html">Privacy Policy</a>]</p>
</div>
15 years, 7 months
Seam SVN: r10401 - in trunk/examples/wiki/src: main/org/jboss/seam/wiki/connectors/cache and 1 other directory.
by seam-commits@lists.jboss.org
Author: christian.bauer(a)jboss.com
Date: 2009-04-14 11:47:38 -0400 (Tue, 14 Apr 2009)
New Revision: 10401
Modified:
trunk/examples/wiki/src/etc/WEB-INF/pages.xml
trunk/examples/wiki/src/main/org/jboss/seam/wiki/connectors/cache/ConnectorCache.java
Log:
JBSEAM-4040, better handling of LocktimeoutException on caches
Modified: trunk/examples/wiki/src/etc/WEB-INF/pages.xml
===================================================================
--- trunk/examples/wiki/src/etc/WEB-INF/pages.xml 2009-04-14 15:46:32 UTC (rev 10400)
+++ trunk/examples/wiki/src/etc/WEB-INF/pages.xml 2009-04-14 15:47:38 UTC (rev 10401)
@@ -262,6 +262,11 @@
<navigation>
+ <!-- More complex rules decide what to do after login, encapsulated in UserLogin -->
+ <rule if-outcome="loggedIn">
+ <redirect url="#{userLogin.loginRedirectURL}"/>
+ </rule>
+
<!-- Go to start page on logout because the session has been invalidated -->
<rule if-outcome="loggedOut">
<end-conversation before-redirect="true"/>
@@ -327,24 +332,23 @@
<description>#{messages['lacewiki.label.userList.MemberList']} (#{messages['lacewiki.label.userList.Results']}: #{userSearch.rowCount})</description>
</page>
-
- <exception class="javax.faces.application.ViewExpiredException">
- <end-conversation/>
+ <exception class="javax.faces.application.ViewExpiredException" log="false">
+ <end-conversation before-redirect="true"/>
<redirect view-id="/wiki.xhtml">
<message severity="WARN">#{messages['lacewiki.msg.SessionTimeoutOccured']}</message>
</redirect>
</exception>
<exception class="org.jboss.seam.wiki.core.nestedset.listener.NestedSetLockTimeoutException">
- <end-conversation/>
+ <end-conversation before-redirect="true"/>
<redirect view-id="/wiki.xhtml">
<message severity="WARN">#{messages['lacewiki.msg.LockTimeoutError']}</message>
</redirect>
</exception>
<!-- This occurs on concurrent delete of comments -->
- <exception class="javax.persistence.EntityNotFoundException">
- <end-conversation/>
+ <exception class="javax.persistence.EntityNotFoundException" log="false">
+ <end-conversation before-redirect="true"/>
<redirect view-id="/wiki.xhtml">
<message severity="WARN">#{messages['lacewiki.msg.EntityNotFound']}</message>
</redirect>
@@ -365,19 +369,26 @@
</redirect>
</exception>
- <exception class="org.jboss.seam.framework.EntityNotFoundException">
+ <exception class="org.jboss.seam.core.LockTimeoutException">
+ <end-conversation before-redirect="true"/>
+ <redirect view-id="/wiki.xhtml">
+ <message severity="WARN">#{messages['lacewiki.msg.LockTimeoutError']}</message>
+ </redirect>
+ </exception>
+
+ <exception class="org.jboss.seam.framework.EntityNotFoundException" log="false">
<end-conversation/>
<http-error error-code="404"/>
</exception>
- <exception class="org.jboss.seam.wiki.core.exception.InvalidWikiRequestException">
+ <exception class="org.jboss.seam.wiki.core.exception.InvalidWikiRequestException" log="false">
<end-conversation/>
<http-error error-code="400">
<message>#{org.jboss.seam.handledException.message}</message>
</http-error>
</exception>
- <exception class="javax.faces.validator.ValidatorException">
+ <exception class="javax.faces.validator.ValidatorException" log="false">
<end-conversation/>
<http-error error-code="400">
<message>#{messages['lacewiki.msg.RequestError']}</message>
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/connectors/cache/ConnectorCache.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/connectors/cache/ConnectorCache.java 2009-04-14 15:46:32 UTC (rev 10400)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/connectors/cache/ConnectorCache.java 2009-04-14 15:47:38 UTC (rev 10401)
@@ -28,7 +28,7 @@
* @author Christian Bauer
*/
@Scope(ScopeType.APPLICATION)
-@Synchronized
+@Synchronized(timeout = 5000)
public abstract class ConnectorCache<T, K> {
@Logger
15 years, 7 months
Seam SVN: r10399 - in trunk/examples/wiki/src: etc/WEB-INF and 5 other directories.
by seam-commits@lists.jboss.org
Author: christian.bauer(a)jboss.com
Date: 2009-04-14 11:46:11 -0400 (Tue, 14 Apr 2009)
New Revision: 10399
Added:
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/UserLogin.java
Removed:
trunk/examples/wiki/src/etc/gwtmodules/
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/dao/WikiManagedPersistenceContext.java
Modified:
trunk/examples/wiki/src/etc/WEB-INF/components.xml
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/Authenticator.java
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/CommentQuery.java
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/DirectoryBrowser.java
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/Menu.java
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/WikiRequestResolver.java
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/WikiSecurityEvents.java
trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/blog/BlogDirectory.java
trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/ForumQuery.java
Log:
JBSEAM-4099, simplify wiki login procedure
Modified: trunk/examples/wiki/src/etc/WEB-INF/components.xml
===================================================================
--- trunk/examples/wiki/src/etc/WEB-INF/components.xml 2009-04-14 15:34:07 UTC (rev 10398)
+++ trunk/examples/wiki/src/etc/WEB-INF/components.xml 2009-04-14 15:46:11 UTC (rev 10399)
@@ -31,6 +31,16 @@
persistence-unit-jndi-name="java:/entityManagerFactories/wiki">
</persistence:managed-persistence-context>
+ <persistence:managed-persistence-context
+ name="restrictedEntityManager"
+ auto-create="true"
+ entity-manager-factory="#{wikiEntityManagerFactory}"
+ persistence-unit-jndi-name="java:/entityManagerFactories/wiki">
+ <persistence:filters>
+ <value>#{accessLevelFilter}</value>
+ </persistence:filters>
+ </persistence:managed-persistence-context>
+
<persistence:filter name="accessLevelFilter">
<persistence:name>accessLevelFilter</persistence:name>
<persistence:parameters>
@@ -39,13 +49,6 @@
</persistence:parameters>
</persistence:filter>
- <component name="restrictedEntityManager" auto-create="true" scope="CONVERSATION"
- class="org.jboss.seam.wiki.core.dao.WikiManagedPersistenceContext">
- <property name="entityManagerFactory">#{wikiEntityManagerFactory}</property>
- <property name="persistenceUnitJndiName">java:/entityManagerFactories/wiki</property>
- <property name="filters"><value>#{accessLevelFilter}</value></property>
- </component>
-
<!-- JSF entity instance from/to string converters for select lists -->
<ui:entity-converter name="entityConverter"
@@ -106,9 +109,6 @@
<value>default</value>
<value>sfwkorg</value>
<value>inrelationto</value>
- <!--
- <value>openremote</value>
- -->
</property>
</component>
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/Authenticator.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/Authenticator.java 2009-04-14 15:34:07 UTC (rev 10398)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/Authenticator.java 2009-04-14 15:46:11 UTC (rev 10399)
@@ -7,10 +7,8 @@
package org.jboss.seam.wiki.core.action;
import org.jboss.seam.Component;
-import org.jboss.seam.web.ServletContexts;
import org.jboss.seam.annotations.*;
import org.jboss.seam.contexts.Contexts;
-import org.jboss.seam.core.Events;
import org.jboss.seam.log.Log;
import org.jboss.seam.security.Identity;
import org.jboss.seam.security.Credentials;
@@ -24,7 +22,6 @@
import org.jboss.seam.wiki.core.model.Role;
import org.jboss.seam.wiki.util.Hash;
import org.jboss.seam.wiki.util.WikiUtil;
-import org.jboss.seam.wiki.WikiInit;
import org.jboss.seam.wiki.preferences.Preferences;
import javax.servlet.http.HttpServletRequest;
@@ -33,8 +30,6 @@
@Name("authenticator")
public class Authenticator {
- protected final static String REGULAR_SESSION_MAX_INACTIVE_SECONDS = "regularSessionMaxInactiveInterval";
-
@Logger
Log log;
@@ -67,7 +62,6 @@
User user = getUserForCredentials(username, password);
if (user == null) return false;
setRolesAndAccessLevels(user);
- Events.instance().raiseEvent("User.loggedInBasicHttp", user);
return true;
}
@@ -83,7 +77,6 @@
user.setPreviousLastLoginOn(user.getLastLoginOn());
user.setLastLoginOn(new Date());
- Events.instance().raiseEvent("User.loggedIn", user);
return true;
}
@@ -109,6 +102,10 @@
if (role.getAccessLevel() > bestRole.getAccessLevel()) bestRole = role;
}
+ if (user.getMemberHome() != null && user.getMemberHome().getName() != null) {
+ log.debug("initializing users member home instance before detaching currentUser into HTTP session");
+ }
+
// Outject current user and access level
Contexts.getSessionContext().set("currentUser", user);
Contexts.getSessionContext().set("currentAccessLevel", bestRole.getAccessLevel());
@@ -184,31 +181,4 @@
return "loggedOut";
}
- @Observer("org.jboss.seam.security.loginSuccessful")
- public void extendSessionTime() {
- // Store the regular session timeout value, so we can set it back later on logout
- int regularSessionTimeout = ServletContexts.getInstance().getRequest().getSession().getMaxInactiveInterval();
- Contexts.getSessionContext().set(REGULAR_SESSION_MAX_INACTIVE_SECONDS, regularSessionTimeout);
- WikiInit init = (WikiInit)Component.getInstance(WikiInit.class);
- if (init.getAuthenticatedSessionTimeoutMinutes() != 0) {
- log.debug("setting timeout of authenticated user session to minutes: " + init.getAuthenticatedSessionTimeoutMinutes());
- ServletContexts.getInstance().getRequest().getSession().setMaxInactiveInterval(
- init.getAuthenticatedSessionTimeoutMinutes()*60
- );
- }
- }
-
- @Observer("org.jboss.seam.security.loggedOut")
- public void resetSessionTime() {
- // Don't rely on that, do a null check - this should never be null but sometimes it is... *sigh*
- Object o = Contexts.getSessionContext().get(REGULAR_SESSION_MAX_INACTIVE_SECONDS);
- if (o != null) {
- int regularSessionTimeout = (Integer) o;
- log.debug("resetting timeout of user session after logout to minutes: " + regularSessionTimeout/60);
- ServletContexts.getInstance().getRequest().getSession().setMaxInactiveInterval(regularSessionTimeout);
- } else {
- // Safety, reset to a low value, 10 minutes
- ServletContexts.getInstance().getRequest().getSession().setMaxInactiveInterval(600);
- }
- }
}
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/CommentQuery.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/CommentQuery.java 2009-04-14 15:34:07 UTC (rev 10398)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/CommentQuery.java 2009-04-14 15:46:11 UTC (rev 10399)
@@ -43,7 +43,6 @@
}
@Observer(value = {
- "PersistenceContext.filterReset",
"PreferenceComponent.refresh.commentsPreferences",
"Comment.commentListRefresh"
}, create = false)
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/DirectoryBrowser.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/DirectoryBrowser.java 2009-04-14 15:34:07 UTC (rev 10398)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/DirectoryBrowser.java 2009-04-14 15:46:11 UTC (rev 10399)
@@ -206,13 +206,13 @@
refreshChildNodes();
}
- @Observer(value = {"PersistenceContext.filterReset", "Node.removed"}, create = false)
+ @Observer(value = {"Node.removed"}, create = false)
public void loadTree() {
WikiDirectory wikiRoot = (WikiDirectory) Component.getInstance("wikiRoot");
treeRoot = wikiNodeDAO.findWikiDirectoryTree(wikiRoot);
}
- @Observer(value = {"PersistenceContext.filterReset", "Node.removed", "Pager.pageChanged"}, create = false)
+ @Observer(value = {"Node.removed", "Pager.pageChanged"}, create = false)
public void refreshChildNodes() {
log.debug("refreshing child nodes of current directory: " + getInstance());
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/Menu.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/Menu.java 2009-04-14 15:34:07 UTC (rev 10398)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/Menu.java 2009-04-14 15:46:11 UTC (rev 10399)
@@ -8,6 +8,7 @@
import org.jboss.seam.ScopeType;
import org.jboss.seam.Component;
+import org.jboss.seam.security.Identity;
import org.jboss.seam.annotations.*;
import org.jboss.seam.log.Log;
import org.jboss.seam.wiki.core.action.prefs.WikiPreferences;
@@ -22,8 +23,6 @@
/**
* Holds the nodes that are displayed in the site menu
*
- * TODO: Caches the menu in the session, better would be a page fragment cache.
- *
* @author Christian Bauer
*/
@Name("menu")
@@ -47,18 +46,6 @@
return root;
}
- @Observer(value = { "Node.updated", "Node.removed", "PersistenceContext.filterReset" }, create = false)
- public void refreshRoot() {
- log.debug("Loading menu items tree");
- WikiPreferences wikiPreferences = Preferences.instance().get(WikiPreferences.class);
- root = WikiNodeDAO.instance().findMenuItemTree(
- (WikiDirectory)Component.getInstance("wikiRoot"),
- wikiPreferences.getMainMenuDepth(),
- wikiPreferences.getMainMenuLevels(),
- wikiPreferences.isMainMenuShowAdminOnly()
- );
- }
-
public String getCacheRegion() {
return CACHE_REGION;
}
@@ -67,9 +54,22 @@
return CACHE_KEY + currentAccessLevel;
}
- @Observer(value = { "Node.updated", "Node.removed"})
+ // Logout invalidates the session context, so we don't need to refresh afterwards
+ @Observer(value = { "Node.updated", "Node.removed", Identity.EVENT_LOGIN_SUCCESSFUL})
public void invalidateCache() {
+ log.debug("invaliding menu items tree cache");
PageFragmentCache.instance().removeAll(CACHE_REGION);
+ root = null;
}
+ private void refreshRoot() {
+ log.debug("Loading menu items tree");
+ WikiPreferences wikiPreferences = Preferences.instance().get(WikiPreferences.class);
+ root = WikiNodeDAO.instance().findMenuItemTree(
+ (WikiDirectory)Component.getInstance("wikiRoot"),
+ wikiPreferences.getMainMenuDepth(),
+ wikiPreferences.getMainMenuLevels(),
+ wikiPreferences.isMainMenuShowAdminOnly()
+ );
+ }
}
Added: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/UserLogin.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/UserLogin.java (rev 0)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/UserLogin.java 2009-04-14 15:46:11 UTC (rev 10399)
@@ -0,0 +1,91 @@
+package org.jboss.seam.wiki.core.action;
+
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Observer;
+import org.jboss.seam.core.Manager;
+import org.jboss.seam.core.Conversation;
+import org.jboss.seam.log.Log;
+import org.jboss.seam.wiki.core.model.WikiDocument;
+import org.jboss.seam.wiki.core.ui.WikiURLRenderer;
+import org.jboss.seam.wiki.WikiInit;
+import org.jboss.seam.Component;
+import org.jboss.seam.security.Identity;
+import org.jboss.seam.contexts.Contexts;
+import org.jboss.seam.web.ServletContexts;
+
+/**
+ * Decides what to do (redirect) after a user logs in successfully.
+ * <p>
+ * This is a stateful component and therefore different than <tt>WikiSecurityEvents</tt>.
+ * </p>
+ *
+ * @author Christian Bauer
+ */
+@Name("userLogin")
+public class UserLogin {
+
+ protected final static String REGULAR_SESSION_MAX_INACTIVE_SECONDS = "regularSessionMaxInactiveInterval";
+
+ @Logger
+ Log log;
+
+ @In(create = false, required = false)
+ DocumentHome documentHome;
+
+ @In
+ WikiURLRenderer wikiURLRenderer;
+
+ String redirectURL;
+
+ @Observer(Identity.EVENT_LOGIN_SUCCESSFUL)
+ public void onLogin() {
+
+ // Store the regular session timeout value, so we can set it back later on logout
+ int regularSessionTimeout = ServletContexts.getInstance().getRequest().getSession().getMaxInactiveInterval();
+ Contexts.getSessionContext().set(REGULAR_SESSION_MAX_INACTIVE_SECONDS, regularSessionTimeout);
+ WikiInit init = (WikiInit)Component.getInstance(WikiInit.class);
+ if (init.getAuthenticatedSessionTimeoutMinutes() != 0) {
+ log.debug("setting timeout of authenticated user session to minutes: " + init.getAuthenticatedSessionTimeoutMinutes());
+ ServletContexts.getInstance().getRequest().getSession().setMaxInactiveInterval(
+ init.getAuthenticatedSessionTimeoutMinutes()*60
+ );
+ }
+
+ // Prepare redirect stuff
+ if (documentHome != null && documentHome.isManaged()) {
+ redirectURL = wikiURLRenderer.renderURL(documentHome.getInstance());
+ } else {
+ redirectURL = wikiURLRenderer.renderURL((WikiDocument)Component.getInstance("wikiStart"));
+ }
+
+ log.debug("preparing URL for redirect after successful login: " + redirectURL);
+
+ log.debug("destroying all conversations after successful login");
+ Manager.instance().killAllOtherConversations();
+
+ // Finally, end the current one after we are done with documentHome
+ Conversation.instance().endBeforeRedirect();
+ }
+
+ @Observer(Identity.EVENT_LOGGED_OUT)
+ public void onLogout() {
+ Object o = Contexts.getSessionContext().get(REGULAR_SESSION_MAX_INACTIVE_SECONDS);
+ // Don't rely on that, do a null check - this should never be null but sometimes it is... *sigh*
+ if (o != null) {
+ int regularSessionTimeout = (Integer) o;
+ log.debug("resetting timeout of user session after logout to minutes: " + regularSessionTimeout/60);
+ ServletContexts.getInstance().getRequest().getSession().setMaxInactiveInterval(regularSessionTimeout);
+ } else {
+ // Safety, reset to a low value, 10 minutes
+ // TODO: That value is actually configured in web.xml, how do we get it here?
+ ServletContexts.getInstance().getRequest().getSession().setMaxInactiveInterval(600);
+ }
+ }
+
+ public String getLoginRedirectURL() {
+ log.debug("obtaining redirect URL: " + redirectURL);
+ return redirectURL;
+ }
+}
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/WikiRequestResolver.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/WikiRequestResolver.java 2009-04-14 15:34:07 UTC (rev 10398)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/WikiRequestResolver.java 2009-04-14 15:46:11 UTC (rev 10399)
@@ -69,6 +69,10 @@
@AutoCreate
public class WikiRequestResolver {
+ public static final String SESSION_MSG = "lacewiki.Session.Message";
+ public static final String SESSION_MSG_SEVERITY = "lacewiki.Session.MessageSeverity";
+ public static final String SESSION_MSG_DATA = "lacewiki.Session.MessageData";
+
@Logger
static Log log;
@@ -76,6 +80,7 @@
protected WikiNodeDAO wikiNodeDAO;
protected Long nodeId;
+
public Long getNodeId() { return nodeId; }
public void setNodeId(Long nodeId) { this.nodeId = nodeId; }
@@ -119,6 +124,28 @@
StatusMessages.instance().addFromResourceBundle(msgSeverity, getMessageKey());
}
+ // Queue a message if requested in the session (for message passing across conversations)
+ String msgKey = (String)Contexts.getSessionContext().get(SESSION_MSG);
+ if (msgKey != null) {
+ log.debug("session contained message: " + msgKey);
+
+ StatusMessage.Severity msgSeverity = StatusMessage.Severity.INFO;
+ StatusMessage.Severity sessionMessageSeverity =
+ (StatusMessage.Severity)Contexts.getSessionContext().get(SESSION_MSG_SEVERITY);
+ if (sessionMessageSeverity != null) {
+ msgSeverity = sessionMessageSeverity;
+ }
+ Object msgData = Contexts.getSessionContext().get(SESSION_MSG_DATA);
+ if (msgData != null) {
+ StatusMessages.instance().addFromResourceBundle(msgSeverity, msgKey, msgData);
+ } else {
+ StatusMessages.instance().addFromResourceBundle(msgSeverity, msgKey);
+ }
+ Contexts.getSessionContext().remove(SESSION_MSG);
+ Contexts.getSessionContext().remove(SESSION_MSG_SEVERITY);
+ Contexts.getSessionContext().remove(SESSION_MSG_DATA);
+ }
+
// Have we been called with a nodeId request parameter, must be a document
if (nodeId != null) {
log.debug("trying to resolve node id: " + nodeId);
Deleted: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/dao/WikiManagedPersistenceContext.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/dao/WikiManagedPersistenceContext.java 2009-04-14 15:34:07 UTC (rev 10398)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/dao/WikiManagedPersistenceContext.java 2009-04-14 15:46:11 UTC (rev 10399)
@@ -1,47 +0,0 @@
-package org.jboss.seam.wiki.core.dao;
-
-import org.jboss.seam.persistence.ManagedPersistenceContext;
-import org.jboss.seam.persistence.Filter;
-import org.jboss.seam.persistence.PersistenceProvider;
-import org.jboss.seam.annotations.Observer;
-import org.jboss.seam.annotations.Logger;
-import org.jboss.seam.log.Log;
-import org.jboss.seam.core.Events;
-
-/**
- * Forces re-evaluation of filter parameter for managed persistence contexts.
- * <p>
- * This is called after a user logs in, so that the <tt>#{currentAccessLevel}</tt>
- * filter argument is evaluated again, <i>on the already open</i> persistence context
- * (which has the filter argument from before login). See the filter definition in
- * components.xml.
- * <p>
- * The risk with re-setting filters on an existing persistence context is that things
- * might be cached already that should be filtered out. Now, in our case that works
- * fine because a login always means that the current user gains privileges and
- * raises his/her access level, i.e. sees a superset of the data he has seen before.
- *
- * @author Christian Bauer
- */
-public class WikiManagedPersistenceContext extends ManagedPersistenceContext {
-
- @Logger
- Log log;
-
- @Observer(value = {"User.loggedIn", "User.loggedInBasicHttp"}, create = false)
- public void resetFilter() {
- try {
-
- log.debug("Resetting persistence context filters");
- PersistenceProvider persistenceProvider = PersistenceProvider.instance();
- for (Filter f : getFilters()) {
- if (f.isFilterEnabled()) {
- persistenceProvider.enableFilter(f, getEntityManager());
- }
- }
- } catch (Exception ex) {
- throw new RuntimeException(ex);
- }
- Events.instance().raiseEvent("PersistenceContext.filterReset");
- }
-}
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/WikiSecurityEvents.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/WikiSecurityEvents.java 2009-04-14 15:34:07 UTC (rev 10398)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/WikiSecurityEvents.java 2009-04-14 15:46:11 UTC (rev 10399)
@@ -9,12 +9,17 @@
import org.jboss.seam.annotations.Install;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Startup;
+import org.jboss.seam.annotations.Observer;
import org.jboss.seam.annotations.intercept.BypassInterceptors;
import org.jboss.seam.international.StatusMessage;
import org.jboss.seam.security.FacesSecurityEvents;
+import org.jboss.seam.security.Identity;
+import org.jboss.seam.contexts.Contexts;
+import org.jboss.seam.wiki.core.action.WikiRequestResolver;
/**
* Overrides the "login failed" message and turns it into a WARN (we don't want INFO here).
+ * Transports "login successful" message across conversations (in the session) for redirect-after-login.
*
* @author Christian Bauer
*/
@@ -28,4 +33,23 @@
public StatusMessage.Severity getLoginFailedMessageSeverity() {
return StatusMessage.Severity.WARN;
}
+
+ @Override
+ @Observer(Identity.EVENT_LOGIN_SUCCESSFUL)
+ public void addLoginSuccessfulMessage() {
+
+ Contexts.getSessionContext().set(
+ WikiRequestResolver.SESSION_MSG, getLoginSuccessfulMessageKey()
+ );
+
+ Contexts.getSessionContext().set(
+ WikiRequestResolver.SESSION_MSG_SEVERITY, getLoginSuccessfulMessageSeverity()
+ );
+
+ Contexts.getSessionContext().set(
+ WikiRequestResolver.SESSION_MSG_DATA, Identity.instance().getCredentials().getUsername()
+ );
+
+ }
+
}
Modified: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/blog/BlogDirectory.java
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/blog/BlogDirectory.java 2009-04-14 15:34:07 UTC (rev 10398)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/blog/BlogDirectory.java 2009-04-14 15:46:11 UTC (rev 10399)
@@ -97,7 +97,6 @@
return blogEntries;
}
- @Observer(value = {"PersistenceContext.filterReset"}, create = false)
public void loadBlogEntries() {
if (pager == null) throw new IllegalStateException("Need to call getBlogEntries(currentMacro) first!");
@@ -141,7 +140,6 @@
return archivedEntries;
}
- @Observer(value = {"PersistenceContext.filterReset"}, create = false)
public void loadArchivedEntries() {
log.debug("loading blog entries and counting/aggregating them by year and month");
archivedEntries =
@@ -164,7 +162,6 @@
private Map<Date, List<BlogEntry>> recentBlogEntries;
@Factory(value = "recentBlogEntries")
- @Observer(value = {"PersistenceContext.filterReset"}, create = false)
public void loadRecentBlogEntries() {
// TODO: This is supposed to use the currentMacro parameter to get the INSTANCE prefs value... how?
BlogPreferences prefs = Preferences.instance().get(BlogPreferences.class);
Modified: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/ForumQuery.java
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/ForumQuery.java 2009-04-14 15:34:07 UTC (rev 10398)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/ForumQuery.java 2009-04-14 15:46:11 UTC (rev 10399)
@@ -63,7 +63,7 @@
return forumsAvailable;
}
- @Observer(value = {"Forum.forumListRefresh", "PersistenceContext.filterReset"}, create = false)
+ @Observer(value = {"Forum.forumListRefresh"}, create = false)
public void loadForumsAvailability() {
// The whole point of this is so that we can use it as a cheaper query in the mess that is the rendered="true/false"
// attribute evaluation in JSF. It is called completely randomly, at any phase in the request, on any component in
@@ -77,7 +77,7 @@
return forums;
}
- @Observer(value = {"Forum.forumListRefresh", "PersistenceContext.filterReset"}, create = false)
+ @Observer(value = {"Forum.forumListRefresh"}, create = false)
public void loadForums() {
log.debug("loading forums");
Map<Long, ForumInfo> forumInfo = forumDAO.findForums(currentDirectory);
@@ -154,7 +154,7 @@
topics.addAll(topicInfo.values());
}
- @Observer(value = {"Forum.topicListRefresh", "PersistenceContext.filterReset"}, create = false)
+ @Observer(value = {"Forum.topicListRefresh"}, create = false)
public void refreshTopics() {
countTopics();
loadTopics();
15 years, 7 months
Seam SVN: r10398 - trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model.
by seam-commits@lists.jboss.org
Author: christian.bauer(a)jboss.com
Date: 2009-04-14 11:34:07 -0400 (Tue, 14 Apr 2009)
New Revision: 10398
Modified:
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/User.java
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/WikiNode.java
Log:
JBSEAM-4098, don't index all documents when a user logs in
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/User.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/User.java 2009-04-14 14:49:30 UTC (rev 10397)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/User.java 2009-04-14 15:34:07 UTC (rev 10398)
@@ -18,7 +18,6 @@
@Entity
@Table(name = "USERS")
@org.hibernate.annotations.BatchSize(size = 20)
-(a)org.hibernate.search.annotations.Indexed
public class User implements Serializable {
public static final String GUEST_USERNAME = "guest";
@@ -27,7 +26,6 @@
@Id
@GeneratedValue(generator = "wikiSequenceGenerator")
@Column(name = "USER_ID")
- @org.hibernate.search.annotations.DocumentId(name = "userId")
private Long id = null;
@Version
@@ -59,10 +57,6 @@
regex="[a-zA-Z]?[a-zA-Z0-9]+",
message="#{messages['lacewiki.entity.UsernameMustStartWithALetterAndOnlyContainLetters']}"
)
- @org.hibernate.search.annotations.Field(
- index = org.hibernate.search.annotations.Index.UN_TOKENIZED,
- store = org.hibernate.search.annotations.Store.YES
- )
private String username; // Unique and immutable
@Column(name = "PASSWORDHASH", length = 255, nullable = false)
@@ -108,10 +102,6 @@
@org.hibernate.annotations.ForeignKey(name = "FK_USER_USER_PROFILE_ID")
private UserProfile profile = new UserProfile();
- @OneToMany(fetch = FetchType.LAZY, mappedBy="createdBy")
- @org.hibernate.search.annotations.ContainedIn
- private Set<WikiNode> createdNodes; // Just for Lucene index updates of username @Field
-
@Transient
private long ratingPoints = 0;
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/WikiNode.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/WikiNode.java 2009-04-14 14:49:30 UTC (rev 10397)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/WikiNode.java 2009-04-14 15:34:07 UTC (rev 10398)
@@ -73,8 +73,6 @@
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "CREATED_BY_USER_ID", nullable = false)
@org.hibernate.annotations.ForeignKey(name = "FK_WIKI_NODE_CREATED_BY_USER_ID")
- @org.hibernate.search.annotations.IndexedEmbedded(prefix = "createdBy_")
- @Searchable(description = "Created By", type = SearchableType.STRING, embeddedProperty = "username")
protected User createdBy;
@Column(name = "LAST_MODIFIED_ON", nullable = true)
@@ -89,8 +87,6 @@
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "LAST_MODIFIED_BY_USER_ID", nullable = true)
@org.hibernate.annotations.ForeignKey(name = "FK_WIKI_NODE_LAST_MODIFIED_BY")
- @org.hibernate.search.annotations.IndexedEmbedded(prefix = "lastModifiedBy_")
- @Searchable(description = "Last Modified By", type = SearchableType.STRING, embeddedProperty = "username")
protected User lastModifiedBy;
@Column(name = "WRITE_ACCESS_LEVEL", nullable = false)
15 years, 7 months
Seam SVN: r10397 - in trunk/examples/wiki: src/main/org/jboss/seam/wiki/core/plugin/metamodel and 6 other directories.
by seam-commits@lists.jboss.org
Author: christian.bauer(a)jboss.com
Date: 2009-04-14 10:49:30 -0400 (Tue, 14 Apr 2009)
New Revision: 10397
Added:
trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/PostingHistory.java
trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/i18n/messages_postingHistory_en.properties
trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/postingHistory.xhtml
Modified:
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/plugin/WikiPluginMacro.java
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/plugin/metamodel/MacroPluginModule.java
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/plugin/metamodel/PluginModule.java
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/WikiPluginThemeResource.java
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/wikitext/renderer/jsf/MacroIncludeTextRenderer.java
trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/Forum.plugin.xml
trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/ForumDAO.java
trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/ForumQueries.hbm.xml
trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/TopicInfo.java
trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/forumListTable.xhtml
trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/lastTopicPost.xhtml
trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/topicTable.xhtml
trunk/examples/wiki/view/userProfile_d.xhtml
Log:
JBSEAM-2629, new user profile plugin showing forum posting history
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/plugin/WikiPluginMacro.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/plugin/WikiPluginMacro.java 2009-04-14 14:42:50 UTC (rev 10396)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/plugin/WikiPluginMacro.java 2009-04-14 14:49:30 UTC (rev 10397)
@@ -19,7 +19,6 @@
import java.io.Serializable;
import java.util.Map;
import java.util.HashMap;
-import java.util.UUID;
import java.util.Date;
/**
@@ -121,11 +120,11 @@
}
public String getRequestImagePath() {
- return getRequestPathPrefix() + getMetadata().getRequestImagePath();
+ return getRequestPathPrefix() + getMetadata().getImagePath();
}
- public String getRequestCSSPath() {
- return getRequestPathPrefix() + getMetadata().getRequestCSSPath();
+ public String getRequestStylesheetPath() {
+ return getRequestPathPrefix() + getMetadata().getStylesheetPath();
}
private String getRequestPathPrefix() {
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/plugin/metamodel/MacroPluginModule.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/plugin/metamodel/MacroPluginModule.java 2009-04-14 14:42:50 UTC (rev 10396)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/plugin/metamodel/MacroPluginModule.java 2009-04-14 14:49:30 UTC (rev 10397)
@@ -126,20 +126,6 @@
return Collections.unmodifiableList(new ArrayList(parameters));
}
- public String getRequestImagePath() {
- return Plugin.GENERATE_RESOURCE_PATH_THEME
- + "/" + getPlugin().getKey()
- + "/" + getKey()
- + "/" + Plugin.PACKAGE_THEMES_IMG;
- }
-
- public String getRequestCSSPath() {
- return Plugin.GENERATE_RESOURCE_PATH_THEME
- + "/" + getPlugin().getKey()
- + "/" + getKey()
- + "/" + Plugin.PACKAGE_THEMES_CSS;
- }
-
// TODO: This is only used in the Administration UI
public String getModuleTypeLabel() {
return "Macro";
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/plugin/metamodel/PluginModule.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/plugin/metamodel/PluginModule.java 2009-04-14 14:42:50 UTC (rev 10396)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/plugin/metamodel/PluginModule.java 2009-04-14 14:49:30 UTC (rev 10397)
@@ -109,5 +109,19 @@
return getFullyQualifiedKey() + "." + name;
}
+ public String getImagePath() {
+ return Plugin.GENERATE_RESOURCE_PATH_THEME
+ + "/" + getPlugin().getKey()
+ + "/" + getKey()
+ + "/" + Plugin.PACKAGE_THEMES_IMG;
+ }
+
+ public String getStylesheetPath() {
+ return Plugin.GENERATE_RESOURCE_PATH_THEME
+ + "/" + getPlugin().getKey()
+ + "/" + getKey()
+ + "/" + Plugin.PACKAGE_THEMES_CSS;
+ }
+
public abstract String getModuleTypeLabel();
}
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/WikiPluginThemeResource.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/WikiPluginThemeResource.java 2009-04-14 14:42:50 UTC (rev 10396)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/WikiPluginThemeResource.java 2009-04-14 14:49:30 UTC (rev 10397)
@@ -16,10 +16,8 @@
import org.jboss.seam.util.Resources;
import org.jboss.seam.web.AbstractResource;
import org.jboss.seam.wiki.core.plugin.PluginRegistry;
-import org.jboss.seam.wiki.core.plugin.WikiPluginMacro;
import org.jboss.seam.wiki.core.plugin.metamodel.Plugin;
-import org.jboss.seam.wiki.core.plugin.metamodel.MacroPluginModule;
-import org.jboss.seam.wiki.core.model.WikiTextMacro;
+import org.jboss.seam.wiki.core.plugin.metamodel.PluginModule;
import org.jboss.seam.core.Expressions;
import javax.servlet.ServletException;
@@ -41,9 +39,9 @@
* <p>
* It is primarily used for serving up plugin CSS and image files. It can also interpolate
* EL expressions in certain resources, configured with <tt>interpolatedResourcesExtensions</tt>.
- * The default is to parse resources with <tt>css</tt> extension. A temporary
- * <tt>WikiPluginMacro</tt> instance is available in these expressions as <tt>currentMacro</tt>,
- * you can utilize this to access the metadata (e.g. paths) of the plugin.
+ * The default is to parse resources with <tt>css</tt> extension. A <tt>PluginModule</tt> instance
+ * is always available as variable <tt>currentPluginModule</tt>, which allows direct access to metadata
+ * and path information such as <tt>imagePath</tt> and <tt>styleSheetPath</tt>.
* </p>
*
* @author Christian Bauer
@@ -57,7 +55,7 @@
private static final Pattern EL_PATTERN = Pattern.compile("#" + Pattern.quote("{") + "(.*)" + Pattern.quote("}"));
- // Resources URIs end with /<pluginKey/<pluginMacroModuleKey>/<themeResourceName>.<themeResourceExtension>
+ // Resources URIs end with /<pluginKey/<pluginModuleKey>/<themeResourceName>.<themeResourceExtension>
public static Pattern PLUGIN_RESOURCE_PATTERN =
Pattern.compile("^/(" + Plugin.KEY_PATTERN + ")/(" + Plugin.KEY_PATTERN + ")/(.+?)\\.([a-z]+)$");
@@ -97,19 +95,19 @@
String pathInfo = request.getPathInfo().substring(getResourcePath().length());
String pluginKey = null;
- String pluginMacroModuleKey = null;
+ String pluginModuleKey = null;
String themeResourceName = null;
String themeResourceExtension = null;
Matcher matcher = PLUGIN_RESOURCE_PATTERN.matcher(pathInfo);
if (matcher.find()) {
pluginKey = matcher.group(1);
- pluginMacroModuleKey = matcher.group(2);
+ pluginModuleKey = matcher.group(2);
themeResourceName = matcher.group(3);
themeResourceExtension = matcher.group(4);
log.debug("request for resource,"
+ " plugin key '" + pluginKey + "'"
- + " plugin macro module key '" + pluginMacroModuleKey + "'"
+ + " plugin module key '" + pluginModuleKey + "'"
+ " theme resource name '" + themeResourceName + "'"
+ " theme resource ext '" + themeResourceExtension + "'"
);
@@ -118,8 +116,8 @@
response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Plugin key not found");
return;
}
- if (pluginMacroModuleKey == null) {
- response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Plugin macro module key not found");
+ if (pluginModuleKey == null) {
+ response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Plugin module key not found");
return;
}
if (themeResourceName == null) {
@@ -130,28 +128,16 @@
PluginRegistry registry = PluginRegistry.instance();
Plugin plugin = registry.getPlugin(pluginKey);
if (plugin == null) {
- response.sendError(HttpServletResponse.SC_NOT_FOUND, "Plugin key not found in registry: " + pluginKey);
+ response.sendError(HttpServletResponse.SC_NOT_FOUND, "Plugin not found in registry: " + pluginKey);
return;
}
-
- // First, check the registry if we have the fully qualified name as a macro plugin module
- MacroPluginModule macroPluginModule =
- registry.getMacroPluginModulesByKey().get(plugin.getKey() + "." + pluginMacroModuleKey);
-
- // Then also check if it's a module of the given plugin
- if (macroPluginModule == null || plugin.getModuleByKey(pluginMacroModuleKey) == null) {
- response.sendError(
- HttpServletResponse.SC_NOT_FOUND,
- "Plugin macro module key not found in registry or not available for plugin: " + pluginMacroModuleKey
- );
+ PluginModule pluginModule = plugin.getModuleByKey(pluginModuleKey);
+ if (pluginModule == null) {
+ response.sendError(HttpServletResponse.SC_NOT_FOUND, "Plugin module not found: " + pluginKey+"."+pluginModuleKey);
return;
}
- // Create a new WikiPluginMacro instance which will be available during interpolation as 'currentMacro'
- WikiPluginMacro pluginMacro = registry.createWikiPluginMacro(
- new WikiTextMacro(macroPluginModule.getName())
- );
- org.jboss.seam.contexts.Contexts.getEventContext().set(WikiPluginMacro.CURRENT_MACRO_EL_VARIABLE, pluginMacro);
+ org.jboss.seam.contexts.Contexts.getEventContext().set("currentPluginModule", pluginModule);
String resourcePath = plugin.getPackageThemePath() + "/" + themeResourceName + "." + themeResourceExtension;
InputStream in = Resources.getResourceAsStream(resourcePath, getServletContext());
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/wikitext/renderer/jsf/MacroIncludeTextRenderer.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/wikitext/renderer/jsf/MacroIncludeTextRenderer.java 2009-04-14 14:42:50 UTC (rev 10396)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/wikitext/renderer/jsf/MacroIncludeTextRenderer.java 2009-04-14 14:49:30 UTC (rev 10397)
@@ -222,7 +222,7 @@
String cssPath = "/" + pluginMacro.getMetadata().getPlugin().getPackageCSSPath() + "/" + pluginMacro.getName() + ".css";
log.debug("trying to load CSS resource from classpath: " + cssPath);
if (ResourceLoader.instance().getResource(cssPath) != null) {
- String cssRequestURIPath = pluginMacro.getRequestCSSPath() + "/" + pluginMacro.getName() + ".css";
+ String cssRequestURIPath = pluginMacro.getRequestStylesheetPath() + "/" + pluginMacro.getName() + ".css";
log.debug("including macro CSS file, rendering URI for document head: " + cssRequestURIPath);
// Use Ajax4JSF loader, it can do what we want - add a CSS <link> to the HTML <head>
Modified: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/Forum.plugin.xml
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/Forum.plugin.xml 2009-04-14 14:42:50 UTC (rev 10396)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/Forum.plugin.xml 2009-04-14 14:49:30 UTC (rev 10397)
@@ -98,5 +98,11 @@
</skins>
</macro>
+ <profile key="postingHistory" template="postingHistory" priority="110">
+ <skins>
+ <skin name="d"/>
+ </skins>
+ </profile>
+
</plugin>
Modified: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/ForumDAO.java
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/ForumDAO.java 2009-04-14 14:42:50 UTC (rev 10396)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/ForumDAO.java 2009-04-14 14:49:30 UTC (rev 10397)
@@ -2,7 +2,6 @@
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.AutoCreate;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.wiki.core.model.*;
import org.jboss.seam.wiki.core.dao.WikiNodeDAO;
@@ -30,6 +29,69 @@
@In
Integer currentAccessLevel;
+ public List<WikiDirectory> findForumDirectories() {
+ return getSession(true).getNamedQuery("forumDirectories")
+ .setComment("Finding forum directories")
+ .list();
+ }
+
+ public Long findForumPostingsCount(List<WikiDirectory> forumDirectories, User user) {
+ return (Long) getSession(true).getNamedQuery("forumTopicsForUserCount")
+ .setParameterList("parentDirectories", forumDirectories)
+ .setParameter("user", user)
+ .setComment("Finding forum topcis count for user: " + user)
+ .uniqueResult();
+ }
+
+ public List<TopicInfo> findForumPostings(List<WikiDirectory> forumDirectories, User user, int firstResult, int maxResults) {
+
+ final Map<Long, TopicInfo> topicInfoMap = new LinkedHashMap();
+
+ getSession(true).getNamedQuery("forumTopicsForUser")
+ .setParameterList("parentDirectories", forumDirectories)
+ .setParameter("user", user)
+ .setComment("Finding forum topcis for user: " + user)
+ .setResultTransformer(
+ new ResultTransformer() {
+ public Object transformTuple(Object[] result, String[] strings) {
+ WikiDocument doc = (WikiDocument) result[0];
+ topicInfoMap.put(
+ doc.getId(),
+ new TopicInfo(doc)
+ );
+ return null;
+ }
+ public List transformList(List list) { return list; }
+ }
+ )
+ .setFirstResult(firstResult)
+ .setMaxResults(maxResults)
+ .list();
+
+ if (topicInfoMap.size() > 0) {
+ getSession(true).getNamedQuery("forumTopicsReplies")
+ .setParameterList("topicIds", topicInfoMap.keySet())
+ .setComment("Retrieving forum topic replies")
+ .setResultTransformer(
+ new ResultTransformer() {
+ public Object transformTuple(Object[] result, String[] strings) {
+ if (topicInfoMap.containsKey((Long)result[1])) {
+ TopicInfo info = topicInfoMap.get( (Long)result[1] );
+ info.setNumOfReplies((Long)result[2]);
+ info.setLastComment((WikiComment)result[0]);
+ }
+ return null;
+ }
+ public List transformList(List list) { return list; }
+ }
+ )
+ .list();
+ }
+
+ return new ArrayList(topicInfoMap.values());
+ }
+
+
public List<WikiMenuItem> findForumsMenuItems(WikiDirectory forumsDirectory) {
return getSession(true).getNamedQuery("forumsMenuItems")
.setParameter("parentDir", forumsDirectory)
Modified: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/ForumQueries.hbm.xml
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/ForumQueries.hbm.xml 2009-04-14 14:42:50 UTC (rev 10396)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/ForumQueries.hbm.xml 2009-04-14 14:49:30 UTC (rev 10397)
@@ -12,6 +12,40 @@
<hibernate-mapping>
+ <query name="forumDirectories">
+ select
+ dir
+ from
+ WikiDirectory dir, WikiDocument doc
+ where
+ dir = doc.parent
+ and doc.contentMacrosString like '%forumTopics%'
+ </query>
+
+ <query name="forumTopicsForUserCount">
+ select
+ count(t)
+ from
+ WikiDocument t
+ where
+ t.parent in (:parentDirectories)
+ and (t.headerMacrosString like '%forumPosting%' or t.headerMacrosString like '%forumStickyPosting%')
+ and t.createdBy = :user
+ </query>
+
+ <query name="forumTopicsForUser">
+ select
+ t
+ from
+ WikiDocument t
+ where
+ t.parent in (:parentDirectories)
+ and (t.headerMacrosString like '%forumPosting%' or t.headerMacrosString like '%forumStickyPosting%')
+ and t.createdBy = :user
+ order by
+ t.createdOn desc
+ </query>
+
<query name="forumsCount">
select count(d.id)
from
Added: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/PostingHistory.java
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/PostingHistory.java (rev 0)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/PostingHistory.java 2009-04-14 14:49:30 UTC (rev 10397)
@@ -0,0 +1,65 @@
+package org.jboss.seam.wiki.plugin.forum;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.*;
+import org.jboss.seam.wiki.core.action.Pager;
+import org.jboss.seam.wiki.core.action.UserHome;
+import org.jboss.seam.wiki.core.model.WikiDirectory;
+
+import java.util.List;
+import java.io.Serializable;
+
+/**
+ * @author Christian Bauer
+ */
+@Name("postingHistory")
+(a)Scope(ScopeType.PAGE)
+public class PostingHistory implements Serializable {
+
+ @In
+ UserHome userHome;
+
+ @In(create = true)
+ ForumDAO forumDAO;
+
+ private List<WikiDirectory> forumDirectories;
+ private List<TopicInfo> topics;
+ private Pager topicPager = new Pager("TopicPager", 15l);
+
+ @Create
+ public void onCreate() {
+ forumDirectories = forumDAO.findForumDirectories();
+ refreshTopics();
+ }
+
+ @Observer(value = {"TopicPager.pageChanged"}, create = false)
+ public void refreshTopics() {
+ countTopics();
+ loadTopics();
+ }
+
+ public List<TopicInfo> getTopics() {
+ return topics;
+ }
+
+ public Pager getTopicPager() {
+ return topicPager;
+ }
+
+ protected void countTopics() {
+ Long numOfRecords = forumDAO.findForumPostingsCount(forumDirectories, userHome.getInstance());
+ topicPager.setNumOfRecords(numOfRecords);
+ }
+
+ protected void loadTopics() {
+
+ topics =
+ forumDAO.findForumPostings(
+ forumDirectories,
+ userHome.getInstance(),
+ topicPager.getQueryFirstResult(),
+ topicPager.getQueryMaxResults()
+ );
+
+ }
+}
Modified: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/TopicInfo.java
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/TopicInfo.java 2009-04-14 14:42:50 UTC (rev 10396)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/TopicInfo.java 2009-04-14 14:49:30 UTC (rev 10397)
@@ -2,9 +2,11 @@
import org.jboss.seam.wiki.core.model.WikiDocument;
import org.jboss.seam.wiki.core.model.WikiComment;
+import org.jboss.seam.wiki.core.model.WikiDirectory;
public class TopicInfo {
+ private WikiDirectory forum;
private WikiDocument topic;
private boolean unread;
private boolean sticky;
@@ -17,6 +19,11 @@
this.replies = replies;
}
+ public TopicInfo(WikiDocument topic) {
+ this.forum = (WikiDirectory) topic.getParent();
+ this.topic = topic;
+ }
+
public void setTopic(WikiDocument topic) {
this.topic = topic;
}
@@ -25,6 +32,10 @@
return topic;
}
+ public WikiDirectory getForum() {
+ return forum;
+ }
+
public boolean isUnread() {
return unread;
}
Added: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/i18n/messages_postingHistory_en.properties
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/i18n/messages_postingHistory_en.properties (rev 0)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/i18n/messages_postingHistory_en.properties 2009-04-14 14:49:30 UTC (rev 10397)
@@ -0,0 +1,10 @@
+forum.postingHistory.label=Forum Posting History
+forum.postingHistory.description=Overview of all forum postings of a particular user.
+forum.postingHistory.titlePluralSuffix='s
+forum.postingHistory.title=Forum Topics
+forum.postingHistory.date=Date
+forum.postingHistory.forum=Forum
+forum.postingHistory.topic=Topic
+forum.postingHistory.lastReply=Last Reply
+
+
Modified: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/forumListTable.xhtml
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/forumListTable.xhtml 2009-04-14 14:42:50 UTC (rev 10396)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/forumListTable.xhtml 2009-04-14 14:49:30 UTC (rev 10397)
@@ -24,8 +24,7 @@
defaultColumn rightBorder bottomBorder alignLeft wrapWhitespace,
fivePercentColumn rightBorder bottomBorder alignCenter smallFont,
fivePercentColumn rightBorder bottomBorder alignCenter smallFont,
- tenPercentColumn rightBorder bottomBorder alignCenter smallFont,
- tenPercentColumn rightBorder bottomBorder alignCenter smallFont"
+ twentyPercentColumn rightBorder bottomBorder alignCenter smallFont"
rowClasses="forumListRow"
cellpadding="0" cellspacing="0" border="0">
@@ -82,6 +81,7 @@
<h:outputText value="-" rendered="#{empty f.totalNumOfPosts}"/>
</h:column>
+ <!--
<h:column rendered="#{not forumListHome.managed}">
<f:facet name="header">#{messages['forum.label.NewestTopic']}</f:facet>
<s:fragment rendered="#{not empty f.lastTopic}">
@@ -96,6 +96,7 @@
-
</s:fragment>
</h:column>
+ -->
<h:column rendered="#{not forumListHome.managed}">
<f:facet name="header">#{messages['forum.label.LatestPost']}</f:facet>
Modified: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/lastTopicPost.xhtml
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/lastTopicPost.xhtml 2009-04-14 14:42:50 UTC (rev 10396)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/lastTopicPost.xhtml 2009-04-14 14:49:30 UTC (rev 10397)
@@ -10,7 +10,7 @@
<s:div>
<h:outputLink value="#{link}" tabindex="1">
- <h:outputText value="#{wiki:truncateString(name, 25, '...')}"/>
+ <h:outputText value="#{wiki:truncateString(name, 45, '...')}"/>
<h:graphicImage styleClass="topicGotoIcon" value="#{currentMacro.requestImagePath}/icon.posting_goto.gif" width="18" height="9"/>
</h:outputLink>
</s:div>
Added: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/postingHistory.xhtml
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/postingHistory.xhtml (rev 0)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/postingHistory.xhtml 2009-04-14 14:49:30 UTC (rev 10397)
@@ -0,0 +1,120 @@
+<s:fragment
+ rendered="#{not empty postingHistory.topics}"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:wiki="http://jboss.com/products/seam/wiki"
+ xmlns:s="http://jboss.com/products/seam/taglib">
+
+ <s:div styleClass="box">
+
+ <s:div styleClass="boxHeader">
+ <h:outputText value="#{userHome.instance.fullname}#{messages['forum.postingHistory.titlePluralSuffix']}"/>
+ <h:outputText value=" #{messages['forum.postingHistory.title']}"/>
+ </s:div>
+
+ <s:div styleClass="boxContent" style="border:none">
+
+ <h:form>
+ <s:div id="topicList">
+
+ <ui:include src="/includes/pager.xhtml">
+ <ui:param name="pager" value="#{postingHistory.topicPager}"/>
+ <ui:param name="pagerStyleClass" value="pagerTop smallFont"/>
+ <ui:param name="pagerSingularLabel" value="topic"/>
+ <ui:param name="pagerPluralLabel" value="topics"/>
+ <ui:param name="useAjax" value="true"/>
+ <ui:param name="renderOnSelect" value="topicList"/>
+ </ui:include>
+
+ <h:dataTable id="topicListTable" cellpadding="0" cellspacing="0"
+ styleClass="datatable smallFont undecoratedLink topLeftBottomBorder"
+ headerClass="sortableHeader alignCenter rightBorder"
+ columnClasses="fifteenPercentColumn alignRight rightBorder,
+ fifteenPercentColumn alignCenter rightBorder,
+ defaultColumn alignLeft wrapWhitespace rightBorder,
+ twentyPercentColumn alignCenter rightBorder"
+ rowClasses="rowOdd,rowEven"
+ var="topicInfo" value="#{postingHistory.topics}">
+
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="#{messages['forum.postingHistory.date']}"/>
+ </f:facet>
+
+ <h:outputText value="#{topicInfo.topic.createdOn}">
+ <f:convertDateTime pattern="dd. MMM yyyy, HH:mm"
+ timeZone="#{preferences.get('Wiki').timeZone}"/>
+ </h:outputText>
+ </h:column>
+
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="#{messages['forum.postingHistory.forum']}"/>
+ </f:facet>
+
+ <h:outputText value="#{topicInfo.forum.name}"/>
+ </h:column>
+
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="#{messages['forum.postingHistory.topic']}"/>
+ </f:facet>
+
+ <h:outputLink value="#{wikiURLRenderer.renderURL(topicInfo.topic)}">
+ <h:outputText value="#{wiki:truncateString(topicInfo.topic.name, 60, '...')}"/>
+ </h:outputLink>
+
+ </h:column>
+
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="#{messages['forum.postingHistory.lastReply']}"/>
+ </f:facet>
+
+ <s:fragment rendered="#{not empty topicInfo.lastComment}">
+ <h:outputLink value="#{wikiURLRenderer.renderURL(topicInfo.lastComment)}">
+ <h:outputText value="#{topicInfo.lastComment.createdOn}">
+ <f:convertDateTime pattern="dd. MMM yyyy, HH:mm "
+ timeZone="#{preferences.get('Wiki').timeZone}"/>
+ </h:outputText>
+ <h:graphicImage styleClass="topicGotoIcon"
+ value="#{currentPluginModule.imagePath}/icon.posting_goto.gif"
+ width="18" height="9"/>
+ </h:outputLink>
+
+ <ui:include src="/includes/userProfileLink.xhtml">
+ <ui:param name="user" value="#{topicInfo.lastComment.createdBy}"/>
+ </ui:include>
+
+ </s:fragment>
+
+ <s:fragment rendered="#{empty topicInfo.lastComment}">
+ <s:div style="line-height:300%">
+ <h:outputText value="-"/>
+ </s:div>
+ </s:fragment>
+
+ </h:column>
+
+ </h:dataTable>
+
+ <ui:include src="/includes/pager.xhtml">
+ <ui:param name="pager" value="#{postingHistory.topicPager}"/>
+ <ui:param name="pagerStyleClass" value="pagerBottom smallFont"/>
+ <ui:param name="pagerSingularLabel" value="topic"/>
+ <ui:param name="pagerPluralLabel" value="topics"/>
+ <ui:param name="useAjax" value="true"/>
+ <ui:param name="renderOnSelect" value="topicList"/>
+ </ui:include>
+
+ </s:div>
+
+ </h:form>
+
+ </s:div>
+
+ </s:div>
+
+</s:fragment>
Modified: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/topicTable.xhtml
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/topicTable.xhtml 2009-04-14 14:42:50 UTC (rev 10396)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/topicTable.xhtml 2009-04-14 14:49:30 UTC (rev 10397)
@@ -18,7 +18,7 @@
<s:div styleClass="box">
<h:dataTable id="topicTable"
- var="t"
+ var="topicInfo"
value="#{forumQuery.topics}"
styleClass="datatable topLeftBottomBorder topicTable"
headerClass="regularHeader rightBorder alignCenter smallFont"
@@ -30,29 +30,29 @@
<h:column>
<f:facet name="header"> </f:facet>
- <h:graphicImage value="#{currentMacro.requestImagePath}/icon.#{t.iconName}.gif" width="22" height="26"/>
+ <h:graphicImage value="#{currentMacro.requestImagePath}/icon.#{topicInfo.iconName}.gif" width="22" height="26"/>
</h:column>
<h:column>
<f:facet name="header">Topic</f:facet>
- <h:outputLink value="#{wikiURLRenderer.renderURL(t.topic)}" tabindex="1">
- <h:outputText value="#{wiki:truncateString(t.topic.name, 60, '...')}"/>
+ <h:outputLink value="#{wikiURLRenderer.renderURL(topicInfo.topic)}" tabindex="1">
+ <h:outputText value="#{wiki:truncateString(topicInfo.topic.name, 60, '...')}"/>
</h:outputLink>
</h:column>
<h:column>
<f:facet name="header">Replies</f:facet>
- <h:outputText value="#{t.numOfReplies}" rendered="#{t.numOfReplies != 0}"/>
- <h:outputText value="-" rendered="#{t.numOfReplies == 0}"/>
+ <h:outputText value="#{topicInfo.numOfReplies}" rendered="#{topicInfo.numOfReplies != 0}"/>
+ <h:outputText value="-" rendered="#{topicInfo.numOfReplies == 0}"/>
</h:column>
<h:column>
<f:facet name="header">Author</f:facet>
<ui:include src="/includes/userProfileLink.xhtml">
- <ui:param name="user" value="#{t.topic.createdBy}"/>
+ <ui:param name="user" value="#{topicInfo.topic.createdBy}"/>
</ui:include>
</h:column>
@@ -60,30 +60,30 @@
<h:column>
<f:facet name="header">Last Post</f:facet>
- <s:fragment rendered="#{not empty t.lastComment}">
- <h:outputLink value="#{wikiURLRenderer.renderURL(t.lastComment)}" tabindex="1">
- <h:outputText value="#{t.lastComment.createdOn}">
+ <s:fragment rendered="#{not empty topicInfo.lastComment}">
+ <h:outputLink value="#{wikiURLRenderer.renderURL(topicInfo.lastComment)}" tabindex="1">
+ <h:outputText value="#{topicInfo.lastComment.createdOn}">
<f:convertDateTime pattern="dd. MMM yyyy, HH:mm" timeZone="#{preferences.get('Wiki').timeZone}"/>
</h:outputText>
<h:graphicImage styleClass="topicGotoIcon" value="#{currentMacro.requestImagePath}/icon.posting_goto.gif" width="18" height="9"/>
</h:outputLink>
<ui:include src="/includes/userProfileLink.xhtml">
- <ui:param name="user" value="#{t.lastComment.createdBy}"/>
+ <ui:param name="user" value="#{topicInfo.lastComment.createdBy}"/>
</ui:include>
</s:fragment>
- <s:fragment rendered="#{empty t.lastComment}">
- <h:outputLink value="#{wikiURLRenderer.renderURL(t.topic)}" tabindex="1">
- <h:outputText value="#{t.topic.createdOn}">
+ <s:fragment rendered="#{empty topicInfo.lastComment}">
+ <h:outputLink value="#{wikiURLRenderer.renderURL(topicInfo.topic)}" tabindex="1">
+ <h:outputText value="#{topicInfo.topic.createdOn}">
<f:convertDateTime pattern="dd. MMM yyyy, HH:mm" timeZone="#{preferences.get('Wiki').timeZone}"/>
</h:outputText>
<h:graphicImage styleClass="topicGotoIcon" value="#{currentMacro.requestImagePath}/icon.posting_goto.gif" width="18" height="9"/>
</h:outputLink>
<ui:include src="/includes/userProfileLink.xhtml">
- <ui:param name="user" value="#{t.topic.createdBy}"/>
+ <ui:param name="user" value="#{topicInfo.topic.createdBy}"/>
</ui:include>
</s:fragment>
Modified: trunk/examples/wiki/view/userProfile_d.xhtml
===================================================================
--- trunk/examples/wiki/view/userProfile_d.xhtml 2009-04-14 14:42:50 UTC (rev 10396)
+++ trunk/examples/wiki/view/userProfile_d.xhtml 2009-04-14 14:49:30 UTC (rev 10397)
@@ -32,6 +32,7 @@
<s:div>
<c:forEach var="pm" items="#{pluginRegistry.profilePluginModulesAsList}">
+ <c:set value="#{pm}" var="currentPluginModule"/>
<ui:include src="/#{pm.plugin.getPackageDefaultTemplatePath(pm.template)}"/>
<br/>
</c:forEach>
15 years, 7 months
Seam SVN: r10396 - in trunk/examples/wiki: src/main/org/jboss/seam/wiki/util and 1 other directory.
by seam-commits@lists.jboss.org
Author: christian.bauer(a)jboss.com
Date: 2009-04-14 10:42:50 -0400 (Tue, 14 Apr 2009)
New Revision: 10396
Modified:
trunk/examples/wiki/README.txt
trunk/examples/wiki/src/main/org/jboss/seam/wiki/util/WikiMySQL5HibernateDialect.java
Log:
JBSEAM-4086, migrate sfwk.org production database to UTF, enable by default
Modified: trunk/examples/wiki/README.txt
===================================================================
--- trunk/examples/wiki/README.txt 2009-04-14 14:38:48 UTC (rev 10395)
+++ trunk/examples/wiki/README.txt 2009-04-14 14:42:50 UTC (rev 10396)
@@ -85,37 +85,15 @@
INSTALLATION WITH UNICODE SUPPORT ON MYSQL
==========================================================================================
-If you want to use any non-latin characters, create the MySQL database you want to use (or
-drop and recreate the default 'test' database) with the following options:
+The database tables in wiki-ddl.sql are automatically created with UTF8 support.
- CREATE DATABASE test CHARACTER SET utf8 COLLATE utf8_general_ci;
-
-Your database should at least have the 'character_set_database' variable set to 'utf8':
-
- mysql> show variables like '%character%';
- +--------------------------+------------------------------------------------------------+
- | Variable_name | Value |
- +--------------------------+------------------------------------------------------------+
- | character_set_client | latin1 |
- | character_set_connection | latin1 |
- | character_set_database | utf8 |
- | character_set_filesystem | binary |
- | character_set_results | latin1 |
- | character_set_server | latin1 |
- | character_set_system | utf8 |
- | character_sets_dir | /usr/local/mysql-5.0.45-osx10.4-i686/share/mysql/charsets/ |
- +--------------------------+------------------------------------------------------------+
-
-If you keep the default latin1 encoding, exceptions will be thrown by the application as
-soon as you try to store any non-latin character.
-
Note that due to URL rewriting rules, stored wiki items (documents, uploaded files) MUST have
at least three latin1 characters in their name! The application will prompt you with a validation
error message when you forget that limitation and enter only non-latin1 characters in a form.
-The wiki search engine passes search terms as request parameters in the URI. If you require
-unicode support for search terms, you need to set an option in Tomcat to enable the correct
-decoding of URL-encoded request parameter values to UTF-8. To do that, edit
+Furthermore, the wiki search engine passes search terms as request parameters in the URI and allows bookmarking
+of search terms. If you require unicode support for search terms, you need to set an option in Tomcat to
+enable the correct decoding of URL-encoded request parameter values to UTF-8. To do that, edit
${JBOSS_HOME}/server/(default)/deploy/jboss-web.deployer/server.xml
@@ -125,4 +103,3 @@
to the <connector> declaration.
-
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/util/WikiMySQL5HibernateDialect.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/util/WikiMySQL5HibernateDialect.java 2009-04-14 14:38:48 UTC (rev 10395)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/util/WikiMySQL5HibernateDialect.java 2009-04-14 14:42:50 UTC (rev 10396)
@@ -17,15 +17,25 @@
*/
public class WikiMySQL5HibernateDialect extends MySQL5InnoDBDialect {
- protected void registerVarcharTypes() {
- registerColumnType( Types.VARCHAR, "longtext" );
- registerColumnType( Types.VARCHAR, 16777215, "mediumtext" );
+ @Override
+ protected void registerVarcharTypes() {
+ // TODO: The MySQL default makes it difficult to migrate the data because mysqldump is braindead...
+ // registerColumnType(Types.BIT, "tinyint(1)");
+
// It's pretty safe to assume that anything with more than 1024 characters (minus length byte) should probably be
// a TEXT, not a VARCHAR which would have the "maximum row size" limit of 65KB.
// I mean, where is the limit? If you have 20 of these VARCHAR fields on a table, and your character set is
// UTF8, you are over the limit. Less than 20 or so should be OK. Just another fine example of how MySQL
// protects its users from seeing its ugly internal implementation details.
- registerColumnType( Types.VARCHAR, 1023, "varchar($l)" );
- }
+ registerColumnType(Types.VARCHAR, "longtext");
+ registerColumnType(Types.VARCHAR, 16777215, "mediumtext");
+ registerColumnType(Types.VARCHAR, 1023, "varchar($l)");
+ }
+
+ // Create all tables as default UTF8!
+ @Override
+ public String getTableTypeString() {
+ return " ENGINE=InnoDB DEFAULT CHARSET=utf8";
+ }
}
15 years, 7 months
Seam SVN: r10395 - in trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum: i18n and 3 other directories.
by seam-commits@lists.jboss.org
Author: christian.bauer(a)jboss.com
Date: 2009-04-14 10:38:48 -0400 (Tue, 14 Apr 2009)
New Revision: 10395
Added:
trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/themes/default/mailtemplates/forumNotifyReplyToPosters.xhtml
trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/themes/inrelationto/mailtemplates/forumNotifyReplyToPosters.xhtml
trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/themes/sfwkorg/mailtemplates/forumNotifyReplyToPosters.xhtml
Modified:
trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/ReplyHome.java
trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/i18n/messages_forum_en.properties
Log:
JBSEAM-4009, e-mail all posters of a forum thread if enabled in profile
Modified: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/ReplyHome.java
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/ReplyHome.java 2009-04-14 14:28:35 UTC (rev 10394)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/ReplyHome.java 2009-04-14 14:38:48 UTC (rev 10395)
@@ -2,6 +2,7 @@
import org.jboss.seam.Component;
import org.jboss.seam.ScopeType;
+import org.jboss.seam.contexts.Contexts;
import org.jboss.seam.annotations.*;
import org.jboss.seam.faces.Renderer;
import org.jboss.seam.international.StatusMessages;
@@ -9,18 +10,24 @@
import org.jboss.seam.wiki.core.action.CommentHome;
import org.jboss.seam.wiki.core.model.WikiComment;
import org.jboss.seam.wiki.core.model.WikiNode;
+import org.jboss.seam.wiki.core.model.User;
import org.jboss.seam.wiki.core.ui.WikiRedirect;
import org.jboss.seam.wiki.core.plugin.PluginRegistry;
import org.jboss.seam.wiki.preferences.Preferences;
import static org.jboss.seam.international.StatusMessage.Severity.INFO;
+import java.util.List;
+import java.util.Set;
+import java.util.HashSet;
+
@Name("replyHome")
@Scope(ScopeType.CONVERSATION)
public class ReplyHome extends CommentHome {
- public static final String REPLY_NOTIFY_TEMPLATE = "/mailtemplates/forumNotifyReply.xhtml";
- public static final String REPLY_NOTIFY_LIST_TEMPLATE = "/mailtemplates/forumNotifyReplyToList.xhtml";
+ public static final String REPLY_NOTIFY_ORIGINAL_POSTER_TEMPLATE = "/mailtemplates/forumNotifyReply.xhtml";
+ public static final String REPLY_NOTIFY_LIST_TEMPLATE = "/mailtemplates/forumNotifyReplyToList.xhtml";
+ public static final String REPLY_NOTIFY_POSTERS_TEMPLATE = "/mailtemplates/forumNotifyReplyToPosters.xhtml";
@Override
public void create() {
@@ -33,9 +40,9 @@
@In(create = true)
private Renderer renderer;
+ // Triggered by superclass after persist() method completes
@Observer(value = "Comment.persisted", create = false)
public void sendNotificationMails() {
- // Triggered by superclass after reply was persisted
// Notify forum mailing list
String notificationMailingList =
@@ -45,13 +52,48 @@
renderer.render(PluginRegistry.instance().getPlugin("forum").getPackageThemePath()+REPLY_NOTIFY_LIST_TEMPLATE);
}
- // Notify original poster
+ // Notify original poster (unless it is the user who posted the comment)
if (documentHome.getInstance().macroPresent(TopicHome.TOPIC_NOTIFY_ME_MACRO)
- && !documentHome.getInstance().getCreatedBy().getUsername().equals(getInstance().getCreatedBy().getUsername())
+ && !documentHome.getInstance().getCreatedBy().getId().equals(getInstance().getCreatedBy().getId())
) {
- getLog().debug("sending reply notification e-mail to original poster");
- renderer.render(PluginRegistry.instance().getPlugin("forum").getPackageThemePath()+REPLY_NOTIFY_TEMPLATE);
+ getLog().debug("sending reply notification e-mail to original poster of topic");
+ renderer.render(PluginRegistry.instance().getPlugin("forum").getPackageThemePath()+ REPLY_NOTIFY_ORIGINAL_POSTER_TEMPLATE);
}
+
+ // Find all posters of the thread
+ Set<User> notifyPosters = new HashSet();
+ getLog().debug("finding all posters of current topic thread");
+ List<WikiComment> comments = getWikiNodeDAO().findWikiCommentsFlat(documentHome.getInstance(), true);
+ for (WikiComment comment : comments) {
+
+ Long commentPosterId = comment.getCreatedBy().getId();
+ // Notify the guy if he is not a) the poster of the current comment or b) the original topic poster
+ if (!commentPosterId.equals(getInstance().getCreatedBy().getId()) &&
+ !commentPosterId.equals(documentHome.getInstance().getCreatedBy().getId())) {
+
+ getLog().debug("adding poster to notification list: " + comment.getCreatedBy());
+ notifyPosters.add(comment.getCreatedBy()); // The set filters duplicate user instances
+ }
+ }
+
+ // Send them an e-mail as well if preferences option is enabled
+ for (User poster : notifyPosters) {
+
+ // Reading this users preferences is a bit awkward...
+ Contexts.getEventContext().set("currentPreferencesUser", poster);
+ Boolean preferencesNotifyReplies = Preferences.instance().get(ForumPreferences.class).getNotifyMeOfReplies();
+ boolean notifyReplies = preferencesNotifyReplies != null && preferencesNotifyReplies;
+ Contexts.getEventContext().remove("currentPreferencesUser");
+
+ if (notifyReplies) {
+ getLog().debug("sending reply notification e-mail to poster on the thread: " + poster);
+ Contexts.getEventContext().set("notifyPoster", poster);
+ renderer.render(PluginRegistry.instance().getPlugin("forum").getPackageThemePath()+ REPLY_NOTIFY_POSTERS_TEMPLATE);
+ } else {
+ getLog().debug("notification not enabled for poster: " + poster);
+ }
+ }
+
}
@Begin(flushMode = FlushModeType.MANUAL, join = true)
Modified: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/i18n/messages_forum_en.properties
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/i18n/messages_forum_en.properties 2009-04-14 14:28:35 UTC (rev 10394)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/i18n/messages_forum_en.properties 2009-04-14 14:38:48 UTC (rev 10395)
@@ -4,7 +4,7 @@
forum.preferences.description=Plugin: Forum
forum.preferences.property.topicsPerPage=Number of topics per page
forum.preferences.property.notificationMailingList=Send all topics/replies to this e-mail address (empty to disable)
-forum.preferences.property.notifyMeOfReplies=Enable e-mail reply notification switch by default
+forum.preferences.property.notifyMeOfReplies=E-mail me replies to my topics or any threads I posted on
forum.list.label=Forum List
forum.list.description=List of all forum subdirectories
@@ -12,7 +12,7 @@
forum.topics.label=Forum Topics
forum.topics.description=List of all topics in a forum directory
forum.topics.preferences.description=Plugin: Forum Topics
-forum.topics.preferences.property.mailingList=Send and receive topics to and from this mailinglist
+forum.topics.preferences.property.mailingList=Send and receive topics to and from this mailinglist (TODO)
forum.posting.label=Forum Posting
forum.posting.description=Turns a WikiDocument into a regular forum posting
@@ -21,7 +21,7 @@
forum.stickyPosting.description=Turns a WikiDocument into a sticky forum posting
forum.notifyReplies.label=Forum Reply Notification
-forum.notifyReplies.description=Send an e-mail to the owner of the posting if a reply is posted
+forum.notifyReplies.description=Send an e-mail to the owner of the topic if a reply is posted
forum.replies.label=Forum Replies
forum.replies.description=Shows wiki comments as posting replies thread
Added: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/themes/default/mailtemplates/forumNotifyReplyToPosters.xhtml
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/themes/default/mailtemplates/forumNotifyReplyToPosters.xhtml (rev 0)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/themes/default/mailtemplates/forumNotifyReplyToPosters.xhtml 2009-04-14 14:38:48 UTC (rev 10395)
@@ -0,0 +1,68 @@
+<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"
+ xmlns:c="http://java.sun.com/jstl/core"
+ xmlns:wiki="http://jboss.com/products/seam/wiki">
+ <m:header name="X-Sent-From" value="JBoss Seam" />
+ <m:header name="Precedence" value="list"/>
+ <m:from name="Seam Wiki" address="do-not-reply(a)jboss.com" />
+ <m:to name="#{notifyPoster.fullname}">#{notifyPoster.email}</m:to>
+ <m:subject>[LaceWiki Forums] #{replyHome.instance.subject}</m:subject>
+ <m:body>
+ <html>
+ <body>
+ <p>Hello #{notifyPoster.firstname},</p>
+
+ <p>
+ a <a href="#{wikiURLRenderer.renderURL(replyHome.instance, true)}">response</a> was made
+ on a <a href="#{wikiURLRenderer.renderURL(currentDocument, true)}">thread</a> on the
+ LaceWiki forum. You also commented on this topic, and you have this notification enabled
+ in your profile preferences.
+ </p>
+
+ <p>
+ This is the new comment, posted by #{replyHome.instance.createdBy.fullname}:
+ </p>
+
+ <hr/>
+
+ <c:if test="#{replyHome.instance.useWikiText}">
+ <wiki:formattedText value="#{replyHome.instance.content}"
+ linkStyleClass="regularLink"
+ brokenLinkStyleClass="brokenLink"
+ attachmentLinkStyleClass="regularLink"
+ thumbnailLinkStyleClass="regularLink"
+ linkBaseFile="#{currentDocument}"
+ currentAreaNumber="#{currentDocument.areaNumber}"
+ enableMacroRendering="false"/>
+ </c:if>
+ <c:if test="#{not replyHome.instance.useWikiText}">
+ <div style="font-family: Andale Mono, Courier New, monospace;">
+ <h:outputText escape="false" value="#{wiki:escapeHTML(replyHome.instance.content, true, true)}"/>
+ </div>
+ </c:if>
+
+ <hr/>
+ <a href="#{wikiURLRenderer.renderURL(replyHome.instance, true)}">Click here</a> to reply...
+
+ </body>
+ </html>
+ <f:facet name="alternative">
+ <h:outputText>
+Hello #{notifyPoster.firstname},
+
+a response was made on a forum thread on the LaceWiki community forum. You also
+commented on this topic, and you have this notification enabled in your
+profile preferences:
+
+From: #{replyHome.instance.createdBy.fullname}
+Subject:#{replyHome.instance.subject}
+
+Follow this link to read and reply:
+
+#{wikiURLRenderer.renderURL(replyHome.instance, true)}
+</h:outputText>
+ </f:facet>
+ </m:body>
+</m:message>
Added: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/themes/inrelationto/mailtemplates/forumNotifyReplyToPosters.xhtml
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/themes/inrelationto/mailtemplates/forumNotifyReplyToPosters.xhtml (rev 0)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/themes/inrelationto/mailtemplates/forumNotifyReplyToPosters.xhtml 2009-04-14 14:38:48 UTC (rev 10395)
@@ -0,0 +1,68 @@
+<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"
+ xmlns:c="http://java.sun.com/jstl/core"
+ xmlns:wiki="http://jboss.com/products/seam/wiki">
+ <m:header name="X-Sent-From" value="JBoss Seam" />
+ <m:header name="Precedence" value="list"/>
+ <m:from name="Seam Wiki" address="do-not-reply(a)jboss.com" />
+ <m:to name="#{notifyPoster.fullname}">#{notifyPoster.email}</m:to>
+ <m:subject>[LaceWiki Forums] #{replyHome.instance.subject}</m:subject>
+ <m:body>
+ <html>
+ <body>
+ <p>Hello #{notifyPoster.firstname},</p>
+
+ <p>
+ a <a href="#{wikiURLRenderer.renderURL(replyHome.instance, true)}">response</a> was made
+ on a <a href="#{wikiURLRenderer.renderURL(currentDocument, true)}">thread</a> on the
+ LaceWiki forum. You also commented on this topic, and you have this notification enabled
+ in your profile preferences.
+ </p>
+
+ <p>
+ This is the new comment, posted by #{replyHome.instance.createdBy.fullname}:
+ </p>
+
+ <hr/>
+
+ <c:if test="#{replyHome.instance.useWikiText}">
+ <wiki:formattedText value="#{replyHome.instance.content}"
+ linkStyleClass="regularLink"
+ brokenLinkStyleClass="brokenLink"
+ attachmentLinkStyleClass="regularLink"
+ thumbnailLinkStyleClass="regularLink"
+ linkBaseFile="#{currentDocument}"
+ currentAreaNumber="#{currentDocument.areaNumber}"
+ enableMacroRendering="false"/>
+ </c:if>
+ <c:if test="#{not replyHome.instance.useWikiText}">
+ <div style="font-family: Andale Mono, Courier New, monospace;">
+ <h:outputText escape="false" value="#{wiki:escapeHTML(replyHome.instance.content, true, true)}"/>
+ </div>
+ </c:if>
+
+ <hr/>
+ <a href="#{wikiURLRenderer.renderURL(replyHome.instance, true)}">Click here</a> to reply...
+
+ </body>
+ </html>
+ <f:facet name="alternative">
+ <h:outputText>
+Hello #{notifyPoster.firstname},
+
+a response was made on a forum thread on the LaceWiki community forum. You also
+commented on this topic, and you have this notification enabled in your
+profile preferences:
+
+From: #{replyHome.instance.createdBy.fullname}
+Subject:#{replyHome.instance.subject}
+
+Follow this link to read and reply:
+
+#{wikiURLRenderer.renderURL(replyHome.instance, true)}
+</h:outputText>
+ </f:facet>
+ </m:body>
+</m:message>
Added: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/themes/sfwkorg/mailtemplates/forumNotifyReplyToPosters.xhtml
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/themes/sfwkorg/mailtemplates/forumNotifyReplyToPosters.xhtml (rev 0)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/themes/sfwkorg/mailtemplates/forumNotifyReplyToPosters.xhtml 2009-04-14 14:38:48 UTC (rev 10395)
@@ -0,0 +1,68 @@
+<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"
+ xmlns:c="http://java.sun.com/jstl/core"
+ xmlns:wiki="http://jboss.com/products/seam/wiki">
+ <m:header name="X-Sent-From" value="SeamFramework.org" />
+ <m:header name="Precedence" value="list"/>
+ <m:from name="SeamFramework.org" address="do-not-reply(a)jboss.com" />
+ <m:to name="#{notifyPoster.fullname}">#{notifyPoster.email}</m:to>
+ <m:subject>[SeamFramework.org Forums] #{replyHome.instance.subject}</m:subject>
+ <m:body>
+ <html>
+ <body>
+ <p>Hello #{notifyPoster.firstname},</p>
+
+ <p>
+ a <a href="#{wikiURLRenderer.renderURL(replyHome.instance, true)}">response</a> was made
+ on a <a href="#{wikiURLRenderer.renderURL(currentDocument, true)}">thread</a> on the
+ Seam community forum. You also commented on this topic, and you have this notification enabled
+ in your profile preferences.
+ </p>
+
+ <p>
+ This is the new comment, posted by #{replyHome.instance.createdBy.fullname}:
+ </p>
+
+ <hr/>
+
+ <c:if test="#{replyHome.instance.useWikiText}">
+ <wiki:formattedText value="#{replyHome.instance.content}"
+ linkStyleClass="regularLink"
+ brokenLinkStyleClass="brokenLink"
+ attachmentLinkStyleClass="regularLink"
+ thumbnailLinkStyleClass="regularLink"
+ linkBaseFile="#{currentDocument}"
+ currentAreaNumber="#{currentDocument.areaNumber}"
+ enableMacroRendering="false"/>
+ </c:if>
+ <c:if test="#{not replyHome.instance.useWikiText}">
+ <div style="font-family: Andale Mono, Courier New, monospace;">
+ <h:outputText escape="false" value="#{wiki:escapeHTML(replyHome.instance.content, true, true)}"/>
+ </div>
+ </c:if>
+
+ <hr/>
+ <a href="#{wikiURLRenderer.renderURL(replyHome.instance, true)}">Click here</a> to reply...
+
+ </body>
+ </html>
+ <f:facet name="alternative">
+ <h:outputText>
+Hello #{notifyPoster.firstname},
+
+a response was made on a forum thread on the Seam community forum. You also
+commented on this topic, and you have this notification enabled in your
+profile preferences:
+
+From: #{replyHome.instance.createdBy.fullname}
+Subject:#{replyHome.instance.subject}
+
+Follow this link to read and reply:
+
+#{wikiURLRenderer.renderURL(replyHome.instance, true)}
+</h:outputText>
+ </f:facet>
+ </m:body>
+</m:message>
15 years, 7 months
Seam SVN: r10394 - in trunk/examples/wiki: src/plugin/org/jboss/seam/wiki/plugin/blog/i18n and 3 other directories.
by seam-commits@lists.jboss.org
Author: christian.bauer(a)jboss.com
Date: 2009-04-14 10:28:35 -0400 (Tue, 14 Apr 2009)
New Revision: 10394
Added:
trunk/examples/wiki/view/includes/feedSubscribeMenu.xhtml
Modified:
trunk/examples/wiki/src/etc/i18n/messages_en.properties
trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/blog/i18n/messages_blog_en.properties
trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/blog/templates/blogArchive.xhtml
trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/blog/templates/blogRecentEntries.xhtml
trunk/examples/wiki/view/themes/inrelationto/css/inrelationto.css
Log:
JBSEAM-2873, added UI for links to feeds w/wo comments
Modified: trunk/examples/wiki/src/etc/i18n/messages_en.properties
===================================================================
--- trunk/examples/wiki/src/etc/i18n/messages_en.properties 2009-04-14 05:06:17 UTC (rev 10393)
+++ trunk/examples/wiki/src/etc/i18n/messages_en.properties 2009-04-14 14:28:35 UTC (rev 10394)
@@ -154,7 +154,12 @@
lacewiki.button.SiteFeed=Subscribe to site
lacewiki.button.DirectoryFeed=Subscribe to directory
+lacewiki.label.Subscribe=Subscribe
+lacewiki.label.SubscribeWithComments=All
+lacewiki.label.SubscribeWithoutComments=No Comments
+lacewiki.label.SubscribeOnlyComments=Only Comments
+
lacewiki.label.PermLink=PermLink
lacewiki.label.WikiLink=WikiLink
lacewiki.label.DirLink=Link to directory
Modified: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/blog/i18n/messages_blog_en.properties
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/blog/i18n/messages_blog_en.properties 2009-04-14 05:06:17 UTC (rev 10393)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/blog/i18n/messages_blog_en.properties 2009-04-14 14:28:35 UTC (rev 10394)
@@ -24,13 +24,11 @@
blog.archive.description=Displays all blog entries in combo box (tag filtered)
blog.archive.preferences.property.archiveSubscribeIcon=Show feed subscribe icon on archive
blog.archive.label.Archive=Archive
-blog.archive.label.Subscribe=Subscribe
blog.archive.label.AllEntries=All Entries
blog.recentEntries.label=Recent Entries
blog.recentEntries.description=Displays all recent entries
blog.recentEntries.label.RecentEntries=Recent Entries
-blog.recentEntries.label.Subscribe=Subscribe
blog.recentEntries.preferences.property.recentEntriesItems=Number of recent entries shown
blog.recentEntries.preferences.property.recentEntriesTruncateTitle=Truncate recent entries title after characters
blog.recentEntries.preferences.property.recentEntriesSubscribeIcon=Show feed subscribe icon on recent entries
Modified: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/blog/templates/blogArchive.xhtml
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/blog/templates/blogArchive.xhtml 2009-04-14 05:06:17 UTC (rev 10393)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/blog/templates/blogArchive.xhtml 2009-04-14 14:28:35 UTC (rev 10394)
@@ -24,15 +24,9 @@
columns="2" cellpadding="0" cellspacing="0" border="0"
styleClass="boxHeader fullWidth">
- <h:panelGrid styleClass="smallFont" rendered="#{not empty currentDirectory.feed}" columns="2"
- cellpadding="2" cellspacing="0" border="0">
- <h:outputLink value="#{wikiURLRenderer.renderFeedURL(currentDirectory.feed, null, null)}">
- <h:graphicImage value="#{imagePath}/icon.atom.ongrey.gif" width="18" height="18" alt="Atom"/>
- </h:outputLink>
- <h:outputLink value="#{wikiURLRenderer.renderFeedURL(currentDirectory.feed, null, null)}">
- <h:outputText value="#{messages['blog.archive.label.Subscribe']}"/>
- </h:outputLink>
- </h:panelGrid>
+ <ui:include src="/includes/feedSubscribeMenu.xhtml">
+ <ui:param name="feed" value="#{currentDirectory.feed}"/>
+ </ui:include>
<h:outputText rendered="#{empty param.tag}" value="#{messages['blog.archive.label.Archive']}"/>
<h:outputText rendered="#{not empty param.tag}" value="#{messages['blog.archive.label.Archive']} '#{param.tag}'"/>
Modified: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/blog/templates/blogRecentEntries.xhtml
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/blog/templates/blogRecentEntries.xhtml 2009-04-14 05:06:17 UTC (rev 10393)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/blog/templates/blogRecentEntries.xhtml 2009-04-14 14:28:35 UTC (rev 10394)
@@ -23,19 +23,9 @@
columns="2" cellpadding="0" cellspacing="0" border="0"
styleClass="boxHeader fullWidth">
- <h:panelGrid styleClass="undecoratedLink smallFont" rendered="#{not empty currentDirectory.feed}" columns="2"
- cellpadding="2" cellspacing="0" border="0">
- <h:outputLink
- target="_top"
- value="#{wikiURLRenderer.renderFeedURL(currentDirectory.feed, null, null)}">
- <h:graphicImage value="#{imagePath}/icon.atom.ongrey.gif" width="18" height="18" alt="Atom"/>
- </h:outputLink>
- <h:outputLink
- target="_top"
- value="#{wikiURLRenderer.renderFeedURL(currentDirectory.feed, null, null)}">
- <h:outputText value="#{messages['blog.recentEntries.label.Subscribe']}"/>
- </h:outputLink>
- </h:panelGrid>
+ <ui:include src="/includes/feedSubscribeMenu.xhtml">
+ <ui:param name="feed" value="#{currentDirectory.feed}"/>
+ </ui:include>
<h:outputText value="#{messages['blog.recentEntries.label.RecentEntries']}"/>
Added: trunk/examples/wiki/view/includes/feedSubscribeMenu.xhtml
===================================================================
--- trunk/examples/wiki/view/includes/feedSubscribeMenu.xhtml (rev 0)
+++ trunk/examples/wiki/view/includes/feedSubscribeMenu.xhtml 2009-04-14 14:28:35 UTC (rev 10394)
@@ -0,0 +1,46 @@
+<s:div styleClass="contextMenu"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:s="http://jboss.com/products/seam/taglib">
+
+ <h:panelGrid styleClass="undecoratedLink smallFont" rendered="#{not empty feed}" columns="2"
+ cellpadding="2" cellspacing="0" border="0">
+
+ <h:outputLink value="javascript://no-op"
+ onmouseover="jQuery(this).parents('.contextMenu').menu();">
+ <h:graphicImage value="#{imagePath}/icon.atom.ongrey.gif" width="18" height="18" alt="Atom"/>
+ </h:outputLink>
+
+ <h:outputLink value="javascript://no-op"
+ onmouseover="jQuery(this).parents('.contextMenu').menu();">
+ <h:outputText value="#{messages['lacewiki.label.Subscribe']}"/>
+ </h:outputLink>
+
+ </h:panelGrid>
+
+ <ul class="contextMenuItems">
+ <li>
+ <h:outputLink
+ target="_top"
+ value="#{wikiURLRenderer.renderFeedURL(feed, null, null)}">
+ <h:outputText value="#{messages['lacewiki.label.SubscribeWithComments']}"/>
+ </h:outputLink>
+ </li>
+ <li>
+ <h:outputLink
+ target="_top"
+ value="#{wikiURLRenderer.renderFeedURL(feed, null, 'exclude')}">
+ <h:outputText value="#{messages['lacewiki.label.SubscribeWithoutComments']}"/>
+ </h:outputLink>
+ </li>
+ <li>
+ <h:outputLink
+ target="_top"
+ value="#{wikiURLRenderer.renderFeedURL(feed, null, 'only')}">
+ <h:outputText value="#{messages['lacewiki.label.SubscribeOnlyComments']}"/>
+ </h:outputLink>
+ </li>
+ </ul>
+
+</s:div>
Modified: trunk/examples/wiki/view/themes/inrelationto/css/inrelationto.css
===================================================================
--- trunk/examples/wiki/view/themes/inrelationto/css/inrelationto.css 2009-04-14 05:06:17 UTC (rev 10393)
+++ trunk/examples/wiki/view/themes/inrelationto/css/inrelationto.css 2009-04-14 14:28:35 UTC (rev 10394)
@@ -1637,7 +1637,6 @@
}
.activetarget {
- font-weight: bold;
cursor: pointer;
}
15 years, 7 months
Seam SVN: r10393 - trunk/doc/Seam_Reference_Guide/it-IT.
by seam-commits@lists.jboss.org
Author: nico.ben
Date: 2009-04-14 01:06:17 -0400 (Tue, 14 Apr 2009)
New Revision: 10393
Modified:
trunk/doc/Seam_Reference_Guide/it-IT/Guice.po
Log:
JBSEAM-3767: Italian translation of Seam guide
Modified: trunk/doc/Seam_Reference_Guide/it-IT/Guice.po
===================================================================
--- trunk/doc/Seam_Reference_Guide/it-IT/Guice.po 2009-04-14 01:37:49 UTC (rev 10392)
+++ trunk/doc/Seam_Reference_Guide/it-IT/Guice.po 2009-04-14 05:06:17 UTC (rev 10393)
@@ -2,7 +2,7 @@
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2009-04-12 01:20-0400\n"
-"PO-Revision-Date: 2009-04-13 22:25+0100\n"
+"PO-Revision-Date: 2009-04-14 07:05+0100\n"
"Last-Translator: Nicola Benaglia <nico.benaz(a)gmail.com>\n"
"Language-Team: LANGUAGE <LL(a)li.org>\n"
"MIME-Version: 1.0\n"
@@ -11,11 +11,11 @@
#: doc/Seam_Reference_Guide/en-US/Guice.xml:6(title)
msgid "Guice integration"
-msgstr "Integrazione Guice"
+msgstr "Integrazione con Guice"
#: doc/Seam_Reference_Guide/en-US/Guice.xml:8(para)
msgid "Google Guice is a library that provides lightweight dependency injection through type-safe resolution. The Guice integration (part of the Seam IoC module) allows use of Guice injection for all Seam components annotated with the <literal>@Guice</literal> annotation. In addition to the regular bijection that Seam performs (which becomes optional), Seam also delegates to known Guice injectors to satisify the dependencies of the component. Guice may be useful to tie non-Seam parts of large or legacy applications together with Seam."
-msgstr "Google Guice è una libreria che fornisce dependency injection leggera attraverso una risoluzione type-safe. L'integrazioneGuice (parte del modulo Seam IoC) consente l'uso dell'iniezione Guice per tutti i componenti Seam annotati con l'annotazione <literal>@Guice</literal>. In aggiunta alla regolare bijection che Seam fornisce (che diviene opzionale), Seam delega a injector Guice noti di soddisfare le dipendenze del componente. Guice può essere utile per unire parte non-Seam di applicazione grosse o legacy assieme a Seam."
+msgstr "Google Guice è una libreria che fornisce una dependency injection leggera attraverso la risoluzione type-safe. L'integrazione con Guice (parte del modulo Seam IoC) consente l'uso dell'iniezione Guice per tutti i componenti Seam annotati con l'annotazione <literal>@Guice</literal>. In aggiunta alla regolare bijection, fornita da Seam (che diviene opzionale), Seam delega agli injector Guice noti di soddisfare le dipendenze del componente. Guice può essere utile per legare parti non-Seam di applicazione grosse o legacy assieme a Seam."
#: doc/Seam_Reference_Guide/en-US/Guice.xml:17(note)
msgid "The Guice integration is bundled in the jboss-seam-ioc library. This dependency is required for all integration techniques covered in this chapter. You will also need the Guice JAR file on the classpath."
15 years, 7 months