Package net.datacrow.core.web.model

Examples of net.datacrow.core.web.model.DcWebObject


       
        Map map = fc.getExternalContext().getRequestParameterMap();
        int fieldIdx = Integer.valueOf((String) map.get("fieldIdx"));
        isChild = Boolean.valueOf((String) map.get("isChild"));
       
        DcWebObject wod = getParentObject();
        DcReferences references = (DcReferences) vr.resolveVariable(fc, "references");

        references.setFieldIdx(fieldIdx);
        references.setModuleIdx(wod.getModule());

        setCurrentReferences(wod, references, fieldIdx);
        setListItems(wod, references, fieldIdx);
       
        return current();
View Full Code Here


        VariableResolver vr = fc.getApplication().getVariableResolver();
        DcReferences references = (DcReferences) vr.resolveVariable(fc, "references");
       
        String[] keys = references.getKeys();
       
        DcWebObject wod = getParentObject();
        DcObject dco = wod.getDcObject();
        dco.setValue(references.getFieldIdx(), null);

        int referenceModIdx = dco.getField(references.getFieldIdx()).getReferenceIdx();
        for (String key : keys) {
            DcObject reference = DataManager.getItem(referenceModIdx, key);
            DataManager.createReference(dco, references.getFieldIdx(), reference);
        }
       
        try {
            dco.saveUpdate(false);
        } catch (ValidationException ve) {
            ve.printStackTrace();
        }
       
        wod.load();
       
        return back();
    }
View Full Code Here

            return redirect();
       
        FacesContext fc = FacesContext.getCurrentInstance();
        VariableResolver vr = fc.getApplication().getVariableResolver();
       
        DcWebObject wo = (DcWebObject) vr.resolveVariable(fc, "webObject");
        Map map = fc.getExternalContext().getRequestParameterMap();

        int fieldIdx = Integer.valueOf((String) map.get("fieldIdx"));
        Picture picture = (Picture) wo.getDcObject().getValue(fieldIdx);
        DcWebImage wi = (DcWebImage) vr.resolveVariable(fc, "image");
        wi.setFieldIdx(fieldIdx);
        wi.setModuleIdx(wo.getModule());

        if (picture != null) {
            wi.setPicture(picture);
        } else {
            wi.setPicture(null);
View Full Code Here

        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();

        wod.initialize(moduleIdx);
        wod.setRowIdx(objects.getData().getRowIndex());
        wod.setID((String) data.get(data.size() - 1));
        wod.setName(wod.getDcObject().toString());
        wod.load();
       
        return current();
    }
View Full Code Here

        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

    }
   
    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

    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

    protected String afterCreate() {
        FacesContext fc = FacesContext.getCurrentInstance();
        VariableResolver vr = fc.getApplication().getVariableResolver();

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

        objects.add(wo);
        return current();
    }
View Full Code Here

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

TOP

Related Classes of net.datacrow.core.web.model.DcWebObject

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.