// Path: src/java/is/idega/idegaweb/egov/accounting/presentation/UpdateAgresso.java
// public class UpdateAgresso extends IWBaseComponent {
// 
// 	/*
// 	 * (non-Javadoc)
// 	 * 
// 	 * @see com.idega.presentation.IWBaseComponent#initializeComponent(javax.faces.context.FacesContext)
// 	 */
// 	protected void initializeComponent(FacesContext context) {
// 		// TODO Auto-generated method stub
// 
// 		setId(getParent().getId() + "_updateagresso");
// 
// 		super.initializeComponent(context);
// 
// 		MethodBinding binding = WFUtil.createMethodBinding("#{AgressoBusinessBean.executeAfterSchoolCareUpdate}", null);
// 
// 		HtmlCommandButton button = new HtmlCommandButton();
// 		button.setId(this.getId() + "_agressoafterschoolcareupdatebutton");
// 		button.setAction(binding);
// 		button.setValue("Update after school care");
// 
// 		add(button);
// 
// 		binding = WFUtil.createMethodBinding("#{AgressoBusinessBean.executeCourseUpdate}", null);
// 
// 		button = new HtmlCommandButton();
// 		button.setId(this.getId() + "_agressocourseupdatebutton");
// 		button.setAction(binding);
// 		button.setValue("Update course");
// 
// 		add(button);
// 	}
// }


import is.idega.idegaweb.egov.accounting.presentation.UpdateAgresso;
import java.util.ArrayList;
import java.util.Collection;
import com.idega.core.view.DefaultViewNode;
import com.idega.core.view.ViewManager;
import com.idega.core.view.ViewNode;
import com.idega.idegaweb.IWBundle;
import com.idega.idegaweb.IWMainApplication;
import com.idega.workspace.view.WorkspaceApplicationNode;
import com.idega.workspace.view.WorkspaceClassViewNode;
	public ViewNode getAccountingViewNode(){
		IWBundle iwb = this.iwma.getBundle("is.idega.idegaweb.egov.accounting");
		if(this.accountingViewNode==null){
			this.accountingViewNode = initalizeAccountingNode(iwb);
		}
		return this.accountingViewNode;
	}

	/**
	 * <p>
	 * TODO tryggvil describe method initalizeSchoolNode
	 * </p>
	 * @param iwb
	 * @return
	 */
	private ViewNode initalizeAccountingNode(IWBundle iwb) {
		ViewManager viewManager = ViewManager.getInstance(this.iwma);
		ViewNode workspace = viewManager.getWorkspaceRoot();
		
		Collection roles = new ArrayList();
		roles.add("accounting_admin");
		
		DefaultViewNode accountingNode = new WorkspaceApplicationNode("accounting",workspace,roles);
		accountingNode.setName("#{localizedStrings['is.idega.idegaweb.egov.accounting']['accounting']}");

		DefaultViewNode agressoNode = new WorkspaceClassViewNode("agresso",accountingNode);
		agressoNode.setName("#{localizedStrings['is.idega.idegaweb.egov.accounting']['agresso']}");
		
		WorkspaceClassViewNode seasons = new WorkspaceClassViewNode("updateagresso",agressoNode);
		seasons.setName("#{localizedStrings['is.idega.idegaweb.egov.accounting']['manual_update_agresso']}");
// Path: src/java/is/idega/idegaweb/egov/accounting/presentation/UpdateAgresso.java
// public class UpdateAgresso extends IWBaseComponent {
// 
// 	/*
// 	 * (non-Javadoc)
// 	 * 
// 	 * @see com.idega.presentation.IWBaseComponent#initializeComponent(javax.faces.context.FacesContext)
// 	 */
// 	protected void initializeComponent(FacesContext context) {
// 		// TODO Auto-generated method stub
// 
// 		setId(getParent().getId() + "_updateagresso");
// 
// 		super.initializeComponent(context);
// 
// 		MethodBinding binding = WFUtil.createMethodBinding("#{AgressoBusinessBean.executeAfterSchoolCareUpdate}", null);
// 
// 		HtmlCommandButton button = new HtmlCommandButton();
// 		button.setId(this.getId() + "_agressoafterschoolcareupdatebutton");
// 		button.setAction(binding);
// 		button.setValue("Update after school care");
// 
// 		add(button);
// 
// 		binding = WFUtil.createMethodBinding("#{AgressoBusinessBean.executeCourseUpdate}", null);
// 
// 		button = new HtmlCommandButton();
// 		button.setId(this.getId() + "_agressocourseupdatebutton");
// 		button.setAction(binding);
// 		button.setValue("Update course");
// 
// 		add(button);
// 	}
// }


// Path: src/java/is/idega/idegaweb/egov/AccountingViewManager.java
import is.idega.idegaweb.egov.accounting.presentation.UpdateAgresso;
import java.util.ArrayList;
import java.util.Collection;
import com.idega.core.view.DefaultViewNode;
import com.idega.core.view.ViewManager;
import com.idega.core.view.ViewNode;
import com.idega.idegaweb.IWBundle;
import com.idega.idegaweb.IWMainApplication;
import com.idega.workspace.view.WorkspaceApplicationNode;
import com.idega.workspace.view.WorkspaceClassViewNode;

	public ViewNode getAccountingViewNode(){
		IWBundle iwb = this.iwma.getBundle("is.idega.idegaweb.egov.accounting");
		if(this.accountingViewNode==null){
			this.accountingViewNode = initalizeAccountingNode(iwb);
		}
		return this.accountingViewNode;
	}

	/**
	 * <p>
	 * TODO tryggvil describe method initalizeSchoolNode
	 * </p>
	 * @param iwb
	 * @return
	 */
	private ViewNode initalizeAccountingNode(IWBundle iwb) {
		ViewManager viewManager = ViewManager.getInstance(this.iwma);
		ViewNode workspace = viewManager.getWorkspaceRoot();
		
		Collection roles = new ArrayList();
		roles.add("accounting_admin");
		
		DefaultViewNode accountingNode = new WorkspaceApplicationNode("accounting",workspace,roles);
		accountingNode.setName("#{localizedStrings['is.idega.idegaweb.egov.accounting']['accounting']}");

		DefaultViewNode agressoNode = new WorkspaceClassViewNode("agresso",accountingNode);
		agressoNode.setName("#{localizedStrings['is.idega.idegaweb.egov.accounting']['agresso']}");
		
		WorkspaceClassViewNode seasons = new WorkspaceClassViewNode("updateagresso",agressoNode);
		seasons.setName("#{localizedStrings['is.idega.idegaweb.egov.accounting']['manual_update_agresso']}");
		seasons.setComponentClass(UpdateAgresso.class);