cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Upayavira ...@upaya.co.uk>
Subject Re: CLI - Problems with URI ending with / (with a code fix inlined)
Date Fri, 17 Oct 2003 14:25:33 GMT
Rolf,

Again, well spotted. I've committed your fix.

[For some reason, I'm not getting list emails - I just happened to see 
these on the archives :-( ]

Regards, Upayavira

Hello,

when using CLI to generate offline pages I get problems if my "in site"
uris end with /. In the following lines I describe the scenario and
small code fix to my problem. Maybe I could have achieved what I want
without that fix maybe not. Here we go.

Scenario:

Some uris in my site are
	- service/
	- contact/
	- etc/
	
I access the homepage for example with http//www.mysite.com/ and a page
with http//www.mysite.com/service/ .

I want CLI to generate the following files and directories in the
destination directory:

-	index.html
-	service/index.html
-	contact/index.html
-	.....

but I get:

-	index.html
-	service/index
-	contact/index
-	.....

CLI is in this case not using my <default-filename> specified in xconf
file, which is "index.html". It uses the one defined in Constants.java.

I tracked this down to a code snippet in class
org.apache.cocoon.bean.Target in method getDerivedTarget(...).

In that method you will find a code snippet like this:

-------- snippet ------------
	 Target target = new Target(this.type, this.root, linkURI,
this.destURI);
        target.setOriginalURI(originalLinkURI);
        target.setParentURI(this.sourceURI);
        target.setConfirmExtension(this.confirmExtension);
        target.setFollowLinks(this.followLinks);
        target.setLogger(this.logger);
        return target;
-------- end of snippet ------------

I think the following line is missing before the return statement:

	target.setDefaultFilename(this.defaultFilename);


Inserting that line and a recompile did the trick for me.


May be I have done some other thinsg wrong....but maybe it works for
you, too.


If someone is asking why I want urls to end with /, here is a reason:

I want to keep my uris, which are a user interface for me, independant
from the implementation of site pages. So I do not want my uris end with
.html .


I'm new to cocoon and I want to say:

Cocoon is really great software. Many thanks to all developers and
contrrbutors and other supporting people for it.




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


Mime
View raw message