Thorsten Scherler wrote:
El vie, 17-03-2006 a las 11:23 +0100, Michael Wechner escribió:
Thorsten Scherler wrote:
El jue, 16-03-2006 a las 13:51 +0000, [EMAIL PROTECTED] escribió:
...
-
- // TODO allow to create other docs than xhtml
- resourceType = (ResourceType) selector.select("xhtml");
- documentManager.add(document, resourceType, "xml",
doc.getName(), true, null);
+
+ if("xml".equals(extension)){
+ // FIXME allow to create other docs than xhtml - but
how?
+ resourceType = (ResourceType) selector.select("xhtml");
+ }else{
+ // FIXME the following works only if the resource typ is called like the extension but normally
+ // that is not the case maybe there is a way to store which extension a resource type is
+ // treating and lookup a hashMap to get the real name via the extension
+ if (selector.isSelectable(extension)){
+ resourceType = (ResourceType)
selector.select(extension);
+ }else{
+ //using a fallback resource type
+ // FIXME this resource tye should be a more generic one like
"media-assets" or "bin"
+ resourceType = (ResourceType)
selector.select("xhtml");
+ }
+ }
+ documentManager.add(document, resourceType, extension,
doc.getName(), true, null);
wdyt?
I think we need a registry configuration file (for WebDAV), where we can
say which suffix corresponds to which resource type creator
and also what resource type is being used if there is no suffix (e.g.
XHTML or Folder resource type).
<config no-suffix="folder">
<suffix resource-type="opendocument">odt</suffix>
<suffix resource-type="html">xhtml</suffix> <!-- What happens if it
isn't well-formed or not valid??? -->
We have discussed that this should not be the problem of webdav but
rather delegated.
Until now we are doing validation of all files since we assume all are
xhtml but this needs to change.
<suffix resource-type="*"></suffix>
</config>
WDYT?
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.
at the moment it's a problem recognizing resource types anyway ;-)
and I think we should change this.
But centralized registration makes sense in order to avoid conflicts.
Michi
salu2
--
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]