Andreas Hartmann wrote:
Michael Wechner wrote:
Andreas Hartmann wrote:
Michael Wechner wrote:
[...]
The major problem of Lenya 1.4 is that Lenya forces you to accept a
specific
data structure
This is not true. You can implement custom NodeFactory classes to
support arbitrary storage facilities. The current refactoring has the
goal to make it clearer how to extend the core with custom
functionality.
ok. How can this be done? Can you give me a pointer?
One example is the JCRNodeFactory in the jcrsource module. It returns
JCRSourceNode objects, which use JCR sources to store the content:
/**
* @see org.apache.lenya.cms.repository.SourceNode#getRealSourceURI()
*/
protected String getRealSourceURI() {
String path = this.sourceUri.substring(LENYA_PROTOCOL.length());
return "jcr://" + path;
}
You can implement a custom NodeFactory which returns custom Node objects.
You don't even have to use sources but can implement arbitrary node
classes, e.g. Node.getInputStream() and Node.getOutputStream() can
use arbitrary files to store the content, depending on the source URI.
There are some restrictions (yet?):
- The node has no access to the document it belongs to, since nodes
are generally used (also by sitetrees etc.).
- The node factory can't be determined based on the resource type.
but this is what I would like to accomplish ;-) How can we make this
dependent
on the resource type?
Thanks
Michi
--
Michael Wechner
Wyona - Open Source Content Management - Apache Lenya
http://www.wyona.com http://lenya.apache.org
[EMAIL PROTECTED] [EMAIL PROTECTED]
+41 44 272 91 61
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]