Package javax.faces.el

Examples of javax.faces.el.VariableResolver


                dco.setValue(wf.getIndex(), wf.getValue());
        }
       
        if (wo.isChild()) {
            FacesContext fc = FacesContext.getCurrentInstance();
            VariableResolver vr = fc.getApplication().getVariableResolver();
            DcWebObject wod = (DcWebObject) vr.resolveVariable(fc, "webObject");
            dco.setValue( dco.getParentReferenceFieldIndex(), wod.getID());
        }
       
        try {
         
View Full Code Here


public class Security {

    public String login() {
        FacesContext fc = FacesContext.getCurrentInstance();
        VariableResolver vr = fc.getApplication().getVariableResolver();
        DcWebUser wu = (DcWebUser) vr.resolveVariable(fc, "user");
       
        try {
            SecuredUser su = SecurityCentre.getInstance().login(wu.getUsername(), wu.getPassword(), true);
            wu.setSecuredUser(su);
            DcWebModules modules = (DcWebModules) vr.resolveVariable(fc, "modules");
            modules.load();
        } catch (SecurityException se) {
            fc.addMessage("loginError", new FacesMessage(se.getMessage()));
            return "login";
        }
View Full Code Here

        return getUser() != null ? getUser().getUser().toString() : "";
    }
   
    public SecuredUser getUser() {
        FacesContext fc = FacesContext.getCurrentInstance();
        VariableResolver vr = fc.getApplication().getVariableResolver();
        DcWebUser wu = (DcWebUser) vr.resolveVariable(fc, "user");
        return wu != null ? wu.getSecuredUser() : null;
    }
View Full Code Here

        return wu != null ? wu.getSecuredUser() : null;
    }
   
    public boolean isLoggedIn() {
        FacesContext fc = FacesContext.getCurrentInstance();
        VariableResolver vr = fc.getApplication().getVariableResolver();
        DcWebUser wu = (DcWebUser) vr.resolveVariable(fc, "user");
        return wu != null && SecurityCentre.getInstance().isLoggedIn(wu.getSecuredUser());
    }
View Full Code Here

        return wu != null && SecurityCentre.getInstance().isLoggedIn(wu.getSecuredUser());
    }
   
    public String logoff() {
        FacesContext fc = FacesContext.getCurrentInstance();
        VariableResolver vr = fc.getApplication().getVariableResolver();
        DcWebUser wu = (DcWebUser) vr.resolveVariable(fc, "user");
       
        wu.setPassword(null);
        wu.setUsername(null);
        wu.setSecuredUser(null);
       
        DcWebModules modules = (DcWebModules) vr.resolveVariable(fc, "modules");
        modules.load();
       
        DcWebObjects objects = (DcWebObjects) vr.resolveVariable(fc, "webObjects");
        objects.setModule(0);
       
        return "login";
    }
View Full Code Here

    }

    @Override
    protected DcWebObject getItem() {
        FacesContext fc = FacesContext.getCurrentInstance();
        VariableResolver vr = fc.getApplication().getVariableResolver();
        return (DcWebObject) vr.resolveVariable(fc, "webChildObject");
    }
View Full Code Here

    }

    @Override
    protected String afterCreate() {
        FacesContext fc = FacesContext.getCurrentInstance();
        VariableResolver vr = fc.getApplication().getVariableResolver();
        DcWebObject wo = (DcWebObject) vr.resolveVariable(fc, "webObject");
        wo.loadChildren();
       
        return back();
    }
View Full Code Here

    }

    @Override
    protected String afterUpdated() {
        FacesContext fc = FacesContext.getCurrentInstance();
        VariableResolver vr = fc.getApplication().getVariableResolver();
        DcWebObject wo = (DcWebObject) vr.resolveVariable(fc, "webObject");
        wo.loadChildren();
       
        return back();
    }
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    public String open() {
        FacesContext fc = FacesContext.getCurrentInstance();
        VariableResolver vr = fc.getApplication().getVariableResolver();
        DcWebObject wo = (DcWebObject) vr.resolveVariable(fc, "webObject");
        List<Object> row = (List<Object>) wo.getChildren().getRowData();
        int moduleIdx = DcModules.get(wo.getModule()).getChild().getIndex();
       
        DcWebObject child = (DcWebObject) vr.resolveVariable(fc, "webChildObject");
       
        if (!getUser().isAuthorized(DcModules.get(moduleIdx)))
            return redirect();

        child.initialize(moduleIdx);
View Full Code Here

    public String create() {
        if (!isLoggedIn())
            return redirect();
       
        FacesContext fc = FacesContext.getCurrentInstance();
        VariableResolver vr = fc.getApplication().getVariableResolver();
        DcWebObject wo = (DcWebObject) vr.resolveVariable(fc, "webObject");
       
        int moduleIdx = wo.getModule();
       
        if (!getUser().isAuthorized(DcModules.get(moduleIdx)))
            return redirect();
       
        DcWebObject child = (DcWebObject) vr.resolveVariable(fc, "webChildObject");
        child.initialize(DcModules.get(moduleIdx).getChild().getIndex());
        child.setNew(true);
       
        return current();
    }
View Full Code Here

TOP

Related Classes of javax.faces.el.VariableResolver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.