package ruboweb.pushetta.jsf.beans.common;

import java.io.Serializable;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;

import org.springframework.context.annotation.Scope;

@ManagedBean
@Scope("request")
public class NavigationBean implements Serializable {

	private static final long serialVersionUID = 713875872520755956L;

	private final String REDIRECT = "?faces-redirect=true";

	@ManagedProperty(value = "#{menuBean}")
	private MenuBean menuBean;

	public NavigationBean() {

	}

	public String goToDataControlPage() {
		this.menuBean.activeDataControl();
		return "/pages/dataControl" + REDIRECT;
	}

	public String goToUsersPage() {
		this.menuBean.activeUsers();
		return "/pages/users" + REDIRECT;
	}

	public String goToCreateNewUser() {
		this.menuBean.activeUsers();
		return "/pages/user/new" + REDIRECT;
	}

	public String goToCreateOnePage() {
		this.menuBean.activeCreationOne();
		return "/pages/createOne" + REDIRECT;
	}

	public String goToListReportsPage() {
		this.menuBean.activeListReports();
		return "/pages/listReports" + REDIRECT;
	}

	public String goToSendNotificationsPage() {
		this.menuBean.activeSendNotifications();
		return "/pages/sendNotifications" + REDIRECT;
	}

	public String goToApiRestPage() {
		this.menuBean.activeApi();
		return "/pages/apiRest" + REDIRECT;
	}

	public MenuBean getMenuBean() {
		return menuBean;
	}

	public void setMenuBean(MenuBean menuBean) {
		this.menuBean = menuBean;
	}
}

@@ -633,16 +633,19 @@
 %22/pages/
+cm/
 dataCont
@@ -654,32 +654,32 @@
 l%22 + REDIRECT;%0D%0A
-
 %09%7D%0D%0A%0D%0A%09public St
@@ -747,24 +747,29 @@
 urn %22/pages/
+user/
 users%22 + RED
@@ -991,16 +991,30 @@
 %22/pages/
+notifications/
 createOn
@@ -1130,16 +1130,30 @@
 %22/pages/
+notifications/
 listRepo
@@ -1283,16 +1283,30 @@
 %22/pages/
+notifications/
 sendNoti
@@ -1397,24 +1397,24 @@
 tiveApi();%0D%0A
-
 %09%09return %22/p
@@ -1418,16 +1418,20 @@
 %22/pages/
+api/
 apiRest%22

Refactor navigation