Package org.apache.roller.ui.core

Examples of org.apache.roller.ui.core.BasePageModel


            ActionMapping       mapping,
            ActionForm          actionForm,
            HttpServletRequest  request,
            HttpServletResponse response)
            throws IOException, ServletException {
        request.setAttribute("model", new BasePageModel(
                "pagesForm.title", request, response, mapping));
        return (mapping.findForward("editPages"));
    }
View Full Code Here


            form.copyFrom(bd, request.getLocale());
            request.setAttribute("state","edit");
               
            // Pass bookmark's Folder on as attribute.                
            parentFolder = bd.getFolder();
            BasePageModel pageModel = new BasePageModel(
                    "bookmarkForm.edit.title", request, response, mapping);
            pageModel.setWebsite(parentFolder.getWebsite());
            request.setAttribute("model", pageModel);
        }
        else if (null != request.getParameter("correct"))
        {
            // We are correcting a previously submtted form.
            request.setAttribute("state","correcting");
               
            // Folder is specified by request param, pass it on as attribute.                
            parentFolder = rreq.getFolder();       
            BasePageModel pageModel = new BasePageModel(
                    "bookmarkForm.correct.title", request, response, mapping);
            pageModel.setWebsite(parentFolder.getWebsite());
            request.setAttribute("model", pageModel);
        }
        else
        {
            // We are adding a new bookmark
            request.setAttribute("state","add");
           
            // Folder is specified by request param, pass it on as attribute.                
            parentFolder = rreq.getFolder();
            BasePageModel pageModel = new BasePageModel(
                    "bookmarkForm.add.title", request, response, mapping);
            pageModel.setWebsite(parentFolder.getWebsite());
            request.setAttribute("model", pageModel);
        }
       
        // Build folder path for display on page
        if (null != parentFolder)
View Full Code Here

        // if group blogging is disabled then you can't change permissions
        if (!RollerConfig.getBooleanProperty("groupblogging.enabled")) {
            return mapping.findForward("access-denied");
        }
       
        BasePageModel pageModel = new BasePageModel(
                "inviteMember.title", request, response, mapping);
        RollerSession rses = RollerSession.getRollerSession(request);
       
        // Ensure use has admin perms for this weblog
        if (pageModel.getWebsite() != null && rses.isUserAuthorizedToAdmin(pageModel.getWebsite())) {
            request.setAttribute("model", pageModel);
            InviteMemberForm form = (InviteMemberForm)actionForm;
            form.setWebsiteId(pageModel.getWebsite().getId());
            ActionForward forward = mapping.findForward("inviteMember.page");
            return forward;
        } else {
            return mapping.findForward("access-denied");
        }
View Full Code Here

        ActionMessages errors = new ActionErrors();
        InviteMemberForm form = (InviteMemberForm)actionForm;
        UserManager umgr = RollerFactory.getRoller().getUserManager();
        UserData user = umgr.getUserByUserName(form.getUserName());
       
        BasePageModel pageModel = new BasePageModel(
                "inviteMember.title", request, response, mapping);
        RollerSession rses = RollerSession.getRollerSession(request);
       
        // Ensure use has admin perms for this weblog
        if (pageModel.getWebsite() != null && rses.isUserAuthorizedToAdmin(pageModel.getWebsite())) {
           
            if (user == null) {
                errors.add(ActionErrors.GLOBAL_ERROR,
                        new ActionError("inviteMember.error.userNotFound"));
            } else {
                RollerRequest rreq = RollerRequest.getRollerRequest(request);
                WebsiteData website = rreq.getWebsite();
                PermissionsData perms = umgr.getPermissions(website, user);
                if (perms != null && perms.isPending()) {
                    errors.add(ActionErrors.GLOBAL_ERROR,
                            new ActionError("inviteMember.error.userAlreadyInvited"));
                    request.setAttribute("model", new BasePageModel(
                            "inviteMember.title", request, response, mapping));
                } else if (perms != null) {
                    errors.add(ActionErrors.GLOBAL_ERROR,
                            new ActionError("inviteMember.error.userAlreadyMember"));
                    request.setAttribute("model", new BasePageModel(
                            "inviteMember.title", request, response, mapping));
                } else {
                    String mask = request.getParameter("permissionsMask");
                    umgr.inviteUser(website, user, Short.parseShort(mask));
                    RollerFactory.getRoller().flush();
                   
                    request.setAttribute("user", user);
                    try {
                        notifyInvitee(request, website, user);
                    } catch (RollerException e) {
                        errors.add(ActionErrors.GLOBAL_ERROR,
                                new ActionError("error.untranslated", e.getMessage()));
                    }
                    msgs.add(ActionMessages.GLOBAL_MESSAGE,
                            new ActionMessage("inviteMember.userInvited"));
                   
                    request.setAttribute("model", new BasePageModel(
                            "inviteMemberDone.title", request, response, mapping));
                   
                    forward = mapping.findForward("memberPermissions");
                }
            }
View Full Code Here

        try {
            if (!isAuthorized(rreq, website)) {
                return mapping.findForward("access-denied");
            }

            BasePageModel pageModel = new BasePageModel("pings.title", req, res, mapping);
            req.setAttribute("model", pageModel);

            List commonPingTargets = pingTargetMgr.getCommonPingTargets();
            req.setAttribute("commonPingTargets", commonPingTargets);
View Full Code Here

     */
    public ActionForward view(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res) throws Exception {
        ActionForward forward = mapping.findForward(VIEW_PAGE);
        RollerRequest rreq = RollerRequest.getRollerRequest(req);
        try {
            BasePageModel pageModel = new BasePageModel(getPingTargetsTitle(), req, res, mapping);
            req.setAttribute("model", pageModel);
            if (!hasRequiredRights(rreq, rreq.getWebsite())) {
                return mapping.findForward(ACCESS_DENIED_PAGE);
            }

View Full Code Here

    public ActionForward save(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res) throws Exception {
        RollerRequest rreq = RollerRequest.getRollerRequest(req);
        PingTargetManager pingTargetMgr = RollerFactory.getRoller().getPingTargetManager();
        PingTargetForm pingTargetForm = (PingTargetForm) form;
        try {
            BasePageModel pageModel = new BasePageModel(getPingTargetEditTitle(), req, res, mapping);
            req.setAttribute("model", pageModel);
            if (!hasRequiredRights(rreq, rreq.getWebsite())) {
                return mapping.findForward(ACCESS_DENIED_PAGE);
            }
View Full Code Here

     * @param res
     * @return the edit page (blank)
     * @throws Exception
     */
    public ActionForward addNew(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res) throws Exception {
        BasePageModel pageModel = new BasePageModel(getPingTargetEditTitle(), req, res, mapping);
        req.setAttribute("model", pageModel);
        return mapping.findForward(PING_TARGET_EDIT_PAGE);
    }
View Full Code Here

     */
    public ActionForward editSelected(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res) throws Exception {
        ActionForward forward = mapping.findForward(PING_TARGET_EDIT_PAGE);
        RollerRequest rreq = RollerRequest.getRollerRequest(req);
        try {
            BasePageModel pageModel = new BasePageModel(getPingTargetEditTitle(), req, res, mapping);
            req.setAttribute("model", pageModel);
            if (!hasRequiredRights(rreq, rreq.getWebsite())) {
                return mapping.findForward(ACCESS_DENIED_PAGE);
            }
            PingTargetData pingTarget = select(rreq);
View Full Code Here

     */
    public ActionForward deleteSelected(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res) throws Exception {
        ActionForward forward = mapping.findForward(PING_TARGET_DELETE_PAGE);
        RollerRequest rreq = RollerRequest.getRollerRequest(req);
        try {
            BasePageModel pageModel = new BasePageModel(getPingTargetDeleteOKTitle(), req, res, mapping);
            req.setAttribute("model", pageModel);
            if (!hasRequiredRights(rreq, rreq.getWebsite())) {
                return mapping.findForward(ACCESS_DENIED_PAGE);
            }
            PingTargetData pingTarget = select(rreq);
View Full Code Here

TOP

Related Classes of org.apache.roller.ui.core.BasePageModel

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.