Package com.volantis.mcs.runtime.policies

Examples of com.volantis.mcs.runtime.policies.RuntimePolicyReference


        // Create a test instance
        RolloverComponentReference test = createTestInstance(TEST_NAME);
        assertNotNull("Rollover reference should exist", test);

        // Access the over image asset reference
        RuntimePolicyReference reference = test.getOverReference();
        assertNotNull("Reference should exist", reference);

        // Rerequest the reference and check no extra resolve calls have
        // been made
        reference = test.getNormalReference();
View Full Code Here


        // Create a test instance
        RolloverComponentReference test = createTestInstance(TEST_NAME);
        assertNotNull("Rollover reference should exist", test);

        // Access the normal image asset reference
        RuntimePolicyReference id = test.getNormalReference();
        assertNull("Identity should not exist (normal)", id);

        // Access the over image asset reference
        id = test.getNormalReference();
        assertNull("Identity should not exist (over)", id);
View Full Code Here

                // project.
                project = context.getCurrentProject();
            }
        }

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

        Policy policy = policyFetcher.fetchPolicy(reference);
        AssetGroup group = null;
        if (policy == null) {
            logger.warn("asset-group-not-found",
                    new Object[]{reference.getName(), asset.getName()});
        } else {
            ActivatedBaseURLPolicy baseURL = (ActivatedBaseURLPolicy) policy;

            group = new AssetGroup();
            group.setProject(baseURL.getActualProject());
View Full Code Here

            BaseLocation baseLocation = relative.getBaseLocation();
            if (baseLocation != BaseLocation.DEFAULT) {
                return baseLocation;
            }

            RuntimePolicyReference reference = (RuntimePolicyReference)
                    relative.getBaseURLPolicyReference();
            if (reference != null) {
                BaseURLPolicy policy = (BaseURLPolicy)
                        policyFetcher.fetchPolicy(reference);
                if (policy != null) {
View Full Code Here

     * @since 3.5.1
     */
    public String retrieveVariantURLAsString(PolicyReference reference,
                                             Encoding encoding) {

        RuntimePolicyReference runtimePolicyReference =
                createPolicyReference(reference);

        return pageContext.getAssetResolver().retrieveVariantURLAsString(
                runtimePolicyReference, getEncodingCollection(encoding));
    }
View Full Code Here

     * @since 3.5.1
     */
    public BestVariant selectBestVariant(PolicyReference reference,
                                           Encoding encoding) {

        RuntimePolicyReference runtimePolicyReference =
                createPolicyReference(reference);

        final AssetResolver resolver = pageContext.getAssetResolver();
        SelectedVariant selected = resolver.selectBestVariant(
                runtimePolicyReference, getEncodingCollection(encoding));
View Full Code Here

     *             instead. This was deprecated in version 3.5.1.
     */
    public String retrieveAudioAssetURLAsString(String name, int encoding)
            throws RepositoryException {

        RuntimePolicyReference reference = createPolicyReference(name,
                PolicyType.AUDIO);
        final AssetResolver resolver = pageContext.getAssetResolver();
        return resolver.retrieveVariantURLAsString(reference,
                getEncodingCollection(EnumerationConverter.AUDIO_ENCODING,
                        encoding));
View Full Code Here

     *             instead. This was deprecated in version 3.5.1.
     */
    public String retrieveDynamicVisualAssetURLAsString(String name)
            throws RepositoryException {

        RuntimePolicyReference reference = createPolicyReference(name,
                PolicyType.VIDEO);
        return pageContext.getAssetResolver().retrieveVariantURLAsString(
                reference, null);
    }
View Full Code Here

                pageContext.getCurrentProject(),
                pageContext.getBaseURL(), name, policyType);
    }

    private RuntimePolicyReference createPolicyReference(PolicyReference reference) {
        RuntimePolicyReference runtimePolicyReference;
        if (reference instanceof RuntimePolicyReference) {
            runtimePolicyReference = (RuntimePolicyReference) reference;
        } else {
            PolicyReferenceFactory factory =
                    pageContext.getPolicyReferenceFactory();
View Full Code Here

     *
     * @return the variant or null if not found.
     */
    protected SelectedVariant getSelectedVariant() {
        if (selectedVariant == SELECTED_VARIANT_NOT_SET) {
            RuntimePolicyReference reference = getPolicyReference();
            if (reference == null) {
                selectedVariant = null;
            } else {
                selectedVariant = assetResolver.selectBestVariant(reference,
                        null);
View Full Code Here

TOP

Related Classes of com.volantis.mcs.runtime.policies.RuntimePolicyReference

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.