[jboss-cvs] jboss-seam/examples/wiki/view ...
Christian Bauer
christian at hibernate.org
Sun Mar 18 11:44:36 EDT 2007
User: cbauer
Date: 07/03/18 11:44:36
Modified: examples/wiki/view userProfile.xhtml
dirDisplay.xhtml userList.xhtml docDisplay.xhtml
dirEdit.xhtml fileEdit.xhtml docEdit.xhtml
docHistory.xhtml userPrefs.xhtml userAccount.xhtml
Log:
Basic access level/role security, automatic home page for activated users
Revision Changes Path
1.3 +3 -5 jboss-seam/examples/wiki/view/userProfile.xhtml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: userProfile.xhtml
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/view/userProfile.xhtml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- userProfile.xhtml 7 Mar 2007 18:37:36 -0000 1.2
+++ userProfile.xhtml 18 Mar 2007 15:44:36 -0000 1.3
@@ -22,17 +22,15 @@
<ui:define name="headerBottomLeft"> </ui:define>
-<ui:define name="headerBottomRight">
- <ui:include src="plugins/searchControl/plugin.xhtml"/>
-</ui:define>
-
<ui:define name="sidebar">
+ <ui:include src="plugins/searchControl/plugin.xhtml"/>
<ui:include src="plugins/mainMenu/plugin.xhtml"/>
</ui:define>
<ui:define name="controlLeft">
<s:div rendered="#{userHome.managed}">
- <s:link id="editAccount" styleClass="linkTab" action="editAccount">Account</s:link>
+ <s:link id="editAccount" styleClass="linkTabActive" action="editAccount"
+ rendered="#{s:hasPermission('User', 'edit', userHome.instance)}">Account</s:link>
<s:link id="editProfile" styleClass="linkTabActive" action="editProfile">Profile</s:link>
<s:link id="editPreferences" styleClass="linkTab" action="editPreferences">Preferences</s:link>
</s:div>
1.9 +50 -26 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.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- dirDisplay.xhtml 9 Mar 2007 08:02:09 -0000 1.8
+++ dirDisplay.xhtml 18 Mar 2007 15:44:36 -0000 1.9
@@ -22,30 +22,34 @@
<ui:define name="headerBottomLeft"> </ui:define>
-<ui:define name="headerBottomRight">
- <ui:include src="plugins/searchControl/plugin.xhtml"/>
-</ui:define>
-
<ui:define name="sidebar">
+ <ui:include src="plugins/searchControl/plugin.xhtml"/>
<ui:include src="plugins/mainMenu/plugin.xhtml"/>
</ui:define>
<ui:define name="controlRight">
- <!-- Real directory -->
<h:panelGroup rendered="#{!empty currentDirectory.parent}">
- <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>
+ <s:link id="createDir" styleClass="linkNavigation" action="createDir" accesskey="S"
+ rendered="#{s:hasPermission('Node', 'create', currentDirectory)}">New <u>S</u>ubdirectory</s:link>
+
+ <s:link id="editDir" styleClass="linkNavigation" action="editDir" accesskey="E"
+ rendered="#{s:hasPermission('Node', 'edit', currentDirectory)}"><u>E</u>dit Directory</s:link>
+
+ <s:link id="createDoc" styleClass="linkNavigation" action="createDoc" accesskey="N"
+ rendered="#{s:hasPermission('Node', 'create', currentDirectory)}"><u>N</u>ew Document</s:link>
+
+ <s:link id="uploadFile" styleClass="linkNavigation" action="uploadFile" accesskey="U"
+ rendered="#{s:hasPermission('Node', 'create', currentDirectory)}"><u>U</u>pload File</s:link>
</h:panelGroup>
- <!-- Virtual root directory -->
<h:panelGroup rendered="#{empty currentDirectory.parent}">
- <s:link id="createArea" styleClass="linkNavigation" action="createDir" accesskey="N"><u>N</u>ew Area</s:link>
- <s:link id="editRoot" styleClass="linkNavigation" action="editDir" accesskey="E"><u>E</u>dit Wiki Root</s:link>
- </h:panelGroup>
+ <s:link id="createArea" styleClass="linkNavigation" action="createDir" accesskey="N"
+ rendered="#{s:hasPermission('Node', 'create', currentDirectory)}"><u>N</u>ew Area</s:link>
+ <s:link id="editRoot" styleClass="linkNavigation" action="editDir" accesskey="E"
+ rendered="#{s:hasPermission('Node', 'edit', currentDirectory)}"><u>E</u>dit Wiki Root</s:link>
+ </h:panelGroup>
</ui:define>
<ui:define name="content">
@@ -68,13 +72,23 @@
<h:dataTable id="directoryTable" var="node"
value="#{currentDirectory.children}"
rendered="#{!empty currentDirectory.children}"
- styleClass="datatable"
- headerClass="regularHeader"
- columnClasses="onePercentColumn,defaultColumn,tenPercentColumn,tenPercentColumn,twentyPercentColumn"
+ styleClass="datatable topLeftBottomBorder"
+ headerClass="regularHeader rightBorder"
+ columnClasses="onePercentColumn rightBorder alignCenter, defaultColumn rightBorder alignLeft,
+ tenPercentColumn rightBorder alignLeft, twentyPercentColumn rightBorder alignLeft,
+ twentyPercentColumn rightBorder alignLeft,twentyPercentColumn rightBorder alignCenter"
rowClasses="rowOdd,rowEven"
cellpadding="0" cellspacing="0" border="0">
<h:column>
+ <f:facet name="header">
+ Test
+ <s:link view="/dirDisplay.xhtml" tabindex="1"
+ rendered="#{!empty currentDirectory.parent and s:hasPermission('Node','read',currentDirectory.parent)}">
+ <f:param name="nodeId" value="#{currentDirectory.parent.id}"/>
+ <h:graphicImage value="/themes/#{globalPrefs.themeName}/img/icon.dirup.gif" width="18" height="20"/>
+ </s:link>
+ </f:facet>
<h:graphicImage value="/themes/#{globalPrefs.themeName}/img/icon.dir.gif"
width="18" height="20"
rendered="#{wiki:isDirectory(node)}"/>
@@ -88,11 +102,9 @@
<h:graphicImage value="/themes/#{globalPrefs.themeName}/img/#{fileMetaMap[node.contentType].displayIcon}"
width="18" height="20"
rendered="#{wiki:isFile(node) and !empty fileMetaMap[node.contentType]}"/>
-
<h:graphicImage value="/themes/#{globalPrefs.themeName}/img/#{fileMetaMap['generic'].displayIcon}"
width="18" height="20"
rendered="#{wiki:isFile(node) and empty fileMetaMap[node.contentType]}"/>
-
</h:column>
<h:column>
@@ -101,37 +113,49 @@
</f:facet>
<s:span rendered="#{wiki:isDirectory(node)}">
- <s:link id="browseDirectory" value="#{node.name}" view="/dirDisplay.xhtml" tabindex="2">
+ <s:link id="browseDirectory" value="#{node.name}" view="/dirDisplay.xhtml"
+ rendered="#{s:hasPermission('Node','read',node)}" tabindex="2">
<f:param name="nodeId" value="#{node.id}"/>
</s:link>
+ <h:outputText value="#{node.name}" rendered="#{!s:hasPermission('Node','read',node)}"/>
</s:span>
<s:span rendered="#{wiki:isDocument(node)}">
- <h:outputLink value="#{wiki:renderURL(node)}" tabindex="2">#{node.name}</h:outputLink>
+ <h:outputLink value="#{wiki:renderURL(node)}" rendered="#{s:hasPermission('Node','read',node)}" tabindex="2">#{node.name}</h:outputLink>
+ <h:outputText value="#{node.name}" rendered="#{!s:hasPermission('Node','read',node)}"/>
</s:span>
- <s:span rendered="#{wiki:isFile(node)}">
+ <s:span rendered="#{wiki:isFile(node) and s:hasPermission('Node', 'edit', node)}">
<s:link id="editFile" value="#{node.name}" action="editFile" tabindex="2">
<f:param name="fileId" value="#{node.id}"/>
</s:link>
-  
- <h:outputText value="(#{node.filename}, #{node.humanReadableFilesize}, #{node.contentType})"/>
+ <h:outputText value=" (#{node.humanReadableFilesize}, #{node.contentType})"/>
+ </s:span>
+ <s:span rendered="#{wiki:isFile(node) and !s:hasPermission('Node', 'edit', node)}">
+ <h:outputText value="#{node.name} (#{node.humanReadableFilesize}, #{node.contentType})"/>
</s:span>
</h:column>
<h:column>
<f:facet name="header">
+ Owner
+ </f:facet>
+ #{node.createdBy.firstname} #{node.createdBy.lastname}
+ </h:column>
+
+ <h:column>
+ <f:facet name="header">
Read Access Level
</f:facet>
- #{roleMap[node.readAccessLevel].displayName} (Level: #{roleMap[node.readAccessLevel].accessLevel})
+ #{wiki:truncateString(wiki:resolveAccessLevel(node.readAccessLevel).roleNames, 20, '...')}
</h:column>
<h:column>
<f:facet name="header">
Write Access Level
</f:facet>
- #{roleMap[node.writeAccessLevel].displayName} (Level: #{roleMap[node.writeAccessLevel].accessLevel})
+ #{wiki:truncateString(wiki:resolveAccessLevel(node.writeAccessLevel).roleNames, 20, '...')}
</h:column>
<h:column rendered="#{!empty node.lastModifiedOn and !empty node.lastModifiedBy}">
1.6 +14 -10 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.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- userList.xhtml 7 Mar 2007 18:37:36 -0000 1.5
+++ userList.xhtml 18 Mar 2007 15:44:36 -0000 1.6
@@ -22,11 +22,8 @@
<ui:define name="headerBottomLeft"> </ui:define>
-<ui:define name="headerBottomRight">
- <ui:include src="plugins/searchControl/plugin.xhtml"/>
-</ui:define>
-
<ui:define name="sidebar">
+ <ui:include src="plugins/searchControl/plugin.xhtml"/>
<ui:include src="plugins/mainMenu/plugin.xhtml"/>
</ui:define>
@@ -128,9 +125,13 @@
<h:dataTable id="userTable" var="u"
value="#{usersList}"
rendered="#{usersList.rowCount >0}"
- styleClass="datatable"
- headerClass="sortableHeader"
- columnClasses="twentyPercentColumn,twentyPercentColumn,twentyPercentColumn,defaultColumn,defaultColumn"
+ styleClass="datatable topLeftBottomBorder"
+ headerClass="sortableHeader rightBorder"
+ columnClasses="tenPercentColumn rightBorder alignLeft,
+ twentyPercentColumn rightBorder alignLeft,
+ twentyPercentColumn rightBorder alignLeft,
+ twentyPercentColumn rightBorder alignLeft,
+ defaultColumn rightBorder alignCenter"
rowClasses="rowOdd,rowEven"
cellpadding="0" cellspacing="0" border="0">
@@ -144,9 +145,8 @@
Username
</h:commandLink>
</f:facet>
- <s:link view="/userAccount.xhtml" value="#{u.username}" tabindex="13" propagation="nest">
- <f:param name="userId" value="#{u.id}"/>
- </s:link>
+ <h:outputLink value="#{wiki:renderHomeURL(u)}" rendered="#{!empty u.memberHome}">#{u.username}</h:outputLink>
+ <h:outputText rendered="#{empty u.memberHome}">#{u.username}</h:outputText>
</h:column>
<h:column>
@@ -203,6 +203,10 @@
</h:outputText>
</h:column>
+ <h:column>
+ Action
+ </h:column>
+
</h:dataTable>
1.8 +8 -7 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.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- docDisplay.xhtml 7 Mar 2007 18:37:36 -0000 1.7
+++ docDisplay.xhtml 18 Mar 2007 15:44:36 -0000 1.8
@@ -25,19 +25,20 @@
<ui:include src="plugins/breadcrumb/plugin.xhtml"/>
</ui:define>
-<ui:define name="headerBottomRight">
- <ui:include src="plugins/searchControl/plugin.xhtml"/>
-</ui:define>
-
<ui:define name="sidebar">
+ <ui:include src="plugins/searchControl/plugin.xhtml"/>
<ui:include src="plugins/mainMenu/plugin.xhtml"/>
</ui:define>
<ui:define name="controlRight">
- <s:link id="createDoc" styleClass="linkNavigation" action="createDoc" accesskey="C"><u>C</u>reate</s:link>
- <s:link id="editDoc" styleClass="linkNavigation" action="editDoc" accesskey="E"><u>E</u>dit</s:link>
+
+ <s:link id="createDoc" styleClass="linkNavigation" action="createDoc" accesskey="C"
+ rendered="#{s:hasPermission('Node', 'create', currentDirectory)}"><u>C</u>reate</s:link>
+
+ <s:link id="editDoc" styleClass="linkNavigation" action="editDoc" accesskey="E"
+ rendered="#{s:hasPermission('Node', 'edit', currentDocument)}"><u>E</u>dit</s:link>
+
<s:link id="showHistory" styleClass="linkNavigation" action="showHistory" accesskey="H"><u>H</u>istory</s:link>
- <s:link id="discussDoc" styleClass="linkNavigation" accesskey="D"><u>D</u>iscuss</s:link>
<s:link id="browseDir" styleClass="linkNavigation" action="browseDir" accesskey="B"><u>B</u>rowse</s:link>
</ui:define>
1.10 +52 -64 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.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- dirEdit.xhtml 8 Mar 2007 17:50:58 -0000 1.9
+++ dirEdit.xhtml 18 Mar 2007 15:44:36 -0000 1.10
@@ -6,6 +6,7 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:wiki="http://jboss.com/products/seam/wiki"
+ xmlns:rich="http://richfaces.ajax4jsf.org/rich"
template="themes/#{globalPrefs.themeName}/template.xhtml">
<ui:define name="pluginHeaders">
@@ -25,11 +26,8 @@
<ui:define name="headerBottomLeft"> </ui:define>
-<ui:define name="headerBottomRight">
- <ui:include src="plugins/searchControl/plugin.xhtml"/>
-</ui:define>
-
<ui:define name="sidebar">
+ <ui:include src="plugins/searchControl/plugin.xhtml"/>
<ui:include src="plugins/mainMenu/plugin.xhtml"/>
</ui:define>
@@ -50,7 +48,7 @@
rendered="#{directoryHome.managed}"/>
</div>
-<div class="formFields">
+<div class="formFieldsWideLabels">
<s:validateAll>
@@ -81,43 +79,33 @@
</div>
</s:decorate>
+ <ui:include src="includes/accessLevelSelector.xhtml"/>
- <s:div styleClass="entry">
- <div class="label">Writable by:</div>
- <div class="input">
- <h:selectOneMenu value="#{nodePermissions.writableByRole}" tabindex="1">
- <s:selectItems value="#{roles}"
- var="role"
- label="Role: #{role.displayName} (Level: #{role.accessLevel})"
- noSelectionLabel="User: #{authenticatedUser.username}"/>
- </h:selectOneMenu>
- </div>
- </s:div>
+ </s:validateAll>
<s:div styleClass="entry">
- <div class="label">Readable by:</div>
+ <div class="label">Default document:</div>
<div class="input">
- <h:selectOneMenu value="#{nodePermissions.readableByRole}" tabindex="2">
- <s:selectItems value="#{roles}"
- var="role"
- label="Role: #{role.displayName} (Level: #{role.accessLevel})"
- noSelectionLabel="User: #{authenticatedUser.username}"/>
+ <h:selectOneMenu value="#{directoryHome.instance.defaultDocument}" converter="#{restrictedEntityConverter}" tabindex="2">
+ <s:selectItems value="#{directoryHome.childDocuments}"
+ var="document"
+ label="#{document.name}"
+ noSelectionLabel="No default document"/>
</h:selectOneMenu>
</div>
</s:div>
- </s:validateAll>
-
- <s:div styleClass="entry" rendered="#{childNodes.rowCount>0}">
- <div class="label">Content:</div>
+ <s:div styleClass="entry"
+ rendered="#{childNodes.rowCount>0 and s:hasPermission('Node', 'editMenu', directoryHome.instance)}">
+ <div class="label">Menu items:</div>
<div class="input">
- <h:dataTable id="directoryFormTable" var="node" width="75%" style="border-width: 1px;"
+ <h:dataTable id="directoryFormTable" var="node" style="width:60%"
value="#{childNodes}"
binding="#{wikiUtil.datatable}"
- styleClass="directoryList"
- headerClass="directoryListHeader"
- columnClasses="positionUpColumn,positionDownColumn,menuControlColumn,defaultDocumentSelectColumn,iconColumn,nameColumn"
- rowClasses="rowOdd,rowEven"
+ styleClass="datatable"
+ columnClasses="onePercentColumn alignCenter, onePercentColumn alignCenter, onePercentColumn alignCenter,
+ onePercentColumn alignCenter, defaultColumn alignLeft"
+ rowClasses="rowEven,rowOdd"
cellpadding="0" cellspacing="0" border="0">
<h:column>
@@ -127,6 +115,7 @@
<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}"
@@ -136,35 +125,23 @@
</h:column>
<h:column>
- <f:facet name="header">
- Menu Item
- </f:facet>
<h:selectBooleanCheckbox value="#{node.menuItem}" tabindex="3"/>
</h:column>
<h:column>
- <f:facet name="header">
- Start Document
- </f:facet>
- <h:commandLink id="defaultDocument" tabindex="4"
- action="#{directoryHome.selectDefaultDocument}"
- rendered="#{directoryHome.instance.defaultDocument != node and wiki:isDocument(node)}">
- <h:graphicImage value="/themes/#{globalPrefs.themeName}/img/right.gif" width="18" height="18"/>
- </h:commandLink>
-
- <h:graphicImage value="/themes/#{globalPrefs.themeName}/img/check.gif" width="18" height="18"
- rendered="#{directoryHome.instance.defaultDocument == node}"/>
-
- <h:outputText value="-" rendered="#{node.class.simpleName == 'Directory'}"/>
- </h:column>
-
- <h:column>
<h:graphicImage value="/themes/#{globalPrefs.themeName}/img/icon.dir.gif"
width="18" height="20"
rendered="#{wiki:isDirectory(node)}"/>
<h:graphicImage value="/themes/#{globalPrefs.themeName}/img/icon.doc.gif"
width="18" height="20"
rendered="#{wiki:isDocument(node)}"/>
+
+ <h:graphicImage value="/themes/#{globalPrefs.themeName}/img/#{fileMetaMap[node.contentType].displayIcon}"
+ width="18" height="20"
+ rendered="#{wiki:isFile(node) and !empty fileMetaMap[node.contentType]}"/>
+ <h:graphicImage value="/themes/#{globalPrefs.themeName}/img/#{fileMetaMap['generic'].displayIcon}"
+ width="18" height="20"
+ rendered="#{wiki:isFile(node) and empty fileMetaMap[node.contentType]}"/>
</h:column>
<h:column>
@@ -184,7 +161,7 @@
<h:commandLink id="preview" styleClass="buttonNonpersistent"
action="#{directoryHome.previewMenuItems()}"
- rendered="#{childNodes.rowCount>0}"
+ rendered="#{childNodes.rowCount>0 and s:hasPermission('Node', 'editMenu', directoryHome.instance)}"
tabindex="5" accesskey="P"><span class="buttonLabel"><u>P</u>review</span></h:commandLink>
<h:commandLink id="save" styleClass="button"
@@ -197,13 +174,11 @@
rendered="#{directoryHome.managed}"
tabindex="7" accesskey="U"><span class="buttonLabel"><u>U</u>pdate</span></h:commandLink>
- <h:commandLink id="delete" styleClass="button"
- action="#{directoryHome.remove}"
+ <h:outputLink id="delete" value="javascript:Richfaces.showModalPanel('deleteConfirmation',{})"
rendered="#{directoryHome.managed
and !empty directoryHome.instance.parent
and empty directoryHome.instance.children}"
- tabindex="8" accesskey="D"><span class="buttonLabel"><u>D</u>elete</span></h:commandLink>
-
+ tabindex="8" accesskey="D" styleClass="button"><span class="buttonLabel"><u>D</u>elete</span></h:outputLink>
</div>
</div>
@@ -212,6 +187,19 @@
</div>
</h:form>
+<ui:decorate template="includes/confirmationModalDialog.xhtml">
+ <ui:param name="confirmationModalDialogId" value="deleteConfirmation"/>
+ <ui:define name="confirmationText">
+ <p>Are you sure you want to delete the directory '#{directoryHome.instance.name}'?</p>
+ </ui:define>
+ <ui:define name="confirmationOption">
+ <h:commandLink id="delete" action="#{directoryHome.remove}"
+ accesskey="O" styleClass="button">
+ <span class="buttonLabel"><u>O</u>k</span>
+ </h:commandLink>
+ </ui:define>
+</ui:decorate>
+
</ui:define>
<ui:define name="footer"> </ui:define>
1.5 +20 -32 jboss-seam/examples/wiki/view/fileEdit.xhtml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: fileEdit.xhtml
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/view/fileEdit.xhtml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- fileEdit.xhtml 9 Mar 2007 08:02:09 -0000 1.4
+++ fileEdit.xhtml 18 Mar 2007 15:44:36 -0000 1.5
@@ -6,6 +6,7 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:wiki="http://jboss.com/products/seam/wiki"
+ xmlns:rich="http://richfaces.ajax4jsf.org/rich"
template="themes/#{globalPrefs.themeName}/template.xhtml">
<ui:define name="pluginHeaders">
@@ -25,11 +26,8 @@
<ui:define name="headerBottomLeft"> </ui:define>
-<ui:define name="headerBottomRight">
- <ui:include src="plugins/searchControl/plugin.xhtml"/>
-</ui:define>
-
<ui:define name="sidebar">
+ <ui:include src="plugins/searchControl/plugin.xhtml"/>
<ui:include src="plugins/mainMenu/plugin.xhtml"/>
</ui:define>
@@ -62,29 +60,7 @@
</div>
</s:decorate>
- <s:div styleClass="entry">
- <div class="label">Writable by:</div>
- <div class="input">
- <h:selectOneMenu value="#{nodePermissions.writableByRole}" tabindex="1">
- <s:selectItems value="#{roles}"
- var="role"
- label="Role: #{role.displayName} (Level: #{role.accessLevel})"
- noSelectionLabel="User: #{authenticatedUser.username}"/>
- </h:selectOneMenu>
- </div>
- </s:div>
-
- <s:div styleClass="entry">
- <div class="label">Readable by:</div>
- <div class="input">
- <h:selectOneMenu value="#{nodePermissions.readableByRole}" tabindex="2">
- <s:selectItems value="#{roles}"
- var="role"
- label="Role: #{role.displayName} (Level: #{role.accessLevel})"
- noSelectionLabel="User: #{authenticatedUser.username}"/>
- </h:selectOneMenu>
- </div>
- </s:div>
+ <ui:include src="includes/accessLevelSelector.xhtml"/>
<s:div id="details" rendered="#{fileHome.managed}">
@@ -149,7 +125,7 @@
<div class="entry">
<div class="label">Upload file:</div>
<div class="input">
- <s:fileUpload data="#{fileHome.filedata}"
+ <s:fileUpload id="upload" data="#{fileHome.filedata}"
contentType="#{fileHome.contentType}"
fileName="#{fileHome.filename}"/>
</div>
@@ -175,10 +151,9 @@
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}"
+ <h:outputLink id="delete" value="javascript:Richfaces.showModalPanel('deleteConfirmation',{})"
rendered="#{fileHome.managed}"
- tabindex="7" accesskey="D" styleClass="button"><span class="buttonLabel"><u>D</u>elete</span></h:commandLink>
-
+ tabindex="7" accesskey="D" styleClass="button"><span class="buttonLabel"><u>D</u>elete</span></h:outputLink>
</div>
</div>
@@ -187,6 +162,19 @@
</div>
</h:form>
+ <ui:decorate template="includes/confirmationModalDialog.xhtml">
+ <ui:param name="confirmationModalDialogId" value="deleteConfirmation"/>
+ <ui:define name="confirmationText">
+ <p>Are you sure you want to delete the file '#{fileHome.instance.name}'?</p>
+ </ui:define>
+ <ui:define name="confirmationOption">
+ <h:commandLink id="delete" action="#{fileHome.remove}"
+ accesskey="O" styleClass="button">
+ <span class="buttonLabel"><u>O</u>k</span>
+ </h:commandLink>
+ </ui:define>
+ </ui:decorate>
+
</ui:define>
<ui:define name="footer"> </ui:define>
1.12 +25 -32 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.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- docEdit.xhtml 16 Mar 2007 05:42:58 -0000 1.11
+++ docEdit.xhtml 18 Mar 2007 15:44:36 -0000 1.12
@@ -1,3 +1,4 @@
+
<!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"
@@ -7,6 +8,7 @@
xmlns:h="http://java.sun.com/jsf/html"
xmlns:a="https://ajax4jsf.dev.java.net/ajax"
xmlns:wiki="http://jboss.com/products/seam/wiki"
+ xmlns:rich="http://richfaces.ajax4jsf.org/rich"
template="themes/#{globalPrefs.themeName}/template.xhtml">
<ui:define name="pluginHeaders">
@@ -26,17 +28,15 @@
<ui:define name="headerBottomLeft"> </ui:define>
-<ui:define name="headerBottomRight">
- <ui:include src="plugins/searchControl/plugin.xhtml"/>
-</ui:define>
-
<ui:define name="sidebar">
+ <ui:include src="plugins/searchControl/plugin.xhtml"/>
<ui:include src="plugins/mainMenu/plugin.xhtml"/>
</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="uploadFile" styleClass="linkNavigation" action="uploadFile" accesskey="U"
+ rendered="#{s:hasPermission('Node', 'create', documentHome.parentDirectory)}"><u>U</u>pload File</s:link>
<s:link id="exit" styleClass="linkNavigation"
action="#{documentHome.exitConversation(true)}"
@@ -46,6 +46,7 @@
<ui:define name="content">
<h:form>
+
<div class="form">
<div class="formHead">
<h:outputText value="New document: #{documentHome.instance.name}" rendered="#{!documentHome.managed}"/>
@@ -67,29 +68,7 @@
</div>
</s:div>
- <s:div styleClass="entry">
- <div class="label">Writable by:</div>
- <div class="input">
- <h:selectOneMenu value="#{nodePermissions.writableByRole}" tabindex="1">
- <s:selectItems value="#{roles}"
- var="role"
- label="Role: #{role.displayName} (Level: #{role.accessLevel})"
- noSelectionLabel="User: #{authenticatedUser.username}"/>
- </h:selectOneMenu>
- </div>
- </s:div>
-
- <s:div styleClass="entry">
- <div class="label">Readable by:</div>
- <div class="input">
- <h:selectOneMenu value="#{nodePermissions.readableByRole}" tabindex="2">
- <s:selectItems value="#{roles}"
- var="role"
- label="Role: #{role.displayName} (Level: #{role.accessLevel})"
- noSelectionLabel="User: #{authenticatedUser.username}"/>
- </h:selectOneMenu>
- </div>
- </s:div>
+ <ui:include src="includes/accessLevelSelector.xhtml"/>
<s:decorate>
<div class="entry">
@@ -154,9 +133,9 @@
rendered="#{documentHome.managed}"
tabindex="5" accesskey="U" styleClass="button"><span class="buttonLabel"><u>U</u>pdate</span></h:commandLink>
- <h:commandLink id="delete" action="#{documentHome.remove}"
+ <h:outputLink id="delete" value="javascript:Richfaces.showModalPanel('deleteConfirmation',{})"
rendered="#{documentHome.managed}"
- tabindex="6" accesskey="D" styleClass="button"><span class="buttonLabel"><u>D</u>elete</span></h:commandLink>
+ tabindex="6" accesskey="D" styleClass="button"><span class="buttonLabel"><u>D</u>elete</span></h:outputLink>
</div>
</div>
@@ -164,8 +143,22 @@
</div>
</div>
+
</h:form>
+ <ui:decorate template="includes/confirmationModalDialog.xhtml">
+ <ui:param name="confirmationModalDialogId" value="deleteConfirmation"/>
+ <ui:define name="confirmationText">
+ <p>Are you sure you want to delete the document '#{documentHome.instance.name}'?</p>
+ </ui:define>
+ <ui:define name="confirmationOption">
+ <h:commandLink id="delete" action="#{documentHome.remove}"
+ accesskey="O" styleClass="button">
+ <span class="buttonLabel"><u>O</u>k</span>
+ </h:commandLink>
+ </ui:define>
+ </ui:decorate>
+
<s:div styleClass="documentDisplay" id="preview">
<wiki:formattedText value="#{documentHome.instance.content}"
linkStyleClass="regularLink"
1.2 +85 -41 jboss-seam/examples/wiki/view/docHistory.xhtml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: docHistory.xhtml
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/view/docHistory.xhtml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- docHistory.xhtml 7 Mar 2007 18:37:36 -0000 1.1
+++ docHistory.xhtml 18 Mar 2007 15:44:36 -0000 1.2
@@ -22,11 +22,8 @@
<ui:define name="headerBottomLeft"> </ui:define>
-<ui:define name="headerBottomRight">
- <ui:include src="plugins/searchControl/plugin.xhtml"/>
-</ui:define>
-
<ui:define name="sidebar">
+ <ui:include src="plugins/searchControl/plugin.xhtml"/>
<ui:include src="plugins/mainMenu/plugin.xhtml"/>
</ui:define>
@@ -38,31 +35,67 @@
<ui:define name="content">
- <s:div rendered="#{historicalNodeList.rowCount == 0}">
- The document '#{currentNode.name}' does not have any history, only the current revision is present.
+<h:form rendered="#{historicalNodeList.rowCount >0}">
+<div class="form">
+
+ <div class="formHead">Document History: #{currentNode.name}</div>
+ <div class="formFieldsWideLabels">
+
+ <s:div styleClass="entry">
+ <div class="label">Revision:</div>
+ <div class="output">
+ <h:outputText value="#{currentNode.revision}"/>
+ </div>
</s:div>
- <h:form rendered="#{historicalNodeList.rowCount >0}">
+ <s:div styleClass="entry">
+ <div class="label">Parent:</div>
+ <div class="output">
+ <h:outputText value="#{currentNode.parent.name}"/>
+ </div>
+ </s:div>
- <h:dataTable id="historyTable" var="hnode"
+ <s:div styleClass="entry">
+ <div class="label">Created On:</div>
+ <div class="output">
+ <h:outputText value="#{currentNode.createdOn}">
+ <f:convertDateTime type="both"/>
+ </h:outputText>
+ (#{currentNode.createdBy.username})
+ </div>
+ </s:div>
+
+ <s:div styleClass="entry" rendered="#{!empty currentNode.lastModifiedBy}">
+ <div class="label">Last Modified On:</div>
+ <div class="output">
+ <h:outputText value="#{currentNode.lastModifiedOn}">
+ <f:convertDateTime type="both"/>
+ </h:outputText>
+ (#{currentNode.lastModifiedBy.username})
+ </div>
+ </s:div>
+
+ <s:div styleClass="entry">
+ <div class="label">Historical revisions:</div>
+ <div class="input">
+
+ <h:dataTable id="historyTable" var="hnode" style="width:50%"
value="#{historicalNodeList}"
- styleClass="datatable"
- headerClass="sortableHeader"
- columnClasses="defaultColumn,defaultColumn,defaultColumn,defaultColumn,defaultColumn"
+ styleClass="datatable topLeftBottomBorder"
+ headerClass="sortableHeader rightBorder"
+ columnClasses="onePercentColumn rightBorder alignCenter,
+ tenPercentColumn rightBorder alignLeft,
+ tenPercentColumn rightBorder alignLeft,
+ defaultColumn rightBorder alignCenter"
rowClasses="rowOdd,rowEven"
cellpadding="0" cellspacing="0" border="0">
<h:column>
- <f:facet name="header">Revision</f:facet>
+ <f:facet name="header">#</f:facet>
#{hnode.revision}
</h:column>
<h:column>
- <f:facet name="header">Name</f:facet>
- #{hnode.name}
- </h:column>
-
- <h:column>
<f:facet name="header">Last Modified On</f:facet>
<h:outputText value="#{hnode.lastModifiedOn}">
<f:convertDateTime type="both"/>
@@ -70,18 +103,29 @@
</h:column>
<h:column>
- <f:facet name="header">Action</f:facet>
+ <f:facet name="header">Last Modified By</f:facet>
+ <h:outputText value="#{hnode.lastModifiedByUsername}"/>
+ </h:column>
+
+ <h:column>
<h:commandLink id="diff"
action="#{nodeHistory.diff}"
tabindex="3" styleClass="buttonNonpersistent"><span class="buttonLabel">Diff</span></h:commandLink>
<h:commandLink id="rollback"
action="#{nodeHistory.rollback}"
- tabindex="4" styleClass="buttonNonpersistent"><span class="buttonLabel">Rollback</span></h:commandLink>
+ tabindex="4" styleClass="buttonNonpersistent"
+ rendered="#{s:hasPermission('Node', 'edit', currentNode)}"><span class="buttonLabel">Rollback</span></h:commandLink>
</h:column>
</h:dataTable>
- </h:form>
+ </div>
+ </s:div>
+
+ </div>
+
+</div>
+</h:form>
<s:div id="diffOutput" rendered="#{not empty nodeHistory.diffResult}">
<wiki:formattedText value="#{nodeHistory.diffResult}"
1.3 +1 -4 jboss-seam/examples/wiki/view/userPrefs.xhtml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: userPrefs.xhtml
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/view/userPrefs.xhtml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- userPrefs.xhtml 7 Mar 2007 18:37:36 -0000 1.2
+++ userPrefs.xhtml 18 Mar 2007 15:44:36 -0000 1.3
@@ -22,11 +22,8 @@
<ui:define name="headerBottomLeft"> </ui:define>
-<ui:define name="headerBottomRight">
- <ui:include src="plugins/searchControl/plugin.xhtml"/>
-</ui:define>
-
<ui:define name="sidebar">
+ <ui:include src="plugins/searchControl/plugin.xhtml"/>
<ui:include src="plugins/mainMenu/plugin.xhtml"/>
</ui:define>
1.3 +21 -7 jboss-seam/examples/wiki/view/userAccount.xhtml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: userAccount.xhtml
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/view/userAccount.xhtml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- userAccount.xhtml 7 Mar 2007 18:37:36 -0000 1.2
+++ userAccount.xhtml 18 Mar 2007 15:44:36 -0000 1.3
@@ -25,19 +25,19 @@
<ui:define name="headerBottomLeft"> </ui:define>
-<ui:define name="headerBottomRight">
- <ui:include src="plugins/searchControl/plugin.xhtml"/>
-</ui:define>
-
<ui:define name="sidebar">
+ <ui:include src="plugins/searchControl/plugin.xhtml"/>
<ui:include src="plugins/mainMenu/plugin.xhtml"/>
</ui:define>
<ui:define name="controlLeft">
<s:div rendered="#{userHome.managed}">
- <s:link id="editAccount" styleClass="linkTabActive" action="editAccount">Account</s:link>
- <s:link id="editProfile" styleClass="linkTab" action="editProfile">Profile</s:link>
- <s:link id="editPreferences" styleClass="linkTab" action="editPreferences">Preferences</s:link>
+ <s:link id="editAccount" styleClass="linkTabActive" action="editAccount"
+ rendered="#{s:hasPermission('User', 'edit', userHome.instance)}">Account</s:link>
+ <s:link id="editProfile" styleClass="linkTab" action="editProfile"
+ rendered="#{s:hasPermission('User', 'edit', userHome.instance)}">Profile</s:link>
+ <s:link id="editPreferences" styleClass="linkTab" action="editPreferences"
+ rendered="#{s:hasPermission('User', 'edit', userHome.instance)}">Preferences</s:link>
</s:div>
</ui:define>
@@ -138,6 +138,20 @@
</s:div>
</s:decorate>
+ <s:div styleClass="entry" rendered="#{userHome.managed}">
+ <s:div styleClass="label" rendered="#{s:hasPermission('User', 'editRoles', currentUser)}">Edit roles:</s:div>
+ <s:div styleClass="label" rendered="#{!s:hasPermission('User', 'editRoles', currentUser)}">Assigned roles:</s:div>
+ <div class="input">
+ <h:selectManyListbox value="#{userHome.roles}" tabindex="8"
+ disabled="#{!s:hasPermission('User', 'editRoles', currentUser)}"
+ converter="#{entityConverter}">
+ <s:selectItems value="#{rolesList}"
+ var="role"
+ label="#{role.displayName} (Access level: #{role.accessLevel})"/>
+ </h:selectManyListbox>
+ </div>
+ </s:div>
+
</s:validateAll>
</div>
More information about the jboss-cvs-commits
mailing list