Package org.b3log.solo.service

Examples of org.b3log.solo.service.PreferenceQueryService


                return;
            }

            final LatkeBeanManager beanManager = Lifecycle.getBeanManager();
            final PreferenceQueryService preferenceQueryService = beanManager.getReference(PreferenceQueryService.class);

            final JSONObject preference = preferenceQueryService.getPreference();

            if (null == preference) {
                throw new EventException("Not found preference");
            }
View Full Code Here


                return;
            }

            final LatkeBeanManager beanManager = Lifecycle.getBeanManager();
            final PreferenceQueryService preferenceQueryService = beanManager.getReference(PreferenceQueryService.class);

            final JSONObject preference = preferenceQueryService.getPreference();

            if (null == preference) {
                throw new EventException("Not found preference");
            }
View Full Code Here

        final JSONObject eventData = event.getData();

        String articleTitle = null;

        final LatkeBeanManager beanManager = Lifecycle.getBeanManager();
        final PreferenceQueryService preferenceQueryService = beanManager.getReference(PreferenceQueryService.class);

        try {
            final JSONObject article = eventData.getJSONObject(Article.ARTICLE);

            articleTitle = article.getString(Article.ARTICLE_TITLE);
            final JSONObject preference = preferenceQueryService.getPreference();
            final String blogTitle = preference.getString(Preference.BLOG_TITLE);

            if (Latkes.getServePath().contains("localhost")) {
                LOGGER.log(Level.INFO,
                    "Blog Solo runs on local server, so should not ping " + "Google Blog Search Service for the article[title={0}]",
View Full Code Here

            new Object[] {event.getType(), data, ArticleSender.class.getName()});
        try {
            final JSONObject originalComment = data.getJSONObject(Comment.COMMENT);

            final LatkeBeanManager beanManager = Lifecycle.getBeanManager();
            final PreferenceQueryService preferenceQueryService = beanManager.getReference(PreferenceQueryService.class);

            final JSONObject preference = preferenceQueryService.getPreference();

            if (null == preference) {
                throw new EventException("Not found preference");
            }
View Full Code Here

        final JSONObject eventData = event.getData();

        String articleTitle = null;

        final LatkeBeanManager beanManager = Lifecycle.getBeanManager();
        final PreferenceQueryService preferenceQueryService = beanManager.getReference(PreferenceQueryService.class);

        try {
            final JSONObject article = eventData.getJSONObject(Article.ARTICLE);

            articleTitle = article.getString(Article.ARTICLE_TITLE);
            final JSONObject preference = preferenceQueryService.getPreference();
            final String blogTitle = preference.getString(Preference.BLOG_TITLE);

            if (Latkes.getServePath().contains("localhost")) {
                LOGGER.log(Level.INFO,
                    "Blog Solo runs on local server, so should not ping " + "Google Blog Search Service for the article[title={0}]",
View Full Code Here

            LOGGER.log(Level.DEBUG, "This comment[id={0}] is not a reply", comment.optString(Keys.OBJECT_ID));
            return;
        }

        final LatkeBeanManager beanManager = Lifecycle.getBeanManager();
        final PreferenceQueryService preferenceQueryService = beanManager.getReference(PreferenceQueryService.class);
       
        final CommentRepository commentRepository = beanManager.getReference(CommentRepositoryImpl.class);
       
        try {
            final String commentEmail = comment.getString(Comment.COMMENT_EMAIL);
            final JSONObject originalComment = commentRepository.get(originalCommentId);
            final String originalCommentEmail = originalComment.getString(Comment.COMMENT_EMAIL);

            if (originalCommentEmail.equalsIgnoreCase(commentEmail)) {
                return;
            }

            final JSONObject preference = preferenceQueryService.getPreference();

            if (null == preference) {
                throw new EventException("Not found preference");
            }

            final String blogTitle = preference.getString(Preference.BLOG_TITLE);
            final String adminEmail = preference.getString(Preference.ADMIN_EMAIL);

            final String commentContent = comment.getString(Comment.COMMENT_CONTENT).replaceAll(SoloServletListener.ENTER_ESC, "<br/>");
            final String commentSharpURL = comment.getString(Comment.COMMENT_SHARP_URL);
            final Message message = new Message();

            message.setFrom(adminEmail);
            message.addRecipient(originalCommentEmail);
            final JSONObject replyNotificationTemplate = preferenceQueryService.getReplyNotificationTemplate();
            final String mailSubject = replyNotificationTemplate.getString("subject").replace("${blogTitle}", blogTitle);

            message.setSubject(mailSubject);
            final String articleTitle = article.getString(Article.ARTICLE_TITLE);
            final String articleLink = Latkes.getServePath() + article.getString(Article.ARTICLE_PERMALINK);
View Full Code Here

            LOGGER.log(Level.DEBUG, "This comment[id={0}] is not a reply", comment.optString(Keys.OBJECT_ID));
            return;
        }

        final LatkeBeanManager beanManager = Lifecycle.getBeanManager();
        final PreferenceQueryService preferenceQueryService = beanManager.getReference(PreferenceQueryService.class);
       
        final CommentRepository commentRepository = beanManager.getReference(CommentRepositoryImpl.class);
       
        try {
            final String commentEmail = comment.getString(Comment.COMMENT_EMAIL);
            final JSONObject originalComment = commentRepository.get(originalCommentId);
            final String originalCommentEmail = originalComment.getString(Comment.COMMENT_EMAIL);

            if (originalCommentEmail.equalsIgnoreCase(commentEmail)) {
                return;
            }

            final JSONObject preference = preferenceQueryService.getPreference();

            if (null == preference) {
                throw new EventException("Not found preference");
            }

            final String blogTitle = preference.getString(Preference.BLOG_TITLE);
            final String adminEmail = preference.getString(Preference.ADMIN_EMAIL);

            final String commentContent = comment.getString(Comment.COMMENT_CONTENT).replaceAll(SoloServletListener.ENTER_ESC, "<br/>");
            final String commentSharpURL = comment.getString(Comment.COMMENT_SHARP_URL);
            final Message message = new Message();

            message.setFrom(adminEmail);
            message.addRecipient(originalCommentEmail);
            final JSONObject replyNotificationTemplate = preferenceQueryService.getReplyNotificationTemplate();
            final String mailSubject = replyNotificationTemplate.getString("subject").replace("${blogTitle}", blogTitle);

            message.setSubject(mailSubject);
            final String pageTitle = page.getString(Page.PAGE_TITLE);
            final String pageLink = Latkes.getServePath() + page.getString(Page.PAGE_PERMALINK);
View Full Code Here

TOP

Related Classes of org.b3log.solo.service.PreferenceQueryService

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.