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

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/forumList      forumForm.xhtml
                        plugin.xhtml lastTopicPost.xhtml
                        forumListTable.xhtml forumListControls.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/forumList/forumForm.xhtml
  
  Index: forumForm.xhtml
  ===================================================================
  <s:div id="forumFormContainer"
         styleClass="forumFormContainer"
         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:j4j="http://javascript4jsf.dev.java.net/"
         xmlns:wiki="http://jboss.com/products/seam/wiki">
  
  <s:fragment rendered="#{forumHome.showForm}">
  
  <div class="box">
  
  <s:fragment rendered="#{forumHome.managed}">
      <ui:include src="../../includes/deleteConfirmation.xhtml">
          <ui:param name="home" value="#{forumHome}"/>
          <ui:param name="reRender" value="forumListPluginContainer, messageBoxContainer"/>
      </ui:include>
  </s:fragment>
  
  <h:form id="forumForm">
  
      <div class="form">
  
          <div class="formHead">
              <h:outputText value="#{forumHome.managed ? messages['forum.label.EditForum'] : messages['forum.label.NewForum']}"/>
          </div>
  
          <s:div styleClass="formFields formBorder">
  
              <s:decorate id="nameDecorate" template="../../includes/formFieldDecorate.xhtml">
                  <ui:define name="label">#{messages['forum.label.ForumName']}</ui:define>
                  <h:inputText size="40" maxlength="255" required="true" tabindex="1" value="#{forumHome.instance.name}">
                      <a:support event="onblur" reRender="nameDecorate"/>
                  </h:inputText>
              </s:decorate>
  
              <s:decorate id="descriptionDecorate" template="../../includes/formFieldDecorate.xhtml">
                  <ui:define name="label">#{messages['forum.label.ForumDescription']}</ui:define>
                  <h:inputText size="70" maxlength="512" required="false" tabindex="1" value="#{forumHome.instance.description}">
                      <a:support event="onblur" reRender="descriptionDecorate"/>
                  </h:inputText>
              </s:decorate>
  
              <ui:include src="../../includes/accessLevelSelector.xhtml">
                  <ui:param name="nodeHome" value="#{forumHome}"/>
              </ui:include>
  
              <s:div styleClass="entry">
                  <div class="label">&#160;</div>
                  <div class="input">
                      <h:selectBooleanCheckbox value="#{forumHome.hasFeed}" tabindex="1"/>
                      <h:outputText value="#{messages['forum.label.EnableFeed']}"/>
                      <a:commandLink id="resetFeed" reRender="messageBoxContainer"
                                     action="#{forumHome.resetFeed}"
                                     rendered="#{!empty forumHome.instance.feed}"
                                     styleClass="buttonNonpersistent">
                          <h:outputText  styleClass="buttonLabel" value="#{messages['forum.button.ResetFeed']}"/>
                      </a:commandLink>
                  </div>
              </s:div>
  
          </s:div>
  
          <div class="formControls">
              <div class="entry">
                  <div class="label">&#160;</div>
                  <div class="input">
  
                      <a:commandLink action="#{forumHome.update}" rendered="#{forumHome.managed}"
                                     reRender="forumListPluginContainer, messageBoxContainer"
                                     tabindex="1" accesskey="#{messages['forum.button.Update.accesskey']}"
                                     styleClass="button saveButton">
                          <h:outputText escape="false" styleClass="buttonLabel" value="#{messages['forum.button.Update']}"/>
                      </a:commandLink>
  
                      <h:outputLink id="delete" value="#" rendered="#{forumHome.managed}"
                                    tabindex="1" accesskey="#{messages['forum.button.Remove.accesskey']}"
                                    styleClass="button saveButton"><j4j:idProxy id="openDialogDelete"/>
                          <h:outputText escape="false" styleClass="buttonLabel" value="#{messages['forum.button.Remove']}"/>
                      </h:outputLink>
  
                      <a:commandLink action="#{forumHome.persist}" rendered="#{!forumHome.managed}"
                                     reRender="forumListPluginContainer, 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:region>
                          <a:commandLink action="#{forumHome.cancel}"
                                         immediate="true"
                                         reRender="forumListPluginContainer, messageBoxContainer"
                                         tabindex="1" styleClass="buttonNonpersistent"
                                         accesskey="#{messages['forum.button.Cancel.accesskey']}">
                              <h:outputText styleClass="buttonLabel" escape="false" value="#{messages['forum.button.Cancel']}"/>
                          </a:commandLink>
                      </a:region>
  
                  </div>
              </div>
          </div>
  
      </div>
  
  </h:form>
  
  </div>
  </s:fragment>
  
  </s:div>
  
  
  1.1      date: 2007/11/09 15:00:29;  author: cbauer;  state: Exp;jboss-seam/examples/wiki/view/plugins/forumList/plugin.xhtml
  
  Index: plugin.xhtml
  ===================================================================
  <wiki:plugin id="forumListPlugin"
          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:a="https://ajax4jsf.dev.java.net/ajax"
          xmlns:s="http://jboss.com/products/seam/taglib">
  
      <s:span id="forumListPluginContainer">
  
          <script type="text/javascript">jQuery(function() {
              jQuery(".userInfoPopupContainer")
                      .jqm({trigger: false, overlay: 0});
          });</script>
          <script type="text/javascript">jQuery(function() {
              wrapBoxes();
          });</script>
  
          <ui:include src="forumListControls.xhtml"/>
  
          <ui:include src="forumForm.xhtml"/>
  
          <ui:include src="forumListTable.xhtml"/>
  
      </s:span>
  
  </wiki:plugin>
  
  
  1.1      date: 2007/11/09 15:00:29;  author: cbauer;  state: Exp;jboss-seam/examples/wiki/view/plugins/forumList/lastTopicPost.xhtml
  
  Index: lastTopicPost.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:c="http://java.sun.com/jstl/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:div>
          <h:outputLink value="#{link}" tabindex="1">
              <h:outputText value="#{wiki:truncateString(name, 25, '...')}"/>
              <h:graphicImage styleClass="topicGotoIcon" value="/themes/#{wikiPreferences.themeName}/img/icon.posting_goto.gif" width="18" height="9"/>
          </h:outputLink>
      </s:div>
  
      <s:div>
          <h:outputText value="#{createdOn}">
              <f:convertDateTime type="both" timeZone="#{wikiPreferences.timeZone}"/>
          </h:outputText>
      </s:div>
  
      <s:fragment rendered="#{wiki:isRegularUser(createdBy)}">
          <s:div styleClass="undecoratedLink">
              <h:outputLink value="#"
                            onclick="jQuery('#userInfoPopup#{popupId}').jqmShow().css({left:'#{leftOffset}', right:'#{rightOffset}'});">
                  <h:outputText value="#{createdBy.fullname}"/>
              </h:outputLink>
          </s:div>
          <ui:include src="../forumPosting/userInfoPopup.xhtml">
              <ui:param name="user" value="#{createdBy}"/>
              <ui:param name="userInfoPopupId" value="#{popupId}"/>
          </ui:include>
      </s:fragment>
      <s:div rendered="#{not wiki:isRegularUser(createdBy)}">
          <h:outputText value="#{createdBy.fullname}"/>
      </s:div>
  
  </s:fragment>
  
  
  1.1      date: 2007/11/09 15:00:29;  author: cbauer;  state: Exp;jboss-seam/examples/wiki/view/plugins/forumList/forumListTable.xhtml
  
  Index: forumListTable.xhtml
  ===================================================================
  <s:div id="forumListTableContainer"
         styleClass="forumListTableContainer"
         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">
  
  <div class="box">
  <h:form id="forumListTableForm" rendered="#{not empty forumQuery.forums}">
  
  <h:dataTable id="forumListTable"
               var="f"
               value="#{forumQuery.forums}"
               styleClass="datatable topLeftBottomBorder"
               headerClass="regularHeader rightBorder"
               columnClasses="onePercentColumn rightBorder alignCenter,
                              defaultColumn rightBorder alignLeft,
                              fivePercentColumn rightBorder alignCenter,
                              fivePercentColumn rightBorder alignCenter,
                              tenPercentColumn rightBorder alignCenter,
                              tenPercentColumn rightBorder alignCenter"
               rowClasses="rowOdd,rowEven"
               cellpadding="0" cellspacing="0" border="0">
  
      <h:column>
          <h:panelGroup>
  
              <h:graphicImage value="/themes/#{wikiPreferences.themeName}/img/icon.posting_unread.gif" width="22" height="26"
                              rendered="#{forumQuery.forumInfo[f.id].unreadPostings}"/>
  
              <h:graphicImage value="/themes/#{wikiPreferences.themeName}/img/icon.posting.gif" width="22" height="26"
                              rendered="#{not forumQuery.forumInfo[f.id].unreadPostings}"/>
  
              <s:span styleClass="forumFeedLink undecoratedLink" rendered="#{not empty f.feed}">
                  <h:outputLink value="#{facesContext.externalContext.request.contextPath}/servlets/feeds/atom.seam?feedId=#{f.feed.id}"
                                tabindex="1">
                      <h:graphicImage value="/themes/#{wikiPreferences.themeName}/img/icon.atom.gif" width="18" height="18"/>
                  </h:outputLink>
              </s:span>
  
              <s:span styleClass="forumFeedLink" rendered="#{empty f.feed}">
                  <h:graphicImage rendered="#{empty f.feed}"
                                  value="/themes/#{wikiPreferences.themeName}/img/blank.gif" width="18" height="18"/>
              </s:span>
  
          </h:panelGroup>
      </h:column>
  
      <h:column>
          <f:facet name="header">#{messages['forum.label.Forum']}</f:facet>
          <s:div styleClass="undecoratedLink forumTitle">
              <h:outputLink styleClass="undecoratedLink" value="#{wiki:renderURL(f)}" tabindex="1">
                  <h:outputText value="#{f.name}"/>
              </h:outputLink>
          </s:div>
          <h:outputText styleClass="forumDescription" value="#{f.description}"/>
      </h:column>
  
      <h:column rendered="#{not forumListHome.managed}">
          <f:facet name="header">#{messages['forum.label.TopicCount']}</f:facet>
          <h:outputText value="#{forumQuery.forumInfo[f.id].totalNumOfTopics}"
                        rendered="#{not empty forumQuery.forumInfo[f.id]}"/>
          <h:outputText value="-" rendered="#{empty forumQuery.forumInfo[f.id]}"/>
      </h:column>
  
      <h:column rendered="#{not forumListHome.managed}">
          <f:facet name="header">#{messages['forum.label.PostCount']}</f:facet>
          <h:outputText value="#{forumQuery.forumInfo[f.id].totalNumOfPosts}"
                        rendered="#{not empty forumQuery.forumInfo[f.id]}"/>
          <h:outputText value="-" rendered="#{empty forumQuery.forumInfo[f.id]}"/>
      </h:column>
  
      <h:column rendered="#{not forumListHome.managed}">
          <f:facet name="header">#{messages['forum.label.NewestTopic']}</f:facet>
          <s:fragment rendered="#{not empty forumQuery.forumInfo[f.id].lastTopic}">
              <ui:include src="lastTopicPost.xhtml">
                  <ui:param name="link"        value="#{wiki:renderURL(forumQuery.forumInfo[f.id].lastTopic)}"/>
                  <ui:param name="name"        value="#{forumQuery.forumInfo[f.id].lastTopic.name}"/>
                  <ui:param name="createdOn"   value="#{forumQuery.forumInfo[f.id].lastTopic.createdOn}"/>
                  <ui:param name="createdBy"   value="#{forumQuery.forumInfo[f.id].lastTopic.createdBy}"/>
                  <ui:param name="popupId"     value="lastTopic#{forumQuery.forumInfo[f.id].lastTopic.id}"/>
                  <ui:param name="rightOffset" value="12%"/>
              </ui:include>
          </s:fragment>
          <s:fragment rendered="#{empty forumQuery.forumInfo[f.id].lastTopic}">
              -
          </s:fragment>
      </h:column>
  
      <h:column rendered="#{not forumListHome.managed}">
          <f:facet name="header">#{messages['forum.label.LatestPost']}</f:facet>
          <s:fragment rendered="#{forumQuery.forumInfo[f.id].lastPostLastTopic}">
              <ui:include src="lastTopicPost.xhtml">
                  <ui:param name="link"        value="#{wiki:renderURL(forumQuery.forumInfo[f.id].lastTopic)}"/>
                  <ui:param name="name"        value="#{forumQuery.forumInfo[f.id].lastTopic.name}"/>
                  <ui:param name="createdOn"   value="#{forumQuery.forumInfo[f.id].lastTopic.createdOn}"/>
                  <ui:param name="createdBy"   value="#{forumQuery.forumInfo[f.id].lastTopic.createdBy}"/>
                  <ui:param name="popupId"     value="latestPost#{forumQuery.forumInfo[f.id].lastTopic.id}"/>
                  <ui:param name="rightOffset" value="1%"/>
              </ui:include>
          </s:fragment>
          <s:fragment rendered="#{not empty forumQuery.forumInfo[f.id].lastComment and not forumQuery.forumInfo[f.id].lastPostLastTopic}">
              <ui:include src="lastTopicPost.xhtml">
                  <ui:param name="link"        value="#{wiki:renderCommentURL(forumQuery.forumInfo[f.id].lastComment.document, forumQuery.forumInfo[f.id].lastComment)}"/>
                  <ui:param name="name"        value="#{forumQuery.forumInfo[f.id].lastComment.subject}"/>
                  <ui:param name="createdOn"   value="#{forumQuery.forumInfo[f.id].lastComment.createdOn}"/>
                  <ui:param name="createdBy"   value="#{forumQuery.forumInfo[f.id].lastComment.fromUser}"/>
                  <ui:param name="popupId"     value="latestPost#{forumQuery.forumInfo[f.id].lastComment.id}"/>
                  <ui:param name="rightOffset" value="1%"/>
              </ui:include>
          </s:fragment>
          <s:fragment rendered="#{empty forumQuery.forumInfo[f.id].lastComment and not forumQuery.forumInfo[f.id].lastPostLastTopic}">
              -
          </s:fragment>
      </h:column>
  
      <h:column rendered="#{forumListHome.managed and not forumHome.showForm}">
          <a:commandLink rendered="#{uiComponent['forumListPlugin:forumListTableForm:forumListTable'].rowIndex != 0}"
                         action="#{forumListHome.moveNode(f.displayPosition, f.displayPosition-1)}"
                         reRender="forumListTable, messageBoxContainer"
                         tabindex="1" styleClass="button">
              <h:outputText styleClass="buttonLabel" value="#{messages['forum.button.MoveUp']}"/>
          </a:commandLink>
      </h:column>
  
      <h:column rendered="#{forumListHome.managed and not forumHome.showForm}">
          <a:commandLink rendered="#{uiComponent['forumListPlugin:forumListTableForm:forumListTable'].rowIndex != uiComponent['forumListPlugin:forumListTableForm:forumListTable'].rowCount-1}"
                         action="#{forumListHome.moveNode(f.displayPosition, f.displayPosition+1)}"
                         reRender="forumListTable, messageBoxContainer"
                         tabindex="1" styleClass="button">
              <h:outputText styleClass="buttonLabel" value="#{messages['forum.button.MoveDown']}"/>
          </a:commandLink>
      </h:column>
  
      <h:column rendered="#{forumListHome.managed and not forumHome.showForm}">
  
          <a:commandLink action="#{forumHome.edit(f.id)}"
                         reRender="forumListControlsContainer, forumListTable, forumFormContainer, messageBoxContainer"
                         tabindex="1" styleClass="buttonNonpersistent">
              <h:outputText styleClass="buttonLabel" value="#{messages['forum.button.Edit']}"/>
          </a:commandLink>
  
      </h:column>
  
  </h:dataTable>
  </h:form>
  </div>
  
  <s:div rendered="#{empty forumQuery.forums}" styleClass="box">
      <h:outputText value="#{messages['forum.msg.NoForumsFound']}"/>
  </s:div>
  
  </s:div>
  
  
  1.1      date: 2007/11/09 15:00:29;  author: cbauer;  state: Exp;jboss-seam/examples/wiki/view/plugins/forumList/forumListControls.xhtml
  
  Index: forumListControls.xhtml
  ===================================================================
  <s:div id="forumListControlsContainer"
         styleClass="forumListControlsContainer"
         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 forumListHome.managed}">
  
      <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>
  
  </s:fragment>
  
  <h:form rendered="#{s:hasPermission('User', 'isAdmin', currentUser)}">
  <s:fragment rendered="#{not forumListHome.managed}">
  
      <h:panelGroup>
  
          <a:commandLink action="#{forumListHome.manage()}"
                         reRender="forumListPluginContainer, messageBoxContainer"
                         accesskey="#{messages['forum.button.ManageForums.accesskey']}"
                         tabindex="1" styleClass="buttonNonpersistent">
              <h:outputText styleClass="buttonLabel" escape="false" value="#{messages['forum.button.ManageForums']}"/>
          </a:commandLink>
  
      </h:panelGroup>
  
  </s:fragment>
  
  <s:fragment rendered="#{forumListHome.managed and not forumHome.showForm}">
  
      <h:panelGroup>
  
          <a:commandLink action="#{forumHome.newForum()}"
                         reRender="forumListPluginContainer, messageBoxContainer"
                         accesskey="#{messages['forum.button.NewForum.accesskey']}"
                         tabindex="1" styleClass="buttonNonpersistent">
              <h:outputText styleClass="buttonLabel" escape="false" value="#{messages['forum.button.NewForum']}"/>
          </a:commandLink>
  
          <h:outputLink value="#{wiki:renderURL(currentDirectory)}"
                        accesskey="#{messages['forum.button.Exit.accesskey']}"
                        tabindex="1" styleClass="buttonNonpersistent">
             <h:outputText styleClass="buttonLabel" escape="false" value="#{messages['forum.button.Exit']}"/>
          </h:outputLink>
  
      </h:panelGroup>
  
  </s:fragment>
  </h:form>
  
  </s:div>
  
  



More information about the jboss-cvs-commits mailing list