Project

General

Profile

« Previous | Next » 

Revision 1789

Added by Matt Jones over 20 years ago

Implemented the "insert()" method and wrote a test to test it. The new test
depends on the property "newdocid" be set to something unique in the build.xml
file so that the insert will work properly. Probably need to fix this to be
some kind of autoincrement counter or random number so that it can be run
several times in succession. Right now, if you run the test without resetting
the newdocid property (and touch the test file), it will fail on the second
and subsequent passes.

View differences:

Metacat.java
80 80
     * @param xmlDocument a Reader for accessing the XML document to be inserted
81 81
     * @param schema a Reader for accessing the DTD or XML Schema for 
82 82
     *               the document
83
     * @return the metacat response message
83 84
     * @throws InsufficientKarmaException when the user has insufficent rights 
84 85
     *                                    for the operation
86
     * @throws MetacatInaccessibleException when the metacat server can not be
87
     *                                    reached or does not respond
88
     * @throws MetacatException when the metacat server generates another error
89
     * @throws IOException when there is an error reading the xml document
85 90
     */
86
    public void insert(String docid, Reader xmlDocument, Reader schema)
87
        throws InsufficientKarmaException;
91
    public String insert(String docid, Reader xmlDocument, Reader schema)
92
        throws InsufficientKarmaException, MetacatException, IOException,
93
        MetacatInaccessibleException;
88 94

  
89 95
    /**
90 96
     * Update an XML document in the repository.

Also available in: Unified diff