Package com.volantis.mcs.utilities

Examples of com.volantis.mcs.utilities.MarinerURL


        FormDescriptor fdesc = new FormDescriptor();
        SessionFormDataMock sessionFormData = new SessionFormDataMock(
                "formData", expectations, "s0", fdesc);

        pageContext.expects.getEnvironmentContext().returns(environmentContextMock).any();
        environmentContextMock.expects.getContextPathURL().returns(new MarinerURL("/")).any();

        pageContext.expects.getFormDataManager().returns(fdm).any();

        fdm.expects.getFormSpecifier(null).returns("s0").any();
View Full Code Here


        FormDescriptor fdesc = new FormDescriptor();
        SessionFormDataMock sessionFormData = new SessionFormDataMock(
                "formData", expectations, "s0", fdesc);

        pageContext.expects.getEnvironmentContext().returns(environmentContextMock).any();
        environmentContextMock.expects.getContextPathURL().returns(new MarinerURL("/")).any();

        pageContext.expects.getFormDataManager().returns(fdm).any();

        fdm.expects.getFormSpecifier(null).returns("s0").any();
View Full Code Here

     * @return REWRITTEN_URL.
     */
    public MarinerURL rewriteURL(MarinerRequestContext context,
                                 MarinerURL url,
                                 PageURLDetails details) {
        return new MarinerURL(REWRITTEN_URL);
    }
View Full Code Here

    public void setContextPathURL(MarinerURL contextPathURL) {
        this.contextPathURL = contextPathURL;
    }

    public void setContextPathURL(String contextPathURL) {
        this.contextPathURL = new MarinerURL(contextPathURL);
    }
View Full Code Here

    public void setPolicySource(PolicySource policySource) {
        this.policySource = policySource;
    }

    public void setAssetsConfiguration(AssetsConfiguration configuration) {
        assetsBaseURL = new MarinerURL(configuration.getBaseUrl());
        assetsBaseURL.makeReadOnly();

        addVariantPrefixURL(VariantType.AUDIO, configuration.getAudioAssets());
        addVariantPrefixURL(VariantType.VIDEO,
                configuration.getDynamicVisualAssets());
View Full Code Here

    }

    public void addVariantPrefixURL(
            VariantType variantType,
            AssetConfiguration configuration) {
        MarinerURL prefixURL;
        if (configuration == null) {
            prefixURL = null;
        } else {
            prefixURL = new MarinerURL(configuration.getPrefixUrl());
            prefixURL.makeReadOnly();
        }

        variantType2PrefixURL.put(variantType, prefixURL);
    }
View Full Code Here

        if (!params.containsName(ParameterNames.SOURCE_HOST)) {
            try {
                // generate an absolute URL to the asset. This allows us to
                // hijack the host and port.
                URL fakeUrl = pageContext.getAbsoluteURL(
                    new MarinerURL(uri.toString()), true);
                params.setParameterValue(ParameterNames.SOURCE_HOST, fakeUrl.getHost());
                int port = fakeUrl.getPort();
                port = port < 0 ? fakeUrl.getDefaultPort(): port;
                if (port >= 0) {
                    params.setParameterValue(
View Full Code Here

            MarinerRequestContext requestContext,
            Asset asset,
            AssetGroup assetGroup,
            MarinerURL marinerURL) throws RepositoryException {

        MarinerURL urlResult = computeURL(requestContext,
                asset, assetGroup, marinerURL);

        if (asset instanceof ConvertibleImageAsset) {
            String url = urlResult.getExternalForm();

            // Construct the url for the convertible image asset.
            ConvertibleImageAsset convertible = (ConvertibleImageAsset)asset;
            PreservedArea area = PreservedArea.get(
                    convertible.getPreserveLeft(),
                    convertible.getPreserveRight(),
                    true);
            String value = ContextInternals.constructImageURL(
                    requestContext, url, area);

            urlResult = new MarinerURL(value);
        }

        // Complete the URL
        urlResult = completeURL(requestContext, asset,
                assetGroup,
                urlResult);

        // Make sure that the url cannot be modified (even if it is a
        // convertible image asset).
        urlResult.makeReadOnly();

        return urlResult;
    }
View Full Code Here

            MarinerRequestContext requestContext,
            Asset asset,
            AssetGroup assetGroup,
            MarinerURL marinerURL) throws RepositoryException {

        MarinerURL urlResult = null;
        // we are not caching the URLs
        urlResult = createMarinerURL(requestContext, asset,
                assetGroup, marinerURL);
        if (logger.isDebugEnabled()) {
            logger.debug("Asset " + asset + " resolved absolute url '"
View Full Code Here

                String url = tvChannelPrefix;
                String value = dynamicVisualAsset.getValue();
                if (value != null) {
                    url += value;
                }
                return  new MarinerURL(url);
            }
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.utilities.MarinerURL

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.