You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by re...@apache.org on 2004/11/27 16:49:52 UTC

svn commit: r106730 - /cocoon/trunk/src/blocks/forms/samples/forms/dynamicrepeater_template.xml /cocoon/trunk/src/blocks/forms/samples/forms/tasktree_template.xml

Author: reinhard
Date: Sat Nov 27 07:49:51 2004
New Revision: 106730

URL: http://svn.apache.org/viewcvs?view=rev&rev=106730
Log:
update directory paths
Modified:
   cocoon/trunk/src/blocks/forms/samples/forms/dynamicrepeater_template.xml
   cocoon/trunk/src/blocks/forms/samples/forms/tasktree_template.xml

Modified: cocoon/trunk/src/blocks/forms/samples/forms/dynamicrepeater_template.xml
Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/forms/samples/forms/dynamicrepeater_template.xml?view=diff&rev=106730&p1=cocoon/trunk/src/blocks/forms/samples/forms/dynamicrepeater_template.xml&r1=106729&p2=cocoon/trunk/src/blocks/forms/samples/forms/dynamicrepeater_template.xml&r2=106730
==============================================================================
--- cocoon/trunk/src/blocks/forms/samples/forms/dynamicrepeater_template.xml	(original)
+++ cocoon/trunk/src/blocks/forms/samples/forms/dynamicrepeater_template.xml	Sat Nov 27 07:49:51 2004
@@ -71,22 +71,22 @@
                         <!-- Don't display the "move up" button on the first row -->
                         <jx:choose>
                           <jx:when test="${repeaterLoop.first}">
-                            <img src="resources/blank_btn.gif"/>
+                            <img src="resources/img/blank_btn.gif"/>
                           </jx:when>
                           <jx:otherwise>
                             <ft:widget id="up">
-                              <fi:styling type="image" src="resources/move_up.gif"/>
+                              <fi:styling type="image" src="resources/img/move_up.gif"/>
                             </ft:widget>
                           </jx:otherwise>
                         </jx:choose>
                         <!-- Don't display the "move down" button on the first row -->
                         <jx:choose>
                           <jx:when test="${repeaterLoop.last}">
-                            <img src="resources/blank_btn.gif"/>
+                            <img src="resources/img/blank_btn.gif"/>
                           </jx:when>
                           <jx:otherwise>
                             <ft:widget id="down">
-                              <fi:styling type="image" src="resources/move_down.gif"/>
+                              <fi:styling type="image" src="resources/img/move_down.gif"/>
                             </ft:widget>
                           </jx:otherwise>
                         </jx:choose>

Modified: cocoon/trunk/src/blocks/forms/samples/forms/tasktree_template.xml
Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/forms/samples/forms/tasktree_template.xml?view=diff&rev=106730&p1=cocoon/trunk/src/blocks/forms/samples/forms/tasktree_template.xml&r1=106729&p2=cocoon/trunk/src/blocks/forms/samples/forms/tasktree_template.xml&r2=106730
==============================================================================
--- cocoon/trunk/src/blocks/forms/samples/forms/tasktree_template.xml	(original)
+++ cocoon/trunk/src/blocks/forms/samples/forms/tasktree_template.xml	Sat Nov 27 07:49:51 2004
@@ -71,10 +71,10 @@
         <div class="section">
           <ft:struct id="task">
             <span class="actions">
-              <ft:widget id="down"><fi:styling type="image" src="resources/move_down.gif"/></ft:widget>
-              <ft:widget id="up"><fi:styling type="image" src="resources/move_up.gif"/></ft:widget>
-              <ft:widget id="delete"><fi:styling type="image" src="resources/delete.gif"/></ft:widget>
-              <ft:widget id="add"><fi:styling type="image" src="resources/new.gif"/></ft:widget>
+              <ft:widget id="down"><fi:styling type="image" src="resources/img/move_down.gif"/></ft:widget>
+              <ft:widget id="up"><fi:styling type="image" src="resources/img/move_up.gif"/></ft:widget>
+              <ft:widget id="delete"><fi:styling type="image" src="resources/img/delete.gif"/></ft:widget>
+              <ft:widget id="add"><fi:styling type="image" src="resources/img/new.gif"/></ft:widget>
             </span>
             Title: <ft:widget id="title"/>
             From <ft:widget id="start"><fi:styling size="10"/></ft:widget>
@@ -99,7 +99,9 @@
             </ft:repeater-widget>
           </jx:when>
           <jx:otherwise>
-            <ft:widget id="addsub"/>
+            <ft:widget id="addsub">
+	      <fi:styling type="link"/>
+	    </ft:widget>
           </jx:otherwise>
         </jx:choose>
       </ft:class>

Re: Cleanup forms/samples/resources

Posted by Antonio Gallardo <ag...@agssa.net>.
<cita quién="Klaus Bertram">
> Antonio Gallardo wrote:
>> <cita quién="Jorg Heymans">
>>
>>>
>>>Jeremy Quinn wrote:
>>>
>>><snip/>
>>>
>>>>Yes, I was one of the people always doing that !!!
>>>>I always assumed you needed to add the mime-type to the <map:read/> so
>>>>needed specific pipelines for each type.
>>>>
>>>>Thanks for the tip !!!
>>>
>>>How does cocoon send the mimetype of a file then? Does it have a
>>>mime.types somewhere internally like apache? Or does it rely on the
>>>browser to interprete the binary stream correctly or guess it from the
>>>file extension?
>>
>>
>> Yep. From the file extension. Defined in the web.xml. For example in
>> Tomcat See:
>>
>> $TOMCAT_HOME/conf/web.xml
>>
>> For the no-defined applications, we can also add new ones in the Cocoon
>> web.xml file.
>>
>> Search for mime in both files.
> Hi all,
>
> this bothered me yesterday and I make some test with pdf, doc, rtf, xls
> documents. The reader send doc and xls docs at text when no mime-type
> attribute is given at the sitemap. There is also no Content Header added
> without the mime-type attribute.
>
> But the source says:
> public String getMimeType() {
>          Context ctx = ObjectModelHelper.getContext(objectModel);
>          if (ctx != null) {
>              final String mimeType = ctx.getMimeType(source);
>              if (mimeType != null) {
>                  return mimeType;
>              }
>          }
>
>          return inputSource.getMimeType();
>      }
> so if I see it correct the header should always appended. or I'm wrong?

Maybe the problem is related to (search for mime):

http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=110172091309354&w=2

Best Regards,

Antonio Gallardo


Re: Cleanup forms/samples/resources

Posted by Klaus Bertram <k....@kbsm.de>.
Antonio Gallardo wrote:
> <cita quién="Jorg Heymans">
> 
>>
>>Jeremy Quinn wrote:
>>
>><snip/>
>>
>>>Yes, I was one of the people always doing that !!!
>>>I always assumed you needed to add the mime-type to the <map:read/> so
>>>needed specific pipelines for each type.
>>>
>>>Thanks for the tip !!!
>>
>>How does cocoon send the mimetype of a file then? Does it have a
>>mime.types somewhere internally like apache? Or does it rely on the
>>browser to interprete the binary stream correctly or guess it from the
>>file extension?
> 
> 
> Yep. From the file extension. Defined in the web.xml. For example in
> Tomcat See:
> 
> $TOMCAT_HOME/conf/web.xml
> 
> For the no-defined applications, we can also add new ones in the Cocoon
> web.xml file.
> 
> Search for mime in both files.
Hi all,

this bothered me yesterday and I make some test with pdf, doc, rtf, xls 
documents. The reader send doc and xls docs at text when no mime-type 
attribute is given at the sitemap. There is also no Content Header added 
without the mime-type attribute.

But the source says:
public String getMimeType() {
         Context ctx = ObjectModelHelper.getContext(objectModel);
         if (ctx != null) {
             final String mimeType = ctx.getMimeType(source);
             if (mimeType != null) {
                 return mimeType;
             }
         }

         return inputSource.getMimeType();
     }
so if I see it correct the header should always appended. or I'm wrong?

Klaus

Re: Cleanup forms/samples/resources

Posted by Antonio Gallardo <ag...@agssa.net>.
<cita quién="Jorg Heymans">
>
>
> Jeremy Quinn wrote:
>>
>
> <snip/>
>
>> Yes, I was one of the people always doing that !!!
>> I always assumed you needed to add the mime-type to the <map:read/> so
>> needed specific pipelines for each type.
>>
>> Thanks for the tip !!!
>
> How does cocoon send the mimetype of a file then? Does it have a
> mime.types somewhere internally like apache? Or does it rely on the
> browser to interprete the binary stream correctly or guess it from the
> file extension?

Yep. From the file extension. Defined in the web.xml. For example in
Tomcat See:

$TOMCAT_HOME/conf/web.xml

For the no-defined applications, we can also add new ones in the Cocoon
web.xml file.

Search for mime in both files.

Best Regards,

Antonio Gallardo.


Re: Cleanup forms/samples/resources

Posted by Jeremy Quinn <je...@media.demon.co.uk>.
On 29 Nov 2004, at 13:16, Jorg Heymans wrote:

>
>
> Jeremy Quinn wrote:
>
> <snip/>
>
>> Yes, I was one of the people always doing that !!!
>> I always assumed you needed to add the mime-type to the <map:read/> 
>> so needed specific pipelines for each type.
>> Thanks for the tip !!!
>
> How does cocoon send the mimetype of a file then? Does it have a 
> mime.types somewhere internally like apache? Or does it rely on the 
> browser to interprete the binary stream correctly or guess it from the 
> file extension?

Sorry, I do not know ..... but it works !!!! ;)

regards jeremy

--------------------------------------------------------

                   If email from this address is not signed
                                 IT IS NOT FROM ME

                         Always check the label, folks !!!!!
--------------------------------------------------------


Re: Cleanup forms/samples/resources

Posted by Jorg Heymans <jh...@domek.be>.

Jeremy Quinn wrote:
> 

<snip/>

> Yes, I was one of the people always doing that !!!
> I always assumed you needed to add the mime-type to the <map:read/> so 
> needed specific pipelines for each type.
> 
> Thanks for the tip !!!

How does cocoon send the mimetype of a file then? Does it have a 
mime.types somewhere internally like apache? Or does it rely on the 
browser to interprete the binary stream correctly or guess it from the 
file extension?

Regards
Jorg


Re: Cleanup forms/samples/resources

Posted by Jeremy Quinn <je...@media.demon.co.uk>.
On 27 Nov 2004, at 17:26, Sylvain Wallez wrote:

> Reinhard Poetz wrote:
>
>>
>> After working a lot with cForms the last week I was fed up by looking 
>> at the resources directory and always having a sense of staring at a 
>> big mess. I moved all images, css and js into their own directories. 
>> Unfortunatly this broke templates that reference images directly. As 
>> cForms are not stable I wouldn't care about this (it won't be the 
>> last thing that changes until we mark cForms as stable) and simply 
>> add a release note but if others think different, I could add an 
>> additional pipeline for gifs.
>
>
> As the number of resources is growing, it is good to organize them and 
> creating subdirectories is ok. However, we must keep them under a 
> single root resource dir to allow a simple <map:read> to serve any of 
> these resources.
>
> Too often I see sitemaps having a myriad of simple match/read for 
> *.gif, *.jpeg, *.js, *.css, etc when a simple <match 
> pattern="resources/**"> would do the job.

Yes, I was one of the people always doing that !!!
I always assumed you needed to add the mime-type to the <map:read/> so 
needed specific pipelines for each type.

Thanks for the tip !!!

> Also, now that these resources have stabilized, we may move them into 
> the cform's jar, in order to avoid copy/pasting them in every project. 
> The resources pipeline would then become:
>
> <map:match pattern="form-rsrc/**">
>  <map:read src="resource://org/apache/cocoon/forms/resources/{1}"/>
> </map:match>
>
> WDYT?

Certainly makes sense to me, for a stabilised CForms.

More realistically, you would probably want :

<map:match pattern="**form-rsrc/**">
  <map:read src="resource://org/apache/cocoon/forms/resources/{2}"/>
</map:match>

To cater for CForms usage in sub-directories as well.


regards Jeremy

--------------------------------------------------------

                   If email from this address is not signed
                                 IT IS NOT FROM ME

                         Always check the label, folks !!!!!
--------------------------------------------------------


Re: Cleanup forms/samples/resources

Posted by Antonio Gallardo <ag...@agssa.net>.
<cita quién="Reinhard Poetz">
> Another question: currently all XSLTs are in the base directory of
> resources. As
> we only support HTML at the moment, this is not a problem.  But where do
> we put
> e.g. a XUL stylesheet so that we don't end up in a big mess?
>
> I propose
>
> /resources
> /resources/stylesheets
> /resources/stylesheets/html
> /resources/stylesheets/xul
> /resources/stylesheets/lazlo
> /resources/img
> /resources/js
> ...
>
> WDYT?

+1

Best Regards,

Antonio Gallardo


Re: Cleanup forms/samples/resources

Posted by Sylvain Wallez <sy...@apache.org>.
Reinhard Poetz wrote:

> Sylvain Wallez wrote:
>
>> Reinhard Poetz wrote:
>>
>>>
>>> After working a lot with cForms the last week I was fed up by 
>>> looking at the resources directory and always having a sense of 
>>> staring at a big mess. I moved all images, css and js into their own 
>>> directories. Unfortunatly this broke templates that reference images 
>>> directly. As cForms are not stable I wouldn't care about this (it 
>>> won't be the last thing that changes until we mark cForms as stable) 
>>> and simply add a release note but if others think different, I could 
>>> add an additional pipeline for gifs.
>>
>>
>>
>>
>> As the number of resources is growing, it is good to organize them 
>> and creating subdirectories is ok. However, we must keep them under a 
>> single root resource dir to allow a simple <map:read> to serve any of 
>> these resources.
>
>
> I agree
>
>>
>> Too often I see sitemaps having a myriad of simple match/read for 
>> *.gif, *.jpeg, *.js, *.css, etc when a simple <match 
>> pattern="resources/**"> would do the job.
>>
>> Also, now that these resources have stabilized, we may move them into 
>> the cform's jar, in order to avoid copy/pasting them in every 
>> project. The resources pipeline would then become:
>>
>> <map:match pattern="form-rsrc/**">
>>  <map:read src="resource://org/apache/cocoon/forms/resources/{1}"/>
>> </map:match>
>>
>> WDYT?
>
>
> This is good for our users who don't have to copy around things and 
> upgrading between Cocoon releases should become easier for them.
> For developers working on e.g. the stylesheets this only requires one 
> change so that map:read points directly to their SVN source tree.


Yes. Or you can also, as I sometimes to, use the ParanoidCocoonServlet 
with a classpath set to Eclipse's build directory 
(build/eclipse/classes) where resources are automatically copied.

That avoids modifying the the sitemap to read in the source tree, which 
will also avoid use to inadvertently commit it :-)

> Another question: currently all XSLTs are in the base directory of 
> resources. As we only support HTML at the moment, this is not a 
> problem.  But where do we put e.g. a XUL stylesheet so that we don't 
> end up in a big mess?
>
> I propose
>
> /resources
> /resources/stylesheets
> /resources/stylesheets/html
> /resources/stylesheets/xul
> /resources/stylesheets/lazlo
> /resources/img
> /resources/js
> ...
>
> WDYT?


Sounds good.

For the record, I initially added stylesheets in the resources dir along 
with client-side files in order to allow the XSLs to be transmitted to 
XSL-aware browsers. Now I never actually tested that browsers could 
effectively run these stylesheets...

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }


Re: Cleanup forms/samples/resources

Posted by Reinhard Poetz <re...@apache.org>.
Sylvain Wallez wrote:
> Reinhard Poetz wrote:
> 
>>
>> After working a lot with cForms the last week I was fed up by looking 
>> at the resources directory and always having a sense of staring at a 
>> big mess. I moved all images, css and js into their own directories. 
>> Unfortunatly this broke templates that reference images directly. As 
>> cForms are not stable I wouldn't care about this (it won't be the last 
>> thing that changes until we mark cForms as stable) and simply add a 
>> release note but if others think different, I could add an additional 
>> pipeline for gifs.
> 
> 
> 
> As the number of resources is growing, it is good to organize them and 
> creating subdirectories is ok. However, we must keep them under a single 
> root resource dir to allow a simple <map:read> to serve any of these 
> resources.

I agree

> 
> Too often I see sitemaps having a myriad of simple match/read for *.gif, 
> *.jpeg, *.js, *.css, etc when a simple <match pattern="resources/**"> 
> would do the job.
> 
> Also, now that these resources have stabilized, we may move them into 
> the cform's jar, in order to avoid copy/pasting them in every project. 
> The resources pipeline would then become:
> 
> <map:match pattern="form-rsrc/**">
>  <map:read src="resource://org/apache/cocoon/forms/resources/{1}"/>
> </map:match>
> 
> WDYT?

This is good for our users who don't have to copy around things and upgrading 
between Cocoon releases should become easier for them.
For developers working on e.g. the stylesheets this only requires one change so 
that map:read points directly to their SVN source tree.

Another question: currently all XSLTs are in the base directory of resources. As 
we only support HTML at the moment, this is not a problem.  But where do we put 
e.g. a XUL stylesheet so that we don't end up in a big mess?

I propose

/resources
/resources/stylesheets
/resources/stylesheets/html
/resources/stylesheets/xul
/resources/stylesheets/lazlo
/resources/img
/resources/js
...

WDYT?

-- 
Reinhard

Re: Cleanup forms/samples/resources

Posted by Sylvain Wallez <sy...@apache.org>.
Reinhard Poetz wrote:

>
> After working a lot with cForms the last week I was fed up by looking 
> at the resources directory and always having a sense of staring at a 
> big mess. I moved all images, css and js into their own directories. 
> Unfortunatly this broke templates that reference images directly. As 
> cForms are not stable I wouldn't care about this (it won't be the last 
> thing that changes until we mark cForms as stable) and simply add a 
> release note but if others think different, I could add an additional 
> pipeline for gifs.


As the number of resources is growing, it is good to organize them and 
creating subdirectories is ok. However, we must keep them under a single 
root resource dir to allow a simple <map:read> to serve any of these 
resources.

Too often I see sitemaps having a myriad of simple match/read for *.gif, 
*.jpeg, *.js, *.css, etc when a simple <match pattern="resources/**"> 
would do the job.

Also, now that these resources have stabilized, we may move them into 
the cform's jar, in order to avoid copy/pasting them in every project. 
The resources pipeline would then become:

<map:match pattern="form-rsrc/**">
  <map:read src="resource://org/apache/cocoon/forms/resources/{1}"/>
</map:match>

WDYT?

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }


Cleanup forms/samples/resources

Posted by Reinhard Poetz <re...@apache.org>.
After working a lot with cForms the last week I was fed up by looking at the 
resources directory and always having a sense of staring at a big mess. I moved 
all images, css and js into their own directories. Unfortunatly this broke 
templates that reference images directly. As cForms are not stable I wouldn't 
care about this (it won't be the last thing that changes until we mark cForms as 
stable) and simply add a release note but if others think different, I could add 
an additional pipeline for gifs.

--
Reinhard

reinhard@apache.org wrote:
> Author: reinhard
> Date: Sat Nov 27 07:49:51 2004
> New Revision: 106730
> 
> URL: http://svn.apache.org/viewcvs?view=rev&rev=106730
> Log:
> update directory paths
> Modified:
>    cocoon/trunk/src/blocks/forms/samples/forms/dynamicrepeater_template.xml
>    cocoon/trunk/src/blocks/forms/samples/forms/tasktree_template.xml
> 
> Modified: cocoon/trunk/src/blocks/forms/samples/forms/dynamicrepeater_template.xml
> Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/forms/samples/forms/dynamicrepeater_template.xml?view=diff&rev=106730&p1=cocoon/trunk/src/blocks/forms/samples/forms/dynamicrepeater_template.xml&r1=106729&p2=cocoon/trunk/src/blocks/forms/samples/forms/dynamicrepeater_template.xml&r2=106730
> ==============================================================================
> --- cocoon/trunk/src/blocks/forms/samples/forms/dynamicrepeater_template.xml	(original)
> +++ cocoon/trunk/src/blocks/forms/samples/forms/dynamicrepeater_template.xml	Sat Nov 27 07:49:51 2004
> @@ -71,22 +71,22 @@
>                          <!-- Don't display the "move up" button on the first row -->
>                          <jx:choose>
>                            <jx:when test="${repeaterLoop.first}">
> -                            <img src="resources/blank_btn.gif"/>
> +                            <img src="resources/img/blank_btn.gif"/>
>                            </jx:when>
>                            <jx:otherwise>
>                              <ft:widget id="up">
> -                              <fi:styling type="image" src="resources/move_up.gif"/>
> +                              <fi:styling type="image" src="resources/img/move_up.gif"/>
>                              </ft:widget>
>                            </jx:otherwise>
>                          </jx:choose>
>                          <!-- Don't display the "move down" button on the first row -->
>                          <jx:choose>
>                            <jx:when test="${repeaterLoop.last}">
> -                            <img src="resources/blank_btn.gif"/>
> +                            <img src="resources/img/blank_btn.gif"/>
>                            </jx:when>
>                            <jx:otherwise>
>                              <ft:widget id="down">
> -                              <fi:styling type="image" src="resources/move_down.gif"/>
> +                              <fi:styling type="image" src="resources/img/move_down.gif"/>
>                              </ft:widget>
>                            </jx:otherwise>
>                          </jx:choose>
> 
> Modified: cocoon/trunk/src/blocks/forms/samples/forms/tasktree_template.xml
> Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/forms/samples/forms/tasktree_template.xml?view=diff&rev=106730&p1=cocoon/trunk/src/blocks/forms/samples/forms/tasktree_template.xml&r1=106729&p2=cocoon/trunk/src/blocks/forms/samples/forms/tasktree_template.xml&r2=106730
> ==============================================================================
> --- cocoon/trunk/src/blocks/forms/samples/forms/tasktree_template.xml	(original)
> +++ cocoon/trunk/src/blocks/forms/samples/forms/tasktree_template.xml	Sat Nov 27 07:49:51 2004
> @@ -71,10 +71,10 @@
>          <div class="section">
>            <ft:struct id="task">
>              <span class="actions">
> -              <ft:widget id="down"><fi:styling type="image" src="resources/move_down.gif"/></ft:widget>
> -              <ft:widget id="up"><fi:styling type="image" src="resources/move_up.gif"/></ft:widget>
> -              <ft:widget id="delete"><fi:styling type="image" src="resources/delete.gif"/></ft:widget>
> -              <ft:widget id="add"><fi:styling type="image" src="resources/new.gif"/></ft:widget>
> +              <ft:widget id="down"><fi:styling type="image" src="resources/img/move_down.gif"/></ft:widget>
> +              <ft:widget id="up"><fi:styling type="image" src="resources/img/move_up.gif"/></ft:widget>
> +              <ft:widget id="delete"><fi:styling type="image" src="resources/img/delete.gif"/></ft:widget>
> +              <ft:widget id="add"><fi:styling type="image" src="resources/img/new.gif"/></ft:widget>
>              </span>
>              Title: <ft:widget id="title"/>
>              From <ft:widget id="start"><fi:styling size="10"/></ft:widget>
> @@ -99,7 +99,9 @@
>              </ft:repeater-widget>
>            </jx:when>
>            <jx:otherwise>
> -            <ft:widget id="addsub"/>
> +            <ft:widget id="addsub">
> +	      <fi:styling type="link"/>
> +	    </ft:widget>
>            </jx:otherwise>
>          </jx:choose>
>        </ft:class>
>