tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject cvs commit: jakarta-tapestry/framework/src/descriptor/META-INF tapestry.services.xml
Date Fri, 03 Dec 2004 16:06:59 GMT
hlship      2004/12/03 08:06:59

  Modified:    framework/src/java/org/apache/tapestry/asset
                        AssetExternalizer.java PrivateAsset.java
                        AssetService.java
               framework/src/descriptor/META-INF tapestry.services.xml
  Added:       framework/src/java/org/apache/tapestry/asset
                        AssetExternalizerImpl.java
  Log:
  Convert AssetExternalizer into a true HiveMind service.
  
  Revision  Changes    Path
  1.3       +22 -264   jakarta-tapestry/framework/src/java/org/apache/tapestry/asset/AssetExternalizer.java
  
  Index: AssetExternalizer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/asset/AssetExternalizer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AssetExternalizer.java	16 Sep 2004 00:26:32 -0000	1.2
  +++ AssetExternalizer.java	3 Dec 2004 16:06:59 -0000	1.3
  @@ -14,273 +14,31 @@
   
   package org.apache.tapestry.asset;
   
  -import java.io.File;
  -import java.io.FileOutputStream;
  -import java.io.IOException;
  -import java.io.InputStream;
  -import java.io.OutputStream;
  -import java.net.URL;
  -import java.util.HashMap;
  -import java.util.Map;
  -
  -import javax.servlet.ServletContext;
  -import javax.servlet.http.HttpServlet;
  -
  -import org.apache.commons.logging.Log;
  -import org.apache.commons.logging.LogFactory;
  -import org.apache.hivemind.ApplicationRuntimeException;
  -import org.apache.hivemind.ClassResolver;
  -import org.apache.tapestry.IRequestCycle;
  -import org.apache.tapestry.Tapestry;
  -import org.apache.tapestry.engine.IPropertySource;
  -import org.apache.tapestry.util.StringSplitter;
  -
   /**
  - *  Responsible for copying assets from the classpath to an external directory that
  - *  is visible to the web server. The externalizer is stored inside
  - *  the {@link ServletContext} as a named attribute.
  - *
  - *  <p>The externalizer uses the name <code>org.apache.tapestry.AssetExternalizer.<i>application
name</i>
  - *  </code>.  It configures itself using two additional 
  - *  properties (searching in 
  - *  {@link org.apache.tapestry.IEngine#getPropertySource()}.
  - *
  - *  <table border=1>
  - *  <tr> <th>Parameter</th> <th>Description</th> </tr>
  - *  <tr valign=top> 
  - *		<td><code>org.apache.tapestry.asset.dir</code> </td>
  - * 		 <td>The directory to which assets will be copied.</td> </tr>
  - *  <tr valign=top>
  - *		<td><code>org.apache.tapestry.asset.URL</code> </td>
  - *		  <td>The corresponding URL for the asset directory.</td> </tr>
  - *	</table>
  - *
  - * <p>If either of these parameters is null, then no externalization occurs.
  - * Private assets will still be available, just less efficiently, as the application
  - * will be invoked via its servlet and, ultimately, the {@link AssetService} will need
  - * to retrieve the asset.
  - *
  - * <p>Assets maintain thier directory structure when copied.  For example,
  - * an asset with a resource path of <code>/com/skunkworx/Banner.gif</code>
would
  - * be copied to the file system as <code><i>dir</i>/com/skunkworx/Banner.gif</code>
and
  - * would have a URL of <code><i>URL</i>/com/skunkworx/Banner.gif</code>.
  - *
  - * <p>The externalizer will create any directories as needed.
  - *
  - * <p>The externalizer will not overwrite existing files.  When a new version of
the application
  - * is deployed with changed assets, there are two deployment stategies:
  - * <ul>
  - * <li>Delete the existing asset directory and allow the externalizer to recreate
and
  - * repopulate it.
  - * <li>Change the asset directory and URL, allowing the old and new assets to exist
  - *  side-by-side.
  - * </ul>
  - *
  - * <p>When using the second approach, it is best to use a directory that has
  - * a version number in it, for example, <code>D:/inetpub/assets/0</code> mapped
to the URL
  - * <code>/assets/0</code>.  When a new version of the application is deployed,
the trailing
  - * version number is incremented from 0 to 1.
  + * <p>
  + * Note: This was a class prior to 3.1, at which point it was split into a service interface
and a
  + * {@link org.apache.tapestry.asset.AssetExternalizerImpl service implementation}.
    * 
  - *  @author Howard Lewis Ship
  - * 
  - **/
  -
  -public class AssetExternalizer
  + * @author Howard M. Lewis Ship
  + * @since 3.1
  + */
  +public interface AssetExternalizer
   {
  -    private static final Log LOG = LogFactory.getLog(AssetExternalizer.class);
  -
  -    private ClassResolver _resolver;
  -    private File _assetDir;
  -    private String _URL;
  -
  -    /**
  -     *  A map from resource path (as a String) to final URL (as a String).
  -     *
  -     **/
  -
  -    private Map _resources = new HashMap();
  -
  -    private static final int BUFFER_SIZE = 2048;
  -
  -    protected AssetExternalizer(IRequestCycle cycle)
  -    {
  -        _resolver = cycle.getEngine().getClassResolver();
  -    
  -        IPropertySource properties = cycle.getEngine().getPropertySource();
  -
  -
  -        String directory = properties.getPropertyValue("org.apache.tapestry.asset.dir");
  -
  -        if (directory == null)
  -            return;
  -
  -        _URL = properties.getPropertyValue("org.apache.tapestry.asset.URL");
  -
  -        if (_URL == null)
  -            return;
  -
  -        _assetDir = new File(directory);
  -
  -        LOG.debug("Initialized with directory " + _assetDir + " mapped to " + _URL);
  -    }
  -
  -    protected void externalize(String resourcePath) throws IOException
  -    {
  -        String[] path;
  -        int i;
  -        File file;
  -        StringSplitter splitter;
  -        InputStream in;
  -        OutputStream out;
  -        int bytesRead;
  -        URL inputURL;
  -        byte[] buffer;
  -
  -        if (LOG.isDebugEnabled())
  -            LOG.debug("Externalizing " + resourcePath);
  -
  -        file = _assetDir;
  -
  -        // Resources are always split by the unix seperator, even on Win32.
  -
  -        splitter = new StringSplitter('/');
  -
  -        path = splitter.splitToArray(resourcePath);
  -
  -        // The path is expected to start with a leading slash, but the StringSplitter
  -        // will ignore that leading slash.
  -
  -        for (i = 0; i < path.length - 1; i++)
  -        {
  -            // Doing it this way makes sure the path seperators are right.
  -
  -            file = new File(file, path[i]);
  -        }
  -
  -        // Make sure the directories exist.
  -
  -        file.mkdirs();
  -
  -        file = new File(file, path[path.length - 1]);
  -
  -        // If the file exists, then assume all is well.  This is OK for development,
  -        // but there may be multithreading (or even multiprocess) race conditions
  -        // around the creation of the file.
  -
  -        if (file.exists())
  -            return;
  -
  -        // Get the resource and copy it to the file.
  -
  -        inputURL = _resolver.getResource(resourcePath);
  -        if (inputURL == null)
  -            throw new IOException(Tapestry.format("missing-resource", resourcePath));
  -
  -        in = inputURL.openStream();
  -
  -        out = new FileOutputStream(file);
  -
  -        buffer = new byte[BUFFER_SIZE];
  -
  -        while (true)
  -        {
  -            bytesRead = in.read(buffer, 0, BUFFER_SIZE);
  -            if (bytesRead < 0)
  -                break;
  -
  -            out.write(buffer, 0, bytesRead);
  -        }
  -
  -        in.close();
  -        out.close();
  -
  -        // The file is copied!
  -    }
  -
  -    /**
  -     *  Gets the externalizer singleton for the application.  If it does not already
  -     *  exist, it is created and stored into the {@link ServletContext}.
  -     *
  -     *  <p>Each Tapestry application within a single {@link ServletContext}
  -     *  will have its own externalizer; they are differentiated by the
  -     *  application name.
  -     *
  -     *  @see org.apache.tapestry.spec.ApplicationSpecification#getName()
  -     *
  -     **/
  -
  -    public static AssetExternalizer get(IRequestCycle cycle)
  -    {
  -        HttpServlet servlet = cycle.getRequestContext().getServlet();
  -        ServletContext context = servlet.getServletContext();
  -
  -        String servletName = servlet.getServletName();
  -        
  -        String attributeName = "org.apache.tapestry.AssetExternalizer:" + servletName;
  -
  -        AssetExternalizer result = (AssetExternalizer) context.getAttribute(attributeName);
  -
  -        if (result == null)
  -        {
  -            result = new AssetExternalizer(cycle);
  -            context.setAttribute(attributeName, result);
  -        }
  -
  -        return result;
  -    }
  -
       /**
  -     *  Gets the URL to a private resource.  If the resource was
  -     *  previously copied out of the classpath, the previously
  -     *  generated URL is returned.
  +     * Gets the URL to a private resource. If the resource was previously copied out of
the
  +     * classpath, the previously generated URL is returned.
  +     * <p>
  +     * If the asset directory and URL are not configured, then returns null.
  +     * <p>
  +     * Otherwise, the asset is copied out to the asset directory, the URL is constructed
(and
  +     * recorded for later) and the URL is returned.
  +     * <p>
  +     * This method is not explicitly synchronized but should work multi-threaded. It synchronizes
on
  +     * the internal <code>Map</code> used to map resource paths to URLs.
        * 
  -     *  <p>If the asset directory and URL are not configured, then
  -     *  returns null.
  -     *
  -     *  <p>Otherwise, the asset is copied out to the asset directory,
  -     *  the URL is constructed (and recorded for later) and the URL is
  -     *  returned.
  -     *
  -     *  <p>This method is not explicitly synchronized but should work
  -     *  multi-threaded.  It synchronizes on the internal
  -     *  <code>Map</code> used to map resource paths to URLs.
  -     *
  -     *  @param resourcePath The full path of the resource within the
  -     *  classpath.  This is expected to include a leading slash.  For
  -     *  example: <code>/com/skunkworx/Banner.gif</code>.
  -     *
  -     **/
  -
  -    public String getURL(String resourcePath)
  -    {
  -        String result;
  -
  -        if (_assetDir == null)
  -            return null;
  -
  -        synchronized (_resources)
  -        {
  -            result = (String) _resources.get(resourcePath);
  -
  -            if (result != null)
  -                return result;
  -
  -            try
  -            {
  -                externalize(resourcePath);
  -            }
  -            catch (IOException ex)
  -            {
  -                throw new ApplicationRuntimeException(
  -                    Tapestry.format("AssetExternalizer.externalize-failure", resourcePath,
_assetDir),
  -                    ex);
  -            }
  -
  -            result = _URL + resourcePath;
  -
  -            _resources.put(resourcePath, result);
  -
  -            return result;
  -        }
  -    }
  +     * @param resourcePath
  +     *            The full path of the resource within the classpath. This is expected
to include a
  +     *            leading slash. For example: <code>/com/skunkworx/Banner.gif</code>.
  +     */
  +    public String getURL(String resourcePath);
   }
  
  
  
  1.4       +3 -14     jakarta-tapestry/framework/src/java/org/apache/tapestry/asset/PrivateAsset.java
  
  Index: PrivateAsset.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/asset/PrivateAsset.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PrivateAsset.java	3 Dec 2004 15:18:38 -0000	1.3
  +++ PrivateAsset.java	3 Dec 2004 16:06:59 -0000	1.4
  @@ -37,9 +37,6 @@
   
   public class PrivateAsset extends AbstractAsset
   {
  -
  -    private AssetExternalizer _externalizer;
  -
       public PrivateAsset(ClasspathResource resourceLocation, Location location)
       {
           super(resourceLocation, location);
  @@ -47,24 +44,16 @@
   
       /**
        * Gets the localized version of the resource. Build the URL for the resource. If possible,
the
  -     * application's {@link AssetExternalizer}is located, to copy the resource to a directory
  +     * application's {@link AssetExternalizerImpl}is located, to copy the resource to a
directory
        * visible to the web server.
        */
   
       public String buildURL(IRequestCycle cycle)
       {
  -        if (_externalizer == null)
  -            _externalizer = AssetExternalizer.get(cycle);
  -
  -        String path = getResourceLocation().getPath();
  -
  -        String externalURL = _externalizer.getURL(path);
  -
  -        if (externalURL != null)
  -            return externalURL;
  -
           IEngineService service = cycle.getEngine().getService(Tapestry.ASSET_SERVICE);
   
  +       String path = getResourceLocation().getPath();
  + 
           ILink link = service.getLink(cycle, path);
   
           return link.getURL();
  
  
  
  1.5       +21 -9     jakarta-tapestry/framework/src/java/org/apache/tapestry/asset/AssetService.java
  
  Index: AssetService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/asset/AssetService.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AssetService.java	3 Dec 2004 15:18:38 -0000	1.4
  +++ AssetService.java	3 Dec 2004 16:06:59 -0000	1.5
  @@ -26,11 +26,11 @@
   
   import org.apache.hivemind.ApplicationRuntimeException;
   import org.apache.hivemind.Defense;
  -import org.apache.tapestry.IComponent;
   import org.apache.tapestry.IRequestCycle;
   import org.apache.tapestry.Tapestry;
   import org.apache.tapestry.engine.AbstractService;
   import org.apache.tapestry.engine.ILink;
  +import org.apache.tapestry.link.StaticLink;
   import org.apache.tapestry.request.ResponseOutputStream;
   import org.apache.tapestry.services.RequestExceptionReporter;
   
  @@ -51,6 +51,9 @@
   
   public class AssetService extends AbstractService
   {
  +    /** @since 3.1 */
  +    private AssetExternalizer _assetExternalizer;
  +
       /**
        * Defaults MIME types, by extension, used when the servlet container doesn't provide
MIME
        * types. ServletExec Debugger, for example, fails to do provide these.
  @@ -86,10 +89,17 @@
       {
           Defense.isAssignable(parameter, String.class, "parameter");
   
  +        String path = (String) parameter;
  +
  +        String externalURL = _assetExternalizer.getURL(path);
  +
  +        if (externalURL != null)
  +            return new StaticLink(externalURL);
  +
           // Service is stateless
   
           return constructLink(cycle, Tapestry.ASSET_SERVICE, null, new Object[]
  -        { parameter }, false);
  +        { path }, false);
       }
   
       public String getName()
  @@ -99,14 +109,10 @@
   
       private static String getMimeType(String path)
       {
  -        String key;
  -        String result;
  -        int dotx;
  +        int dotx = path.lastIndexOf('.');
  +        String key = path.substring(dotx + 1).toLowerCase();
   
  -        dotx = path.lastIndexOf('.');
  -        key = path.substring(dotx + 1).toLowerCase();
  -
  -        result = (String) _mimeTypes.get(key);
  +        String result = (String) _mimeTypes.get(key);
   
           if (result == null)
               result = "text/plain";
  @@ -203,5 +209,11 @@
       public void setExceptionReporter(RequestExceptionReporter exceptionReporter)
       {
           _exceptionReporter = exceptionReporter;
  +    }
  +
  +    /** @since 3.1 */
  +    public void setAssetExternalizer(AssetExternalizer assetExternalizer)
  +    {
  +        _assetExternalizer = assetExternalizer;
       }
   }
  
  
  
  1.1                  jakarta-tapestry/framework/src/java/org/apache/tapestry/asset/AssetExternalizerImpl.java
  
  Index: AssetExternalizerImpl.java
  ===================================================================
  // Copyright 2004 The Apache Software Foundation
  //
  // Licensed under the Apache License, Version 2.0 (the "License");
  // you may not use this file except in compliance with the License.
  // You may obtain a copy of the License at
  //
  //     http://www.apache.org/licenses/LICENSE-2.0
  //
  // Unless required by applicable law or agreed to in writing, software
  // distributed under the License is distributed on an "AS IS" BASIS,
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  // See the License for the specific language governing permissions and
  // limitations under the License.
  
  package org.apache.tapestry.asset;
  
  import java.io.BufferedInputStream;
  import java.io.BufferedOutputStream;
  import java.io.File;
  import java.io.FileOutputStream;
  import java.io.IOException;
  import java.io.InputStream;
  import java.io.OutputStream;
  import java.net.URL;
  import java.util.HashMap;
  import java.util.Map;
  
  import javax.servlet.ServletContext;
  
  import org.apache.commons.logging.Log;
  import org.apache.hivemind.ApplicationRuntimeException;
  import org.apache.hivemind.ClassResolver;
  import org.apache.tapestry.Tapestry;
  import org.apache.tapestry.engine.IPropertySource;
  import org.apache.tapestry.util.StringSplitter;
  
  /**
   * Implementation of the {@link org.apache.tapestry.asset.AssetExternalizer}service interface.
   * Responsible for copying assets from the classpath to an external directory that is visible
to the
   * web server. The externalizer is stored inside the {@link ServletContext}as a named attribute.
   * <p>
   * The externalizer uses the name
   * <code>org.apache.tapestry.AssetExternalizer.<i>application name</i>
   *  </code>. It configures
   * itself using two additional properties (searching in
   * {@link org.apache.tapestry.IEngine#getPropertySource()}. <table border=1>
   * <tr>
   * <th>Parameter</th>
   * <th>Description</th>
   * </tr>
   * <tr valign=top>
   * <td><code>org.apache.tapestry.asset.dir</code></td>
   * <td>The directory to which assets will be copied.</td>
   * </tr>
   * <tr valign=top>
   * <td><code>org.apache.tapestry.asset.URL</code></td>
   * <td>The corresponding URL for the asset directory.</td>
   * </tr>
   * </table>
   * <p>
   * If either of these parameters is null, then no externalization occurs. Private assets
will still
   * be available, just less efficiently, as the application will be invoked via its servlet
and,
   * ultimately, the {@link AssetService}will need to retrieve the asset.
   * <p>
   * Assets maintain thier directory structure when copied. For example, an asset with a resource
path
   * of <code>/com/skunkworx/Banner.gif</code> would be copied to the file system
as
   * <code><i>dir</i>/com/skunkworx/Banner.gif</code> and would have
a URL of
   * <code><i>URL</i>/com/skunkworx/Banner.gif</code>.
   * <p>
   * The externalizer will create any directories as needed.
   * <p>
   * The externalizer will not overwrite existing files. When a new version of the application
is
   * deployed with changed assets, there are two deployment stategies:
   * <ul>
   * <li>Delete the existing asset directory and allow the externalizer to recreate
and repopulate
   * it.
   * <li>Change the asset directory and URL, allowing the old and new assets to exist
side-by-side.
   * </ul>
   * <p>
   * When using the second approach, it is best to use a directory that has a version number
in it,
   * for example, <code>D:/inetpub/assets/0</code> mapped to the URL <code>/assets/0</code>.
When
   * a new version of the application is deployed, the trailing version number is incremented
from 0
   * to 1.
   * 
   * @author Howard Lewis Ship
   */
  
  public class AssetExternalizerImpl implements AssetExternalizer
  {
      /** @since 3.1 */
      private Log _log;
  
      private ClassResolver _resolver;
  
      /** @since 3.1 */
      private IPropertySource _propertySource;
  
      private File _assetDir;
  
      private String _URL;
  
      /**
       * A map from resource path (as a String) to final URL (as a String).
       */
  
      private Map _resources = new HashMap();
  
      private static final int BUFFER_SIZE = 2048;
  
      public void initializeService()
      {
          String directory = _propertySource.getPropertyValue("org.apache.tapestry.asset.dir");
  
          if (directory == null)
              return;
  
          _URL = _propertySource.getPropertyValue("org.apache.tapestry.asset.URL");
  
          if (_URL == null)
              return;
  
          _assetDir = new File(directory);
  
          _log.debug("Initialized with directory " + _assetDir + " mapped to " + _URL);
      }
  
      protected void externalize(String resourcePath) throws IOException
      {
          if (_log.isDebugEnabled())
              _log.debug("Externalizing " + resourcePath);
  
          File file = _assetDir;
  
          // Resources are always split by the unix seperator, even on Win32.
  
          StringSplitter splitter = new StringSplitter('/');
  
          String[] path = splitter.splitToArray(resourcePath);
  
          // The path is expected to start with a leading slash, but the StringSplitter
          // will ignore that leading slash.
  
          for (int i = 0; i < path.length - 1; i++)
          {
              // Doing it this way makes sure the path seperators are right.
  
              file = new File(file, path[i]);
          }
  
          // Make sure the directories exist.
  
          file.mkdirs();
  
          file = new File(file, path[path.length - 1]);
  
          // If the file exists, then assume all is well. This is OK for development,
          // but there may be multithreading (or even multiprocess) race conditions
          // around the creation of the file.
  
          if (file.exists())
              return;
  
          // Get the resource and copy it to the file.
  
          URL inputURL = _resolver.getResource(resourcePath);
          if (inputURL == null)
              throw new IOException(Tapestry.format("missing-resource", resourcePath));
  
          InputStream in = null;
          OutputStream out = null;
  
          try
          {
              in = new BufferedInputStream(inputURL.openStream());
  
              out = new BufferedOutputStream(new FileOutputStream(file));
  
              byte[] buffer = new byte[BUFFER_SIZE];
  
              while (true)
              {
                  int bytesRead = in.read(buffer, 0, BUFFER_SIZE);
                  if (bytesRead < 0)
                      break;
  
                  out.write(buffer, 0, bytesRead);
              }
          }
          finally
          {
              close(in);
              close(out);
          }
  
          // The file is copied!
      }
  
      private void close(InputStream in)
      {
          if (in != null)
              try
              {
                  in.close();
              }
              catch (IOException ex)
              {
                  // Ignore.
              }
      }
  
      private void close(OutputStream out)
      {
          if (out != null)
  
              try
              {
                  out.close();
              }
              catch (IOException ex)
              {
                  // Ignore
              }
      }
  
      /**
       * Gets the URL to a private resource. If the resource was previously copied out of
the
       * classpath, the previously generated URL is returned.
       * <p>
       * If the asset directory and URL are not configured, then returns null.
       * <p>
       * Otherwise, the asset is copied out to the asset directory, the URL is constructed
(and
       * recorded for later) and the URL is returned.
       * <p>
       * This method is not explicitly synchronized but should work multi-threaded. It synchronizes
on
       * the internal <code>Map</code> used to map resource paths to URLs.
       * 
       * @param resourcePath
       *            The full path of the resource within the classpath. This is expected to
include a
       *            leading slash. For example: <code>/com/skunkworx/Banner.gif</code>.
       */
  
      public String getURL(String resourcePath)
      {
          if (_assetDir == null)
              return null;
  
          synchronized (_resources)
          {
              String result = (String) _resources.get(resourcePath);
  
              if (result != null)
                  return result;
  
              try
              {
                  externalize(resourcePath);
              }
              catch (IOException ex)
              {
                  throw new ApplicationRuntimeException(Tapestry.format(
                          "AssetExternalizer.externalize-failure",
                          resourcePath,
                          _assetDir), ex);
              }
  
              result = _URL + resourcePath;
  
              _resources.put(resourcePath, result);
  
              return result;
          }
      }
  
      /** @since 3.1 */
      public void setLog(Log log)
      {
          _log = log;
      }
  
      /** @since 3.1 */
      public void setClassResolver(ClassResolver resolver)
      {
          _resolver = resolver;
      }
  
      /** since 3.1 */
      public void setPropertySource(IPropertySource propertySource)
      {
          _propertySource = propertySource;
      }
  }
  
  
  1.3       +14 -0     jakarta-tapestry/framework/src/descriptor/META-INF/tapestry.services.xml
  
  Index: tapestry.services.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/descriptor/META-INF/tapestry.services.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- tapestry.services.xml	12 Oct 2004 12:42:33 -0000	1.2
  +++ tapestry.services.xml	3 Dec 2004 16:06:59 -0000	1.3
  @@ -78,6 +78,7 @@
       <invoke-factory model="primitive">
         <construct class="org.apache.tapestry.asset.AssetService">
           <set-object property="exceptionReporter" value="infrastructure:requestExceptionReporter"/>
  +        <set-service property="assetExternalizer" service-id="AssetExternalizer"/>
         </construct>
       </invoke-factory>
     </service-point>  
  @@ -155,6 +156,19 @@
         <construct class="org.apache.tapestry.services.impl.ServiceMapImpl">
           <set-configuration property="factoryServices" configuration-id="FactoryServices"/>
           <set-configuration property="applicationServices" configuration-id="ApplicationServices"/>
  +      </construct>
  +    </invoke-factory>
  +    
  +  </service-point>
  +  
  +  <service-point id="AssetExternalizer" interface="org.apache.tapestry.asset.AssetExternalizer">
  +    
  +    Used by the AssetService to copy private assets out onto the file system within
  +    a web folder, so that static URLs to the assets may be generated.
  +    
  +    <invoke-factory>
  +      <construct class="org.apache.tapestry.asset.AssetExternalizerImpl">
  +        <set-object property="propertySource" value="infrastructure:applicationPropertySource"/>
         </construct>
       </invoke-factory>
       
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


Mime
View raw message