You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "manuel aldana (JIRA)" <ji...@apache.org> on 2009/04/12 19:42:14 UTC
[jira] Issue Comment Edited: (TAP5-423) Implement a file-system
Asset type
[ 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:41 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://<
rootContext>
/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://<rootContext>/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.