Examples of VariableResolver


Examples of javax.faces.el.VariableResolver

        return "itemimage";
    }
   
    public boolean isAllowUpload() {
        FacesContext fc = FacesContext.getCurrentInstance();
        VariableResolver vr = fc.getApplication().getVariableResolver();
        DcWebImage wi = (DcWebImage) vr.resolveVariable(fc, "image");
        DcWebObject wo = (DcWebObject) vr.resolveVariable(fc, "webObject");
        return getUser().isEditingAllowed(DcModules.get(wo.getModule()).getField(wi.getFieldIdx()));
    }
View Full Code Here

Examples of javax.faces.el.VariableResolver

    }

    @SuppressWarnings("unchecked")
    public String upload() throws IOException {
        FacesContext fc = FacesContext.getCurrentInstance();
        VariableResolver vr = fc.getApplication().getVariableResolver();
       
        DcWebImage wi = (DcWebImage) vr.resolveVariable(fc, "image");
        byte[] b = uploadedFile.getBytes();
       
        DcWebObject wo = (DcWebObject) vr.resolveVariable(fc, "webObject");
        DcObject dco = wo.getDcObject();
        dco.setValue(wi.getFieldIdx(), new DcImageIcon(b));
       
        try {
            dco.saveUpdate(false);
            wi.setPicture((Picture) dco.getValue(wi.getFieldIdx()));
            wo.load();
       
            DcWebObjects objects = (DcWebObjects) vr.resolveVariable(fc, "webObjects");
            objects.update(wo);
           
        } catch (ValidationException ve) {
            ve.printStackTrace();
        }
View Full Code Here

Examples of javax.faces.el.VariableResolver

       
        List<NavigationMenuItem> menu = new ArrayList<NavigationMenuItem>();

        // edit
        FacesContext fc = FacesContext.getCurrentInstance();
        VariableResolver vr = fc.getApplication().getVariableResolver();
        DcWebObjects objects = (DcWebObjects) vr.resolveVariable(fc, "webObjects");
       
        if (getUser().isEditingAllowed(DcModules.get(objects.getModule()))) {
            NavigationMenuItem edit = getMenuItem(DcResources.getText("lblEdit"), null, null);
           
            new DcWebModule(objects.getModule(), "").getIcon16();
View Full Code Here

Examples of javax.faces.el.VariableResolver

       
        if (!isLoggedIn())
            return redirect();
       
        FacesContext fc = FacesContext.getCurrentInstance();
        VariableResolver vr = fc.getApplication().getVariableResolver();
        Map map = fc.getExternalContext().getRequestParameterMap();
       
        DcWebObjects objects = (DcWebObjects) vr.resolveVariable(fc, "webObjects");
        if (map.get("moduleId") != null && !map.get("moduleId").equals("")) {
            int moduleIdx = Integer.valueOf((String) map.get("moduleId"));
           
            if (getUser().isAuthorized(DcModules.get(moduleIdx))) {
                objects.setModule(moduleIdx);
View Full Code Here

Examples of javax.faces.el.VariableResolver

        return df;
    }
   
    private void applyFilter(DcWebObjects wo, boolean advanced) {
        FacesContext fc = FacesContext.getCurrentInstance();
        VariableResolver vr = fc.getApplication().getVariableResolver();
        AdvancedFilter af = (AdvancedFilter) vr.resolveVariable(fc, "advancedFilter");

        DataFilter df = advanced ?  af.getFilter() : getFilter(wo);
       
      List<WebFieldDefinition> definitions = new ArrayList<WebFieldDefinition>();
      DcField field;
View Full Code Here

Examples of javax.faces.el.VariableResolver

    }

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

Examples of javax.faces.el.VariableResolver

        if (!isLoggedIn())
            return redirect();
       
        FacesContext fc = FacesContext.getCurrentInstance();
        VariableResolver vr = fc.getApplication().getVariableResolver();
        DcWebObjects objects = (DcWebObjects) vr.resolveVariable(fc, "webObjects");
        List<?> data = (List) objects.getData().getRowData();
       
        DcWebObject wod = (DcWebObject) vr.resolveVariable(fc, "webObject");
       
        int moduleIdx = objects.getModule();

        if (!getUser().isAuthorized(DcModules.get(moduleIdx)))
            return redirect();
View Full Code Here

Examples of javax.faces.el.VariableResolver

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

Examples of javax.faces.el.VariableResolver

        return current();
    }
   
    public String save() {
        FacesContext fc = FacesContext.getCurrentInstance();
        VariableResolver vr = fc.getApplication().getVariableResolver();
        DcWebObject wod = (DcWebObject) vr.resolveVariable(fc, "webObject");
        return save(wod);
   
View Full Code Here

Examples of javax.faces.el.VariableResolver

   
   
    @Override
    protected String afterUpdated() {
        FacesContext fc = FacesContext.getCurrentInstance();
        VariableResolver vr = fc.getApplication().getVariableResolver();

        DcWebObjects objects = (DcWebObjects) vr.resolveVariable(fc, "webObjects");
        DcWebObject wo = (DcWebObject) vr.resolveVariable(fc, "webObject");

        objects.update(wo);
        return back();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.