Package net.datacrow.core.web.model

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


        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

    }
   
    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

    @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

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

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.