Andreas Hartmann schrieb:
Michael Wechner schrieb:
Andreas Hartmann wrote:
Hi Lenya devs,
currently, the only available LinkManager implementation is the
ContentLinkManager. When you ask it to return all links that point to
a particular document, it parses all (!) other documents in the same
area and extracts the links based on the link XPaths of the resource
type. As you can imagine that can take a while, especially in large
publications. I expericened this with the docu publication. If you
want to decativate a page, you can fetch a coffee in the meantime,
and even drink it (at least if it's an espresso).
In a discussion on the Jackrabbit mailing list, Bertrand Delacretaz
suggested to extract all links that are contained in a document
before saving it,
I guess you mean rather just after it has been saved successfully, right?
Saved in the sense of committed to the file system. The extraction
happens in Persistable.save(), which is called right before
Transactionable.save() in Session.commit(), which writes the content
from the in-memory session to the file system. This happens only after
successful validation when you use the standard Lenya editors.
BTW, an implication of this approach is that the MetaDataLinkManager
doesn't find any new links that were added in the current session. And
it still finds old links that were removed in the current session. Do
you think this is acceptable? Another option might be to use a
persistent map which maps each document to all referencing documents.
-- Andreas
-- Andreas
and store them in the meta data. Now, since all Lenya meta data are
indexed, this link list can be used for a Lucene search. The query
looks like this (special characters have to be escaped):
\{http\://apache.org/lenya/metadata/link/1.0\}outgoingLinks:lenya\-document\:1aca68c0\-0243\-11dd\-881a\-f3cc793eb58e\*
The name of the meta data field is
{http://apache.org/lenya/metadata/link/1.0}outgoingLinks
The term value is
lenya-document:1aca68c0-0243-11dd-881a-f3cc793eb58e*
Note the wildcard at the end of the term value. It includes URLs with
an attached language or publication parameter. The link manager uses
some post-search checks to verify that only the actually linked
documents are listed (conforming to the declared LinkResolver
implementation).
With the MetaDataLinkManager, the deactivate screen appears virtually
immediately. I guess this scales nicely with large number of
documents (as good as Lucene scales). If you have an index spanning
multiple publications, you can even detect links from other
publications.
I have the MetaDataLinkManager in my local sandbox. It depends on the
search API which I have posted on the user list. If you want to take
a closer look at the classes, I can upload a ZIP somewhere, or maybe
I can extract a patch.
that would be great
Replacing the ContentLinkManager with the MetaDataLinkManager would
require to "touch" all documents so that the links are extracted
(they are indexed automatically when the session is committed).
Is anybody interested in this feature?
sure, I think it would be a great improvement
Cheers
Michael
-- Andreas
--
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]