Package com.volantis.mcs.assets

Examples of com.volantis.mcs.assets.ConvertibleImageAsset


    ImageRepositoryManager imageRepositoryManager=
        new ImageRepositoryManager(repository);

    ImageComponent component=
        new ImageComponent(assetName);
    ConvertibleImageAsset asset =
        new ConvertibleImageAsset(assetName,
                                  pixelsX,
                                  pixelsY,
                                  pixelDepth,
                                  rendering,
                                  encoding,
                                  assetGroup,
                                  assetValue);

    imageRepositoryManager.addImageComponent(repositoryConnection,component);
    imageRepositoryManager.addConvertibleImageAsset(repositoryConnection,asset);
    ConvertibleImageAsset asset2 = imageRepositoryManager.
                                   retrieveConvertibleImageAsset (
                                   repositoryConnection,
                                   assetName);
    Assert.assertTrue("public void addConvertibleImageAsset(RepositoryConnection,ConvertibleImageAsset) throws RepositoryException asset not equal.",
                        asset.equals(asset2));
View Full Code Here


    ImageRepositoryManager imageRepositoryManager=
        new ImageRepositoryManager(repository);

    ImageComponent component=
        new ImageComponent(assetName);
    ConvertibleImageAsset asset =
        new ConvertibleImageAsset(assetName,
                                  pixelsX,
                                  pixelsY,
                                  pixelDepth,
                                  rendering,
                                  encoding,
                                  assetGroup,
                                  assetValue);

    imageRepositoryManager.addImageComponent(repositoryConnection,component);
    imageRepositoryManager.addConvertibleImageAsset(repositoryConnection,asset);
    //
    // Make a copy of our convertible image asset.
    //
    component.setName(newAssetName);
    imageRepositoryManager.addImageComponent(repositoryConnection,component);
    imageRepositoryManager.copyConvertibleImageAsset(repositoryConnection,
                                                     assetName,
                                                     newAssetName);
    ConvertibleImageAsset asset2 = imageRepositoryManager.
                                   retrieveConvertibleImageAsset (
                                   repositoryConnection,
                                   newAssetName);
    Assert.assertTrue("public void copyConvertibleImageAsset(RepositoryConnection,String,String) throws RepositoryException asset group name not equal.",asset.getAssetGroupName().equals(asset2.getAssetGroupName()));
    Assert.assertTrue("public void copyConvertibleImageAsset(RepositoryConnection,String,String) throws RepositoryException value not equal.",asset.getValue().equals(asset2.getValue()));
  }
        });
  }
View Full Code Here

    ImageRepositoryManager imageRepositoryManager=
        new ImageRepositoryManager(repository);

    ImageComponent component=
        new ImageComponent(assetName);
    ConvertibleImageAsset asset =
        new ConvertibleImageAsset(assetName,
                                  pixelsX,
                                  pixelsY,
                                  pixelDepth,
                                  rendering,
                                  encoding,
                                  assetGroup,
                                  assetValue);

    imageRepositoryManager.addImageComponent(repositoryConnection,component);
    imageRepositoryManager.addConvertibleImageAsset(repositoryConnection,asset);
    imageRepositoryManager.removeConvertibleImageAsset(repositoryConnection,
                                                       assetName);

    ConvertibleImageAsset asset2 = imageRepositoryManager.
                                   retrieveConvertibleImageAsset (
                                   repositoryConnection,
                                   assetName);
    Assert.assertEquals("public void removeConvertibleImageAsset(RepositoryConnection,String,int,int,int,int,int) throws RepositoryException asset not null.",asset2,null);
  }
View Full Code Here

    ImageRepositoryManager imageRepositoryManager=
        new ImageRepositoryManager(repository);

    ImageComponent component=
        new ImageComponent(assetName);
    ConvertibleImageAsset asset =
        new ConvertibleImageAsset(assetName,
                                  pixelsX,
                                  pixelsY,
                                  pixelDepth,
                                  rendering,
                                  encoding,
                                  assetGroup,
                                  assetValue);

    imageRepositoryManager.addImageComponent(repositoryConnection,component);
    imageRepositoryManager.addConvertibleImageAsset(repositoryConnection,asset);
    ConvertibleImageAsset asset2 = imageRepositoryManager.
                                   retrieveConvertibleImageAsset (
                                   repositoryConnection,
                                   assetName);
    Assert.assertTrue("public ConvertibleImageAsset retrieveConvertibleImageAsset(RepositoryConnection,String) throws RepositoryException not equal.",asset.equals(asset2));
  }
View Full Code Here

        final AssetResolverMock assetResolverMock =
                new AssetResolverMock("assetResolverMock", expectations);
        PrivateAccessor.setField(context, "assetResolver", assetResolverMock);

        // set up the ImageAsset
        ImageAsset imageAsset = new ConvertibleImageAsset();
        imageAsset.setValue("rotatingWorld.gif");
        imageAsset.setSequence(false);

        assetResolverMock.expects.computeURLAsString(imageAsset)
                .returns("rotatingWorld.gif").any();

        // perform the tests
View Full Code Here

        final AssetResolverMock assetResolverMock =
                new AssetResolverMock("assetResolverMock", expectations);
        PrivateAccessor.setField(context, "assetResolver", assetResolverMock);

        // set up the ImageAsset
        ImageAsset imageAsset = new ConvertibleImageAsset();
        imageAsset.setValue("rotatingWorld{$index}.gif");
        imageAsset.setSequence(true);
        imageAsset.setSequenceSize(2);

        ImageAsset imageAsset0 = (ImageAsset) imageAsset.clone();
        imageAsset0.setValue("rotatingWorld0.gif");

        ImageAsset imageAsset1 = (ImageAsset) imageAsset.clone();
        imageAsset1.setValue("rotatingWorld1.gif");

        assetResolverMock.expects.computeURLAsString(imageAsset0)
                .returns("rotatingWorld0.gif").any();
        assetResolverMock.expects.computeURLAsString(imageAsset1)
View Full Code Here

    public void testRewriteAssetURLConvertibleImage() throws Exception {
        AssetGroup assetGroup = new AssetGroup("Default Group");
        assetGroup.setProject(createProject("/base"));

        MarinerURL url = new MarinerURL("http://host.com/this=that");
        ConvertibleImageAsset asset = new ConvertibleImageAsset("Test");
        asset.setEncoding(ConvertibleImageAsset.PNG);
        asset.setValue("/image.gif");
        asset.setPixelDepth(16);
        String expected = "http://host.com/gp16/this=that?" +
            "v.maxSize=1024&" +
            "v.width=640";

        doRewriterTest(asset, assetGroup, url, expected);
View Full Code Here

        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);
View Full Code Here

        // Convert the variant into an asset.
        ImageMetaData metaData = (ImageMetaData) variant.getMetaData();
        ImageAsset asset;
        if (metaData.getConversionMode() == ImageConversionMode.ALWAYS_CONVERT) {
            asset = new ConvertibleImageAsset();
            ((ConvertibleImageAsset)asset).setPreserveLeft(
                    metaData.getPreserveLeft());
            ((ConvertibleImageAsset)asset).setPreserveRight(
                    metaData.getPreserveRight());
        } else {
View Full Code Here

TOP

Related Classes of com.volantis.mcs.assets.ConvertibleImageAsset

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.