You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Richard Cunliffe <ri...@cunliffe.net> on 2003/03/11 15:56:22 UTC

Images - Lets get this straight

Geoff,

Ok we are going to get this sorted!

My directory structure looks like this:

C:\tomcat\webapps\cocoon\soundpool\images\musicnews.gif

C:
  |-Program Files
       |-Apaache Group
  		|- ...
  |-tomcat
       |-webapps
		|-cocoon
              \sitemap.xmap
			|-soundpool
			  \sitemap.xmap
				|-images
					\musicnews.gif


I have put the following code into my MAIN sitemap which is located in
the cocoon directory:

-------------------------------------------------------------
		<!-- soundpool Folder -->
		<map:pipeline>
			<map:match pattern="soundpool/**">
				<map:mount check-reload="yes"
reload-method="synchron" src="soundpool/sitemap.xmap"
uri-prefix="soundpool"/>	
			</map:match>
		</map:pipeline>
-------------------------------------------------------------


This tells cocoon where my soundpool folder is and its sitemap.

I then have the soundpool sitemap in the soundpool folder.


In the Apache httpd file the only code I have added is:

-------------------------------------------------------------
JkMount /examples ajp13
JkMount /examples/* ajp13

JkMount /jk ajp13
JkMount /jk/* ajp13

JkMount /cocoon ajp13
JkMount /cocoon/* ajp13
-------------------------------------------------------------


Now my readers in my soundpool sitemap look like this, with my current
directory set up:


-------------------------------------------------------------
	<!-- images Readers -->

		<map:match pattern="soundpool/images/*.gif">
			<map:read mime-type="image/gif"
src="soundpool/images/{1}.gif"/>
		</map:match>

		<map:match pattern="soundpool/images/*.jpg">
			<map:read mime-type="image/jpg"
src="soundpool/images/{1}.jpg"/>
		</map:match>
-------------------------------------------------------------


The above code is within my pipeline in the soundpool sitemap. I also
have put the following code in the components section:


-------------------------------------------------------------
	<map:readers default="resource">
 	 <map:reader logger="sitemap.reader.resource" name="resource"
pool-max="32"
 
src="org.apache.cocoon.reading.ResourceReader"/>
	</map:readers>

	</map:components>
-------------------------------------------------------------

Finally in my xsl file I have referenced the image like so:

-------------------------------------------------------------
<body background="soundpool/images/musicnews.gif">
-------------------------------------------------------------

So I have done (I think) everything you have suggest.

Can you check to see if I have?

Note: Look at the live site through Internet Explorer, as the Netscape
version is currently set to PDA version, which needs a lot of work. If
you don't have IE I can change them around.


Thank you,

Richard.






---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Images - Lets get this straight

Posted by Niclas Hedhman <ni...@internuscorp.com>.
On Tuesday 11 March 2003 22:56, Richard Cunliffe wrote:

Richard,

IMHO, you have a whole set of problems, and inadequate analysis behind each. 
And the only way to sort things out is a systematic check from top to bottom.

If we start at the Apache Webserver httpd.conf.

> In the Apache httpd file the only code I have added is:
>
> -------------------------------------------------------------
> JkMount /examples ajp13
> JkMount /examples/* ajp13
>
> JkMount /jk ajp13
> JkMount /jk/* ajp13
>
> JkMount /cocoon ajp13
> JkMount /cocoon/* ajp13
> -------------------------------------------------------------

The /cocoon/ mounting will connect the Web server with Tomcat, and in the 
process /cocoon/ is stripped, and the rest is passed to Tomcat.

If you have not changed the default config of Tomcat, then Tomcat will have 
the cocoon app mounted at its /cocoon/ URL, i.e. you will need;
http://www.cunliffe.net/cocoon/cocoon/soundpool/ to reach the directory

-- o --

The changing of image, as I suggested, shows that you are not getting what you 
are seeing, i.e. the browser is caching images. My suggestion was to actually 
change the image, without changing the name, and you would see the still "old 
image".

-- o --

It is now time for you to decide what you want to do.
Do you want to use Apache Webserver as the front end? (Recommended)
Do you want Apache WS, Tomcat or Cocoon to serve the static content (WS 
recommended)?
How do you want your URL space divided?

It is then a matter of systematic configuration, from top to bottom, with 
verification of each step.

I have a pretty straight forward setup. Apache WS is the frontend, Tomcat is 
acting as a Cocoon-only container, mounted at /site/.

In httpd.conf;
JkMount /site/* worker1
JkWorkersFile /home/tomcat/conf/workers.properties
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories

In /home/tomcat/conf/workers.properties

worker.list=worker1
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009
worker.worker1.lbfactor=50
worker.worker1.cachesize=10
worker.worker1.cache_timeout=600
worker.worker1.socket_keepalive=1
worker.worker1.socket_timeout=300

Now (after restart?), make sure that you get the Tomcat greeting page when 
accessing the /site/ URL, making sure that ApacheWS -> Tomcat works.


In Tomcat's server.xml I changed the ROOT context under
<Context path="" reloadable="true" docBase="/home/cocoon/site" debug="0"/>


And in /home/cocoon/site/ there is the cocoon sitemap, and so on.


I hope this should get you on the right track.

Niclas

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Images - Lets get this straight

Posted by Geoff Howard <co...@leverageweb.com>.
At 09:56 AM 3/11/2003, you wrote:
>Geoff,
>
>Ok we are going to get this sorted!
>
>My directory structure looks like this:
>
>C:\tomcat\webapps\cocoon\soundpool\images\musicnews.gif
>
>C:
>   |-Program Files
>        |-Apaache Group
>                 |- ...
>   |-tomcat
>        |-webapps
>                 |-cocoon
>               \sitemap.xmap
>                         |-soundpool
>                           \sitemap.xmap
>                                 |-images
>                                         \musicnews.gif
>

Aha. See below.  Do you happen to have background.gif in the apache doc 
root tree by the way?


>I have put the following code into my MAIN sitemap which is located in
>the cocoon directory:
>
>-------------------------------------------------------------
>                 <!-- soundpool Folder -->
>                 <map:pipeline>
>                         <map:match pattern="soundpool/**">
>                                 <map:mount check-reload="yes"
>reload-method="synchron" src="soundpool/sitemap.xmap"
>uri-prefix="soundpool"/>
>                         </map:match>
>                 </map:pipeline>
>-------------------------------------------------------------

<snip/>

>Now my readers in my soundpool sitemap look like this, with my current
>directory set up:
>
>
>-------------------------------------------------------------
>         <!-- images Readers -->
>
>                 <map:match pattern="soundpool/images/*.gif">
>                         <map:read mime-type="image/gif"
>src="soundpool/images/{1}.gif"/>
>                 </map:match>
>
>                 <map:match pattern="soundpool/images/*.jpg">
>                         <map:read mime-type="image/jpg"
>src="soundpool/images/{1}.jpg"/>
>                 </map:match>
>-------------------------------------------------------------


Wrong: your map:mount uses uri-prefix="soundpool" (this may need to be 
"soundpool/").

So your matchers here need to be pattern="images/*.gif" and likewise for *.jpg
See http://wiki.cocoondev.org/Wiki.jsp?page=UnderstandingCocoonMounts.

Also, the src will need to be relative to the mounted dir (whether you keep 
uri-prefix or not) - so src="images/{1}.jpg"

Isn't this like what you are using for the html?


>The above code is within my pipeline in the soundpool sitemap. I also
>have put the following code in the components section:
>
>
>-------------------------------------------------------------
>         <map:readers default="resource">
>         <map:reader logger="sitemap.reader.resource" name="resource"
>pool-max="32"
>
>src="org.apache.cocoon.reading.ResourceReader"/>
>         </map:readers>
>
>         </map:components>
>-------------------------------------------------------------

Right.


>Finally in my xsl file I have referenced the image like so:
>
>-------------------------------------------------------------
><body background="soundpool/images/musicnews.gif">
>-------------------------------------------------------------

Right if you don't want them served by cocoon (in which case, ignore 
everything above - you don't need it)

To have this come from cocoon, use ="cocoon/soundpool/images/musicnews.gif" 
with the changes noted above.

>Note: Look at the live site through Internet Explorer, as the Netscape
>version is currently set to PDA version, which needs a lot of work. If
>you don't have IE I can change them around.
I've been using IE. 


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org