Examples of BasePageModel


Examples of org.apache.roller.presentation.BasePageModel

        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

Examples of org.apache.roller.presentation.BasePageModel

            userForm.setLocale(Locale.getDefault().toString());
            userForm.setTimeZone(TimeZone.getDefault().getID());
           
            userForm.setPasswordText(null);
            userForm.setPasswordConfirm(null);           
            request.setAttribute("model", new BasePageModel(
                    "newUser.addNewUser", request, response, mapping));
        }
        catch (Exception e)
        {
            errors.add(ActionErrors.GLOBAL_ERROR,
View Full Code Here

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

    {
        RollerRequest rreq = RollerRequest.getRollerRequest(request);
        WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
        WeblogCategoryFormEx form = (WeblogCategoryFormEx)actionForm;
       
        BasePageModel pageModel = null;
        WeblogCategoryData parentCat = null;
        if (null!=rreq.getWeblogCategory() && null==request.getParameter("correct"))
        {
            // If request specifies Category and we are not correcting an
            // already submitted form then load that Category into the form.
            WeblogCategoryData cd = rreq.getWeblogCategory();
            form.copyFrom(cd, request.getLocale());
            request.setAttribute("state","edit");
                            
            parentCat = cd.getParent();           
            pageModel = new BasePageModel(
                "categoryForm.edit.title", request, response, mapping);
            pageModel.setWebsite(cd.getWebsite());
        }
        else if (null != request.getParameter("correct"))
        {
            // We are correcting a previously submtted form.
            // already submitted form then load that Category into the form.
            WeblogCategoryData cd = rreq.getWeblogCategory();
            request.setAttribute("state","correcting");   
           
            parentCat = wmgr.getWeblogCategory(cd.getId());         
            pageModel = new BasePageModel(
                "categoryForm.correct.title", request, response, mapping);
            pageModel.setWebsite(cd.getWebsite());
        }
        else
        {
            // We are adding a new Category
            request.setAttribute("state","add");
           
            String pid = request.getParameter(RequestConstants.PARENT_ID);
            parentCat = wmgr.getWeblogCategory(pid);            
            form.setParentId(parentCat.getId());
           
            pageModel = new BasePageModel(
                "categoryForm.add.title", request, response, mapping);
            pageModel.setWebsite(parentCat.getWebsite());
        }
       
        // Build cat path for display on page
        if (null != parentCat)
        {
View Full Code Here

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

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

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

                ActionMessages messages = new ActionMessages();
                messages.add(null, new ActionMessage("maintenance.message.indexed"));
                saveMessages(request, messages);
            }
           
            request.setAttribute("model", new BasePageModel(
                    "maintenance.title", request, response, mapping));
           
        } catch (RollerException re) {
            mLogger.error("Unexpected exception",re.getRootCause());
            throw new ServletException(re);
View Full Code Here

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

                messages.add(null, new ActionMessage("maintenance.message.flushed"));
                saveMessages(request, messages);
               
            }
           
            request.setAttribute("model", new BasePageModel(
                    "maintenance.title", request, response, mapping));
           
        } catch (Exception e) {
            throw new ServletException(e);
        }
View Full Code Here

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

            throws IOException, ServletException {
       
        ActionForward forward = mapping.findForward("editPages.page");
        WeblogTemplateForm form = (WeblogTemplateForm)actionForm;
        try {
            request.setAttribute("model", new BasePageModel(
                    "pagesForm.title", request, response, mapping));
            RollerRequest rreq = RollerRequest.getRollerRequest(request);
            RollerSession rses = RollerSession.getRollerSession(request);
            WebsiteData website = rreq.getWebsite();
            if ( rses.isUserAuthorizedToAdmin(website) ) {
View Full Code Here

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

            RollerRequest rreq = RollerRequest.getRollerRequest(request);
            WeblogTemplate pd = (WeblogTemplate)rreq.getPage();
           
            RollerSession rses = RollerSession.getRollerSession(request);
            if ( rses.isUserAuthorizedToAdmin(pd.getWebsite()) ) {
                BasePageModel pageModel = new BasePageModel(
                        "pageForm.title", request, response, mapping);
                pageModel.setWebsite(pd.getWebsite());
                request.setAttribute("model", pageModel);
               
                WeblogTemplateForm pf = (WeblogTemplateForm)actionForm;
                pf.copyFrom(pd, request.getLocale());
               
View Full Code Here

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

        ActionForward forward = mapping.findForward("editPages.page");
        try {
            WeblogTemplateForm form = (WeblogTemplateForm)actionForm;
            RollerRequest rreq = RollerRequest.getRollerRequest(request);
            RollerSession rses = RollerSession.getRollerSession(request);
            request.setAttribute("model", new BasePageModel(
                    "pagesForm.title", request, response, mapping));
           
            WebsiteData website = rreq.getWebsite();
            if (website == null && form.getId()!=null) {
                UserManager mgr = RollerFactory.getRoller().getUserManager();
View Full Code Here

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

            HttpServletRequest  request,
            HttpServletResponse response)
            throws IOException, ServletException {
       
        ActionForward forward = mapping.findForward("editPages");
        request.setAttribute("model", new BasePageModel(
                "pagesForm.title", request, response, mapping));
        try {
            UserManager mgr = RollerFactory.getRoller().getUserManager();
            WeblogTemplateForm form = (WeblogTemplateForm)actionForm;
            WeblogTemplate template = mgr.getPage(form.getId());
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.