source structure

2 views
Skip to first unread message

Wouter

unread,
Jun 16, 2011, 9:15:39 AM6/16/11
to XTF Developer list
Dear developers,

I have been looking at the code-base of XTF recently. I have a couple
of questions; perhaps there are simple answers to them.

I noticed that XTF is very customizable. What I however would like to
do is to use XTF for multiple internal projects (and have multiple
configurations). Each project has its own layout of the webpages, its
own data repository and document structure, and its own search
parameters/facets. I've seen an option to 'brand' each collection.
However, it seems that 'branding' is intended to style various
collections, and is not intended to maintain several 'projects' within
XTF. Is there a easy way to define multiple 'projects'?

Another question is about the structure of the source-code; is there a
rationale behind putting the 'src' and 'contrib' folders inside the
'WEB-INF' folder?

And the last question is the contents of the WAR-file that is produced
by the build script. The indexing-scripts and the javadocs seem to be
included in the WAR-file, and many stylesheet files that are used
server-side can be accessed via the browser (and are not hidden under
WEB-INF). Are these files put in the WAR-file intentionally?

I noticed that great care has been taken in backwards compatibility,
so I assume the answers have something to do with this compatibility
constraint. However, it would be helpful for me to understand how the
XTF software is intended to be used. So if anyone could comment on the
questions above, I would appreciate it.

Kind regards,
Wouter

Martin Haye

unread,
Jun 17, 2011, 5:06:41 PM6/17/11
to xtf-...@googlegroups.com
Hi Wouter,

Answers inline below...

On 6/16/11 6:15 AM, "Wouter" <wouter...@gmail.com> wrote:

>Dear developers,
>
>I have been looking at the code-base of XTF recently. I have a couple
>of questions; perhaps there are simple answers to them.

Great! Welcome to the code.

>I noticed that XTF is very customizable. What I however would like to
>do is to use XTF for multiple internal projects (and have multiple
>configurations). Each project has its own layout of the webpages, its
>own data repository and document structure, and its own search
>parameters/facets. I've seen an option to 'brand' each collection.
>However, it seems that 'branding' is intended to style various
>collections, and is not intended to maintain several 'projects' within
>XTF. Is there a easy way to define multiple 'projects'?

Generally it's easier to just have multiple instances of XTF, one per
project. If you're into Mercurial or Git you can even put them on separate
branches and then periodically merge in from the trunk to deploy changes
to all at once. But that's beyond our scope here.

You can certainly put them all together in one instance, with appropriate
switching logic in docSelector and queryRouter to point to
instance-specific stylesheets to do the rendering. It is some added
complexity; the benefit is that you can, when you choose, implement a
search across *all* the collections at the same time. That can be nice; it
depends really on your requirements.

>Another question is about the structure of the source-code; is there a
>rationale behind putting the 'src' and 'contrib' folders inside the
>'WEB-INF' folder?

This is mostly a historical artifact. At one point I was really
enthusiastic about trying to contribute the significant changes XTF makes
to Lucene back into Lucene itself. So I restructured the code to isolate
XTF-independent stuff into the "contrib" directory, in hopes that we could
get all or part of that directory incorporated into Lucene and then get
rid of the directory. That never happened, mostly because I didn't (and
don't now) know how to navigate the human aspect of open source projects.
So it never went anywhere, and we're stuck with this rather
arbitrary-seeming division of code.

>And the last question is the contents of the WAR-file that is produced
>by the build script. The indexing-scripts and the javadocs seem to be
>included in the WAR-file, and many stylesheet files that are used
>server-side can be accessed via the browser (and are not hidden under
>WEB-INF). Are these files put in the WAR-file intentionally?

They all need to be in the .war file; I think what you're asking is why
they're not inside WEB-INF. Good question, and I think again it's a
historical artifact. When we first built the system we didn't think too
much about security protections. That said, you can implement Tomcat
configuration (or maybe web.xml?) to protect things explicitly. I haven't
done it but I'm told it can be done.

>I noticed that great care has been taken in backwards compatibility,
>so I assume the answers have something to do with this compatibility
>constraint. However, it would be helpful for me to understand how the
>XTF software is intended to be used. So if anyone could comment on the
>questions above, I would appreciate it.

Yes, backwards compatibility is and will be a requirement for us. It would
stop us from, for instance, moving all the stylesheets into WEB-INF. It
wouldn't really stop us from re-integrating the code, since we only
concern ourselves with *stylesheet* compatibility, not Java-level
compatibility; inertia is what keeps the code where it is.

If you have more questions, feel free to ask more!

--Martin

Reply all
Reply to author
Forward
0 new messages