[daisy] Create new site from wiki interface
Marc Portier
mpo at outerthought.org
Tue Sep 11 08:53:01 CDT 2007
Parisi, Lou wrote:
> I am working on a proof of concept for a project management CMS using
> daisy. When a new project is started, I have a defined set of documents
> I want to populate into a new site. I have been able to generate the
> documents in an existing site but now I want to create a project
> management site where one of the tasks that can be performed is to
> create a new site with the populated blank documents using a form to
> collect the information necessary to create the site. I have been
> working on this and am using the repository manager to create a new
> collection and this works but the collection is not visible in the daisy
> home site list. I have also looked at the code for
> org.outerj.daisy.install.DaisyWikiAddSite. It seems the main difference
> between what DaisyWikiAddSite code does and what I am doing is to create
> the site directory and add the siteconf.xml to the directory.
>
>
good observation
>
> I am still new to Daisy and have a few questions about this.
>
>
>
> Question 1: It seems there is a distinction between a collection and a
> site. It appears the difference is that a site has a site directory but
> a collection does not. Is this correct? If so, how is a collection
> used if it is not a site?
>
collections live on the repository side and are to be seen as some tag
on your document grouping them together somewhat (You manage them
through the collection-manager, you assign them to documents)
You can use these in any way you like: editors are to assign to which
collection a document belongs and all sorts of queries and stuff can be
taking that into account. (e.g. ACL does, search does, ...)
a 'site' however is a concept that is not known on the repository (e.g.
you cannot have a query looking for documents belonging to a site) but
only exist at the level of the wiki-frontend. (These are indeed created
by having a directory with siteconf.xml in the dsy-wiki/sites )
There is a subtle link between the two: the siteconf.xml points to a
default collection for that 'site', the effect of this is:
- new documents created through this site will be automatically in this
collection
- full-text-search results (and similar lookups in the editor-dialogs)
will be automatically limited to the site's collection
- ... etc
So again: above describes how the wiki (=just a repository-client) uses
the repository concept of 'collection' inside its own wiki-concept 'site'
This usage suggests a one on one between site and collection (And
confirmed by the init-site procedure you've been looking into, since
that creates both at once.)
Note however that this no must: e.g. in multilingual setups you would
have one site per language and _all_ of them keeping documents in the
same collection.
So for you're case you are actually free to choose:
- will you keep all documents on all projects in one repository and let
all 'sites' use that common collection. In which case you'll probably
need to introduce some other field to link it to the correct projects.
By making that field multivalue or not you can control of documents can
be linked to more then one project or not.
- or will you indeed create separate collections and use that to group
documents of certain projects together (note: here you have no choice:
collections _are_ multi-value tags on documents, so you'll always be
able to store on document in multiple collections)
- you might even consider not to make multiple sites... but structure
the info all on one 'site' and play around with subnavigations and stuff
- ....
pretty timtowdi as you seen, one of the approaches is likely to have
natural fit with your case...
>
>
> Question 2: Is it possible to create a full-fledged site using
> javascript through the wiki front-end or does this have to be done by an
> external script calling a java class? If it can’t be done through
> javascript through daisy, is it possible to accomplish the same thing by
> creating a Servlet that the form called to write to the filesystem or
> possibly an applet embedded in a document?
>
the 'site' being a daisy-wiki feature I would go for hosting the code
for creating that directory as a daisy-wiki extension... (that will have
access to ths dsy-wiki directory where the action is to happen)
- applets run on the client: unlikely you can reach dsy-wiki directory there
- daisy.js scripts pretty much have the same issue (although you could
execute those on the server as well, they keep being 'client' apps)
- servlets are the best candidates from your list, but you might find
that writing a cocoon-based flowscript extension (javascript again) for
this is a far easier approach
from the same script you'll be able to create the collection and all
necessary documents
you'ld want to read up on this:
http://cocoondev.org/daisydocs-2_1/374-cd/60-cd.html
(and sections below)
good luck, and please report back
(my guess is this is useful for more people that might be willing to
chime in, or at least just snatch your results :-))
regards,
-marc=
More information about the daisy
mailing list