Package org.apache.roller.presentation

Examples of org.apache.roller.presentation.RollerContext


    }
   
    private void sendCommentNotifications(
        HttpServletRequest req, List comments) throws RollerException {
       
        RollerContext rc = RollerContext.getRollerContext();                            
        String rootURL = rc.getAbsoluteContextUrl(req);
        try {
            if (rootURL == null || rootURL.trim().length()==0) {
                rootURL = RequestUtils.serverURL(req) + req.getContextPath();
            }
        } catch (MalformedURLException e) {
View Full Code Here


            UploadFilePageModel pageModel = new UploadFilePageModel(
                request, response, mapping, website.getHandle(), lastUploads);
            request.setAttribute("model", pageModel);
            pageModel.setWebsite(website);
           
            RollerContext rctx = RollerContext.getRollerContext();
        String baseURL = rctx.getAbsoluteContextUrl(request);
            String resourcesBaseURL = baseURL + fmgr.getUploadUrl() + "/" + website.getHandle();
            Iterator uploads = lastUploads.iterator();
            if (uploads.hasNext()) {
                messages.add(ActionMessages.GLOBAL_MESSAGE,
                    new ActionMessage("uploadFiles.uploadedFiles"));
View Full Code Here

                    // Else, if trackback verification is on...
                    else if (RollerRuntimeConfig.getBooleanProperty(
                           "site.trackbackVerification.enabled")) {
                       
                        // ...ensure trackbacker actually links to us
                        RollerContext rctx= RollerContext.getRollerContext();
                        String absurl = rctx.getAbsoluteContextUrl(req);
                        LinkbackExtractor linkback = new LinkbackExtractor(
                            comment.getUrl(), absurl + entry.getPermaLink());
                        if (linkback.getExcerpt() == null) {
                           comment.setPending(Boolean.TRUE);
                           comment.setApproved(Boolean.FALSE);
                           verified = false;
                           // if we can't verify trackback, then reject it
                           error = "REJECTED: trackback failed verification";
                           logger.debug("Trackback failed verification: "+comment.getUrl());
                        }
                    }
                   
                    if (error == null) {
                        // If comment moderation is on, set comment as pending
                        if (verified && website.getCommentModerationRequired()) {
                            comment.setPending(Boolean.TRUE);  
                            comment.setApproved(Boolean.FALSE);
                        } else if (verified) {
                            comment.setPending(Boolean.FALSE);  
                            comment.setApproved(Boolean.TRUE);
                        }

                        // save, commit, send response
                        WeblogManager mgr = RollerFactory.getRoller().getWeblogManager();
                        mgr.saveComment(comment);
                        RollerFactory.getRoller().flush();

                        // Clear all caches associated with comment
                        CacheManager.invalidate(comment);

                        // Send email notifications
                        RollerContext rc = RollerContext.getRollerContext();                               
                        String rootURL = rc.getAbsoluteContextUrl(req);
                        if (rootURL == null || rootURL.trim().length()==0) {
                            rootURL = RequestUtils.serverURL(req) + req.getContextPath();
                        }
                        CommentServlet.sendEmailNotification(comment, rootURL);
View Full Code Here

        }
       
        // validate the referrer
        if (pageRequest != null && pageRequest.getWeblogHandle() != null && !isRobot) {
           
            RollerContext rctx = RollerContext.getRollerContext();
           
            // Base page URLs, with and without www.
            String basePageUrlWWW =
                    rctx.getAbsoluteContextUrl(request)+"/page/"+weblog.getHandle();
            String basePageUrl = basePageUrlWWW;
            if ( basePageUrlWWW.startsWith("http://www.") ) {
                // chop off the http://www.
                basePageUrl = "http://"+basePageUrlWWW.substring(11);
            }
View Full Code Here

            throws RollerException {
       
        mLogger.debug("setupContext( ctx = "+ctx+")");
       
        HttpServletRequest request = rreq.getRequest();
        RollerContext rollerCtx = RollerContext.getRollerContext( );
       
        try {
            // Add page model object to context
            String pageModelClassName =
                RollerConfig.getProperty("velocity.pagemodel.classname");
View Full Code Here

        try {
           
            // setup context
            ctx.put("website", weblog);
           
            RollerContext rollerContext = new RollerContext();
            ctx.put("absBaseURL", rollerContext.getAbsoluteContextUrl(request));
           
            // lookup our rsd template
            template = getTemplate("/flavors/rsd.vm");
           
            // make sure response content type is properly set
View Full Code Here

        ve.info("Done initializing VelocityEngine for ExportRss");
        ve.info("************************************************");
       
        ctx = new VelocityContext();
       
        RollerContext rollerCtx = RollerContext.getRollerContext();
       
        loadPageHelper();
       
        loadDates(website);
       
View Full Code Here

   
    private Hashtable createPostStruct(WeblogEntryData entry, String userid) {
       
        RollerRequest rreq = RollerRequest.getRollerRequest();
        HttpServletRequest request = rreq.getRequest();
        RollerContext rollerCtx = RollerContext.getRollerContext();
        String permalink =
                rollerCtx.getAbsoluteContextUrl(request) + entry.getPermaLink();
       
        Hashtable struct = new Hashtable();
        struct.put("title", entry.getTitle());
        if (entry.getLink() != null) {
            struct.put("link", Utilities.escapeHTML(entry.getLink()));
View Full Code Here

     * @param ctx
     */
    private void setupContext(Context ctx, RollerRequest rreq) throws RollerException {
       
        HttpServletRequest request = rreq.getRequest();
        RollerContext rollerCtx = RollerContext.getRollerContext( );
        RollerSession rses = RollerSession.getRollerSession(request);
        Roller roller = RollerFactory.getRoller();
        // ROLLER_2.0 : figure out how to fix FOAF servlet (does anybody use it?)
        // UserData user =
        //   roller.getUserManager().getUser(userName, Boolean.TRUE);
View Full Code Here

                            userID = userPass.substring(0, p);
                            UserData user = mRoller.getUserManager().getUserByUsername(userID);                                                       
                            boolean enabled = user.getEnabled().booleanValue();
                            if (enabled) {   
                                // are passwords encrypted?
                                RollerContext rollerContext =
                                    RollerContext.getRollerContext();
                                String encrypted =
                                    RollerConfig.getProperty("passwds.encryption.enabled");
                                password = userPass.substring(p+1);
                                if ("true".equalsIgnoreCase(encrypted)) {
View Full Code Here

TOP

Related Classes of org.apache.roller.presentation.RollerContext

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.