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

Christian Bauer christian.bauer at jboss.com
Wed Feb 28 13:25:08 EST 2007


  User: cbauer  
  Date: 07/02/28 13:25:08

  Modified:    examples/wiki/view       dirDisplay.xhtml userList.xhtml
                        docDisplay.xhtml dirEdit.xhtml docEdit.xhtml
  Added:       examples/wiki/view       fileEdit.xhtml
  Log:
  Basic file attachment/image embedding support
  
  Revision  Changes    Path
  1.5       +12 -0     jboss-seam/examples/wiki/view/dirDisplay.xhtml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: dirDisplay.xhtml
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/view/dirDisplay.xhtml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -b -r1.4 -r1.5
  --- dirDisplay.xhtml	27 Feb 2007 13:21:44 -0000	1.4
  +++ dirDisplay.xhtml	28 Feb 2007 18:25:08 -0000	1.5
  @@ -37,6 +37,7 @@
           <s:link id="createDir"  styleClass="linkNavigation" action="createDir" accesskey="S">New <u>S</u>ubdirectory</s:link>
           <s:link id="editDir"    styleClass="linkNavigation" action="editDir" accesskey="E"><u>E</u>dit Directory</s:link>
           <s:link id="createDoc"  styleClass="linkNavigation" action="createDoc" accesskey="N"><u>N</u>ew Document</s:link>
  +        <s:link id="uploadFile" styleClass="linkNavigation" action="uploadFile" accesskey="U"><u>U</u>pload File</s:link>
       </h:panelGroup>
   
       <!-- Virtual root directory -->
  @@ -83,6 +84,10 @@
               <h:graphicImage value="/themes/#{globalPrefs.themeName}/img/icon.doc.default.gif"
                               width="18" height="20"
                               rendered="#{wiki:isDocument(node) and node == currentDirectory.defaultDocument}"/>
  +            <h:graphicImage value="/themes/#{globalPrefs.themeName}/img/#{fileMetaMap[node.contentType].displayIcon}"
  +                            width="18" height="20"
  +                            rendered="#{wiki:isFile(node)}"/>
  +
           </h:column>
   
           <h:column>
  @@ -94,6 +99,13 @@
               <s:div rendered="#{wiki:isDocument(node)}">
                   <h:outputLink value="#{wiki:renderURL(node)}" tabindex="2">#{node.name}</h:outputLink>
               </s:div>
  +            <s:div rendered="#{wiki:isFile(node)}">
  +                <s:link id="editFile" value="#{node.name}" action="editFile" tabindex="2">
  +                    <f:param name="fileId" value="#{node.id}"/>
  +                </s:link>
  +                &#160;
  +                <h:outputText value="(#{node.filename}, #{node.humanReadableFilesize}, #{node.contentType})"/>
  +            </s:div>
           </h:column>
   
           <h:column>
  
  
  
  1.4       +1 -1      jboss-seam/examples/wiki/view/userList.xhtml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: userList.xhtml
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/view/userList.xhtml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- userList.xhtml	27 Feb 2007 13:21:44 -0000	1.3
  +++ userList.xhtml	28 Feb 2007 18:25:08 -0000	1.4
  @@ -14,7 +14,7 @@
       <link href="#{themePath}/css/mainMenu.css" rel="stylesheet" type="text/css"/>
   </ui:define>
   
  -<ui:define name="screenname">User List</ui:define>
  +<ui:define name="screenname">Member List</ui:define>
   
   <ui:define name="headerTopRight">
       <ui:include src="plugins/userControl/plugin.xhtml"/>
  
  
  
  1.6       +39 -1     jboss-seam/examples/wiki/view/docDisplay.xhtml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: docDisplay.xhtml
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/view/docDisplay.xhtml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- docDisplay.xhtml	27 Feb 2007 13:21:44 -0000	1.5
  +++ docDisplay.xhtml	28 Feb 2007 18:25:08 -0000	1.6
  @@ -41,9 +41,47 @@
   </ui:define>
   
   <ui:define name="content">
  +
       <s:div styleClass="documentDisplay">
  -        <wiki:formattedText value="#{currentDocument.content}" linkStyleClass="regularLink" brokenLinkStyleClass="brokenLink"/>
  +        <wiki:formattedText value="#{currentDocument.content}"
  +                            linkStyleClass="regularLink"
  +                            brokenLinkStyleClass="brokenLink"
  +                            attachmentLinkStyleClass="regularLink"
  +                            inlineLinkStyleClass="regularLink"/>
  +    </s:div>
  +
  +    <s:div styleClass="attachmentDisplay" rendered="#{not empty wikiTextAttachments}">
  +        <div class="formHead">Attachments:</div>
  +        <h:dataTable value="#{wikiTextAttachments}" var="link"
  +             binding="#{jsfUtil.datatable}"
  +             styleClass="directoryList"
  +             columnClasses="iconColumn,iconColumn,nameColumn"
  +             rowClasses="rowOdd,rowEven"
  +             cellpadding="0" cellspacing="0" border="0">
  +            <h:column>
  +                <h:panelGroup>
  +                    <a name="attachment#{jsfUtil.datatable.rowIndex + 1}"/>
  +                    <h:outputText value="#&#160;#{jsfUtil.datatable.rowIndex + 1}"/>
  +                </h:panelGroup>
  +            </h:column>
  +            <h:column>
  +                <h:panelGroup>
  +                    <h:graphicImage value="/themes/#{globalPrefs.themeName}/img/#{fileMetaMap[link.node.contentType].displayIcon}"
  +                                    width="18" height="20"/>
  +                </h:panelGroup>
  +            </h:column>
  +            <h:column>
  +                <h:panelGroup>
  +                    <h:outputLink value="#{link.url}">
  +                        <h:outputText value="#{link.node.name}"/>
  +                        &#160;
  +                        <h:outputText value="(#{link.node.filename}, #{link.node.humanReadableFilesize}, #{link.node.contentType})"/>
  +                    </h:outputLink>
  +                </h:panelGroup>
  +            </h:column>
  +        </h:dataTable>
       </s:div>
  +
   </ui:define>
   
   <ui:define name="footer">&#160;</ui:define>
  
  
  
  1.7       +3 -3      jboss-seam/examples/wiki/view/dirEdit.xhtml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: dirEdit.xhtml
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/view/dirEdit.xhtml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -b -r1.6 -r1.7
  --- dirEdit.xhtml	27 Feb 2007 13:21:44 -0000	1.6
  +++ dirEdit.xhtml	28 Feb 2007 18:25:08 -0000	1.7
  @@ -85,7 +85,7 @@
           <div class="input">
               <h:dataTable id="directoryFormTable" var="node" width="75%" style="border-width: 1px;"
                            value="#{childNodes}"
  -                         binding="#{uiBindings.childNodeTable}"
  +                         binding="#{jsfUtil.datatable}"
                            styleClass="directoryList"
                            headerClass="directoryListHeader"
                            columnClasses="positionUpColumn,positionDownColumn,menuControlColumn,defaultDocumentSelectColumn,iconColumn,nameColumn"
  @@ -95,14 +95,14 @@
                   <h:column>
                       <h:commandLink id="nodeUp" tabindex="1"
                                      action="#{directoryHome.moveNodeUpInList}"
  -                                   rendered="#{uiBindings.childNodeTable.rowIndex > 0}">
  +                                   rendered="#{jsfUtil.datatable.rowIndex > 0}">
                           <h:graphicImage value="/themes/#{globalPrefs.themeName}/img/up.gif" width="18" height="18"/>
                       </h:commandLink>
                   </h:column>
                   <h:column>
                       <h:commandLink id="nodeDown" tabindex="2"
                                      action="#{directoryHome.moveNodeDownInList}"
  -                                   rendered="#{uiBindings.childNodeTable.rowIndex+1 lt uiBindings.childNodeTable.rowCount}">
  +                                   rendered="#{jsfUtil.datatable.rowIndex+1 lt jsfUtil.datatable.rowCount}">
                           <h:graphicImage value="/themes/#{globalPrefs.themeName}/img/down.gif" width="18" height="18"/>
                       </h:commandLink>
                   </h:column>
  
  
  
  1.7       +41 -2     jboss-seam/examples/wiki/view/docEdit.xhtml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: docEdit.xhtml
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/view/docEdit.xhtml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -b -r1.6 -r1.7
  --- docEdit.xhtml	27 Feb 2007 13:21:44 -0000	1.6
  +++ docEdit.xhtml	28 Feb 2007 18:25:08 -0000	1.7
  @@ -34,6 +34,9 @@
   </ui:define>
   
   <ui:define name="controlRight">
  +
  +    <s:link id="uploadFile" styleClass="linkNavigation" action="uploadFile" accesskey="U"><u>U</u>pload File</s:link>
  +
       <s:link id="exit" styleClass="linkNavigation"
               action="#{documentHome.exitConversation(true)}"
               accesskey="E"><u>E</u>xit Editor</s:link>
  @@ -93,7 +96,7 @@
   
                           <h:commandLink id="save" action="#{documentHome.persist}"
                                          rendered="#{!documentHome.managed}"
  -                                       tabindex="4" accesskey="S"><span class="button"><u>S</u>ave</span></h:commandLink>
  +                                       tabindex="4" accesskey="S" styleClass="button"><span class="buttonLabel"><u>S</u>ave</span></h:commandLink>
   
                           <h:commandLink id="update" action="#{documentHome.update}"
                                      rendered="#{documentHome.managed}"
  @@ -112,7 +115,43 @@
       </h:form>
   
       <s:div styleClass="documentDisplay" rendered="#{documentHome.enabledPreview}">
  -        <wiki:formattedText value="#{documentHome.instance.content}" linkStyleClass="regularLink" brokenLinkStyleClass="brokenLink"/>
  +        <wiki:formattedText value="#{documentHome.instance.content}"
  +                            linkStyleClass="regularLink"
  +                            brokenLinkStyleClass="brokenLink"
  +                            attachmentLinkStyleClass="regularLink"
  +                            inlineLinkStyleClass="regularLink"/>
  +    </s:div>
  +
  +    <s:div styleClass="attachmentDisplay" rendered="#{not empty wikiTextAttachments}">
  +        <div class="formHead">Attachments:</div>
  +        <h:dataTable value="#{wikiTextAttachments}" var="link"
  +             binding="#{jsfUtil.datatable}"
  +             styleClass="directoryList"
  +             columnClasses="iconColumn,iconColumn,nameColumn"
  +             rowClasses="rowOdd,rowEven"
  +             cellpadding="0" cellspacing="0" border="0">
  +            <h:column>
  +                <h:panelGroup>
  +                    <a name="attachment#{jsfUtil.datatable.rowIndex + 1}"/>
  +                    <h:outputText value="#&#160;#{jsfUtil.datatable.rowIndex + 1}"/>
  +                </h:panelGroup>
  +            </h:column>
  +            <h:column>
  +                <h:panelGroup>
  +                    <h:graphicImage value="/themes/#{globalPrefs.themeName}/img/#{fileMetaMap[link.node.contentType].displayIcon}"
  +                                    width="18" height="20"/>
  +                </h:panelGroup>
  +            </h:column>
  +            <h:column>
  +                <h:panelGroup>
  +                    <h:outputLink value="#{link.url}">
  +                        <h:outputText value="#{link.node.name}"/>
  +                        &#160;
  +                        <h:outputText value="(#{link.node.filename}, #{link.node.humanReadableFilesize}, #{link.node.contentType})"/>
  +                    </h:outputLink>
  +                </h:panelGroup>
  +            </h:column>
  +        </h:dataTable>
       </s:div>
   
   </ui:define>
  
  
  
  1.1      date: 2007/02/28 18:25:08;  author: cbauer;  state: Exp;jboss-seam/examples/wiki/view/fileEdit.xhtml
  
  Index: fileEdit.xhtml
  ===================================================================
  <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <ui:composition 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:wiki="http://jboss.com/products/seam/wiki"
                  template="themes/#{globalPrefs.themeName}/template.xhtml">
  
  <ui:define name="pluginCSS">
      <link href="#{themePath}/css/userControl.css" rel="stylesheet" type="text/css"/>
      <link href="#{themePath}/css/searchControl.css" rel="stylesheet" type="text/css"/>
      <link href="#{themePath}/css/mainMenu.css" rel="stylesheet" type="text/css"/>
  </ui:define>
  
  <ui:define name="screenname">
      <h:outputText value="Upload File" rendered="#{!fileHome.managed}"/>
      <h:outputText value="Edit File" rendered="#{fileHome.managed}"/>
  </ui:define>
  
  <ui:define name="headerTopRight">
      <ui:include src="plugins/userControl/plugin.xhtml"/>
  </ui:define>
  
  <ui:define name="headerBottomLeft">&#160;</ui:define>
  
  <ui:define name="headerBottomRight">
      <ui:include src="plugins/searchControl/plugin.xhtml"/>
  </ui:define>
  
  <ui:define name="sidebar">
      <ui:include src="plugins/mainMenu/plugin.xhtml"/>
  </ui:define>
  
  <ui:define name="controlRight">
      <s:link id="exit" styleClass="linkNavigation"
              action="#{fileHome.exitConversation(true)}"
              accesskey="E"><u>E</u>xit Editor</s:link>
  </ui:define>
  
  <ui:define name="content">
  
      <h:form enctype="multipart/form-data">
          <div class="form">
              <div class="formHead">
                  <h:outputText value="New file: #{fileHome.instance.name}" rendered="#{!fileHome.managed}"/>
                  <h:outputText value="Editing file: #{fileHome.instance.name}" rendered="#{fileHome.managed}"/>
              </div>
  
              <div class="formFieldsWideLabels">
  
                  <s:validateAll>
  
                      <div class="entry">
                          <div class="label">Directory:</div>
                          <div class="output">#{currentDirectory.name}</div>
                      </div>
  
                      <s:decorate>
                          <div class="entry">
                              <div class="label">Name:</div>
                              <div class="input">
                                  <h:inputText tabindex="1" size="50" maxlength="255" id="name" required="true"
                                               value="#{fileHome.instance.name}"/>
                              </div>
                          </div>
                      </s:decorate>
  
                      <s:div id="details" rendered="#{fileHome.managed}">
  
                          <div class="entry">
                              <div class="label">File Details:</div>
                              <div class="output">
                                  <h:outputText value="(#{fileHome.instance.filename}, #{fileHome.instance.humanReadableFilesize}, #{fileHome.instance.contentType})"/>
                              </div>
                          </div>
  
                      </s:div>
  
                      <s:div id="imagePreview"
                             rendered="#{fileHome.managed and not empty fileHome.instance.imageMetaInfo}">
  
                          <div class="entry">
                              <div class="label">Original Image Size:</div>
                              <div class="output">#{fileHome.instance.imageMetaInfo.sizeX} x #{fileHome.instance.imageMetaInfo.sizeY} pixel</div>
                          </div>
  
                          <div class="entry">
                              <div class="label">Image Preview:</div>
                              <div class="output">
                                  <h:outputLink value="#{facesContext.externalContext.requestContextPath}/files/download?fileId=#{fileHome.instance.id}"><h:graphicImage
                                      value="/files/download?fileId=#{fileHome.instance.id}&amp;width=#{fileHome.imagePreviewSize}&amp;conversationId=#{conversation.id}"/>
                                  </h:outputLink>
                                  
                              </div>
                          </div>
  
                          <div class="entry">
                              <div class="label">&#160;</div>
                              <div class="input">
                                  <h:panelGroup>
                                      <h:commandLink id="zoomOut" tabindex="2" action="#{fileHome.zoomPreviewOut}">
                                          <h:graphicImage value="/themes/#{globalPrefs.themeName}/img/minus.gif" width="18" height="18"/>
                                      </h:commandLink>
                                      <h:commandLink id="zoomIn" tabindex="3" action="#{fileHome.zoomPreviewIn}">
                                          <h:graphicImage value="/themes/#{globalPrefs.themeName}/img/plus.gif" width="18" height="18"/>
                                      </h:commandLink>
                                  </h:panelGroup>
                              </div>
                          </div>
  
                          <div class="entry">
                              <div class="label">Show in documents:</div>
                              <div class="input">
                                  <h:selectOneMenu value="#{fileHome.instance.imageMetaInfo.thumbnail}" styleClass="" tabindex="4">
                                      <f:selectItem itemLabel="Small thumbnail" itemValue="S"/>
                                      <f:selectItem itemLabel="Medium thumbnail" itemValue="M"/>
                                      <f:selectItem itemLabel="Large thumbnail" itemValue="L"/>
                                      <f:selectItem itemLabel="Full size " itemValue="F"/>
                                      <f:selectItem itemLabel="As attachment" itemValue="A"/>
                                  </h:selectOneMenu>
                              </div>
                          </div>
  
                      </s:div>
  
                      <s:div rendered="#{!fileHome.managed}">
  
                          <s:decorate>
                              <div class="entry">
                                  <div class="label">Upload:</div>
                                  <div class="input">
                                      <s:fileUpload data="#{fileHome.filedata}"
                                                    contentType="#{fileHome.contentType}"
                                                    fileName="#{fileHome.filename}"/>
                                  </div>
                              </div>
                          </s:decorate>
                          
                      </s:div>
  
                  </s:validateAll>
  
  
              </div>
              <div class="formControlsWideLabels">
  
                  <div class="entry">
                      <div class="label">&#160;</div>
                      <div class="input">
  
                          <h:commandLink id="save" action="#{fileHome.persist}"
                                         rendered="#{!fileHome.managed}"
                                         tabindex="5" accesskey="S" styleClass="button"><span class="buttonLabel"><u>S</u>ave</span></h:commandLink>
  
                          <h:commandLink id="update" action="#{fileHome.update}"
                                     rendered="#{fileHome.managed}"
                                     tabindex="6" accesskey="U" styleClass="button"><span class="buttonLabel"><u>U</u>pdate</span></h:commandLink>
  
                          <h:commandLink id="delete" action="#{fileHome.remove}"
                                         rendered="#{fileHome.managed}"
                                         tabindex="7" accesskey="D" styleClass="button"><span class="buttonLabel"><u>D</u>elete</span></h:commandLink>
  
                      </div>
                  </div>
  
              </div>
  
          </div>
      </h:form>
  
  </ui:define>
  
  <ui:define name="footer">&#160;</ui:define>
  
  
  </ui:composition>
  
  
  
  



More information about the jboss-cvs-commits mailing list