Project

General

Profile

« Previous | Next » 

Revision 5673

Added by berkley over 13 years ago

made delete serialize the identifier

View differences:

src/edu/ucsb/nceas/metacat/restservice/ResourceHandler.java
1602 1602
        {
1603 1603
            System.out.println("Calling delete");
1604 1604
            cs.delete(token, id);
1605
            serializeServiceType(Identifier.class, id, out);
1605 1606
        } 
1606 1607
        catch (NotAuthorized e) {
1607 1608
            response.setStatus(500);
......
1621 1622
        } catch(NotFound e) {
1622 1623
            response.setStatus(500);
1623 1624
            serializeException(e, out);
1625
        } catch(JiBXException e) {
1626
            response.setStatus(500);
1627
            serializeException(new ServiceFailure("1350", "JiBXException: " + e.getMessage()), out);
1624 1628
        }
1625 1629
        out.close();
1626 1630
    }
src/edu/ucsb/nceas/metacat/DocumentImpl.java
3266 3266
            		(afterXMLRelation - afterDeleteQueryResult) );
3267 3267

  
3268 3268
            // Delete it from xml_path_index table
3269
            logMetacat.info("DocumentImpl.delete - deleting from xml_path_index");
3269 3270
            pstmt = conn.prepareStatement(
3270 3271
                    "DELETE FROM xml_path_index WHERE docid = ?");
3271 3272
            //increase usage count
......
3275 3276
            pstmt.close();
3276 3277
            conn.increaseUsageCount(1);
3277 3278

  
3278

  
3279
            logMetacat.info("DocumentImpl.delete - deleting from xml_accesssubtree");
3279 3280
            // Delete it from xml_accesssubtree table
3280 3281
            pstmt = conn.prepareStatement(
3281 3282
                    "DELETE FROM xml_accesssubtree WHERE docid = ?");
......
3285 3286
            pstmt.execute();
3286 3287
            pstmt.close();
3287 3288
            conn.increaseUsageCount(1);
3289
            
3290
            /*logMetacat.info("DocumentImpl.delete - deleting from xml_index");
3291
            pstmt = conn.prepareStatement(
3292
                "DELETE FROM xml_index WHERE docid = ?");
3293
            pstmt.setString(1, docid);
3294
            logMetacat.debug("DocumentImpl.delete - running sql: " + pstmt.toString());
3295
            pstmt.execute();
3296
            pstmt.close();*/
3288 3297

  
3289 3298
            // Delete it from xml_documents table
3299
            logMetacat.info("DocumentImpl.delete - deleting from xml_documents");
3290 3300
            pstmt = conn.prepareStatement(
3291 3301
                    "DELETE FROM xml_documents WHERE docid = ?");
3292 3302
            pstmt.setString(1, docid);

Also available in: Unified diff