Return-Path: X-Original-To: apmail-tapestry-dev-archive@www.apache.org Delivered-To: apmail-tapestry-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 96823DB46 for ; Tue, 24 Jul 2012 15:02:01 +0000 (UTC) Received: (qmail 1095 invoked by uid 500); 24 Jul 2012 15:02:01 -0000 Delivered-To: apmail-tapestry-dev-archive@tapestry.apache.org Received: (qmail 1032 invoked by uid 500); 24 Jul 2012 15:02:01 -0000 Mailing-List: contact dev-help@tapestry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tapestry development" Delivered-To: mailing list dev@tapestry.apache.org Received: (qmail 1013 invoked by uid 99); 24 Jul 2012 15:02:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Jul 2012 15:02:01 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of hlship@gmail.com designates 209.85.213.52 as permitted sender) Received: from [209.85.213.52] (HELO mail-yw0-f52.google.com) (209.85.213.52) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Jul 2012 15:01:54 +0000 Received: by yhpp61 with SMTP id p61so7059648yhp.11 for ; Tue, 24 Jul 2012 08:01:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=VB/tsULJj76qaXeZZVRU+xI0WbPV2ZdUJeBFKEOpqXI=; b=D+ql89z98/oLebrtH5eJqm2lmxNxI87LJsWi/tLaHl8nuuUjdhYRMcI4nUoujPbnjI 5pqrrTOVRNEZUWfJic0mRqlfcqs2AMOK0rumSRuiarOZ6R+SFKlVwFAxCBs/HryFHXCt KDin/yASTzscEKM+YjwA7W0b2p/0c+I3YU5P7Tc+mNJOirU9lO/jT7eq+CzXKy8rPKZt kLlZxuB+lqZ0PuchxbJR6DXS/p+TuyIvnSr2qmGFmLeoQpKwv1yUbTTvoSlpETIlzFbx 1wq1WrG4VgEpxShqEZ10ajwRG0YQ5Mivh4IfdGvRjz9HIjbzUIV830xNCb9+1Ct5lKrz 7rmw== MIME-Version: 1.0 Received: by 10.42.84.16 with SMTP id j16mr15608962icl.7.1343142092971; Tue, 24 Jul 2012 08:01:32 -0700 (PDT) Received: by 10.50.2.10 with HTTP; Tue, 24 Jul 2012 08:01:32 -0700 (PDT) In-Reply-To: <9D5B6D7C-8B08-431C-B726-0012F457DB4F@gmail.com> References: <9D5B6D7C-8B08-431C-B726-0012F457DB4F@gmail.com> Date: Tue, 24 Jul 2012 08:01:32 -0700 Message-ID: Subject: Re: META-INF/assets/ in 5.4 From: Howard Lewis Ship To: Tapestry development Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Tue, Jul 24, 2012 at 3:38 AM, Denis Stepanov wrote: > I don't think 'META-INF' is the right location for all assets, its suppos= ed to store internal Java meta information or configuration files, web reso= urces do not belong there. We can just use '/assets', I would also support = {lib-path}/assets (org.apache.tapestry5.corelib.assets for core lib). > The advantage of META-INF/ as a prefix is that it guarantees that there won't be a conflict with any existing Java package. I'm open to suggestions; maybe T5-RESOURCES/assets/ (and /modules/). > Denis > > Jul 23, 2012 v 8:06 PM, Howard Lewis Ship: > >> On Mon, Jul 23, 2012 at 7:37 AM, Thiago H de Paula Figueiredo >> wrote: >>> Just for backward compatibility, what about adding a symbol defaulting = to >>> false that allows assets to be loaded from outside /META-INF/assets? >> >> You mean, in 5.5 and beyond? >> >> In 5.4, you have compatibility with 5.3, you just get an error in the co= nsole. >> >>> >>> >>> On Sun, 22 Jul 2012 15:43:47 -0300, Howard Lewis Ship >>> wrote: >>> >>>> Just a note on where I'm heading with the 5.4 code. >>>> >>>> In Tapestry 5.3 and earlier, classpath assets were allowed to be >>>> anywhere on the classpath, as long as the assets where somewhere under >>>> a library root package. Tapestry would build an asset URL that >>>> incorporated the library name and the relative path from that root to >>>> the asset. So, move_up.png in org.apache.tapestry5.corelib.components >>>> would be combined with the library name "core" -> >>>> "org.apache.tapestry5.corelib" to create as asset URL of >>>> /assets/123bc/core/components/move_up.png >>>> >>>> Of course, this has its problems including how to handle libraries >>>> that have multiple root packages (Tapestry builds a path relative to >>>> the deepest common folder) and, more importantly, how to keep users >>>> from downloading things that were not intended to be downloaded, >>>> including Java .class files and Tapestry templates and properties >>>> files. You end up with some extra cruft, such as attaching an md5 >>>> checksum to certain assets to "prove" that the application intended to >>>> expose it to the client. It still makes people unhappy, as parts of >>>> the /assets/ namespace is browsable (via the web browser); further >>>> protection on files requires opt in (you must declare which extensions >>>> need extra protection). All in all, less than satisfactory. >>>> >>>> I believe Thiago pointed out, maybe a year back, that it would have >>>> been better to isolate assets from other things on the classpath. I >>>> agree, and in 5.4 I'm starting a transition that way. The current >>>> approach will continue to be supported until at least 5.5, with >>>> runtime warnings. >>>> >>>> The new approach is that assets go in /META-INF/assets/ >>>> (or just /META-INF/assets/ for application classpath assets). Relative >>>> URLs are now relative to that folder, not relative to the component >>>> class. Again, outside of some warnings, all existing assets work >>>> correctly using 5.3 rules. >>>> >>>> The warnings I mention above include where to move the file so that it >>>> will be picked up correctly: >>>> >>>> [ERROR] AssetSource Packaging of classpath assets has changed in >>>> release 5.4; Assets should no longer be on the main classpath, but >>>> should be moved to 'META-INF/assets/' or a sub-folder. Future releases >>>> of Tapestry may no longer support assets on the main classpath. >>>> [ERROR] AssetSource Classpath asset >>>> '/org/apache/tapestry5/corelib/components/sort-asc.png' should be >>>> moved under folder '/META-INF/assets/core/', and the relative path >>>> adjusted. >>>> [ERROR] AssetSource Classpath asset >>>> '/org/apache/tapestry5/corelib/components/sort-desc.png' should be >>>> moved under folder '/META-INF/assets/core/', and the relative path >>>> adjusted. >>>> [ERROR] AssetSource Classpath asset >>>> '/org/apache/tapestry5/corelib/components/sortable.png' should be >>>> moved under folder '/META-INF/assets/core/', and the relative path >>>> adjusted. >>>> >>>> The location of resources (component templates and message catalogs) >>>> is not changed. >>>> >>>> One of my secondary goals will be to have a way of generating a kind >>>> of manifest of all assets (classpath or context, static or virtual) >>>> that can be used to pre-load assets into a CDN. >>>> >>> >>> >>> -- >>> Thiago H. de Paula Figueiredo >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org >>> For additional commands, e-mail: dev-help@tapestry.apache.org >>> >> >> >> >> -- >> Howard M. Lewis Ship >> >> Creator of Apache Tapestry >> >> The source for Tapestry training, mentoring and support. Contact me to >> learn how I can get you up and productive in Tapestry fast! >> >> (971) 678-5210 >> http://howardlewisship.com >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org >> For additional commands, e-mail: dev-help@tapestry.apache.org >> > > Denis > > > --=20 Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org For additional commands, e-mail: dev-help@tapestry.apache.org