Package org.apache.cocoon.environment

Examples of org.apache.cocoon.environment.Context


    /**
     * Returns the mime-type of the resource in process.
     */
    public String getMimeType() {
        Context ctx = ObjectModelHelper.getContext(objectModel);
        if (ctx != null) {
            final String mimeType = ctx.getMimeType(source);
            if (mimeType != null) {
                return mimeType;
            }
        }
        return inputSource.getMimeType();
View Full Code Here


     */
    public Publication getPublication(Map objectModel) throws PublicationException {

        assert objectModel != null;
        Request request = ObjectModelHelper.getRequest(objectModel);
        Context context = ObjectModelHelper.getContext(objectModel);
        return getPublication(request, context);
    }
View Full Code Here

     */
    public PageEnvelope getPageEnvelope(DocumentIdentityMap map, Map objectModel)
            throws PageEnvelopeException {
        Request request = ObjectModelHelper.getRequest(objectModel);
        String contextPath = request.getContextPath();
        Context context = ObjectModelHelper.getContext(objectModel);
        String webappUrl = ServletHelper.getWebappURI(request);
        String servletContextPath = context.getRealPath("");
        return getPageEnvelope(map, contextPath, webappUrl, new File(servletContextPath));
    }
View Full Code Here

        if (getLogger().isDebugEnabled()) {
            getLogger().debug("Resolving page envelope for URL [" + webappUrl + "]");
        }

        String contextPath = request.getContextPath();
        Context context = ObjectModelHelper.getContext(objectModel);
        String servletContextPath = context.getRealPath("");

        try {
            DocumentIdentityMap map = getDocumentIdentityMap();
            envelope = PageEnvelopeFactory.getInstance().getPageEnvelope(map,
                    contextPath,
View Full Code Here

            if (getLogger().isDebugEnabled()) {
                getLogger().debug("Resolving page envelope for URL [" + webappUrl + "]");
            }

            String contextPath = request.getContextPath();
            Context context = ObjectModelHelper.getContext(objectModel);
            String servletContextPath = context.getRealPath("");

            try {
                DocumentFactory factory = getDocumentFactory();
                Publication pub = null;
                String pubId = new URLInformation(webappUrl).getPublicationId();
View Full Code Here

    /**
     * Returns the mime-type of the resource in process.
     */
    public String getMimeType() {
        Context ctx = ObjectModelHelper.getContext(objectModel);
        if (ctx != null) {
            final String mimeType = ctx.getMimeType(source);
            if (mimeType != null) {
                return mimeType;
            }
        }

View Full Code Here

    /**
     * Returns the mime-type of the resource in process.
     */
    public String getMimeType() {
        Context ctx = ObjectModelHelper.getContext(objectModel);
        if (ctx != null) {
            final String mimeType = ctx.getMimeType(source);
            if (mimeType != null) {
                return mimeType;
            }
        }
        return inputSource.getMimeType();
View Full Code Here

        Object bean = FlowHelper.getContextObject(objectModel);
        WebContinuation kont = FlowHelper.getWebContinuation(objectModel);
        Map map = new HashMap();
        Request request = ObjectModelHelper.getRequest(objectModel);
        Response response = ObjectModelHelper.getResponse(objectModel);
        Context context = ObjectModelHelper.getContext(objectModel);
        if (bean != null) {
            fillContext(bean, map);
            map.put("flowContext", bean);
            map.put("continuation", kont);
        }
View Full Code Here

    public static String relativeFilename(String filename, Map objectModel) throws IOException {
        File file = new File(filename);
        if (file.isAbsolute() && file.exists()) {
            return filename;
        }
        Context context = ObjectModelHelper.getContext(objectModel);
        URL resource = context.getResource(filename);
        if (resource == null) {
            throw new FileNotFoundException("The file " + filename + " does not exist!");
        }
        return NetUtils.getPath(resource.toExternalForm());
    }
View Full Code Here

            return cnt;
        }
    }

    public static Object getContextAttribute(Map objectModel, String name) {
        Context context = ObjectModelHelper.getContext(objectModel);
        return context.getAttribute(name);
    }
View Full Code Here

TOP

Related Classes of org.apache.cocoon.environment.Context

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.