Examples of Asset


Examples of org.apache.tapestry5.Asset

    {
        String path = "${root}/foo/bar.pdf";
        String expanded = "org/apache/tapestry5/foo/bar.pdf";

        DocumentLinker linker = mockDocumentLinker();
        Asset asset = mockAsset();
        SymbolSource source = mockSymbolSource();
        AssetSource assetSource = mockAssetSource();

        train_expandSymbols(source, path, expanded);
View Full Code Here

Examples of org.apache.tapestry5.Asset

    @Test
    public void add_stylesheet_link()
    {
        String media = "print";
        DocumentLinker linker = mockDocumentLinker();
        Asset asset = mockAsset();

        train_toClientURL(asset, ASSET_URL);
        linker.addStylesheetLink(ASSET_URL, media);

        replay();
View Full Code Here

Examples of org.apache.tapestry5.Asset

    private void addScriptLinkFromClasspath(String path)
    {
        String expanded = symbolSource.expandSymbols(path);

        Asset asset = assetSource.getAsset(null, expanded, null);

        linker.addScriptLink(asset.toClientURL());
    }
View Full Code Here

Examples of org.bladerunnerjs.model.Asset

            if(assetPlugin.canHandleAsset(assetFile, assetLocation)) {
              String assetFilePath = assetFile.getAbsolutePath();
             
              if(!cachedAssets.containsKey(assetFilePath)) {
                try {
                  Asset createdAsset = assetPlugin.createAsset(assetFile, assetLocation);
                  assetLocation.root().logger(this.getClass()).debug("creating new asset for the path '%s'",
                      createdAsset.getAssetPath());
                  String assetPrimaryRequirePath = createdAsset.getPrimaryRequirePath();
                 
                  if (createdAsset instanceof SourceModule && createdAsset.assetLocation().assetContainer().isNamespaceEnforced()) {
                    String relativePathFromAssetContainer = RelativePathUtility.get(assetLocation.root().getFileInfoAccessor(), createdAsset.assetLocation().assetContainer().dir(), createdAsset.dir());
                    String relativeRequirePathPathFromAssetContainer = StringUtils.substringAfter(relativePathFromAssetContainer, "/"); // strip of 'src/' at the start of the relative path
                    String appRequirePrefix = assetLocation.assetContainer().app().getRequirePrefix();
                    String createdAssetContainerRequirePrefix = createdAsset.assetLocation().assetContainer().requirePrefix();
                    if (relativeRequirePathPathFromAssetContainer.startsWith(appRequirePrefix) && !relativeRequirePathPathFromAssetContainer.startsWith(createdAssetContainerRequirePrefix)) {
                      InvalidRequirePathException wrappedRequirePathException = new InvalidRequirePathException(
                          "The source module at '"+createdAsset.getAssetPath()+"' is in an invalid location. "+
                          "It's require path starts with the apps require prefix ('"+appRequirePrefix+"') which suggests it's require path is intended to be '"+createdAssetContainerRequirePrefix+"'. "+
                          "The require path defined by the source modules location is '"+relativeRequirePathPathFromAssetContainer+"'. Either it's package structure should be '"+createdAssetContainerRequirePrefix+"/*' or "+
                          "remove the folders '"+relativeRequirePathPathFromAssetContainer+"' to allow the require prefix to be calculated automatically.");
                      throw new RuntimeException(wrappedRequirePathException);
                    }
                  }
                 
                 
                  if (assetPrimaryRequirePath != null) {
                    assetLocation.root().logger(this.getClass()).debug("asset at '%s' is a '%s' and it's primary require path is '%s'",
                        createdAsset.getAssetPath(), createdAsset.getClass().getSimpleName(), assetPrimaryRequirePath);
                  } else {
                    assetLocation.root().logger(this.getClass()).debug("asset at '%s' is a '%s'",
                        createdAsset.getAssetPath(), createdAsset.getClass().getSimpleName());
                  }
                  cachedAssets.put(assetFilePath, createdAsset);
                }
                catch (AssetFileInstantationException e) {
                  throw new RuntimeException(e);
                }
              }
             
              Asset asset = cachedAssets.get(assetFilePath);
              if(asset instanceof SourceModule) {
                assets.sourceModules.add((SourceModule) asset);
              }
              else if(asset instanceof LinkedAsset) {
                assets.linkedAssets.add((LinkedAsset) asset);
View Full Code Here

Examples of org.drools.guvnor.client.rpc.Asset

                -1);
    }

    public DefaultRuleContentWidget(Asset a,
                                    int visibleLines) {
        Asset asset = a;
        data = (RuleContentText) asset.getContent();

        if (data.content == null) {
            data.content = "";
        }
View Full Code Here

Examples of org.drools.guvnor.server.jaxrs.jaxb.Asset

        int counter = 0;
        for (CategoryItem c : categories) {
            cats[counter++] = c.getName();
        }

        Asset ret = new Asset();
        ret.setMetadata(metadata);
        ret.setType(a.getType());
        ret.setCheckInComment(a.getCheckinComment());
        ret.setDescription(a.getDescription());
        UriBuilder builder = uriInfo.getBaseUriBuilder();
        ret.setRefLink(
                builder.path("/packages/" + a.getPackage().getName() + "/assets/" + a.getName()).build());
        builder = uriInfo.getBaseUriBuilder();
        ret.setBinaryLink(
                builder.path("/packages/" + a.getPackage().getName() + "/assets/" + a.getName() + "/binary").build());
        builder = uriInfo.getBaseUriBuilder();
        ret.setSourceLink(
                builder.path("/packages/" + a.getPackage().getName() + "/assets/" + a.getName() + "/source").build());
        ret.setVersion(a.getVersionNumber());
        return ret;
    }
View Full Code Here

Examples of org.drools.guvnor.server.util.ClassicDRLImporter.Asset

        assertEqualsIgnoreWhitespace( "when ka chow then bam",
                                      imp.getAssets().get( 0 ).content );
        assertEqualsIgnoreWhitespace( "when ka chiga then ka chow",
                                      imp.getAssets().get( 1 ).content );

        Asset as = imp.getAssets().get( 0 );
        assertEquals( AssetFormats.DSL_TEMPLATE_RULE,
                      as.format );

    }
View Full Code Here

Examples of org.hoteia.qalingo.core.domain.Asset

        storeViewBean.setWebsite(store.getWebsite());
       
        storeViewBean.setLongitude(store.getLongitude());
        storeViewBean.setLatitude(store.getLatitude());
       
        final Asset defaultPackshotImage = store.getDefaultPackshotImage(ImageSize.SMALL.name());
        if (defaultPackshotImage != null) {
            final String defaultImage = engineSettingService.getRetailerOrStoreImageWebPath(defaultPackshotImage);
            storeViewBean.setDefaultImage(defaultImage);
        } else {
            storeViewBean.setDefaultImage("");
        }
        final Asset defaultIconImage = store.getDefaultThumbnailImage();
        if (defaultIconImage != null) {
            final String iconImage = engineSettingService.getRetailerOrStoreImageWebPath(defaultIconImage);
            storeViewBean.setIconImage(iconImage);
        } else {
            storeViewBean.setIconImage("");
View Full Code Here

Examples of org.jboss.shrinkwrap.api.asset.Asset

                simpleNames.add(clazz.getSimpleName());

                if (classesPackage == null) {
                    classesPackage = clazz.getPackage();
                }
                Asset resource = new ClassAsset(clazz);
                ArchivePath location = ArchivePaths.create(resolveClassesPath(archive),
                        AssetUtil.getFullPathForClassResource(clazz));
                archive.add(resource, location);
            }
View Full Code Here

Examples of org.jboss.shrinkwrap.api.asset.Asset

    /**
     * @return corresponding beans descriptor asset
     */
    protected Asset getBeansDescriptorAsset() {

        Asset asset = null;

        if (beansDescriptor != null) {
            asset = new StringAsset(beansDescriptor.exportAsString());
        } else if (beansXml != null) {
            asset = new ClassLoaderAsset(beansXml.getSource());
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.