Author: christian.bauer(a)jboss.com
Date: 2008-05-23 12:12:57 -0400 (Fri, 23 May 2008)
New Revision: 8273
Added:
trunk/examples/wiki/view/errors/
trunk/examples/wiki/view/errors/generic.jsp
trunk/examples/wiki/view/errors/toomanysessions.html
Modified:
trunk/examples/wiki/src/etc/WEB-INF/pages.xml
trunk/examples/wiki/src/etc/WEB-INF/web.xml
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/DocumentHistory.java
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/TagQuery.java
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/UserHome.java
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/WikiIdentity.java
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/renderer/WikiURLRenderer.java
trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/forumReplies.xhtml
trunk/examples/wiki/view/docDisplay_d.xhtml
trunk/examples/wiki/view/docHistory_d.xhtml
trunk/examples/wiki/view/includes/commentForm.xhtml
trunk/examples/wiki/view/includes/commentsDisplay.xhtml
trunk/examples/wiki/view/themes/default/css/template.css
trunk/examples/wiki/view/themes/inrelationto/css/inrelationto.css
trunk/examples/wiki/view/themes/sfwkorg/css/sfwk.css
Log:
Replaced dangerous (for bots) s:links, highlighting of selected comments, improved generic
error handling
Modified: trunk/examples/wiki/src/etc/WEB-INF/pages.xml
===================================================================
--- trunk/examples/wiki/src/etc/WEB-INF/pages.xml 2008-05-23 16:09:51 UTC (rev 8272)
+++ trunk/examples/wiki/src/etc/WEB-INF/pages.xml 2008-05-23 16:12:57 UTC (rev 8273)
@@ -198,7 +198,7 @@
<page view-id="/userHome*"
no-conversation-view-id="/wiki.xhtml">
<param name="userId" value="#{userHome.userId}"/>
- <action execute="#{userHome.init}"/>
+ <action execute="#{userHome.initEdit}"/>
<begin-conversation flush-mode="MANUAL" join="true"/>
<navigation>
<rule if-outcome="updatedCurrentCredentials">
@@ -217,6 +217,7 @@
<page view-id="/userInfo*">
<param name="userId" value="#{userHome.userId}"/>
<param name="username"
value="#{userHome.requestedUsername}"/>
+ <action execute="#{userHome.initDisplay}"/>
</page>
<page view-id="/userList*">
Modified: trunk/examples/wiki/src/etc/WEB-INF/web.xml
===================================================================
--- trunk/examples/wiki/src/etc/WEB-INF/web.xml 2008-05-23 16:09:51 UTC (rev 8272)
+++ trunk/examples/wiki/src/etc/WEB-INF/web.xml 2008-05-23 16:12:57 UTC (rev 8273)
@@ -128,6 +128,19 @@
<!-- Misc Settings -->
+ <error-page>
+ <error-code>500</error-code>
+ <exception-type>java.lang.IllegalStateException</exception-type>
+ <location>/errors/toomanysessions.html</location>
+ <!-- Don't use a Faces or JSP page here, too many sessions means nothing
works anymore!
+ Unfortunately, Tomcat can't be bothered to throw anything better than an
IllegalStateException... -->
+ </error-page>
+
+ <error-page>
+ <error-code>500</error-code>
+ <location>/errors/generic.jsp</location>
+ </error-page>
+
<!-- Session timeout,can be extended for authenticated users in components.xml!
-->
<session-config>
<session-timeout>10</session-timeout>
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 2008-05-23
16:09:51 UTC (rev 8272)
+++
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/DocumentHistory.java 2008-05-23
16:12:57 UTC (rev 8273)
@@ -12,6 +12,7 @@
import org.jboss.seam.wiki.core.dao.WikiNodeDAO;
import org.jboss.seam.wiki.core.model.WikiDocument;
import org.jboss.seam.wiki.core.model.WikiFile;
+import org.jboss.seam.wiki.core.exception.InvalidWikiRequestException;
import org.jboss.seam.wiki.util.Diff;
import org.jboss.seam.wiki.util.WikiUtil;
@@ -87,7 +88,7 @@
if (!isInitialized) {
if (getFileId() == null)
- throw new org.jboss.seam.framework.EntityNotFoundException(getFileId(),
WikiDocument.class);
+ throw new InvalidWikiRequestException("Missing filedId request
parameter");
log.debug("initializing document history with file id: " +
getFileId());
@@ -113,6 +114,7 @@
public void displayHistoricalRevision() {
log.debug("displaying historical file id: " +
selectedHistoricalFile.getHistoricalFileId());
+
displayedHistoricalFile = selectedHistoricalFile;
diffResult = null;
@@ -124,28 +126,16 @@
);
}
- public void diff() {
- init(); // TODO: Why doesn't Seam execute my page action but instead s:link
action="diff" in a fake RENDER RESPONSE?!?
- displayedHistoricalFile = null;
+ public void diffHistoricalRevision() {
+ log.debug("diffing historical file id: " +
selectedHistoricalFile.getHistoricalFileId());
- if (historicalFileId == null) return;
- selectedHistoricalFile =
wikiNodeDAO.findHistoricalFile(getCurrentFile().getHistoricalEntityName(),
historicalFileId);
- if (selectedHistoricalFile == null) {
- statusMessages.addFromResourceBundleOrDefault(
- ERROR,
- "lacewiki.msg.HistoricalNodeNotFound",
- "Couldn't find historical node: {0}",
- historicalFileId
- );
- return;
- }
-
String[] a =
((WikiDocument)selectedHistoricalFile).getContent().split("\n");
String[] b = ((WikiDocument)currentFile).getContent().split("\n");
StringBuilder result = new StringBuilder();
List<Diff.Difference> differences = new Diff(a, b).diff();
+ // TODO: Externalize and i18n these strings
for (Diff.Difference diff : differences) {
int delStart = diff.getDeletedStart();
int delEnd = diff.getDeletedEnd();
@@ -201,6 +191,25 @@
);
}
+ // This methods takes the historicalFileId parameter to load a revision from the DB
+ public void diff() {
+ init(); // TODO: Why doesn't Seam execute my page action but instead s:link
action="diff" in a fake RENDER RESPONSE?!?
+ displayedHistoricalFile = null;
+
+ if (historicalFileId == null) return;
+ selectedHistoricalFile =
wikiNodeDAO.findHistoricalFile(getCurrentFile().getHistoricalEntityName(),
historicalFileId);
+ if (selectedHistoricalFile == null) {
+ statusMessages.addFromResourceBundleOrDefault(
+ ERROR,
+ "lacewiki.msg.HistoricalNodeNotFound",
+ "Couldn't find historical node: {0}",
+ historicalFileId
+ );
+ return;
+ }
+ diffHistoricalRevision();
+ }
+
@Restrict("#{s:hasPermission('Node', 'edit',
documentHistory.currentFile)}")
public String rollback() {
statusMessages.addFromResourceBundleOrDefault(
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/TagQuery.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/TagQuery.java 2008-05-23
16:09:51 UTC (rev 8272)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/TagQuery.java 2008-05-23
16:12:57 UTC (rev 8273)
@@ -16,6 +16,7 @@
import org.jboss.seam.wiki.core.model.WikiDirectory;
import org.jboss.seam.wiki.core.model.WikiFile;
import org.jboss.seam.wiki.core.model.WikiNode;
+import org.jboss.seam.wiki.core.exception.InvalidWikiRequestException;
import java.io.Serializable;
import java.util.List;
@@ -50,6 +51,9 @@
}
public void loadTaggedFiles() {
+ if (tag == null) {
+ throw new InvalidWikiRequestException("Missing tag parameter");
+ }
log.debug("loading wiki files tagged with: " + tag);
taggedFiles = tagDAO.findWikFiles(wikiRoot, null, tag,
WikiNode.SortableProperty.createdOn, false);
}
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/UserHome.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/UserHome.java 2008-05-23
16:09:51 UTC (rev 8272)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/UserHome.java 2008-05-23
16:12:57 UTC (rev 8273)
@@ -27,6 +27,7 @@
import org.jboss.seam.wiki.core.model.User;
import org.jboss.seam.wiki.core.model.WikiUploadImage;
import org.jboss.seam.wiki.core.upload.Uploader;
+import org.jboss.seam.wiki.core.exception.InvalidWikiRequestException;
import org.jboss.seam.wiki.preferences.PreferenceVisibility;
import org.jboss.seam.wiki.preferences.Preferences;
import org.jboss.seam.wiki.preferences.PreferenceProvider;
@@ -34,7 +35,6 @@
import org.jboss.seam.wiki.util.Hash;
import org.jboss.seam.wiki.util.WikiUtil;
-import static org.jboss.seam.international.StatusMessage.Severity.ERROR;
import static org.jboss.seam.international.StatusMessage.Severity.WARN;
import static org.jboss.seam.international.StatusMessage.Severity.INFO;
@@ -115,6 +115,19 @@
}
}
+ public void initEdit() {
+ if (getUserId() == null) {
+ throw new InvalidWikiRequestException("Missing userId request
parameter");
+ }
+ init();
+ }
+
+ public void initDisplay() {
+ if (getUserId() == null && getRequestedUsername() == null) {
+ throw new InvalidWikiRequestException("Missing userId or username
request parameter");
+ }
+ }
+
@Override
protected void initInstance() {
if ( isIdDefined() || (getRequestedUsername() != null &&
getRequestedUsername().length() >0) ) {
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/WikiIdentity.java
===================================================================
---
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/WikiIdentity.java 2008-05-23
16:09:51 UTC (rev 8272)
+++
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/WikiIdentity.java 2008-05-23
16:12:57 UTC (rev 8273)
@@ -200,8 +200,8 @@
// Can't delete admin and guest accounts
User adminUser = (User)Component.getInstance("adminUser");
User guestUser = (User)Component.getInstance("guestUser");
- if (user.getId().equals(adminUser.getId())) return false;
- if (user.getId().equals(guestUser.getId())) return false;
+ if (adminUser.getId().equals(user.getId())) return false;
+ if (guestUser.getId().equals(user.getId())) return false;
if (currentAccessLevel == Role.ADMINROLE_ACCESSLEVEL) return true;
return false;
Modified:
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/renderer/WikiURLRenderer.java
===================================================================
---
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/renderer/WikiURLRenderer.java 2008-05-23
16:09:51 UTC (rev 8272)
+++
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/renderer/WikiURLRenderer.java 2008-05-23
16:12:57 UTC (rev 8273)
@@ -90,6 +90,10 @@
return url.toString();
}
+ public String renderFeedURL(Feed feed) {
+ return renderFeedURL(feed, null, null, false);
+ }
+
public String renderFeedURL(Feed feed, String tag, String comments) {
return renderFeedURL(feed, tag, comments, false);
}
Modified:
trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/forumReplies.xhtml
===================================================================
---
trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/forumReplies.xhtml 2008-05-23
16:09:51 UTC (rev 8272)
+++
trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/forumReplies.xhtml 2008-05-23
16:12:57 UTC (rev 8273)
@@ -42,25 +42,25 @@
</s:div>
<s:div id="forumPostingControls"
styleClass="forumPostingControls">
+ <h:form>
+ <h:panelGroup rendered="#{not replyHome.showForm and
replyHome.isPersistAllowed(null,null)}">
- <h:panelGroup rendered="#{not replyHome.showForm and
replyHome.isPersistAllowed(null,null)}">
+ <h:commandLink tabindex="1"
action="#{replyHome.replyToDocument()}"
+
accesskey="#{messages['forum.button.Reply.accesskey']}"
+ styleClass="buttonNonpersistent">
+ <f:param name="conversationPropagation"
value="none"/>
+ <h:outputText styleClass="buttonLabel"
escape="false" value="#{messages['forum.button.Reply']}"/>
+ </h:commandLink>
- <s:link tabindex="1" propagation="none"
- action="#{replyHome.replyToDocument()}"
-
accesskey="#{messages['forum.button.Reply.accesskey']}"
- styleClass="buttonNonpersistent">
- <h:outputText styleClass="buttonLabel"
escape="false" value="#{messages['forum.button.Reply']}"/>
- </s:link>
+ <h:commandLink tabindex="1"
action="#{replyHome.quoteDocument()}"
+ styleClass="buttonNonpersistent"
+
accesskey="#{messages['forum.button.Quote.accesskey']}">
+ <f:param name="conversationPropagation"
value="none"/>
+ <h:outputText styleClass="buttonLabel"
escape="false" value="#{messages['forum.button.Quote']}"/>
+ </h:commandLink>
- <s:link tabindex="1" propagation="none"
- action="#{replyHome.quoteDocument()}"
- styleClass="buttonNonpersistent"
-
accesskey="#{messages['forum.button.Quote.accesskey']}">
- <h:outputText styleClass="buttonLabel"
escape="false" value="#{messages['forum.button.Quote']}"/>
- </s:link>
-
- </h:panelGroup>
-
+ </h:panelGroup>
+ </h:form>
</s:div>
<!-- The forumPostingDocumentWrapper <div> is closed here! -->
@@ -124,19 +124,19 @@
<s:fragment rendered="#{not replyHome.showForm and
replyHome.isPersistAllowed(null,null)}">
- <s:link tabindex="102"
propagation="none"
- action="#{replyHome.replyTo()}"
- styleClass="buttonNonpersistent">
+ <h:commandLink tabindex="102"
action="#{replyHome.replyTo()}"
+
styleClass="buttonNonpersistent">
+ <f:param name="conversationPropagation"
value="none"/>
<f:param name="parentCommentId"
value="#{c.id}"/>
<h:outputText styleClass="buttonLabel"
value="#{messages['lacewiki.button.commentsDisplay.ReplyTo']}"/>
- </s:link>
+ </h:commandLink>
- <s:link tabindex="102"
propagation="none"
- action="#{replyHome.quote()}"
- styleClass="buttonNonpersistent">
+ <h:commandLink tabindex="102"
action="#{replyHome.quote()}"
+
styleClass="buttonNonpersistent">
+ <f:param name="conversationPropagation"
value="none"/>
<f:param name="parentCommentId"
value="#{c.id}"/>
<h:outputText styleClass="buttonLabel"
value="#{messages['lacewiki.button.commentsDisplay.Quote']}"/>
- </s:link>
+ </h:commandLink>
</s:fragment>
Modified: trunk/examples/wiki/view/docDisplay_d.xhtml
===================================================================
--- trunk/examples/wiki/view/docDisplay_d.xhtml 2008-05-23 16:09:51 UTC (rev 8272)
+++ trunk/examples/wiki/view/docDisplay_d.xhtml 2008-05-23 16:12:57 UTC (rev 8273)
@@ -15,7 +15,7 @@
<s:fragment rendered="#{not empty
documentHome.instance.parent.feed}">
<link rel="alternate" type="application/atom+xml"
title="#{documentHome.instance.parent.name}"
- href="#{wikiURLRenderer.renderFeedURL(currentDirectory.feed, null,
null)}"/>
+
href="#{wikiURLRenderer.renderFeedURL(currentDirectory.feed)}"/>
</s:fragment>
@@ -223,19 +223,19 @@
<s:fragment rendered="#{not commentHome.showForm and
s:hasPermission('Comment', 'create', documentHome.instance)}">
- <s:link tabindex="102"
propagation="none"
- action="#{commentHome.replyTo()}"
- styleClass="buttonNonpersistent">
+ <h:commandLink tabindex="102"
action="#{commentHome.replyTo()}"
+
styleClass="buttonNonpersistent">
+ <f:param name="conversationPropagation"
value="none"/>
<f:param name="parentCommentId"
value="#{c.id}"/>
<h:outputText styleClass="buttonLabel"
value="#{messages['lacewiki.button.commentsDisplay.ReplyTo']}"/>
- </s:link>
+ </h:commandLink>
- <s:link tabindex="102"
propagation="none"
- action="#{commentHome.quote()}"
- styleClass="buttonNonpersistent">
+ <h:commandLink tabindex="102"
action="#{commentHome.quote()}"
+
styleClass="buttonNonpersistent">
+ <f:param name="conversationPropagation"
value="none"/>
<f:param name="parentCommentId"
value="#{c.id}"/>
<h:outputText styleClass="buttonLabel"
value="#{messages['lacewiki.button.commentsDisplay.Quote']}"/>
- </s:link>
+ </h:commandLink>
</s:fragment>
Modified: trunk/examples/wiki/view/docHistory_d.xhtml
===================================================================
--- trunk/examples/wiki/view/docHistory_d.xhtml 2008-05-23 16:09:51 UTC (rev 8272)
+++ trunk/examples/wiki/view/docHistory_d.xhtml 2008-05-23 16:12:57 UTC (rev 8273)
@@ -97,26 +97,21 @@
</h:column>
<h:column>
- <a:commandLink id="show"
status="globalStatus"
- oncomplete="onAjaxRequestComplete()"
-
action="#{documentHistory.displayHistoricalRevision}"
+ <a:commandLink
action="#{documentHistory.displayHistoricalRevision}"
+ status="globalStatus"
oncomplete="onAjaxRequestComplete()"
reRender="messageBoxContainer, historyTable,
diffResult, historicalPreview"
tabindex="3"
styleClass="buttonNonpersistent sessionEventTrigger">
<h:outputText styleClass="buttonLabel"
value="#{messages['lacewiki.button.docHistory.Show']}"/>
</a:commandLink>
- <s:link id="diff" rendered="#{empty
documentHistory.diffResult or hfile.historicalFileId !=
documentHistory.historicalFileId}"
- action="#{documentHistory.diff}"
tabindex="3" styleClass="buttonNonpersistent sessionEventTrigger">
+ <a:commandLink
action="#{documentHistory.diffHistoricalRevision}"
+ status="globalStatus"
oncomplete="onAjaxRequestComplete()"
+ reRender="messageBoxContainer, historyTable,
diffResult, historicalPreview"
+ tabindex="3"
styleClass="buttonNonpersistent sessionEventTrigger">
<h:outputText styleClass="buttonLabel"
value="#{messages['lacewiki.button.docHistory.Diff']}"/>
- <f:param name="historicalFileId"
value="#{hfile.historicalFileId}"/>
- </s:link>
- <h:outputLink rendered="#{not empty
documentHistory.diffResult and hfile.historicalFileId ==
documentHistory.historicalFileId}"
- value="#diffResult"
tabindex="3" styleClass="buttonNonpersistent sessionEventTrigger">
- <h:outputText styleClass="buttonLabel"
value="Diff Output"/>
- </h:outputLink>
+ </a:commandLink>
- <h:commandLink id="rollback"
- action="#{documentHistory.rollback}"
+ <h:commandLink action="#{documentHistory.rollback}"
tabindex="4"
styleClass="buttonNonpersistent sessionEventTrigger"
rendered="#{s:hasPermission('Node',
'edit', documentHistory.currentFile)}">
<h:outputText styleClass="buttonLabel"
value="#{messages['lacewiki.button.docHistory.Rollback']}"/>
Added: trunk/examples/wiki/view/errors/generic.jsp
===================================================================
--- trunk/examples/wiki/view/errors/generic.jsp (rev 0)
+++ trunk/examples/wiki/view/errors/generic.jsp 2008-05-23 16:12:57 UTC (rev 8273)
@@ -0,0 +1,94 @@
+<%@ page import="java.io.PrintWriter" %>
+<%@ page import="org.jboss.seam.wiki.util.WikiUtil" %>
+<html>
+<head>
+ <meta HTTP-EQUIV="Content-Type"
CONTENT="text/html;charset=UTF-8" />
+ <title>Generic error message</title>
+</head>
+<body>
+<style>
+body {
+ font-family : arial, verdana, Geneva, Arial, Helvetica, sans-serif;
+ font-size : 1.1em;
+}
+.errorHeader {
+ font-size: 1.6em;
+ background-color: #6392C6;
+ color: white;
+ font-weight: bold;
+ padding: 3px;
+ margin-bottom: 10px;
+}
+
+.errorFooter {
+ font-size: 0.8em;
+ background-color: #6392C6;
+ color: white;
+ font-style: italic;
+ padding: 3px;
+ margin-top: 5px;
+}
+
+.errorMessage {
+ color: red;
+ font-weight: bold;
+}
+.errorExceptions {
+}
+.errorExceptionStack {
+ margin-top: 5px;
+ padding: 3px;
+ border-style: solid;
+ border-width: 1px;
+ border-color: #9F9F9F;
+ background-color: #E0E0E0;
+}
+.errorExceptionCause {
+ font-size: 1.1em;
+ padding: 3px;
+ border-style: solid;
+ border-width: 1px;
+ border-color: #9F9F9F;
+ background-color: #E0E0E0;
+}
+.errorException {
+ font-size: 1.0em;
+}
+</style>
+<div class="errorHeader">Your request was not successful, server-side
error encountered.</div>
+
+<%
+Object exception = request.getAttribute("javax.servlet.error.exception");
+if (exception != null)
+{
+ Throwable throwable = WikiUtil.unwrap((Throwable)exception);
+ String exceptionMessage = throwable.getMessage();
+
+ %>Message: <span
class="errorMessage"><%=exceptionMessage%></span><%
+
+ PrintWriter pw = new PrintWriter(out);
+
+ %><br/><%
+ %><span id="errorDetails" class="errorExceptions"><%
+ %><pre class="errorExceptionCause"><%
+ throwable.printStackTrace(pw);
+ %></pre><%
+
+ %><input type="button" value="More Details>>"
onclick="document.getElementById('errorMoreDetails').style.display=''"/><%
+ %><div id="errorMoreDetails" style="display:none"
class="errorExceptionStack"><%
+
+ %><pre class="errorException"><%
+ throwable.printStackTrace(pw);
+ %></pre><%
+
+ %></div><%
+ %></span><%
+}
+else
+{
+ %>Unknown error<%
+}
+%>
+<div class="errorFooter">End of exception report</div>
+</body>
+</html>
\ No newline at end of file
Added: trunk/examples/wiki/view/errors/toomanysessions.html
===================================================================
--- trunk/examples/wiki/view/errors/toomanysessions.html (rev 0)
+++ trunk/examples/wiki/view/errors/toomanysessions.html 2008-05-23 16:12:57 UTC (rev
8273)
@@ -0,0 +1,11 @@
+<html>
+<head>
+ <title>Too many active users</title>
+</head>
+<body>
+<p>
+ Sorry, your request could not be completed. Too many users are currently active on
our website. Please try again later.
+</p>
+</body>
+</html>
+
Modified: trunk/examples/wiki/view/includes/commentForm.xhtml
===================================================================
--- trunk/examples/wiki/view/includes/commentForm.xhtml 2008-05-23 16:09:51 UTC (rev
8272)
+++ trunk/examples/wiki/view/includes/commentForm.xhtml 2008-05-23 16:12:57 UTC (rev
8273)
@@ -27,13 +27,15 @@
<script
type="text/javascript">stopSessionTimeoutCheck();</script>
</s:fragment>
- <s:link tabindex="102"
rendered="#{!commentHome.showForm}"
- action="#{commentHome.newComment()}"
propagation="none"
-
accesskey="#{messages['lacewiki.button.commentForm.PostComment.accesskey']}"
- styleClass="buttonNonpersistent">
+ <h:commandLink tabindex="102"
rendered="#{!commentHome.showForm}"
+ action="#{commentHome.newComment()}"
+
accesskey="#{messages['lacewiki.button.commentForm.PostComment.accesskey']}"
+ styleClass="buttonNonpersistent">
+
+ <f:attribute name="conversationPropagation"
value="none"/>
<h:outputText escape="false"
styleClass="buttonLabel"
value="#{messages['lacewiki.button.commentForm.PostComment']}"/>
- </s:link>
+ </h:commandLink>
<s:fragment rendered="#{commentHome.showForm}">
<h:outputText
value="#{messages['lacewiki.label.commentForm.PostComment']}"/>
Modified: trunk/examples/wiki/view/includes/commentsDisplay.xhtml
===================================================================
--- trunk/examples/wiki/view/includes/commentsDisplay.xhtml 2008-05-23 16:09:51 UTC (rev
8272)
+++ trunk/examples/wiki/view/includes/commentsDisplay.xhtml 2008-05-23 16:12:57 UTC (rev
8273)
@@ -10,6 +10,20 @@
<s:div styleClass="box" rendered="#{not empty
commentQuery.comments}">
+ <script type="text/javascript">
+ jQuery(function() {
+ var fragment = window.location.hash;
+ if (fragment.substring(1,8) == 'comment') {
+ selectCommentBox(fragment);
+ }
+ });
+
+ function selectCommentBox(commentAnchor) {
+ jQuery(".commentBox").removeClass("commentBoxSelected");
+
jQuery(commentAnchor).parent(".commentBox").addClass("commentBoxSelected");
+ }
+ </script>
+
<h:panelGrid columns="1"
styleClass="datatable"
columnClasses="commentColumn"
@@ -25,16 +39,14 @@
<c:forEach var="c" items="#{commentQuery.comments}">
<s:div style="margin-left:#{c.level > 1 ? c.level :
''}0px;"
- styleClass="#{c.level > 1 ? 'commentLevel' :
'commentFirstLevel'}">
+ styleClass="commentBox #{c.level > 1 ? 'commentLevel'
: 'commentFirstLevel'}">
- <a id="comment#{c.id}"/>
-
<h:panelGrid columns="3"
styleClass="commentHeader"
columnClasses="commentSubject, commentAuthorInfo
smallFont, commentAuthorPortrait"
cellpadding="0" cellspacing="0"
border="0">
<s:div styleClass="undecoratedLink largeFont"
rendered="#{currentDocument.name != c.subject}">
- <h:outputLink
value="#{wikiURLRenderer.renderURL(c)}">
+ <h:outputLink
value="#{wikiURLRenderer.renderURL(c)}"
onclick="selectCommentBox('#comment#{c.id}')">
<h:outputText value="#{c.subject}"/>
</h:outputLink>
</s:div>
@@ -96,6 +108,8 @@
</h:panelGrid>
+ <a id="comment#{c.id}"/>
+
<s:div styleClass="commentText"
rendered="#{c.useWikiText and not empty currentDocument.areaNumber}">
<s:cache region="wiki.Comment"
key="#{c.id}">
<wiki:formattedText value="#{c.content}"
Modified: trunk/examples/wiki/view/themes/default/css/template.css
===================================================================
--- trunk/examples/wiki/view/themes/default/css/template.css 2008-05-23 16:09:51 UTC (rev
8272)
+++ trunk/examples/wiki/view/themes/default/css/template.css 2008-05-23 16:12:57 UTC (rev
8273)
@@ -1069,6 +1069,10 @@
.commentForm {}
+.commentBoxSelected {
+ border-left: 5px solid #C3BBB6;
+}
+
/* Document history and diff
-----------------------------------------------*/
Modified: trunk/examples/wiki/view/themes/inrelationto/css/inrelationto.css
===================================================================
--- trunk/examples/wiki/view/themes/inrelationto/css/inrelationto.css 2008-05-23 16:09:51
UTC (rev 8272)
+++ trunk/examples/wiki/view/themes/inrelationto/css/inrelationto.css 2008-05-23 16:12:57
UTC (rev 8273)
@@ -1095,6 +1095,10 @@
.commentForm {}
+.commentBoxSelected {
+ border-left: 5px solid #C3BBB6;
+}
+
/* Document history and diff
-----------------------------------------------*/
Modified: trunk/examples/wiki/view/themes/sfwkorg/css/sfwk.css
===================================================================
--- trunk/examples/wiki/view/themes/sfwkorg/css/sfwk.css 2008-05-23 16:09:51 UTC (rev
8272)
+++ trunk/examples/wiki/view/themes/sfwkorg/css/sfwk.css 2008-05-23 16:12:57 UTC (rev
8273)
@@ -808,6 +808,9 @@
.commentForm {}
+.commentBoxSelected {
+ border-left: 5px solid #75a8bd;
+}
/* Document history and diff
-----------------------------------------------*/