Package org.b3log.latke.ioc

Examples of org.b3log.latke.ioc.LatkeBeanManager


            chain.doFilter(request, response);

            return;
        }

        final LatkeBeanManager beanManager = Lifecycle.getBeanManager();
        final InitService initService = beanManager.getReference(InitService.class);

        if (initService.isInited()) {
            chain.doFilter(request, response);

            return;
View Full Code Here


    public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain) throws IOException,
            ServletException {
        final HttpServletResponse httpServletResponse = (HttpServletResponse) response;
        final HttpServletRequest httpServletRequest = (HttpServletRequest) request;

        final LatkeBeanManager beanManager = Lifecycle.getBeanManager();
        final UserMgmtService userMgmtService = beanManager.getReference(UserMgmtService.class);
        final UserQueryService userQueryService = beanManager.getReference(UserQueryService.class);

        try {
            userMgmtService.tryLogInWithCookie(httpServletRequest, httpServletResponse);

            final JSONObject currentUser = userQueryService.getCurrentUser(httpServletRequest);
View Full Code Here

        }

        JSONObject article;
        JSONObject page = null;

        final LatkeBeanManager beanManager = Lifecycle.getBeanManager();

        try {
            final ArticleRepository articleRepository = beanManager.getReference(ArticleRepositoryImpl.class);

            article = articleRepository.getByPermalink(permalink);
           
            if (null == article) {
                final PageRepository pageRepository = beanManager.getReference(PageRepositoryImpl.class);
        
                page = pageRepository.getByPermalink(permalink);
            }

            if (null == page && null == article) {
                LOGGER.log(Level.DEBUG, "Not found article/page with permalink[{0}]", permalink);
                chain.doFilter(request, response);

                return;
            }
        } catch (final RepositoryException e) {
            LOGGER.log(Level.ERROR, "Processes article permalink filter failed", e);
            httpServletResponse.sendError(HttpServletResponse.SC_NOT_FOUND);

            return;
        }

        // If requests an article and the article need view passowrd, sends redirect to the password form
        final ArticleQueryService articleQueryService = beanManager.getReference(ArticleQueryService.class);

        if (null != article && articleQueryService.needViewPwd(httpServletRequest, article)) {
            try {
                httpServletResponse.sendRedirect(
                    Latkes.getServePath() + "/console/article-pwd?articleId=" + article.optString(Keys.OBJECT_ID));
View Full Code Here

                if (Strings.isEmptyOrNull(userEmail)) {
                    break;
                }

                final LatkeBeanManager beanManager = Lifecycle.getBeanManager();
                final UserQueryService userQueryService = beanManager.getReference(UserQueryService.class);

                final JSONObject user = userQueryService.getUserByEmail(userEmail.toLowerCase().trim());

                if (null == user) {
                    break;
View Full Code Here

TOP

Related Classes of org.b3log.latke.ioc.LatkeBeanManager

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.