You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Rolf Kulemann <ma...@rolf-kulemann.com> on 2003/10/17 16:08:35 UTC

CLI - Problems with URI ending with / (with a code fix inlined)

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.



-- 
Rolf Kulemann

The individual choice of garnishment of a burger can be an important
point to the consumer in this day when individualism is an increasingly
important thing to people.
		-- Donald N. Smith, president of Burger King


PGP/GPG public key:
	 http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x6B4EA7EA


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