WorkflowItem [] wfarray = WorkflowItem.findByCollection(ourContext, this); for( int x = 0; x < wfarray.length; x++ ) {  Item myItem = wfarray[x].getItem(); wfarray[x].deleteWrapper(); myItem.delete(); }   WorkspaceItem [] wsarray = WorkspaceItem.findByCollection(ourContext, this); for( int x = 0; x < wsarray.length; x++ ) { wsarray[x].deleteAll(); }    DatabaseManager.delete(ourContext, collectionRow);
    void delete()        throws SQLException, AuthorizeException, IOException    {        log.info(LogManager.getHeader(ourContext,            "delete_collection",            "collection_id=" + getID()));        // remove from index        DSIndexer.unIndexContent(ourContext, this);        // Remove from cache        ourContext.removeCached(this, getID());        HistoryManager.saveHistory(ourContext,            this,            HistoryManager.REMOVE,            ourContext.getCurrentUser(),            ourContext.getExtraLogInfo());        // Remove items        ItemIterator items = getItems();                while (items.hasNext())        {            removeItem(items.next());        }        // Delete bitstream logo        setLogo(null);        // Delete collection row        DatabaseManager.delete(ourContext, collectionRow);        // Remove all authorization policies        AuthorizeManager.removeAllPolicies(ourContext, this);        // Remove any workflow groups        Group g = null;                g = getWorkflowGroup(1);  if( g != null ) { g.delete(); }        g = getWorkflowGroup(2);  if( g != null ) { g.delete(); }        g = getWorkflowGroup(3);  if( g != null ) { g.delete(); }    }