Examples of TurbineRunDataInternal


Examples of com.alibaba.citrus.turbine.TurbineRunDataInternal

        controlToolName = defaultIfNull(controlToolName, DEFAULT_CONTROL_TOOL_NAME);
        substName = defaultIfNull(substName, DEFAULT_SUBSTITUTION_NAME);
    }

    public void invoke(PipelineContext pipelineContext) throws Exception {
        TurbineRunDataInternal rundata = (TurbineRunDataInternal) getTurbineRunData(request);
        Substitution subst = getSubstitution(pipelineContext);

        String template = trimToNull(subst.substitute(templateName));
        String module = trimToNull(subst.substitute(moduleName));

        Context context = rundata.getContext();
        ControlTool controlTool = getControlTool(context, template, module, rundata);

        // render control
        rundata.getResponse().getWriter(); // ������Ԥ����buffer
        String content = controlTool.render();

        // ����context���Ա����ģ���ܹ���ȡ
        context.put("controlContent", content); // controlContentΪcontrol��Ⱦ�Ľ��
        context.put("controlTarget", template != null ? template : module);

        // �ض�����controlExporter target
        rundata.setRedirectTarget(controlExporterTarget);

        pipelineContext.invokeNext();
    }
View Full Code Here

Examples of com.alibaba.citrus.turbine.TurbineRunDataInternal

    @Autowired
    private MappingRuleService mappingRuleService;

    public void invoke(PipelineContext pipelineContext) throws Exception {
        TurbineRunDataInternal rundata = (TurbineRunDataInternal) getTurbineRunData(request);
        String target = assertNotNull(rundata.getTarget(), "Target was not specified");

        // ����ض����־��������ض�������Ҫ��ҳ�������
        if (!rundata.isRedirected()) {
            Context context = rundata.getContext();

            renderTemplate(getScreenTemplate(target), context, rundata);

            // layout�ɱ����á�
            if (rundata.isLayoutEnabled()) {
                String layoutTemplateOverride = rundata.getLayoutTemplateOverride();

                if (layoutTemplateOverride != null) {
                    target = layoutTemplateOverride;
                }
View Full Code Here

Examples of com.alibaba.citrus.turbine.TurbineRunDataInternal

            setHomepage("/index");
        }
    }

    public void invoke(PipelineContext pipelineContext) throws Exception {
        TurbineRunDataInternal rundata = (TurbineRunDataInternal) getTurbineRunData(request);
        String target = null;

        // ȡ��target����ת����ͳһ���ڲ���׺����
        String pathInfo = ServletUtil.getResourcePath(rundata.getRequest()).substring(
                component.getComponentPath().length());

        if ("/".equals(pathInfo)) {
            pathInfo = getHomepage();
        }

        // ע�⣬���뽫pathInfoת����camelCase��
        int lastSlashIndex = pathInfo.lastIndexOf("/");

        if (lastSlashIndex >= 0) {
            pathInfo = pathInfo.substring(0, lastSlashIndex) + "/"
                    + StringUtil.toCamelCase(pathInfo.substring(lastSlashIndex + 1));
        } else {
            pathInfo = StringUtil.toCamelCase(pathInfo);
        }

        target = mappingRuleService.getMappedName(EXTENSION_INPUT, pathInfo);

        rundata.setTarget(target);

        // ȡ��action
        String action = StringUtil.toCamelCase(trimToNull(rundata.getParameters().getString(actionParam)));

        action = mappingRuleService.getMappedName(ACTION_MODULE, action);
        rundata.setAction(action);

        // ȡ��actionEvent
        String actionEvent = ActionEventUtil.getEventName(rundata.getRequest());
        rundata.setActionEvent(actionEvent);

        pipelineContext.invokeNext();
    }
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.