From 91d8f5c4a9563bf3f212b38d94bc8b383d2fbe45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20P=C3=B6ppke?= Date: Mon, 20 Jun 2016 21:16:59 +0200 Subject: [PATCH] Login working and added skeletons for remaining pages --- .../cocome/cloud/web/events/LoginEvent.java | 19 ++- .../cocome/cloud/web/events/LogoutEvent.java | 4 + .../navigation/INavigationElement.java | 6 + .../navigation/NavigationElement.java | 21 ++- .../navigation/NavigationElements.java | 7 +- .../frontend/navigation/NavigationMenu.java | 31 +++- .../frontend/navigation/NavigationStates.java | 8 -- .../cloud/web/login/DummyAuthenticator.java | 11 +- .../org/cocome/cloud/web/login/DummyUser.java | 134 +++++++++--------- .../org/cocome/cloud/web/login/IUser.java | 32 +++-- .../org/cocome/cloud/web/login/Login.java | 55 ++++--- .../cocome/frontend/Strings.properties | 15 +- .../src/main/webapp/WEB-INF/faces-config.xml | 108 ++------------ .../src/main/webapp/WEB-INF/web.xml | 40 +++--- .../main/webapp/{login.jsp => login.xhtml} | 18 ++- .../main/webapp/templates/commonHeader.xhtml | 15 +- .../webapp/templates/commonNavigation.xhtml | 2 +- .../webapp/templates/commonTemplate.xhtml | 2 +- 18 files changed, 259 insertions(+), 269 deletions(-) delete mode 100644 cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/frontend/navigation/NavigationStates.java rename cocome-maven-project/cloud-web-frontend/src/main/webapp/{login.jsp => login.xhtml} (63%) diff --git a/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/events/LoginEvent.java b/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/events/LoginEvent.java index 8c7c2c68..5e5c80ef 100644 --- a/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/events/LoginEvent.java +++ b/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/events/LoginEvent.java @@ -4,22 +4,23 @@ import org.cocome.cloud.web.frontend.navigation.NavigationViewStates; import org.cocome.cloud.web.login.IUser; +import org.cocome.cloud.web.login.UserRole; public class LoginEvent { private IUser user; - private NavigationViewStates requestedView; + private UserRole role; - public LoginEvent(@NotNull IUser user, @NotNull NavigationViewStates requestedView) { + public LoginEvent(@NotNull IUser user, @NotNull UserRole role) { this.user = user; - this.requestedView = requestedView; + this.role = role; } - public NavigationViewStates getRequestedView() { - return requestedView; + public UserRole getRole() { + return role; } - public void setRequestedView(@NotNull NavigationViewStates requestedView) { - this.requestedView = requestedView; + public void setRole(@NotNull UserRole role) { + this.role = role; } public IUser getUser() { @@ -30,4 +31,8 @@ public void setUser(@NotNull IUser user) { this.user = user; } + public NavigationViewStates getRequestedView() { + return role.associatedView(); + } + } diff --git a/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/events/LogoutEvent.java b/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/events/LogoutEvent.java index 5b53ca83..5c7cc322 100644 --- a/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/events/LogoutEvent.java +++ b/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/events/LogoutEvent.java @@ -5,6 +5,10 @@ public class LogoutEvent { private IUser user; + public LogoutEvent(IUser user) { + this.user = user; + } + public IUser getUser() { return user; } diff --git a/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/frontend/navigation/INavigationElement.java b/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/frontend/navigation/INavigationElement.java index a98cf3a3..41b1c2c5 100644 --- a/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/frontend/navigation/INavigationElement.java +++ b/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/frontend/navigation/INavigationElement.java @@ -13,5 +13,11 @@ public interface INavigationElement { * @return */ String getDisplayText(); + + /** + * + * @return + */ + String getRequiredPermission(); } \ No newline at end of file diff --git a/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/frontend/navigation/NavigationElement.java b/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/frontend/navigation/NavigationElement.java index 2f2d7696..84ba417f 100644 --- a/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/frontend/navigation/NavigationElement.java +++ b/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/frontend/navigation/NavigationElement.java @@ -1,5 +1,7 @@ package org.cocome.cloud.web.frontend.navigation; +import org.cocome.cloud.web.login.IPermission; + /** * Represents an element inside an {@link INavigationMenu}. * @@ -10,6 +12,7 @@ public class NavigationElement implements INavigationElement { private String navOutcome; private String displayText; private ILabelResolver resolver; + private String requiredPermission; /** * @@ -18,7 +21,7 @@ public class NavigationElement implements INavigationElement { * @param resolver */ public NavigationElement(NavigationElements navElement, ILabelResolver resolver) { - this(navElement.getNavigationOutcome(), null, resolver); + this(navElement.getNavigationOutcome(), null, navElement.getNeededPermission(), resolver); } /** @@ -26,14 +29,15 @@ public NavigationElement(NavigationElements navElement, ILabelResolver resolver) * @param navOutcome * @param displayText */ - public NavigationElement(String navOutcome, String displayText, ILabelResolver resolver) { + public NavigationElement(String navOutcome, String displayText, String requiredPermission, ILabelResolver resolver) { this.navOutcome = navOutcome; this.displayText = displayText; this.resolver = resolver; + this.requiredPermission = requiredPermission; } - public NavigationElement(NavigationElements navElement, String displayText, ILabelResolver labelResolver) { - this(navElement.getNavigationOutcome(), displayText, labelResolver); + public NavigationElement(NavigationElements navElement, String displayText, String requiredPermission, ILabelResolver labelResolver) { + this(navElement.getNavigationOutcome(), displayText, requiredPermission, labelResolver); } /* (non-Javadoc) @@ -70,4 +74,13 @@ public String getDisplayText() { public void setDisplayText(String displayText) { this.displayText = displayText; } + + @Override + public String getRequiredPermission() { + return requiredPermission; + } + + public void setRequiredPermission(String requiredPermission) { + this.requiredPermission = requiredPermission; + } } diff --git a/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/frontend/navigation/NavigationElements.java b/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/frontend/navigation/NavigationElements.java index 12d45a57..f82f4ea7 100644 --- a/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/frontend/navigation/NavigationElements.java +++ b/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/frontend/navigation/NavigationElements.java @@ -1,12 +1,11 @@ package org.cocome.cloud.web.frontend.navigation; public enum NavigationElements { - LOGOUT("logout", null), LOGIN("login", null), - MAIN_PAGE("index", null), + MAIN_PAGE("main", null), START_SALE("start_sale", "cashier"), - ORDER_PRODUCTS("order_products", "store manager"), - SHOW_REPORTS("show_reports", "store manager"), + ORDER_PRODUCTS("order_products", "stock manager"), + SHOW_REPORTS("show_reports", "stock manager"), CHANGE_PRICE("change_price", "store manager"), RECEIVE_PRODUCTS("receive_products", "stock manager"), SHOW_ENTERPRISES("show_enterprises", "enterprise manager"), diff --git a/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/frontend/navigation/NavigationMenu.java b/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/frontend/navigation/NavigationMenu.java index 4ec7c569..986d556c 100644 --- a/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/frontend/navigation/NavigationMenu.java +++ b/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/frontend/navigation/NavigationMenu.java @@ -3,6 +3,7 @@ import java.io.Serializable; import java.util.Collections; import java.util.HashMap; +import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; @@ -16,6 +17,7 @@ import org.cocome.cloud.web.events.ChangeViewEvent; import org.cocome.cloud.web.events.LoginEvent; import org.cocome.cloud.web.events.LogoutEvent; +import org.cocome.cloud.web.login.IUser; /** * Implements the navigation menu for the site. @@ -35,6 +37,8 @@ public class NavigationMenu implements INavigationMenu, Serializable { @Inject ILabelResolver labelResolver; + IUser currentUser; + private NavigationViewStates navigationState = NavigationViewStates.DEFAULT_VIEW; @@ -64,7 +68,6 @@ private synchronized void initViewLists() { private List populateCashpadView() { List cashpadViewList = new LinkedList<>(); cashpadViewList.add(new NavigationElement(NavigationElements.MAIN_PAGE, labelResolver)); - cashpadViewList.add(new NavigationElement(NavigationElements.LOGOUT, labelResolver)); return cashpadViewList; } @@ -75,7 +78,6 @@ private List populateStoreView() { storeViewList.add(new NavigationElement(NavigationElements.SHOW_REPORTS, labelResolver)); storeViewList.add(new NavigationElement(NavigationElements.CHANGE_PRICE, labelResolver)); storeViewList.add(new NavigationElement(NavigationElements.RECEIVE_PRODUCTS, labelResolver)); - storeViewList.add(new NavigationElement(NavigationElements.LOGOUT, labelResolver)); return storeViewList; } @@ -85,14 +87,11 @@ private List populateEnterpriseView() { enterpriseViewList.add(new NavigationElement(NavigationElements.CREATE_ENTERPRISE, labelResolver)); enterpriseViewList.add(new NavigationElement(NavigationElements.CREATE_PRODUCT, labelResolver)); enterpriseViewList.add(new NavigationElement(NavigationElements.SHOW_PRODUCTS, labelResolver)); - // TODO test this version of labels, perhaps the label resolver is not needed - enterpriseViewList.add(new NavigationElement(NavigationElements.LOGOUT, "#{strings['navigation.logout.label']}", labelResolver)); return enterpriseViewList; } private List populateDefaultView() { List enterpriseViewList = new LinkedList<>(); - enterpriseViewList.add(new NavigationElement(NavigationElements.LOGOUT, labelResolver)); return enterpriseViewList; } @@ -102,7 +101,7 @@ private List populateDefaultView() { @Override public List getElements() { if (elements == null || elements.isEmpty()) { - elements = STATE_MAP.get(NavigationViewStates.DEFAULT_VIEW); + elements = new LinkedList<>(STATE_MAP.get(NavigationViewStates.DEFAULT_VIEW)); } return elements; } @@ -110,7 +109,23 @@ public List getElements() { @Override public void changeStateTo(@NotNull NavigationViewStates newState) { navigationState = newState; - elements = STATE_MAP.get(navigationState); + elements = new LinkedList<>(STATE_MAP.get(navigationState)); + + Iterator iterator = elements.iterator(); + + if (currentUser == null) { + navigationState = NavigationViewStates.DEFAULT_VIEW; + elements = STATE_MAP.get(NavigationViewStates.DEFAULT_VIEW); + return; + } + + while (iterator.hasNext()) { + INavigationElement element = iterator.next(); + if (element.getRequiredPermission() != null && + !currentUser.hasPermission(element.getRequiredPermission())) { + iterator.remove(); + } + } } @Override @@ -119,10 +134,12 @@ public NavigationViewStates getCurrentState() { } public void observeLoginEvent(@Observes LoginEvent loginEvent) { + this.currentUser = loginEvent.getUser(); changeStateTo(loginEvent.getRequestedView()); } public void observeLogoutEvent(@Observes LogoutEvent logoutEvent) { + this.currentUser = null; changeStateTo(NavigationViewStates.DEFAULT_VIEW); } diff --git a/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/frontend/navigation/NavigationStates.java b/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/frontend/navigation/NavigationStates.java deleted file mode 100644 index 4a046048..00000000 --- a/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/frontend/navigation/NavigationStates.java +++ /dev/null @@ -1,8 +0,0 @@ -package org.cocome.cloud.web.frontend.navigation; - -public enum NavigationStates { - ENTERPRISE_VIEW, - STORE_VIEW, - CASHPAD_VIEW, - DEFAULT_VIEW; -} diff --git a/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/login/DummyAuthenticator.java b/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/login/DummyAuthenticator.java index 5418a36b..dd3b398b 100644 --- a/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/login/DummyAuthenticator.java +++ b/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/login/DummyAuthenticator.java @@ -29,6 +29,9 @@ private void createDummyUsers() { ICredential cashierCredentials = new PlainCredential("cashier"); IUser admin = new DummyUser("admin", adminCredentials); + admin.addPermission(cashierPermission); + admin.addPermission(stockPermission); + admin.addPermission(storePermission); admin.addPermission(adminPermission); admin.addPermission(enterprisePermission); admin.addPermission(databasePermission); @@ -38,10 +41,12 @@ private void createDummyUsers() { IUser storeManager = new DummyUser("storemanager", storeCredentials); storeManager.addPermission(storePermission); + storeManager.addPermission(stockPermission); + storeManager.addPermission(cashierPermission); IUser stockManager = new DummyUser("stockmanager", storeCredentials); - stockManager.addPermission(storePermission); stockManager.addPermission(stockPermission); + stockManager.addPermission(cashierPermission); IUser cashier = new DummyUser("cashier", cashierCredentials); cashier.addPermission(cashierPermission); @@ -85,8 +90,10 @@ public IUser checkCredential(String username, ICredential credential) { if(storedUser.checkCredentials(credential)) { return storedUser; } + LOG.debug("Wrong credentials provided."); + } else { + LOG.warn("No user with name " + username + " found!"); } - LOG.warn("No user with name " + username + " found!"); } return null; } diff --git a/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/login/DummyUser.java b/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/login/DummyUser.java index af1d74ac..05d5db67 100644 --- a/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/login/DummyUser.java +++ b/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/login/DummyUser.java @@ -1,64 +1,70 @@ -package org.cocome.cloud.web.login; - -import java.util.HashMap; - -import org.apache.log4j.Logger; - -public class DummyUser implements IUser { - - private static final Logger LOG = Logger.getLogger(DummyUser.class); - - private String username; - - private ICredential credentials; - - private HashMap permissions; - - public DummyUser(String username, String password) { - this(username, new PlainCredential(password)); - } - - public DummyUser(String username, ICredential credentials) { - this.username = username; - this.credentials = credentials; - this.permissions = new HashMap(); - } - - @Override - public String getUsername() { - return username; - } - - @Override - public void setCredentials(ICredential credentials) { - this.credentials = credentials; - } - - @Override - public ICredential getCredentials() { - return credentials; - } - - @Override - public boolean checkCredentials(ICredential credentials) { - return this.credentials.isMatching(credentials); - } - - @Override - public boolean hasPermission(IPermission permission) { - LOG.debug("Checking for permission " + permission.getName() + " in " + permissions.toString()); - IPermission stored = null; - if (permission != null) { - stored = permissions.get(permission.getName()); - } - return stored != null; - } - - @Override - public void addPermission(IPermission permission) { - if (permission != null) { - permissions.put(permission.getName(), permission); - } - } - -} +package org.cocome.cloud.web.login; + +import java.util.HashMap; + +import org.apache.log4j.Logger; + +public class DummyUser implements IUser { + + private static final Logger LOG = Logger.getLogger(DummyUser.class); + + private String username; + + private ICredential credentials; + + private HashMap permissions; + + public DummyUser(String username, String password) { + this(username, new PlainCredential(password)); + } + + public DummyUser(String username, ICredential credentials) { + this.username = username; + this.credentials = credentials; + this.permissions = new HashMap(); + } + + @Override + public String getUsername() { + return username; + } + + @Override + public void setCredentials(ICredential credentials) { + this.credentials = credentials; + } + + @Override + public ICredential getCredentials() { + return credentials; + } + + @Override + public boolean checkCredentials(ICredential credentials) { + return this.credentials.isMatching(credentials); + } + + @Override + public boolean hasPermission(IPermission permission) { + LOG.debug("Checking for permission " + permission.getName() + " in " + permissions.toString()); + IPermission stored = null; + if (permission != null) { + stored = permissions.get(permission.getName()); + } + return stored != null; + } + + @Override + public void addPermission(IPermission permission) { + if (permission != null) { + permissions.put(permission.getName(), permission); + } + } + + @Override + public boolean hasPermission(String permission) { + IPermission checkPermission = new DummyPermission(permission); + return hasPermission(checkPermission); + } + +} diff --git a/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/login/IUser.java b/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/login/IUser.java index 43ba93c1..ca58bb11 100644 --- a/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/login/IUser.java +++ b/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/login/IUser.java @@ -1,15 +1,17 @@ -package org.cocome.cloud.web.login; - -public interface IUser { - public String getUsername(); - - public void setCredentials(ICredential credentials); - - public ICredential getCredentials(); - - public boolean checkCredentials(ICredential credentials); - - public boolean hasPermission(IPermission permission); - - public void addPermission(IPermission permission); -} +package org.cocome.cloud.web.login; + +public interface IUser { + public String getUsername(); + + public void setCredentials(ICredential credentials); + + public ICredential getCredentials(); + + public boolean checkCredentials(ICredential credentials); + + public boolean hasPermission(IPermission permission); + + public boolean hasPermission(String permission); + + public void addPermission(IPermission permission); +} diff --git a/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/login/Login.java b/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/login/Login.java index 2f208602..45675526 100644 --- a/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/login/Login.java +++ b/cocome-maven-project/cloud-web-frontend/src/main/java/org/cocome/cloud/web/login/Login.java @@ -1,6 +1,7 @@ package org.cocome.cloud.web.login; import javax.enterprise.event.Event; +import javax.enterprise.inject.Produces; import javax.faces.application.FacesMessage; import javax.faces.bean.ManagedBean; import javax.faces.bean.SessionScoped; @@ -29,7 +30,10 @@ public class Login { private String username = ""; private ICredential password = new PlainCredential(""); - private NavigationViewStates requestedView = NavigationViewStates.ENTERPRISE_VIEW; + private UserRole requestedRole = UserRole.ENTERPRISE_MANAGER; + + private IUser user = null; + private long requestedStoreId; private boolean loggedIn = false; @@ -57,22 +61,31 @@ public String login() { if (storedUser != null) { setLoggedIn(true); - loginEvent.fire(new LoginEvent(storedUser, requestedView)); + user = storedUser; + loginEvent.fire(new LoginEvent(storedUser, requestedRole)); LOG.info(String.format("Successful login: username %s.", getUserName())); return NavigationElements.MAIN_PAGE.getNavigationOutcome(); } - FacesContext.getCurrentInstance().addMessage(null, - new FacesMessage(FacesMessage.SEVERITY_ERROR, - "#{strings['login.failed.text']}", null)); + FacesContext context = FacesContext.getCurrentInstance(); + String message = context.getApplication().evaluateExpressionGet( + context, "#{strings['login.failed.text']}", String.class); + context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, + message, null)); LOG.warn(String.format("Failed login: username %s.", getUserName())); return NavigationElements.LOGIN.getNavigationOutcome(); } public String logout() { - this.username = ""; - this.password = new PlainCredential(""); + username = ""; + password = new PlainCredential(""); + requestedRole = UserRole.ENTERPRISE_MANAGER; + requestedStoreId = 0; + + logoutEvent.fire(new LogoutEvent(user)); + user = null; + FacesContext.getCurrentInstance().getExternalContext().invalidateSession(); return NavigationElements.LOGIN.getNavigationOutcome(); } @@ -84,14 +97,6 @@ public boolean isLoggedIn() { public void setLoggedIn(boolean loggedIn) { this.loggedIn = loggedIn; } - - public NavigationViewStates getRequestedView() { - return requestedView; - } - - public void setRequestedView(NavigationViewStates requestedView) { - this.requestedView = requestedView; - } public long getRequestedStoreId() { return requestedStoreId; @@ -101,10 +106,28 @@ public void setRequestedStoreId(long requestedStoreId) { this.requestedStoreId = requestedStoreId; } + public UserRole getRequestedRole() { + return requestedRole; + } + + public void setRequestedRole(UserRole requestedRole) { + this.requestedRole = requestedRole; + } + public boolean isStoreRequired() { - if (requestedView != NavigationViewStates.ENTERPRISE_VIEW) { + if (requestedRole.associatedView() != NavigationViewStates.ENTERPRISE_VIEW) { return true; } return false; } + + @Produces + @javax.enterprise.context.SessionScoped + public IUser getUser() { + return user; + } + + public void setUser(IUser user) { + this.user = user; + } } diff --git a/cocome-maven-project/cloud-web-frontend/src/main/resources/cocome/frontend/Strings.properties b/cocome-maven-project/cloud-web-frontend/src/main/resources/cocome/frontend/Strings.properties index bc9da032..cd80138e 100644 --- a/cocome-maven-project/cloud-web-frontend/src/main/resources/cocome/frontend/Strings.properties +++ b/cocome-maven-project/cloud-web-frontend/src/main/resources/cocome/frontend/Strings.properties @@ -1,4 +1,5 @@ navigation.logout.label=Logout +navigation.no_store_selected.text=No Store selected login.enterprise_manager.text=Enterprise Manager login.store_manager.text=Store Manager login.stock_manager.text=Stock Manager @@ -7,14 +8,14 @@ login.admin.text=Admin login.database_manager.text=Database Manager login.failed.text=Failed login\: Invalid username or password. navigation.dashboard.label=Main Page -navigation.start_sale.label=Start New Sale +navigation.start_sale.label=Cashpad navigation.order_products.label=Order Products -navigation.show_reports.label=Show Stock Reports -navigation.change_price.label=Change Stock Item Price +navigation.show_reports.label=Stock Reports +navigation.change_price.label=Change Prices navigation.receive_products.label=Receive Products -navigation.show_enterprises.label=Show Enterprises -navigation.create_enterprise.label=Create New Enterprise -navigation.create_product.label=Create New Product -navigation.show_products.label=Show Products +navigation.show_enterprises.label=Enterprises +navigation.create_enterprise.label=New Enterprise +navigation.create_product.label=New Product +navigation.show_products.label=Products page.title=CoCoME Web Frontend navigation.logged_in_as.text=Logged in as diff --git a/cocome-maven-project/cloud-web-frontend/src/main/webapp/WEB-INF/faces-config.xml b/cocome-maven-project/cloud-web-frontend/src/main/webapp/WEB-INF/faces-config.xml index 5ef46990..8ec04979 100644 --- a/cocome-maven-project/cloud-web-frontend/src/main/webapp/WEB-INF/faces-config.xml +++ b/cocome-maven-project/cloud-web-frontend/src/main/webapp/WEB-INF/faces-config.xml @@ -1,98 +1,14 @@ - - - - - en - - - cocome.frontend.Strings - strings - - - - cocome_main - /cocome_main.jsp - - logout - /login.jsp - - - - cashdesk - /cashdesk.jsp - - logout - /login.jsp - - - - enterprise - /enterprise.jsp - - logout - /login.jsp - - - - enterprise - /enterprise.jsp - - success_store - /center.jsp - - - - login - /login.jsp - - success_enterprise - /enterprise.jsp - - - - login - /login.jsp - - success_store - /center.jsp - - - - center - /center.jsp - - logout - /login.jsp - - - - center - /center.jsp - - newsale - /cashdesk.jsp - - - - cashdesk - /cashdesk.jsp - - finishsale - /center.jsp - - - - cashdesk - /cashdesk.jsp - - home - /center.jsp - - - + + + + en + + + cocome.frontend.Strings + strings + + diff --git a/cocome-maven-project/cloud-web-frontend/src/main/webapp/WEB-INF/web.xml b/cocome-maven-project/cloud-web-frontend/src/main/webapp/WEB-INF/web.xml index 0a7af842..aff4cc0a 100644 --- a/cocome-maven-project/cloud-web-frontend/src/main/webapp/WEB-INF/web.xml +++ b/cocome-maven-project/cloud-web-frontend/src/main/webapp/WEB-INF/web.xml @@ -1,20 +1,20 @@ - - - CoCoME-Web - - Faces Servlet - javax.faces.webapp.FacesServlet - 1 - - - Faces Servlet - /faces/* - - - faces/login.jsp - - - jsp - text/html - - + + + CoCoME-Web + + Faces Servlet + javax.faces.webapp.FacesServlet + 1 + + + Faces Servlet + /faces/* + + + faces/login.xhtml + + + diff --git a/cocome-maven-project/cloud-web-frontend/src/main/webapp/login.jsp b/cocome-maven-project/cloud-web-frontend/src/main/webapp/login.xhtml similarity index 63% rename from cocome-maven-project/cloud-web-frontend/src/main/webapp/login.jsp rename to cocome-maven-project/cloud-web-frontend/src/main/webapp/login.xhtml index 38d7f106..22bfd82d 100644 --- a/cocome-maven-project/cloud-web-frontend/src/main/webapp/login.jsp +++ b/cocome-maven-project/cloud-web-frontend/src/main/webapp/login.xhtml @@ -7,26 +7,25 @@ - + -
-
\ No newline at end of file diff --git a/cocome-maven-project/cloud-web-frontend/src/main/webapp/templates/commonHeader.xhtml b/cocome-maven-project/cloud-web-frontend/src/main/webapp/templates/commonHeader.xhtml index 191df88c..5cfbe71c 100644 --- a/cocome-maven-project/cloud-web-frontend/src/main/webapp/templates/commonHeader.xhtml +++ b/cocome-maven-project/cloud-web-frontend/src/main/webapp/templates/commonHeader.xhtml @@ -19,12 +19,12 @@ - - - - diff --git a/cocome-maven-project/cloud-web-frontend/src/main/webapp/templates/commonNavigation.xhtml b/cocome-maven-project/cloud-web-frontend/src/main/webapp/templates/commonNavigation.xhtml index 7f5b301f..4c168fc5 100644 --- a/cocome-maven-project/cloud-web-frontend/src/main/webapp/templates/commonNavigation.xhtml +++ b/cocome-maven-project/cloud-web-frontend/src/main/webapp/templates/commonNavigation.xhtml @@ -6,7 +6,7 @@ -
+ + @@ -32,15 +32,16 @@ - + + - +
+ ( )
+
+ diff --git a/cocome-maven-project/cloud-web-frontend/src/main/webapp/templates/commonTemplate.xhtml b/cocome-maven-project/cloud-web-frontend/src/main/webapp/templates/commonTemplate.xhtml index 86092803..4506e212 100644 --- a/cocome-maven-project/cloud-web-frontend/src/main/webapp/templates/commonTemplate.xhtml +++ b/cocome-maven-project/cloud-web-frontend/src/main/webapp/templates/commonTemplate.xhtml @@ -87,7 +87,7 @@ } tr.header-table-banner-row { - background-image:url("#{resource['images:banner_v2.png']}"); + background-image:url("#{resource['image:banner_v2.png']}"); background-repeat: no-repeat; height: 95px; overflow: hidden;