Issue Details (XML | Word | Printable)

Key: XWIKI-458
Type: Improvement Improvement
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Vincent Massol
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
XWiki Core

Review Packaging API design

Created: 23/Nov/06 13:35   Updated: 28/Apr/08 15:09
Component/s: Core
Affects Version/s: 0.9.1252
Fix Version/s: Future


 Description  « Hide
Context: I'm trying to use the packaging API from the backup import/export tool.

Several issues:

  • I shouldn't have to use the internal API. However the public API doesn't offer the same methods... For example the readFromDir one.
  • The Package class is way too big. It's missing lots of ancillary classes
  • We need javadoc!
  • Method names need to be improved: For example I don't understand what Package.add(XWikiDocument doc, int defaultAction, XWikiContext context) can mean! What does it mean to add to a Package? Are we adding a document? If so it should be called addDocument(). But then what is an action? Maybe we need to introduce an PackageAction class?
  • A method in java cannot start with an uppercase and thus the Import() method must be renamed. For example to importDocuments().
  • Package.setWithVersions(): what does it mean to set a package with versions?
  • Package.updateDoc(): what does it mean to update a doc in a package? Why would we need to update a doc? For me a package is read only.
  • The import() action shouldn't be done on a Package but on a Packager
  • The Package should be there to contain a definition of what's inside but the actions should be done by a Packager. The idea would be that you add documents to a Package and then you import a Package. For exporting you would export a Package.
  • There are way to many ways of adding in Package (I've counted at least 10 methods which seem to be about adding stuff to the Package)
  • The fact that you import/export from/to File or Streams or Zips should be completely externalized either in a ZipPackager, FilePackager or StreamPackager for example
  • I don't understand what Package.install() means. I can understand import/export but not install. API needs to be made more clear.
  • XML operations need to be abstracted out of the Packager class
  • No method should throw an exception other than PackageException. For example the readFromDir must not throw an IOException. It must wrap it.


 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.