Examples of DcWebImage


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

               
                if (picture == null) continue;
               
                picture.loadImage(false);
                if (picture.getValue(Picture._D_IMAGE) != null) {
                    DcWebImage wi = new DcWebImage();
                    wi.setFieldIdx(field.getIndex());
                    wi.setModuleIdx(field.getModule());
                    wi.setPicture(picture);
                    images.add(wi);
                }
            }
        }
    }
View Full Code Here

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

        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);
        }
       
        return "itemimage";
    }
View Full Code Here

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

    }
   
    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 net.datacrow.core.web.model.DcWebImage

    @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);
           
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.