Commit 2da241d9 by Tuukka Kivilahti

role stuff

1 parent c14d376b
...@@ -50,7 +50,15 @@ ...@@ -50,7 +50,15 @@
<to-view-id>/modulePossibleReturnValues.xhtml</to-view-id> <to-view-id>/modulePossibleReturnValues.xhtml</to-view-id>
</navigation-case> </navigation-case>
</navigation-rule> </navigation-rule>
<navigation-rule>
<from-view-id>/resources/tools/role/list.xhtml</from-view-id>
<navigation-case>
<from-outcome>roleEdit</from-outcome>
<to-view-id>/modulePossibleReturnValues.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config> </faces-config>
...@@ -2,82 +2,56 @@ ...@@ -2,82 +2,56 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html <html
xmlns="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html" xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core" xmlns:f="http://java.sun.com/jsf/core"
xmlns:composite="http://java.sun.com/jsf/composite" xmlns:composite="http://java.sun.com/jsf/composite"
xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:tools="http://java.sun.com/jsf/composite/tools"> xmlns:tools="http://java.sun.com/jsf/composite/tools">
<composite:interface> <composite:interface>
</composite:interface> </composite:interface>
<composite:implementation> <composite:implementation>
<tools:authorization>
<h:form>
<h:dataTable
border="1"
id="user"
value="#{userView.users}"
var="user">
<h:column>
<f:facet name="header">
<h:outputText value="Id" />
</f:facet>
<h:outputText value="#{user.id}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Real name" />
</f:facet>
<h:outputText value="#{user.firstnames}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Address" />
</f:facet>
<h:outputText value="#{user.address}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Town" />
</f:facet>
<h:outputText value="#{user.town}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Zip" />
</f:facet>
<h:outputText value="#{user.zip}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Phone number" />
</f:facet>
<h:outputText value="#{user.phone}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Sex" />
</f:facet>
<h:outputText value="#{user.female}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Edit" />
</f:facet>
<h:commandButton
action="#{userView.edit()}"
value="Edit" />
</h:column>
</h:dataTable>
</h:form>
</tools:authorization>
<h:form>
<tools:canRead target="roleManagement">
<h:dataTable
border="1"
id="user"
value="#{roleView.roles}"
var="role">
<h:column>
<f:facet name="header">
<h:outputText value="#" />
</f:facet>
<h:outputText value="#{role.id}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{i18n['role.name']}" />
</f:facet>
<h:outputText value="#{role.name}" />
</h:column>
<tools:canWrite target="roleManagement">
<h:column>
<f:facet name="header">
<h:outputText value="Edit" />
</f:facet>
<h:commandButton
action="#{roleView.edit()}"
value="Edit" />
</h:column>
</tools:canWrite>
</h:dataTable>
</tools:canRead>
</h:form>
</tools:authorization>
</composite:implementation>
</composite:implementation>
</html> </html>
userManagement userManagement
\ No newline at end of file roleManagement
\ No newline at end of file
...@@ -21,7 +21,7 @@ import org.slf4j.LoggerFactory; ...@@ -21,7 +21,7 @@ import org.slf4j.LoggerFactory;
* *
* @author tuukka * @author tuukka
*/ */
@ManagedBean(name="RoleView") @ManagedBean(name="roleView")
@SessionScoped @SessionScoped
public class RoleView { public class RoleView {
...@@ -41,6 +41,12 @@ public class RoleView { ...@@ -41,6 +41,12 @@ public class RoleView {
} }
public String edit() {
role = items.getRowData();
return "roleEdit";
}
/** Creates a new instance of RoleView */ /** Creates a new instance of RoleView */
public RoleView() { public RoleView() {
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!