Package com.psddev.cms.db

Examples of com.psddev.cms.db.Preview


                    automaticallySavedDraftIds.add(id);
                }
            }

            // Preview for looking glass.
            Preview preview = new Preview();
            UUID currentPreviewId = user.getCurrentPreviewId();

            if (currentPreviewId == null) {
                saveUser = true;
                currentPreviewId = preview.getId();

                user.setCurrentPreviewId(currentPreviewId);
            }

            Map<String, Object> values = state.getSimpleValues();

            preview.getState().setId(currentPreviewId);
            preview.setCreateDate(new Date());
            preview.setObjectType(state.getType());
            preview.setObjectId(state.getId());
            preview.setObjectValues(values);
            preview.setSite(page.getSite());
            preview.save();
            AuthenticationFilter.Static.setCurrentPreview(page.getRequest(), page.getResponse(), preview);
            user.saveAction(page.getRequest(), object);

            if (saveUser) {
                user.save();
View Full Code Here


                    INSECURE_TOOL_USER_ATTRIBUTE,
                    INSECURE_TOOL_USER_CHECKED_ATTRIBUTE);
        }

        public static Preview getCurrentPreview(HttpServletRequest request) {
            Preview preview;

            if (Boolean.TRUE.equals(request.getAttribute(PREVIEW_CHECKED_ATTRIBUTE))) {
                preview = (Preview) request.getAttribute(PREVIEW_ATTRIBUTE);

            } else {
View Full Code Here

        Object content = Query.
                from(Object.class).
                where("_id = ?", action.getContentId()).
                first();

        Preview preview = Query.
                from(Preview.class).
                where("_id = ?", user.getCurrentPreviewId()).
                first();

        String mirrorUrl = StringUtils.addQueryParameters(preview != null && ObjectUtils.equals(action.getContentId(), preview.getObjectId()) ?
                JspUtils.getAbsolutePath(page.getRequest(), "/_preview", "_cms.db.previewId", preview.getId()) :
                action.getUrl(), "_mirror", true);

        doRenderAction(page, content, mirrorUrl);
    }
View Full Code Here

TOP

Related Classes of com.psddev.cms.db.Preview

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.