Commit baffa4ac by Juho Juopperi

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

2 parents 95545241 02841205
<?xml version="1.0"?> <?xml version="1.0"?>
<faces-config <faces-config
xmlns="http://java.sun.com/xml/ns/javaee" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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>
<var>i18n</var> <var>i18n</var>
</resource-bundle> </resource-bundle>
<message-bundle>resources.i18n</message-bundle> <message-bundle>resources.i18n</message-bundle>
<!-- Legal Country codes: http://www.iso.org/iso/country_codes/iso_3166_code_lists/english_country_names_and_code_elements.htm --> <!-- Legal Country codes: http://www.iso.org/iso/country_codes/iso_3166_code_lists/english_country_names_and_code_elements.htm -->
<!-- Assigned Country codes: --> <!-- Assigned Country codes: -->
<!-- Insomnia: IN (INDIA) --> <!-- Insomnia: IN (INDIA) -->
<!-- Stream: ST (SAO TOME AND PRINCIPE ) --> <!-- Stream: ST (SAO TOME AND PRINCIPE ) -->
<!-- Vector VE (VENEZUELA, BOLIVARIAN REPUBLIC OF) --> <!-- Vector VE (VENEZUELA, BOLIVARIAN REPUBLIC OF) -->
<locale-config> <locale-config>
<default-locale>fi</default-locale> <default-locale>fi</default-locale>
<supported-locale>fi_IN_XII</supported-locale> <supported-locale>fi_IN_XII</supported-locale>
<supported-locale>en_ST_v7</supported-locale> <supported-locale>en_ST_v7</supported-locale>
</locale-config> </locale-config>
</application> </application>
<navigation-rule>
<from-view-id>*</from-view-id> <navigation-rule>
<navigation-case> <from-view-id>/user/list.xhtml</from-view-id>
<from-outcome>permissionDenied</from-outcome> <navigation-case>
<to-view-id>/permissionDenied.xhtml</to-view-id> <from-outcome>userEdit</from-outcome>
</navigation-case> <to-view-id>/NotImplementedYet.xhtml</to-view-id>
</navigation-rule> </navigation-case>
<navigation-rule> </navigation-rule>
<from-view-id>/user/list.xhtml</from-view-id> <navigation-rule>
<navigation-case> <from-view-id>/user/edit.xhtml</from-view-id>
<from-outcome>userEdit</from-outcome> <navigation-case>
<to-view-id>/NotImplementedYet.xhtml</to-view-id> <from-outcome>userSave</from-outcome>
</navigation-case> <to-view-id>/NotImplementedYet.xhtml</to-view-id>
</navigation-rule> </navigation-case>
<navigation-rule> </navigation-rule>
<from-view-id>/user/edit.xhtml</from-view-id> <navigation-rule>
<navigation-case> <from-view-id>/resources/tools/user/list.xhtml</from-view-id>
<from-outcome>userSave</from-outcome> <navigation-case>
<to-view-id>/NotImplementedYet.xhtml</to-view-id> <from-outcome>userEdit</from-outcome>
</navigation-case> <to-view-id>/modulePossibleReturnValues.xhtml</to-view-id>
</navigation-rule> </navigation-case>
<navigation-rule> </navigation-rule>
<from-view-id>/resources/tools/user/list.xhtml</from-view-id> <navigation-rule>
<navigation-case> <from-view-id>/resources/tools/user/edit.xhtml</from-view-id>
<from-outcome>userEdit</from-outcome> <navigation-case>
<to-view-id>/modulePossibleReturnValues.xhtml</to-view-id> <from-outcome>userSave</from-outcome>
</navigation-case> <to-view-id>/modulePossibleReturnValues.xhtml</to-view-id>
</navigation-rule> </navigation-case>
<navigation-rule> </navigation-rule>
<from-view-id>/resources/tools/user/edit.xhtml</from-view-id> <navigation-rule>
<navigation-case> <from-view-id>/resources/tools/role/list.xhtml</from-view-id>
<from-outcome>userSave</from-outcome> <navigation-case>
<to-view-id>/modulePossibleReturnValues.xhtml</to-view-id> <from-outcome>roleEdit</from-outcome>
</navigation-case> <to-view-id>/modulePossibleReturnValues.xhtml</to-view-id>
</navigation-rule> </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>
...@@ -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
...@@ -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!