Drasko Kokic wrote:
> 
> Okay ... after a small (but very eficient) chat with
> javaguru ... I have identified background information
> about the way where the generated java file is being
> created:
> 
> It seams that the informtion suplied in the src
> atribute of the generate element is used to define
> where (relative to .../org/apache/cocoon/www) the file
> will be created.
> 
> There is a possibility in a multiple sub-sitemaps
> environment to have same "relative paths" for diferent
> XSP's in different sub-sitemaps.  This means that
> either the files will overwrite each other all the
> time or (even worse) be mistaken!!!


The generated class files are placed in a main package
which you can override in cocoon.xconf.  By default, it
is the package org.apache.cocoon.www.  From this point,
all class names and sub packages are generated from the
filename of the source document itself.  In fact, the
extension is made part of the class name.  For example,
the root sitemap.xmap file will be generated into:

org.apache.cocoon.www.sitemap_xmap;

If you have two other sitemaps that vary only by extension
(for instance .map, and .alt) they will have a unique file
and class name:

org.apache.cocoon.www.sitemap_map;
org.apache.cocoon.www.sitemap_alt;

Also, since the actual class/filename is derived from the
context directory, the sub directories are treated as
sub-packages, and illegal characters are transformed into
an '_' character.

The only potential conflict that remains then is one where
you have two identically named files in the same directory
that differ by using a period (.) instead of a hyphen (-).
Niether of these characters are legal class name characters.
For example, we can have the following files: file-one.xsp
and file.one.xsp:

org.apache.cocoon.www.docs.file_one_xsp; // docs/file-one.xsp
org.apache.cocoon.www.docs.file_one_xsp; // docs/file.one.xsp

It is theorhetically possible--however the circumstances to
create it would require a developer who doesn't give a flying
leap about maintainance.  Since Contexts cannot be written to
by an outside user, we are safe from this approach.



> 
> Please, could somebody give some light on this
> problem?!
> 
> TIA
> Drasko
> 
> --- Drasko Kokic <[EMAIL PROTECTED]> wrote:
> > Hello again,
> >
> > can anybody tell me what is the path/filename rule
> > applied when a java file is being generated from the
> > XSP?!
> >
> > TIA
> > Drasko
> >
> > --- Drasko Kokic <[EMAIL PROTECTED]> wrote:
> > > I think I have found something very strange in the
> > > way
> > > Java files are being generated from the XSP files.
> > >
> > > I have situation like described in the attached
> > > email.
> > >  There is a main sitemap and a sub-sitemap for the
> > > sub-URI LOOP.
> > >
> > > In the LOOP sub-sitemap I have the following code:
> > >
> > >    <map:match pattern="Index">
> > >     <map:generate type="serverpages"
> > > src="index.xsp"/>
> > >     <map:transform src="index-html.ss"/>
> > >     <map:serialize type="html"/>
> > >    </map:match>
> > >
> > > I don't understand why is the Java file
> > > index_xsp.java
> > > generated under the www directory and not under
> > > www/LOOP directory???
> > >
> > > Anybody care to explain how XSP and sitemap work
> > > together.
> > >
> > > TIA
> > > Drasko
> > >
> > > --- Drasko Kokic <[EMAIL PROTECTED]> wrote:
> > > > Hello everybody,
> > > >
> > > > this is already the second time I am getting
> > > stucked
> > > > with this problem.  Unfortunately the first time
> > I
> > > > have "solved" the problem in untraceble way :-(
> > > >
> > > > I am using submaps like following
> > > >
> > > > context = KontoCheck
> > > > submap  = LOOP
> > > >
> > > > this creates properly the sitemap_xmap.java in
> > the
> > > >  blabla...KontoCheck/org/apache/cocoon/www
> > > > as well as in the subdirectory LOOP.
> > > > Both get compiled and things work fine.
> > > >
> > > > BUT ...
> > > >
> > > > after I have configured the LOOP submap to serve
> > > the
> > > > URI SingleLogin/CheckIn I am getting the
> > > > ClassNotFoundException.
> > > >
> > > > Looking into the work directory I can see that
> > > under
> > > > the www directory there is SingleLogin
> > > subdirectory
> > > > containing the java file generated thrue XSP.
> > ONLY
> > > > THERE IS NO CLASS FILE.
> > > >
> > > > How is it possible to fix this problem?  What is
> > > > causing this misbehaviour?
> > > >
> > > > TIA
> > > > Drasko
> > > >
> > > >
> > > >
> > __________________________________________________
> > > > Do You Yahoo!?
> > > > Get personalized email addresses from Yahoo!
> > Mail
> > > > http://personal.mail.yahoo.com/
> > > >
> > > >
> > >
> >
> ---------------------------------------------------------------------
> > > > Please check that your question has not already
> > > been
> > > > answered in the
> > > > FAQ before posting.
> > > > <http://xml.apache.org/cocoon/faqs.html>
> > > >
> > > > To unsubscribe, e-mail:
> > > > <[EMAIL PROTECTED]>
> > > > For additional commands, e-mail:
> > > > <[EMAIL PROTECTED]>
> > > >
> > >
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Get personalized email addresses from Yahoo! Mail
> > > http://personal.mail.yahoo.com/
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > Please check that your question has not already
> > been
> > > answered in the
> > > FAQ before posting.
> > > <http://xml.apache.org/cocoon/faqs.html>
> > >
> > > To unsubscribe, e-mail:
> > > <[EMAIL PROTECTED]>
> > > For additional commands, e-mail:
> > > <[EMAIL PROTECTED]>
> > >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Get personalized email addresses from Yahoo! Mail
> > http://personal.mail.yahoo.com/
> >
> >
> ---------------------------------------------------------------------
> > Please check that your question has not already been
> > answered in the
> > FAQ before posting.
> > <http://xml.apache.org/cocoon/faqs.html>
> >
> > To unsubscribe, e-mail:
> > <[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> > <[EMAIL PROTECTED]>
> >
> 
> __________________________________________________
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/
> 
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> 
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail: <[EMAIL PROTECTED]>

S/MIME Cryptographic Signature

Reply via email to