[jboss-cvs] jboss-seam/examples/wiki/view/plugins/forumTopics ...

Christian Bauer christian at hibernate.org
Fri Nov 9 10:00:29 EST 2007


  User: cbauer  
  Date: 07/11/09 10:00:29

  Added:       examples/wiki/view/plugins/forumTopics     
                        topicControls.xhtml plugin.xhtml topicTable.xhtml
                        topicPager.xhtml topicForm.xhtml
  Log:
  Initial import of forum plugin
  
  Revision  Changes    Path
  1.1      date: 2007/11/09 15:00:29;  author: cbauer;  state: Exp;jboss-seam/examples/wiki/view/plugins/forumTopics/topicControls.xhtml
  
  Index: topicControls.xhtml
  ===================================================================
  <s:div id="topicControlsContainer"
         styleClass="topicControlsContainer"
         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:a="https://ajax4jsf.dev.java.net/ajax"
         xmlns:s="http://jboss.com/products/seam/taglib">
  
  <s:fragment rendered="#{not topicHome.showForm}">
  
      <s:div styleClass="forumsFeedLink undecoratedLink" rendered="#{not empty currentDirectory.feed}">
          <h:outputLink value="#{facesContext.externalContext.request.contextPath}/servlets/feeds/atom.seam?feedId=#{currentDirectory.feed.id}"
                        tabindex="1">
              <h:graphicImage value="/themes/#{wikiPreferences.themeName}/img/icon.atom.gif" width="18" height="18"/>
              <h:outputText value="#{currentDocument.name}&#160;#{messages['forum.label.Feed']}"/>
          </h:outputLink>
      </s:div>
  
      <h:form>
      <h:panelGroup>
  
          <h:outputLink value="#{wiki:renderURL(currentDirectory.parent)}"
                        accesskey="#{messages['forum.button.ForumList.accesskey']}"
                        tabindex="1" styleClass="buttonNonpersistent">
              <h:outputText styleClass="buttonLabel" escape="false" value="#{messages['forum.button.ForumList']}"/>
          </h:outputLink>
  
          <a:commandLink rendered="#{s:hasPermission('Node', 'create', currentDirectory)}"
                         action="#{topicHome.newTopic}"
                         reRender="forumTopicsPluginContainer, messageBoxContainer"
                         accesskey="#{messages['forum.button.NewTopic.accesskey']}"
                         tabindex="1" styleClass="buttonNonpersistent">
              <h:outputText styleClass="buttonLabel" escape="false" value="#{messages['forum.button.NewTopic']}"/>
          </a:commandLink>
  
      </h:panelGroup>
      </h:form>
  
  </s:fragment>
  
  </s:div>
  
  
  1.1      date: 2007/11/09 15:00:29;  author: cbauer;  state: Exp;jboss-seam/examples/wiki/view/plugins/forumTopics/plugin.xhtml
  
  Index: plugin.xhtml
  ===================================================================
  <wiki:plugin id="forumTopicsPlugin"
          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:c="http://java.sun.com/jstl/core"
          xmlns:wiki="http://jboss.com/products/seam/wiki"
          xmlns:s="http://jboss.com/products/seam/taglib">
  
      <s:span id="forumTopicsPluginContainer">
  
          <script type="text/javascript">jQuery(function() {
              jQuery(".userInfoPopupContainer")
                      .jqm({trigger: false, overlay: 0})
                      .css({ right: "1%"});
          });</script>
          <script type="text/javascript">jQuery(function() {
              wrapBoxes();
          });</script>
  
          <ui:include src="topicControls.xhtml"/>
  
          <ui:include src="topicForm.xhtml"/>
  
          <ui:include src="topicTable.xhtml"/>
  
      </s:span>
  
  </wiki:plugin>
  
  
  1.1      date: 2007/11/09 15:00:29;  author: cbauer;  state: Exp;jboss-seam/examples/wiki/view/plugins/forumTopics/topicTable.xhtml
  
  Index: topicTable.xhtml
  ===================================================================
  <s:div id="topicTableContainer"
         styleClass="topicFormContainer"
         xmlns="http://www.w3.org/1999/xhtml"
         xmlns:s="http://jboss.com/products/seam/taglib"
         xmlns:ui="http://java.sun.com/jsf/facelets"
         xmlns:f="http://java.sun.com/jsf/core"
         xmlns:h="http://java.sun.com/jsf/html"
         xmlns:a="https://ajax4jsf.dev.java.net/ajax"
         xmlns:wiki="http://jboss.com/products/seam/wiki">
  
  <s:fragment rendered="#{not topicHome.showForm}">
  
      <ui:include src="topicPager.xhtml"/>
  
      <div class="box">
  
      <h:dataTable id="topicTable"
                   var="topic"
                   value="#{forumQuery.topics}"
                   rendered="#{not empty forumQuery.topics}"
                   styleClass="datatable topLeftBottomBorder topicTable"
                   headerClass="regularHeader rightBorder"
                   columnClasses="onePercentColumn rightBorder alignCenter, defaultColumn rightBorder alignLeft,
                                  onePercentColumn rightBorder alignCenter, fivePercentColumn rightBorder alignCenter,
                                  tenPercentColumn rightBorder alignCenter"
                   rowClasses="rowOdd,rowEven"
                   cellpadding="0" cellspacing="0" border="0">
  
          <h:column>
              <h:graphicImage value="/themes/#{wikiPreferences.themeName}/img/icon.#{topic.iconName}.gif" width="22" height="26"/>
          </h:column>
  
          <h:column>
              <f:facet name="header">Topic</f:facet>
  
              <h:outputLink value="#{wiki:renderURL(topic)}" tabindex="1">
                  <h:outputText value="#{wiki:truncateString(topic.name, 60, '...')}"/>
              </h:outputLink>
  
          </h:column>
  
          <h:column>
              <f:facet name="header">Replies</f:facet>
              <h:outputText value="#{topic.numOfComments}" rendered="#{topic.numOfComments != 0}"/>
              <h:outputText value="-" rendered="#{topic.numOfComments == 0}"/>
          </h:column>
  
          <h:column>
              <f:facet name="header">Author</f:facet>
  
              <s:fragment rendered="#{wiki:isRegularUser(topic.createdBy)}">
                  <s:div styleClass="undecoratedLink">
                      <h:outputLink value="#"
                                    onclick="jQuery('#userInfoPopup#{topic.createdBy.id}').jqmShow().css({right: '11%'});">
                          <h:outputText value="#{topic.createdBy.fullname}"/>
                      </h:outputLink>
                  </s:div>
                  <ui:include src="../forumPosting/userInfoPopup.xhtml">
                      <ui:param name="user" value="#{topic.createdBy}"/>
                      <ui:param name="userInfoPopupId" value="#{topic.createdBy.id}"/>
                  </ui:include>
              </s:fragment>
              <s:div rendered="#{not wiki:isRegularUser(topic.createdBy)}">
                  <h:outputText value="#{topic.createdBy.fullname}"/>
              </s:div>
  
          </h:column>
  
          <h:column>
              <f:facet name="header">Last Post</f:facet>
              <s:fragment rendered="#{not empty topic.lastComment}">
                  <h:outputLink value="#{wiki:renderCommentURL(topic, topic.lastComment)}" tabindex="1">
                      <h:outputText value="#{topic.lastComment.createdOn}">
                          <f:convertDateTime type="both" timeZone="#{wikiPreferences.timeZone}"/>
                      </h:outputText>
                      <h:graphicImage styleClass="topicGotoIcon" value="/themes/#{wikiPreferences.themeName}/img/icon.posting_goto.gif" width="18" height="9"/>
                  </h:outputLink>
  
                  <s:fragment rendered="#{wiki:isRegularUser(topic.lastComment.fromUser)}">
                      <s:div styleClass="undecoratedLink">
                          <h:outputLink value="#"
                                        onclick="jQuery('#userInfoPopup#{topic.lastComment.id}').jqmShow().css({right: '1%'});">
                              <h:outputText value="#{topic.lastComment.fromUser.fullname}"/>
                          </h:outputLink>
                      </s:div>
                      <ui:include src="../forumPosting/userInfoPopup.xhtml">
                          <ui:param name="user" value="#{topic.lastComment.fromUser}"/>
                          <ui:param name="userInfoPopupId" value="#{topic.lastComment.id}"/>
                      </ui:include>
                  </s:fragment>
                  <s:div rendered="#{not wiki:isRegularUser(topic.lastComment.fromUser)}">
                      <h:outputText value="#{topic.lastComment.fromUser.fullname}"/>
                  </s:div>
  
              </s:fragment>
              <s:fragment rendered="#{empty topic.lastComment}">
                  <h:outputLink value="#{wiki:renderURL(topic)}" tabindex="1">
                      <h:outputText value="#{topic.createdOn}">
                          <f:convertDateTime type="both" timeZone="#{wikiPreferences.timeZone}"/>
                      </h:outputText>
                      <h:graphicImage styleClass="topicGotoIcon" value="/themes/#{wikiPreferences.themeName}/img/icon.posting_goto.gif" width="18" height="9"/>
                  </h:outputLink>
  
                  <s:fragment rendered="#{wiki:isRegularUser(topic.createdBy)}">
                      <s:div styleClass="undecoratedLink">
                          <h:outputLink value="#"
                                        onclick="jQuery('#userInfoPopup#{topic.id}').jqmShow().css({right: '1%'});">
                              <h:outputText value="#{topic.createdBy.fullname}"/>
                          </h:outputLink>
                      </s:div>
                      <ui:include src="../forumPosting/userInfoPopup.xhtml">
                          <ui:param name="user" value="#{topic.createdBy}"/>
                          <ui:param name="userInfoPopupId" value="#{topic.id}"/>
                      </ui:include>
                  </s:fragment>
                  <s:div rendered="#{not wiki:isRegularUser(topic.createdBy)}">
                      <h:outputText value="#{topic.createdBy.fullname}"/>
                  </s:div>
  
              </s:fragment>
          </h:column>
  
      </h:dataTable>
  
      </div>
  
      <s:div rendered="#{empty forumQuery.topics}" styleClass="box">
          No topics in this forum.
      </s:div>
  
      <ui:include src="topicPager.xhtml"/>
  
  </s:fragment>
  
  </s:div>
  
  
  
  1.1      date: 2007/11/09 15:00:29;  author: cbauer;  state: Exp;jboss-seam/examples/wiki/view/plugins/forumTopics/topicPager.xhtml
  
  Index: topicPager.xhtml
  ===================================================================
  <s:fragment
          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">
  
      <h:panelGrid columns="5" rendered="#{not empty forumQuery.topics}"
                   styleClass="topicPagerTable"
                   columnClasses="topicPagerColumn, topicPagerColumn, topicPagerTextColumn, topicPagerColumn, topicPagerColumn, "
                   cellpadding="0" cellspacing="0" border="0">
  
          <h:outputLink rendered="#{forumQuery.pager.previousPageAvailable}" target="_top"
                        value="#{wiki:renderURL(currentDocument)}">
                  <h:graphicImage value="/themes/#{wikiPreferences.themeName}/img/page.first.gif" width="13" height="11"/>
          </h:outputLink>
          <h:graphicImage value="/themes/#{wikiPreferences.themeName}/img/blank.gif" width="13" height="11"
                          rendered="#{!forumQuery.pager.previousPageAvailable}"/>
  
          <h:outputLink rendered="#{forumQuery.pager.previousPageAvailable}" target="_top"
                        value="#{wiki:renderURL(currentDocument)}/Page/#{forumQuery.pager.previousPage}">
              <h:graphicImage value="/themes/#{wikiPreferences.themeName}/img/page.previous.gif" width="13" height="11"/>
          </h:outputLink>
          <h:graphicImage value="/themes/#{wikiPreferences.themeName}/img/blank.gif" width="13" height="11"
                          rendered="#{!forumQuery.pager.previousPageAvailable}"/>
  
          <s:span>
              <h:outputText value="#{messages['forum.label.Showing']}
                                      #{forumQuery.pager.firstRecord} #{messages['forum.label.To']}
                                      #{forumQuery.pager.lastRecord} #{messages['forum.label.Of']}
                                      #{forumQuery.pager.numOfRecords} #{messages['forum.label.Topics']}"/>
          </s:span>
  
          <h:outputLink rendered="#{forumQuery.pager.nextPageAvailable}" target="_top"
                        value="#{wiki:renderURL(currentDocument)}/Page/#{forumQuery.pager.nextPage}">
              <h:graphicImage value="/themes/#{wikiPreferences.themeName}/img/page.next.gif" width="13" height="11"/>
          </h:outputLink>
          <h:graphicImage value="/themes/#{wikiPreferences.themeName}/img/blank.gif" width="13" height="11"
                          rendered="#{!forumQuery.pager.nextPageAvailable}"/>
  
          <h:outputLink rendered="#{forumQuery.pager.nextPageAvailable}" target="_top"
                        value="#{wiki:renderURL(currentDocument)}/Page/#{forumQuery.pager.lastPage}">
              <h:graphicImage value="/themes/#{wikiPreferences.themeName}/img/page.last.gif" width="13" height="11"/>
          </h:outputLink>
          <h:graphicImage value="/themes/#{wikiPreferences.themeName}/img/blank.gif" width="13" height="11"
                          rendered="#{!forumQuery.pager.nextPageAvailable}"/>
  
      </h:panelGrid>
      
  </s:fragment>
  
  
  1.1      date: 2007/11/09 15:00:29;  author: cbauer;  state: Exp;jboss-seam/examples/wiki/view/plugins/forumTopics/topicForm.xhtml
  
  Index: topicForm.xhtml
  ===================================================================
  <s:div id="topicFormContainer"
         styleClass="topicFormContainer"
         xmlns="http://www.w3.org/1999/xhtml"
         xmlns:s="http://jboss.com/products/seam/taglib"
         xmlns:ui="http://java.sun.com/jsf/facelets"
         xmlns:f="http://java.sun.com/jsf/core"
         xmlns:h="http://java.sun.com/jsf/html"
         xmlns:a="https://ajax4jsf.dev.java.net/ajax"
         xmlns:wiki="http://jboss.com/products/seam/wiki">
  
  <s:fragment rendered="#{s:hasPermission('Node', 'create', currentDirectory) and topicHome.showForm}">
  
      <div class="box">
  
      <h:form id="topicForm">
          <div class="form">
  
              <div class="formHead">
                  <h:outputText value="New Topic"/>
              </div>
  
              <a:region>
                  <s:div styleClass="formFields formBorder">
  
                      <s:decorate id="nameDecorate" template="../../includes/formFieldDecorate.xhtml">
                          <ui:define name="label">Subject</ui:define>
                          <h:inputText id="topicName" tabindex="1" size="90" maxlength="255" required="true" value="#{topicHome.instance.name}">
                              <a:support event="onblur" reRender="nameDecorate"/>
                          </h:inputText>
                      </s:decorate>
  
                      <ui:include src="../../includes/wikiTextEditor.xhtml">
                          <ui:param name="textEditorId" value="topic"/>
                          <ui:param name="textPreviewId" value="topicPreview"/>
                          <ui:param name="namingContainer" value="forumTopicsPlugin\\\\:topicForm"/>
                          <ui:param name="label" value="Message"/>
                          <ui:param name="valueBinding" value="#{topicHome.formContent}"/>
                          <ui:param name="valueMaxLength" value="32768"/>
                          <ui:param name="valueRequired" value="true"/>
                          <ui:param name="textEditorColumns" value="88"/>
                          <ui:param name="textEditorRows" value="20"/>
                      </ui:include>
  
                      <s:div styleClass="marginLeft">
                          <ui:include src="../../includes/wikiTextPreview.xhtml">
                              <ui:param name="textPreviewId" value="topicPreview"/>
                              <ui:param name="valueBinding" value="#{topicHome.instance.content}"/>
                              <ui:param name="enablePlugins" value="false"/>
                              <ui:param name="baseDocument" value="#{topicHome.instance}"/>
                              <ui:param name="baseDirectory" value="#{topicHome.parentDirectory}"/>
                          </ui:include>
                      </s:div>
  
                      <s:fragment rendered="#{s:hasPermission('User', 'isAdmin', currentUser)}">
                          <s:div styleClass="entry">
                              <div class="label">
                                  <h:outputText value="Options:"/>
                              </div>
                              <div class="input">
                                  <h:selectBooleanCheckbox value="#{topicHome.instance.sticky}" tabindex="1"/>
                                  <h:outputText value="Sticky posting"/>
                              </div>
                          </s:div>
  
                          <s:div styleClass="entry">
                              <div class="label">&#160;</div>
                              <div class="input">
                                  <h:selectBooleanCheckbox value="#{topicHome.instance.enableCommentForm}" tabindex="1"/>
                                  <h:outputText value="Open topic, allow replies"/>
                              </div>
                          </s:div>
                      </s:fragment>
  
                  </s:div>
  
                  <div class="formControls">
                      <div class="entry">
                          <div class="label">&#160;</div>
                          <div class="input">
  
                              <a:commandLink id="save" action="#{topicHome.persist}"
                                             reRender="forumTopicsPluginContainer, messageBoxContainer"
                                             tabindex="1" accesskey="#{messages['forum.button.Save.accesskey']}"
                                             styleClass="button saveButton">
                                  <h:outputText escape="false" styleClass="buttonLabel" value="#{messages['forum.button.Save']}"/>
                              </a:commandLink>
  
                              <a:commandLink action="#{topicHome.cancel}"
                                             reRender="forumTopicsPluginContainer, messageBoxContainer"
                                             tabindex="1" styleClass="buttonNonpersistent"
                                             accesskey="#{messages['forum.button.Cancel.accesskey']}">
                                  <h:outputText styleClass="buttonLabel" escape="false" value="#{messages['forum.button.Cancel']}"/>
                              </a:commandLink>
  
                          </div>
                      </div>
                  </div>
  
              </a:region>
  
          </div>
      </h:form>
  
      </div>
  
  </s:fragment>
  </s:div>
  
  



More information about the jboss-cvs-commits mailing list