jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "angela (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JCR-249) Webdav: Review usage of command chains
Date Mon, 07 Nov 2005 16:01:20 GMT
    [ http://issues.apache.org/jira/browse/JCR-249?page=comments#action_12356964 ] 

angela commented on JCR-249:

overview over changes implied by the removal of the command-chains:

Chain, Command and Context replacement

chain          -----> IOManager interface

command -----> IOHandler interface

context      ----->  IOContext base interface
                   ----->  ImportContext interface
                   ----->  ExportContext interface

IOHandler covers the corresponding import AND export
for both collections and non-collections. 
nevertheless, it is possible that a given implementation
only handles export or import (then the corresponding
'canImport/canExport' must return false).

IOManager is used to define a list of IOHandlers
that can be asked for a specific import/export. note.
in contrast to the command-chains the import/export
should be considered completed as soon as the first 
handler indicates success.

both the IOManager and the IOHandler allow to run
the import/export either with a DavResource or with a boolean
flag indication if a collection is affected.

I extracted slightly modified interfaces from the original context 
classes.  Apart from the common methods (covered by IOContext), the
ImportContext interface allows to get related properties, the ExportContext 
however only allows to set them.
After the import/export is completed (success or failure)
the context must be 'released' by calling 'informCompleted'.


Common utitily methods present in the abstract commands
and in the NodeResource class were moved to a IOUtil.java.


catalog.xml is not used any more.
The resource configuration should define an IOManager.
If the configuration entry is missing the default impl. is used as fallback.

Commands in detail

FileExport      -------> DefaultIOHandler

ZipImport       -------> ZipHandler 
                         [ new: covers also export ]

XmlExport       -------> XmlHandler 
                         [ only generic xml, see below ]

DirListing      -------> DirListingExportHandler
                         [ note: no import ]

AddMixin        -------> no replacement

PrimaryItem  -------> was not used. no replacement inside jackrabbit.

NOTE regarding xml import/export. The import-command
tried to distinguish generic xml from exported sysview/docview
xml files, that were extracted without a file/folder
node being created. This lead to consistency problems.
The new xml-Handler does not make this distinction. if
an xml should be directly extracted below the import-root
a separated handler should take care of this (and should
rather not be used in a webdav context).


> Webdav: Review usage of command chains
> --------------------------------------
>          Key: JCR-249
>          URL: http://issues.apache.org/jira/browse/JCR-249
>      Project: Jackrabbit
>         Type: Improvement
>     Reporter: angela
>     Assignee: angela

> i'd like to review the usage of command chains for import/export within the simple webdav
> while the concept of command chains offers a lot of flexibility, it showed that the implementation
generates some drawbacks. a new mechanism should take advantage of the experiences made with
the command chains.
> from my point of view the following issues should be taken into consideration:
> - provide means to extend and modify the import/export logic with minimal effort
> - consistent import/export functionality for both collections and non-collections
>   > export/import should not be completely separated.
>   > interfaces should encourage consistency
>   > increase maintainability, reduce no of errors
> - distinction of collections and non-collections for import/export behaviour
>   > PUT must result in non-coll, MKCOL in collection
> - allow to defined a set of import/export-handlers with a given order.
> - the different handlers must not rely on each other.
> - an import/export should be completed after the first handler indicates success. there

>   should not be other classes involved in order to complete the import/export.
> - avoid huge configuration files and if possible, avoid program flow being defined outside
of java code.
> - avoid duplicate configuration (e.g. resource-filtering), duplicate code, duplicate
logic, that is 
>   hard to maintain.
> - additonal logic should be defined within a given import/export handler.
>   however, in case of webdav i see limited value of using extra logic such as addMixin
or checkin, 
>   that are covered by  webdav methods (such as LOCK, VERSION-CONTROL or CHECKIN).
> regards
> angela

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message