Changeset 2103


Ignore:
Timestamp:
2001-03-01T17:06:23+13:00 (23 years ago)
Author:
paynter
Message:

Attempt to get collection metadata.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/java-client/org/nzdl/gsdl/SearchAllCollections.java

    r2100 r2103  
    298298    void queryCollection(String collectionName, String queryText)
    299299    {
    300    
    301     NzdlCollectionInfo collInfo = nzdl.getCollectionInfo( collectionName );
    302        
    303300    NzdlQuery query = new NzdlQuery(queryText);
    304301    query.setMaxDocs( 10 );
    305    
     302
    306303    NzdlRequest request = new NzdlRequest( query );
    307304    NzdlResponse response = new NzdlResponse( );
     
    309306    nzdl.service( collectionName, request, response );
    310307   
    311     System.out.println(response.getResultSet().getNumOfDocs() + "\t" + collectionName);
     308    int frequency = response.getResultSet().getNumOfDocs();
     309    if (frequency > 0) {
     310        System.out.println("------------------------------");
     311        System.out.println(frequency + "\t" + collectionName);
     312        describeCollection(collectionName);
     313    }
     314    }
     315   
     316    void describeCollection(String collectionName) {
     317
     318    String document = nzdl.getDocument(collectionName, "collection");
     319    System.out.println(document);
     320
     321    Set s = nzdl.getMetaData(collectionName, "document", "collectionextra");
     322    /*
     323    Iterator setIterator = s.iterator();
     324    while (setIterator.hasNext() ) {
     325        String value = (String) setIterator.next();
     326        System.out.println("collectionextra: " + value + "\n---\n");
     327    }
     328    */
     329   
    312330    }
    313331   
Note: See TracChangeset for help on using the changeset viewer.