Examples of ProcessingContext


Examples of org.jahia.params.ProcessingContext

    @SuppressWarnings("unchecked")
    protected void handleGet(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws ServletException, IOException {

        final ProcessingContextFactory pcf = (ProcessingContextFactory) SpringContextSingleton.
                getInstance().getContext().getBean(ProcessingContextFactory.class.getName());
        ProcessingContext ctx = null;

        try {
            // should send response wrapper !
            ctx = pcf.getContext(httpServletRequest, httpServletResponse, servletContext);
        } catch (JahiaException e) {
            logger.error("Error while trying to build ProcessingContext", e);
            return;
        }

        try {
            ctx.setOperationMode(ParamBean.EDIT);
//            ctx.setEntryLoadRequest(new EntryLoadRequest(EntryLoadRequest.STAGING_WORKFLOW_STATE, 0, ctx.getLocales()));
            JahiaUser admin = JahiaAdminUser.getAdminUser(0);
            JCRSessionFactory.getInstance().setCurrentUser(admin);
            ctx.setTheUser(admin);
        } catch (JahiaException e) {
            logger.error("Error getting user", e);
            return;
        }
View Full Code Here

Examples of org.jahia.params.ProcessingContext

    @Test
    public void testSimpleFulltextSearchOnSingleSite() throws Exception {
        SearchService searchService = ServicesRegistry.getInstance()
                .getSearchService();
        try {
            ProcessingContext ctx = Jahia.getThreadParamBean();
            RenderContext context = new RenderContext(((ParamBean) ctx)
                    .getRequest(), ((ParamBean) ctx).getResponse(), ctx
                    .getUser());
            JCRSessionWrapper session = JCRSessionFactory.getInstance()
                    .getCurrentUserSession(null, Locale.ENGLISH);
            JCRNodeWrapper homeNode = session
                    .getNode(FIRST_SITECONTENT_ROOT_NODE + "/home");
View Full Code Here

Examples of org.jahia.params.ProcessingContext

    @Test
    public void testSimpleFulltextSearchOnSingleSiteInFrench() throws Exception {
        SearchService searchService = ServicesRegistry.getInstance()
                .getSearchService();
        try {
            ProcessingContext ctx = Jahia.getThreadParamBean();
            RenderContext context = new RenderContext(((ParamBean) ctx)
                    .getRequest(), ((ParamBean) ctx).getResponse(), ctx
                    .getUser());
            JCRSessionWrapper session = JCRSessionFactory.getInstance()
                    .getCurrentUserSession(null, Locale.FRENCH);
            JCRNodeWrapper homeNode = session
                    .getNode(FIRST_SITECONTENT_ROOT_NODE + "/home");
View Full Code Here

Examples of org.jahia.params.ProcessingContext

    public void testSimpleFulltextSearchOnSingleSiteInDocsOnly()
            throws Exception {
        SearchService searchService = ServicesRegistry.getInstance()
                .getSearchService();
        try {
            ProcessingContext ctx = Jahia.getThreadParamBean();
            RenderContext context = new RenderContext(((ParamBean) ctx)
                    .getRequest(), ((ParamBean) ctx).getResponse(), ctx
                    .getUser());
            JCRSessionWrapper session = JCRSessionFactory.getInstance()
                    .getCurrentUserSession(null, Locale.ENGLISH);
            JCRNodeWrapper homeNode = session
                    .getNode(FIRST_SITECONTENT_ROOT_NODE + "/home");
View Full Code Here

Examples of org.jahia.params.ProcessingContext

    @Test
    public void testFulltextMatchTypeSearchOnSingleSite() throws Exception {
        SearchService searchService = ServicesRegistry.getInstance()
                .getSearchService();
        try {
            ProcessingContext ctx = Jahia.getThreadParamBean();
            RenderContext context = new RenderContext(((ParamBean) ctx)
                    .getRequest(), ((ParamBean) ctx).getResponse(), ctx
                    .getUser());
            JCRSessionWrapper session = JCRSessionFactory.getInstance()
                    .getCurrentUserSession(null, Locale.ENGLISH);
            JCRNodeWrapper homeNode = session
                    .getNode(FIRST_SITECONTENT_ROOT_NODE + "/home");
View Full Code Here

Examples of org.jahia.params.ProcessingContext

    @Test
    public void testSimpleFulltextSearchOnTwoSites() throws Exception {
        SearchService searchService = ServicesRegistry.getInstance()
                .getSearchService();
        try {
            ProcessingContext ctx = Jahia.getThreadParamBean();
            RenderContext context = new RenderContext(((ParamBean) ctx)
                    .getRequest(), ((ParamBean) ctx).getResponse(), ctx
                    .getUser());
            JCRSessionWrapper session = JCRSessionFactory.getInstance()
                    .getCurrentUserSession();
            JCRNodeWrapper homeNode = session
                    .getNode(SECOND_SITECONTENT_ROOT_NODE + "/home");
View Full Code Here

Examples of org.jahia.params.ProcessingContext

    protected static String getUserInfo(HttpServletRequest request) {
        String info = null;

        // processing context available?
        ProcessingContext ctx = (ProcessingContext) request
                .getAttribute("org.jahia.params.ParamBean");
        info = ctx != null && ctx.getUser() != null ? ctx.getUser()
                .getUsername() : null;

        if (null == info) {
            // try out session user
            JahiaUser user = null;
View Full Code Here

Examples of org.jahia.params.ProcessingContext

    @Test
    public void testSimpleFulltextSearchOnSingleSite() throws Exception {
        SearchService searchService = ServicesRegistry.getInstance().getSearchService();
        try {
            ProcessingContext ctx = Jahia.getThreadParamBean();
            RenderContext context = new RenderContext(((ParamBean) ctx).getRequest(), ((ParamBean) ctx).getResponse(),
                    ctx.getUser());
            JCRSessionWrapper session = JCRSessionFactory.getInstance().getCurrentUserSession(null, Locale.ENGLISH);
            JCRNodeWrapper homeNode = session.getNode(FIRST_SITECONTENT_ROOT_NODE + "/home");
            Resource resource = new Resource(homeNode, "html", null, Resource.CONFIGURATION_PAGE);
            context.setMainResource(resource);
            context.setSite(homeNode.getResolveSite());
View Full Code Here

Examples of org.jahia.params.ProcessingContext

    }

    private void processFileImport(List<Map<Object, Object>> importsInfos, JahiaUser user)
            throws IOException, ServletException, JahiaException {

        ProcessingContext ctx = new ProcessingContext(System.currentTimeMillis(), null,
                user, ProcessingContext.EDIT);

        for (Map<Object, Object> infos : importsInfos) {
            File file = (File) infos.get("importFile");
            if (infos.get("importFileName").equals("users.xml")) {
                ImportExportBaseService.getInstance().importUsers(file);
                break;
            }
        }

        for (Map<Object, Object> infos : importsInfos) {
            File file = (File) infos.get("importFile");
            if (infos.get("type").equals("files")) {
                try {
                    ImportExportBaseService.getInstance().importSiteZip(file, ctx.getSite(), infos);
                } catch (RepositoryException e) {
                    logger.error(e.getMessage(), e);
                }
            } else if (infos.get("type").equals("xml") && (infos.get("importFileName").equals(
                    "serverPermissions.xml") || infos.get("importFileName").equals("users.xml"))) {

            } else if (infos.get("type").equals("site")) {
                // site import
                String tpl = (String) infos.get("templates");
                if ("".equals(tpl)) {
                    tpl = null;
                }
                try {
                        sitesService.addSite(user, (String) infos.get(
                                "sitetitle"), (String) infos.get("siteservername"), (String) infos.get("sitekey"), "",
                                ctx.getLocale(), tpl,
                                "fileImport", file,
                                (String) infos.get(
                                        "importFileName"), true,
                                false, (String) infos.get("originatingJahiaRelease"));
                } catch (Exception e) {
View Full Code Here

Examples of org.jboss.errai.bus.rebind.ProcessingContext

    composer.addImplementedInterface("org.jboss.errai.workspaces.client.framework.WorkspaceConfig");

    SourceWriter sourceWriter = composer.createSourceWriter(context, printWriter);

    ctx = new ProcessingContext(logger, context, sourceWriter, typeOracle);
    iocGenerator = new IOCGenerator(ctx);
    iocGenerator.initializeProviders(context, logger, sourceWriter);

    // generator constructor source code
    generateBootstrapClass(context, logger, sourceWriter);
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.