
| Key: |
XWIKI-458
|
| Type: |
Improvement
|
| Status: |
Open
|
| Priority: |
Major
|
| Assignee: |
Unassigned
|
| Reporter: |
Vincent Massol
|
| Votes: |
0
|
| Watchers: |
0
|
|
If you were logged in you would be able to see more operations.
|
|
|
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.
|
|
Description
|
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.
|
Show » |
| There are no comments yet on this issue.
|
|