Commit baffa4ac by Juho Juopperi

Merge branch 'master' of dev.intra.insomnia.fi:/data/bortal

2 parents 95545241 02841205
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd" http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
version="2.0" version="2.0"
> >
<application> <application>
<resource-bundle> <resource-bundle>
<base-name>i18n</base-name> <base-name>i18n</base-name>
...@@ -24,13 +24,7 @@ ...@@ -24,13 +24,7 @@
</locale-config> </locale-config>
</application> </application>
<navigation-rule>
<from-view-id>*</from-view-id>
<navigation-case>
<from-outcome>permissionDenied</from-outcome>
<to-view-id>/permissionDenied.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule> <navigation-rule>
<from-view-id>/user/list.xhtml</from-view-id> <from-view-id>/user/list.xhtml</from-view-id>
<navigation-case> <navigation-case>
...@@ -59,7 +53,23 @@ ...@@ -59,7 +53,23 @@
<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>
<navigation-rule>
<from-view-id>*</from-view-id>
<navigation-case>
<from-outcome>permissionDenied</from-outcome>
<to-view-id>/permissionDenied.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config> </faces-config>
...@@ -11,73 +11,47 @@ ...@@ -11,73 +11,47 @@
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:form>
<tools:canRead target="roleManagement">
<h:dataTable <h:dataTable
border="1" border="1"
id="user" id="user"
value="#{userView.users}" value="#{roleView.roles}"
var="user"> var="role">
<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> <h:column>
<f:facet name="header"> <f:facet name="header">
<h:outputText value="Phone number" /> <h:outputText value="#" />
</f:facet> </f:facet>
<h:outputText value="#{user.phone}" /> <h:outputText value="#{role.id}" />
</h:column> </h:column>
<h:column> <h:column>
<f:facet name="header"> <f:facet name="header">
<h:outputText value="Sex" /> <h:outputText value="#{i18n['role.name']}" />
</f:facet> </f:facet>
<h:outputText value="#{user.female}" /> <h:outputText value="#{role.name}" />
</h:column> </h:column>
<tools:canWrite target="roleManagement">
<h:column> <h:column>
<f:facet name="header"> <f:facet name="header">
<h:outputText value="Edit" /> <h:outputText value="Edit" />
</f:facet> </f:facet>
<h:commandButton <h:commandButton
action="#{userView.edit()}" action="#{roleView.edit()}"
value="Edit" /> value="Edit" />
</h:column> </h:column>
</tools:canWrite>
</h:dataTable> </h:dataTable>
</tools:canRead>
</h:form> </h:form>
</tools:authorization> </tools:authorization>
</composite:implementation> </composite:implementation>
</html> </html>
userManagement userManagement
roleManagement
\ No newline at end of file
...@@ -69,4 +69,8 @@ public class SessionHandler { ...@@ -69,4 +69,8 @@ public class SessionHandler {
return user; return user;
} }
public boolean hasLoggedIn() {
throw new UnsupportedOperationException();
}
} }
...@@ -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!