Thorsten Scherler wrote:
El lun, 20-03-2006 a las 11:23 +0100, Andreas Hartmann escribió:
Thorsten Scherler wrote:
El lun, 20-03-2006 a las 10:28 +0100, Andreas Hartmann escribió:
Michael Wechner wrote:
Thorsten Scherler wrote:
[...]


I came up with nearly the same config, so yeah +1 to add it in the
config, but the only problem is that one need to patch the conf when
adding a new resource type. That is not that nice.
Why?
http://svn.apache.org/viewcvs?rev=386656&view=rev
You would need to add new resource types here.
Hmmm, why would you need to add resource types there?
Isn't it sufficient to reference registered resource types?

Are they registered with extension? If so, how can I lookup the resource
type with an extension ?

I don't think that it makes sense to define a global mapping from
extensions to resource types. For instance, a lot of resource types
might support the extension ".xml". We could add a method

    ResourceType.getSourceExtensions()

but I'd discourage even that.

IMO resource types and source extensions should be completely
separated. The internal storage of a document is entirely up
to the repo implementation. Recognizing WebDAV documents is a
different story.


Is there a simpler way?

Could be overcome with a centralized registration.

at the moment it's a problem recognizing resource types anyway ;-)
What is the problem with recognizing resource types?

Well, webDAV PUT is adding just a file e.g. index.xml, that could be a
forrest xdoc or a xhtml or ... How can we determine this?
Well, that's a general problem, it is not related to the resource
type recognition. You can't determine the type of a file in a
generic way without meta information. I see two options:

1) explicit mapping (that's what you do)

2) ask all resource types: Does this file belong to you?

The second option has the advantage that it doesn't require any
special WebDAV configuration. But I guess it is hard to implement.


Well one could use something like the resource type action to determine
it for xml files.

What do you mean with "resource type action"?

I imagine something like

ResourceType[] types = resourceTypeManager.getResourceTypes();

for (int i = 0; i < types.length; i++) {

    if (types[i].isSource(webdavSource)) {
        import(webdavSource, types[i]);
    }

}


-- Andreas

--
Andreas Hartmann
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
[EMAIL PROTECTED]                     [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to