Package com.mossle.ext.store

Examples of com.mossle.ext.store.StoreDTO


    @RequestMapping("user-base-upload")
    @ResponseBody
    public String upload(@RequestParam(value = "id", required = false) Long id,
            @RequestParam("avatar") MultipartFile avatar,
            HttpSession httpSession) throws Exception {
        StoreDTO storeDto = storeConnector
                .save("avatar", new MultipartFileResource(avatar),
                        avatar.getOriginalFilename());

        if (id != null) {
            UserBase userBase = userBaseManager.get(id);
            userBase.setAvatar(storeDto.getKey());
            userBaseManager.save(userBase);
        } else {
            httpSession.setAttribute("temporaryAvatar", storeDto.getKey());
        }

        return "{\"success\":true,\"id\":\"" + ((id == null) ? "" : id) + "\"}";
    }
View Full Code Here


    @ResponseBody
    public void avatar(@RequestParam(value = "id", required = false) Long id,
            OutputStream os, HttpSession httpSession) throws Exception {
        if (id != null) {
            UserBase userBase = userBaseManager.get(id);
            StoreDTO storeDto = storeConnector.get("avatar",
                    userBase.getAvatar());

            IoUtils.copyStream(storeDto.getResource().getInputStream(), os);
        } else {
            StoreDTO storeDto = storeConnector.get("avatar",
                    (String) httpSession.getAttribute("temporaryAvatar"));

            IoUtils.copyStream(storeDto.getResource().getInputStream(), os);
        }
    }
View Full Code Here

            String userId = SpringSecurityUtils.getCurrentUserId();
            dest.setUserId(Long.parseLong(userId));
        }

        StoreDTO storeDto = storeConnector.save("docinfo",
                new MultipartFileResource(attachment),
                attachment.getOriginalFilename());

        dest.setName(attachment.getOriginalFilename());
        dest.setPath(storeDto.getKey());

        docInfoManager.save(dest);

        messageHelper.addFlashMessage(redirectAttributes, "core.success.save",
                "保存成功");
View Full Code Here

    @RequestMapping("cms-article-uploadImage")
    @ResponseBody
    public String uploadImage(@RequestParam("CKEditorFuncNum") String callback,
            @RequestParam("upload") MultipartFile attachment) throws Exception {
        StoreDTO storeDto = storeConnector.save("cms/html/r/images",
                new MultipartFileResource(attachment),
                attachment.getOriginalFilename());

        return "<script type='text/javascript'>"
                + "window.parent.CKEDITOR.tools.callFunction(" + callback
                + ",'" + "r/images/" + storeDto.getKey() + "','')"
                + "</script>";
    }
View Full Code Here

TOP

Related Classes of com.mossle.ext.store.StoreDTO

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.