Package org.apache.roller.pojos

Examples of org.apache.roller.pojos.WebsiteData


        // TODO: does the permissions data need to be invalidated?
       
        try {
            UserData ud = getRoller().getUserManager().getUserByUsername(entry.getName());
            CacheManager.invalidate(ud);
            WebsiteData wd = getRoller().getUserManager().getWebsiteByHandle(entry.getHandle());
            CacheManager.invalidate(wd);
           
            UserManager mgr = getRoller().getUserManager();
            mgr.savePermissions(pd);
           
View Full Code Here


            UserManager mgr = getRoller().getUserManager();
            mgr.removePermissions(pd);
           
            UserData ud = getRoller().getUserManager().getUserByUsername(username);
            CacheManager.invalidate(ud);
            WebsiteData wd = getRoller().getUserManager().getWebsiteByHandle(handle);
            CacheManager.invalidate(wd);
            getRoller().flush();
           
            EntrySet es = toMemberEntrySet(pds);
            return es;
View Full Code Here

           
            if (!entry.getWebsite().getAllowComments().booleanValue() ||
                    !entry.getCommentsStillAllowed())
                throw new Exception("Comments not allowed on this entry");
           
            WebsiteData website = entry.getWebsite();
           
            // Construct our Comment object from the submitted data
            WeblogManager mgr = RollerFactory.getRoller().getWeblogManager();
            CommentFormEx cf = new CommentFormEx();
            CommentData comment = new CommentData();
            RequestUtils.populate(cf, request);
            cf.copyTo(comment, request.getLocale());
           
            comment.setWeblogEntry(entry);
            comment.setRemoteHost(request.getRemoteHost());
            comment.setPostTime(new java.sql.Timestamp(System.currentTimeMillis()));
           
            cf.setWeblogEntry(entry);
            cf.setPostTime(new java.sql.Timestamp(System.currentTimeMillis()));
           
            request.setAttribute("commentForm", cf);
            request.setAttribute("blogEntry", entry);
           
            if (preview) {
                message = "This is a comment preview only";
               
                // If comment contains blacklisted text, warn commenter
                SpamChecker checker = new SpamChecker();
                if (checker.checkComment(comment)) {
                   error = bundle.getString("commentServlet.previewMarkedAsSpam");
                   mLogger.debug("Comment marked as spam");
                }
                request.setAttribute("previewComments", "dummy");
                mLogger.debug("Comment is a preview");
               
            } else {
                if (this.authenticator.authenticate(comment, request)) {
                    mLogger.debug("Comment passed authentication");
                   
                    // If comment contains blacklisted text, mark as spam
                    SpamChecker checker = new SpamChecker();
                    if (checker.checkComment(comment)) {
                       comment.setSpam(Boolean.TRUE);
                       error = bundle.getString("commentServlet.commentMarkedAsSpam");
                       mLogger.debug("Comment marked as spam");
                    }
                    
                    // If comment moderation is on, set comment as pending
                    if (website.getCommentModerationRequired()) {
                        comment.setPending(Boolean.TRUE);  
                        comment.setApproved(Boolean.FALSE);
                        //message = bundle.getString("commentServlet.submittedToModerator");
                    } else {
                        comment.setPending(Boolean.FALSE);  
View Full Code Here

       
        // Send commment notifications in locale of server
        ResourceBundle resources = ResourceBundle.getBundle("ApplicationResources");

        WeblogEntryData entry = cd.getWeblogEntry();
        WebsiteData site = entry.getWebsite();
        UserData user = entry.getCreator();
       
        // Send e-mail to owner and subscribed users (if enabled)
        boolean notify = RollerRuntimeConfig.getBooleanProperty("users.comments.emailnotify");
        if (notify && site.getEmailComments().booleanValue()) {
            mLogger.debug("Comment notification enabled ... preparing email");
           
            // Determine message and addressing options from init parameters
            boolean separateMessages =
                    RollerConfig.getBooleanProperty("comment.notification.separateOwnerMessage");
            boolean hideCommenterAddrs =
                    RollerConfig.getBooleanProperty("comment.notification.hideCommenterAddresses");
           
            //------------------------------------------
            // --- Determine the "from" address
            // --- Use either the site configured from address or the user's address
           
            String from =
                    (StringUtils.isEmpty(site.getEmailFromAddress()))
                    ? user.getEmailAddress()
                    : site.getEmailFromAddress();
           
            //------------------------------------------
            // --- Build list of email addresses to send notification to
           
            List comments = null;
View Full Code Here

       
        // Send commment notifications in locale of server
        ResourceBundle resources = ResourceBundle.getBundle("ApplicationResources");
       
        WeblogEntryData entry = cd.getWeblogEntry();
        WebsiteData site = entry.getWebsite();
        UserData user = entry.getCreator();
           
        // Only send email if email notificaiton is enabled
        boolean notify = RollerRuntimeConfig.getBooleanProperty("users.comments.emailnotify");
        if (notify && site.getEmailComments().booleanValue()) {
            mLogger.debug("Comment notification enabled ... preparing email");
           

                               
            //------------------------------------------
            // --- Determine the "from" address
            // --- Use either the site configured from address or the user's address
           
            String from =
                    (StringUtils.isEmpty(site.getEmailFromAddress()))
                    ? user.getEmailAddress()
                    : site.getEmailFromAddress();
                       
            //------------------------------------------
            // --- Form the message to be sent -
           
            String subject = resources.getString("email.comment.commentApproved");
View Full Code Here

        ActionErrors errors = new ActionErrors();
        ActionForward forward = mapping.findForward("editTheme.page");
        try {
            RollerSession rses = RollerSession.getRollerSession(request);
            RollerRequest rreq = RollerRequest.getRollerRequest(request);
            WebsiteData website = rreq.getWebsite();
            if ( rses.isUserAuthorizedToAdmin(website) ) {
               
                BasePageModel pageModel = new BasePageModel(
                        "themeEditor.title", request, response, mapping);
                request.setAttribute("model",pageModel);         
                   
                // get users current theme and our themes list
                Roller roller = RollerFactory.getRoller();
                ThemeManager themeMgr = roller.getThemeManager();
               
                String username = rses.getAuthenticatedUser().getUserName();
                String currentTheme = website.getEditorTheme();
                List themes = themeMgr.getEnabledThemesList();
               
                // this checks if the website has a default page template
                // if not then we don't allow for a custom theme
                boolean allowCustomTheme = true;
                if(website.getDefaultPageId() == null
                        || website.getDefaultPageId().equals("dummy")
                        || website.getDefaultPageId().trim().equals(""))
                    allowCustomTheme = false;
               
                // if we allow custom themes then add it to the end of the list
                if(RollerRuntimeConfig.getBooleanProperty("themes.customtheme.allowed")
                        && allowCustomTheme)
View Full Code Here

         getXmlFiles(actionForm, rreq);
                ImportEntriesForm form = (ImportEntriesForm)actionForm;
                if (StringUtils.isNotEmpty(form.getImportFileName()))
                {
                    // "default" values
                    WebsiteData website = rreq.getWebsite();

                    // load selected file
                    String dir = RollerFactory.getRoller().getFileManager().getUploadDir();
                    File f = new File(dir + website.getHandle() +
                                      "/" + form.getImportFileName());

                    //ArchiveParser archiveParser =
                        //new ArchiveParser(RollerFactory.getRoller(), rreq.getWebsite(), f);
                    String parseMessages = null; // archiveParser.parse();
View Full Code Here

        ActionErrors errors = new ActionErrors();
        ActionForward forward = mapping.findForward("editTheme.page");
        try {
            RollerSession rses = RollerSession.getRollerSession(request);           
            RollerRequest rreq = RollerRequest.getRollerRequest(request);
            WebsiteData website = rreq.getWebsite();
            if ( rses.isUserAuthorizedToAdmin(website)) {

                // get users current theme
                Roller roller = RollerFactory.getRoller();
                ThemeManager themeMgr = roller.getThemeManager();
               
                   
                BasePageModel pageModel = new BasePageModel(
                        "themeEditor.title", request, response, mapping);
                request.setAttribute("model",pageModel);         
                   
                String username = rses.getAuthenticatedUser().getUserName();
                String currentTheme = website.getEditorTheme();
                List themes = themeMgr.getEnabledThemesList();
               
                // this checks if the website has a default page template
                // if not then we don't allow for a custom theme
                boolean allowCustomTheme = true;
                if(website.getDefaultPageId() == null
                        || website.getDefaultPageId().equals("dummy")
                        || website.getDefaultPageId().trim().equals(""))
                    allowCustomTheme = false;
               
                // if we allow custom themes then add it to the end of the list
                if(RollerRuntimeConfig.getBooleanProperty("themes.customtheme.allowed")
                        && allowCustomTheme)
View Full Code Here

        ActionErrors errors = new ActionErrors();
        ActionForward forward = mapping.findForward("editTheme.page");
        try {
            RollerSession rses = RollerSession.getRollerSession(request);
            RollerRequest rreq = RollerRequest.getRollerRequest(request);
            WebsiteData website = rreq.getWebsite();
            if ( rses.isUserAuthorizedToAdmin(website) ) {
               
                BasePageModel pageModel = new BasePageModel(
                        "themeEditor.title", request, response, mapping);
                request.setAttribute("model",pageModel);         
                   
                String newTheme = null;
               
                // lookup what theme the user wants first
                String theme = request.getParameter("theme");
                try {
                    Roller roller = RollerFactory.getRoller();
                    ThemeManager themeMgr = roller.getThemeManager();
                    Theme previewTheme = themeMgr.getTheme(theme);
                   
                    if(previewTheme.isEnabled()) {
                        newTheme = previewTheme.getName();
                    } else {
                        errors.add(null, new ActionMessage("Theme not enabled"));
                        saveErrors(request, errors);
                    }
                   
                } catch(ThemeNotFoundException tnfe) {
                    // possibly selected "custom"
                    if(theme != null && theme.equals(Theme.CUSTOM)) {
                        newTheme = Theme.CUSTOM;
                    } else {
                        // hmm ... that's weird
                        mLogger.warn(tnfe);
                        errors.add(null, new ActionMessage("Theme not found"));
                        saveErrors(request, errors);
                    }
                }
               
                // update theme for website and save
                if(newTheme != null) {
                    try {
                        String username = rses.getAuthenticatedUser().getUserName();
                       
                        website.setEditorTheme(newTheme);
                       
                        UserManager userMgr = RollerFactory.getRoller().getUserManager();
                        userMgr.saveWebsite(website);
                        RollerFactory.getRoller().flush();
                       
View Full Code Here

        ActionErrors errors = new ActionErrors();
        ActionForward forward = mapping.findForward("editTheme.page");
        try {
            RollerSession rses = RollerSession.getRollerSession(request);
            RollerRequest rreq = RollerRequest.getRollerRequest(request);
            WebsiteData website = rreq.getWebsite();
            if ( rses.isUserAuthorizedToAdmin(website) ) {
               
                BasePageModel pageModel = new BasePageModel(
                        "themeEditor.title", request, response, mapping);
                request.setAttribute("model",pageModel);         
                   
                // copy down current theme to weblog templates
                Roller roller = RollerFactory.getRoller();
                ThemeManager themeMgr = roller.getThemeManager();
               
                String username = rses.getAuthenticatedUser().getUserName();
               
                try {
                    Theme usersTheme = themeMgr.getTheme(website.getEditorTheme());
                   
                    // only if custom themes are allowed
                    if(RollerRuntimeConfig.getBooleanProperty("themes.customtheme.allowed")) {
                        try {
                            themeMgr.saveThemePages(website, usersTheme);
View Full Code Here

TOP

Related Classes of org.apache.roller.pojos.WebsiteData

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.