tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "manuel aldana (JIRA)" <j...@apache.org>
Subject [jira] Issue Comment Edited: (TAP5-423) Implement a file-system Asset type
Date Sun, 12 Apr 2009 17:44:14 GMT

    [ https://issues.apache.org/jira/browse/TAP5-423?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12698246#action_12698246
] 

manuel aldana edited comment on TAP5-423 at 4/12/09 10:42 AM:
--------------------------------------------------------------

Using filesystem asset designed as follows, filesystem as new asset type (filesystem:). The
asset type is followed by a symbol which is an alias of a filesystem path. This symbol is
supposed to be declared inside the AppModule. The limit of filesystem symbols is unbounded.

------------------------
EXAMPLE:

INCLUSION OF ASSET IN PAGE (example):
@Property
@Inject
@Path("filesystem:/images/test.txt")
private Asset fileAsset;

DEFINITION OF FILESYSTEM SYMBOL in AppModule:
public class AppModule
{
...
    //filesystem asset alias manager keeps the mappings of symbol to filesystem root
    public static void contributeFilesystemAssetAliasManager(MappedConfiguration<String,String>
configuration)
    {
        configuration.add("images", "file:/d:/srv/imgRoot/");
    }
...
}


END EXAMPLE
--------------------------------

In the end such a filesystem asset would receive following link: http://ROOT_CONTEXT/assets/fs/images/test.txt

I develop on windows, please test this on *nix systems also (I checked most of OS filesystem
portability problems inside code but could not test it yet).

Some things I would like to discuss are:
-Application version  (random number which changes after each restart) as in context and classpath
asset is not used because the filesystem deployment is not directly connected to the webapp
deployment
-I have not used resource cache inside the FilesystemAssetFactory in difference to the other
assets. Maybe I will add it...


      was (Author: aldana):
    Using filesystem asset designed as follows, filesystem as new asset type (filesystem:).
The asset type is followed by a symbol which is an alias of a filesystem path. This symbol
is supposed to be declared inside the AppModule. The limit of filesystem symbols is unbounded.

------------------------
EXAMPLE:

INCLUSION OF ASSET IN PAGE (example):
@Property
@Inject
@Path("filesystem:/images/test.txt")
private Asset fileAsset;

DEFINITION OF FILESYSTEM SYMBOL in AppModule:
public class AppModule
{
...
    //filesystem asset alias manager keeps the mappings of symbol to filesystem root
    public static void contributeFilesystemAssetAliasManager(MappedConfiguration<String,String>
configuration)
    {
        configuration.add("images", "file:/d:/srv/imgRoot/");
    }
...
}


END EXAMPLE
--------------------------------

In the end such a filesystem asset would receive following link: http://&lt;
rootContext&gt;/assets/fs/images/test.txt

I develop on windows, please test this on *nix systems also (I checked most of OS filesystem
portability problems inside code but could not test it yet).

Some things I would like to discuss are:
-Application version  (random number which changes after each restart) as in context and classpath
asset is not used because the filesystem deployment is not directly connected to the webapp
deployment
-I have not used resource cache inside the FilesystemAssetFactory in difference to the other
assets. Maybe I will add it...

  
> Implement a file-system Asset type
> ----------------------------------
>
>                 Key: TAP5-423
>                 URL: https://issues.apache.org/jira/browse/TAP5-423
>             Project: Tapestry 5
>          Issue Type: New Feature
>          Components: tapestry-core
>    Affects Versions: 5.0.18
>            Reporter: manuel aldana
>         Attachments: filesystem_asset1.0_TAP423.patch
>
>
> currenty it is built in to retrieve assets from classpath and from webcontext.
> a file system asset type which can retrieve stuff directly from the filesystem (e.g.
from /srv/statics/xxxx) makes also sense. 
> something like:
> *ResourceFileSystem extends AbstractResource* and *FileSystemAssetFactory extends AssetFactory*

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message