Examples of MarinerURL


Examples of com.volantis.mcs.utilities.MarinerURL

    /**
     * Sets {@link #url} to an 'empty' MarinerURL if null.
     */
    private void initialiseFormURL() {
        if (url == null) {
            url = new MarinerURL();
        }
    }
View Full Code Here

Examples of com.volantis.mcs.utilities.MarinerURL

            // Convert back rewritten URI into MarinerURL instance.
            // TODO: Optimise this code in case we have writable (non read-only)
            // instance of MarinerURL - there's no need to create a new instance in
            // that case.
            url = new MarinerURL(uri.toString());
           
            return url;
        }
View Full Code Here

Examples of com.volantis.mcs.utilities.MarinerURL

     * @param asset the asset
     * @return A MarinerURL object
     */
    private MarinerURL computeURL(Asset asset) {

        MarinerURL marinerURL = null;
        if (asset == null) {
            logger.warn("asset-null-no-url");
        } else {
            try {
                ApplicationContext applicationContext =
                        context.getApplicationContext();
                MarinerRequestContext requestContext =
                        context.getRequestContext();
                marinerURL = applicationContext.getAssetURLRewriter().
                        rewriteAssetURL(requestContext,
                                        asset,
                                        getAssetGroup(asset),
                                        new MarinerURL(getAssetValue(asset)));
            } catch (RepositoryException re) {
                logger.warn("repository-exception", re);
            }
        }
        return marinerURL;
View Full Code Here

Examples of com.volantis.mcs.utilities.MarinerURL

        }

        RuntimePolicyReference reference =
                referenceFactory.createLazyNormalizedReference(
                        project,
                        new MarinerURL(sAsset.getName()),
                        assetGroupName,
                PolicyType.BASE_URL);

        Policy policy = policyFetcher.fetchPolicy(reference);
        AssetGroup group = null;
View Full Code Here

Examples of com.volantis.mcs.utilities.MarinerURL

            String urlString, final PageURLType pageURLType) {

        // Rewrite only if there's an instance of rewriter specified.
        if (pageURLRewriter != null) {
            // Create an instance of MarinerURL with the URL to rewrite.
            MarinerURL originalURL = new MarinerURL(urlString);
           
            // Now, the issue with the MarinerURL is, that it can not be used to
            // represent arbitrary URIs, like:
            //  - javascript:alert()
            //  - mailto:john.smith@gmail.com
            //
            // When creating an instance of MarinerURL on such URIs, it appends
            // a slash character after the colon, so the URI looks like:
            //  - javascript:/alert()
            //  - mailto:/john.smith@gmail.com
            //
            // Since nothing can be done here, we do rewrite only those URLs,
            // which were not damaged by creating an instance of MarinerURL on it.
            //
            // The ideal solution would be to refactor the MCS code to use
            // java.set.URI instead.
            if (originalURL.getExternalForm().equals(urlString)) {
                MarinerURL rewrittenURL = pageURLRewriter.
                    rewriteURL(context.getRequestContext(),
                               originalURL,
                               PageURLDetailsFactory.
                               createPageURLDetails(pageURLType));
           
                urlString = rewrittenURL.getExternalForm();
            }
        }

        return urlString;
    }
View Full Code Here

Examples of com.volantis.mcs.utilities.MarinerURL

            boolean supportsAggregation
                    = pageContext.getBooleanDevicePolicyValue("aggregation");

            if (!supportsAggregation) {

                MarinerURL requestURL = pageContext.getRequestURL(true);
                RuntimeDeviceLayout deviceLayout =
                        pageContext.getDeviceLayout();
                String defaultSegmentSrc = getDefaultSegmentSrc(deviceLayout,
                        pageContext);

                if (defaultSegmentSrc != null) {
                    // Resolve the defaultSegmentSrc relative to the current request URL
                    MarinerURL url =
                            new MarinerURL(requestURL, defaultSegmentSrc);

                    String destination = url.getExternalForm();

                    if (logger.isDebugEnabled()) {
                        logger.debug("MontageTag: device "
                                + pageContext.getDeviceName()
                                + "does not support aggregation."
View Full Code Here

Examples of com.volantis.mcs.utilities.MarinerURL

   * Returns the value of a request parameter as a String.
   * @param name The name of the parameter.
   * @see javax.servlet.ServletRequest#getParameter
   */
  public String getParameter (String name) {
    MarinerURL requestURL = pageContext.getPureRequestURL ();
    return requestURL.getParameterValue (name);
  }
View Full Code Here

Examples of com.volantis.mcs.utilities.MarinerURL

  /**
   * Returns a Map containing all the values of the request parameters.
   * @seenotinservlet22spec javax.servlet.ServletRequest#getParameterMap
   */
  public Map getParameterMap () {
    MarinerURL requestURL = pageContext.getPureRequestURL ();
    return requestURL.getParameterMap ();
  }
View Full Code Here

Examples of com.volantis.mcs.utilities.MarinerURL

  /**
   * Returns an Enumeration of all the request parameter names.
   * @see javax.servlet.ServletRequest#getParameterNames
   */
  public Enumeration getParameterNames () {
    MarinerURL requestURL = pageContext.getPureRequestURL ();
    return requestURL.getParameterNames ();
  }
View Full Code Here

Examples of com.volantis.mcs.utilities.MarinerURL

   * specified request parameter.
   * @param name The name of the parameter.
   * @see javax.servlet.ServletRequest#getParameterValues
   */
  public String [] getParameterValues (String name) {
    MarinerURL requestURL = pageContext.getPureRequestURL ();
    return requestURL.getParameterValues (name);
  }
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.