Changeset 22298


Ignore:
Timestamp:
06/23/10 15:44:44 (11 years ago)
Author:
ak19
Message:

Changes to get Fedora to work with Greenstone3: to let the Greenstone3 Reader Interface work with a Fedora Repository behind the scenes.

Location:
other-projects/gs3-webservices-java-client/trunk/src/GS3DemoClient/org/greenstone/gs3client/dlservices
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • other-projects/gs3-webservices-java-client/trunk/src/GS3DemoClient/org/greenstone/gs3client/dlservices/DigitalLibraryServicesAPIA.java

    r21835 r22298  
    106106     * collection, describing the collection (display items) as well as
    107107     * listing any services supported specifically by the collection.
    108      * @param collection is the name of the collection to be described */
     108     * @param collection is the name of the collection to be described. */
    109109    public String describeCollection(String collection);
    110110   
     
    112112     * collection's service, describing the service (display items).
    113113     * @param collection is the name of the collection to be described
    114      * @param service is the name of the collection's service to be described */
     114     * @param service is the name of the collection's service to be described. */
    115115    public String describeCollectionService(String collection, String service);
    116116   
     
    125125     * @param collection is the name of the collection
    126126     * @param docIDs is an array of document identifiers of documents whose 
    127      * metadata is requested */
    128     public String retrieveDocumentMetadata(String collection, String[] docIDs);
     127     * metadata is requested
     128     * @param metadata is the list of metadata elements to be retrieved for each doc */
     129    public String retrieveDocumentMetadata(String collection, String[] docIDs, String[] metadata);
    129130   
    130131    /** @return a String representing Greenstone3 DocumentMetadataRetrieve XML
     
    132133     * @param collection is the name of the collection
    133134     * @param docID is the document identifier of the document whose metadata is
    134      * requested */
    135     public String retrieveDocumentMetadata(String collection, String docID);
     135     * requested
     136     * @param metadata is the list of metadata elements to be retrieved for each doc */
     137    public String retrieveDocumentMetadata(String collection, String docID, String[] metadata);
    136138
    137139    /** @return a String representing Greenstone3 DocumentMetadataRetrieve XML
     
    178180     * structure is requested */
    179181    public String retrieveDocumentStructure(String collection, String docID);
     182
     183
     184        /** @return a String representing Greenstone3 DocumentMetadataRetrieve XML
     185     * containing the requested portion of the document structure of the documents
     186     * indicated by docIDs:
     187     * @param collection is the name of the collection
     188     * @param docIDs is an array of document identifiers of documents whose
     189     * hierarchical structures are requested
     190     * @param structure - strings specifying the required structure of each document.
     191     * It can be a combination of: ancestors, parent, siblings, children, descendants, entire.
     192     * @param info - strings specifying the required structural info of each document.
     193     * It can be any combination of: siblingPosition, numSiblings, numChildren.
     194    */
     195    public String retrieveDocumentStructure(String collection, String[] docIDs, String[] structure, String[] info);
     196
     197
     198        /** @return a String representing Greenstone3 DocumentMetadataRetrieve XML
     199     * containing the requested portion of the document structure of the documents
     200     * indicated by docIDs:
     201     * @param collection is the name of the collection
     202     * @param docID is the document identifier of the document whose hierarchical
     203     * structure is requested
     204     * @param structure - strings specifying the required structure of the document.
     205     * It can be a combination of: ancestors, parent, siblings, children, descendants, entire.
     206     * @param info - strings specifying the required structural info of the document.
     207     * It can be any combination of: siblingPosition, numSiblings, numChildren.
     208    */
     209    public String retrieveDocumentStructure(String collection, String docID, String[] structure, String[] info);
     210
    180211
    181212    // UNUSED by the client, but still a very useful method:
     
    205236     * @param collection is the name of the collection
    206237     * @param service is the name of the browse service (=ClassifierBrowse usually)
    207     */
    208     public String retrieveBrowseStructure(
    209             String collection, String service, String[] classifierIDs);
     238     * @param structure - the requested browse substructure. Can be any combination
     239     * of ancestors, parent, siblings, children, descendants.
     240     * @param info - the requested structural info. Can be numSiblings, siblingPosition,
     241     * numChildren
     242    */
     243    public String retrieveBrowseStructure(String collection, String service,
     244                          String[] classifierIDs, String[] structure, String[] info);
    210245
    211246    /** @return a String representing Greenstone3
     
    214249     * @param nodeIDs is of the form CL#.# where the number (#) marks
    215250     * out structured sections like CL2.1.3. NodeIDs are generally subsections
    216      * of top-level classifierNodes (CL#, e.g. CL3).
     251     * of top-level classifierNodes (CL#, e.g. CL3).
     252     * @param metafields are the classifier metadata fields that are to be returned.
    217253     * @param collection is the name of the collection
    218254     * @param service is the name of the Browse's MetadataRetrieve service
    219255     * (usually the browse service is ClassifierBrowse, in which case it always
    220256     * has a retrieve service called ClassifierBrowseMetadataRetrieve) */
    221     public String retrieveBrowseMetadata(
    222             String collection, String service, String[] nodeIDs);
     257    public String retrieveBrowseMetadata(String collection, String service,
     258                         String[] nodeIDs, String[] metafields);
    223259   
    224260    /** @return a String representing Greenstone3 XML for a query process
  • other-projects/gs3-webservices-java-client/trunk/src/GS3DemoClient/org/greenstone/gs3client/dlservices/FedoraServicesAPIA.java

    r21846 r22298  
    7676     * @param collection is the name of the collection
    7777     * @param docIDs is an array of document identifiers of documents whose 
    78      * metadata is requested */
    79     public String retrieveDocumentMetadata(String collection, String[] docIDs) {
    80         return this.getDocumentMetadata(docIDs);
     78     * metadata is requested
     79     * @param metadata is the list of metadata elements requested. If "all" is specified
     80     * then all metadata is requested. */
     81    public String retrieveDocumentMetadata(String collection, String[] docIDs, String[] metadata) {
     82    return this.getDocumentMetadata(docIDs, metadata);
    8183    }
    8284   
     
    8587     * @param collection is the name of the collection
    8688     * @param docID is the document identifier of the document whose metadata is
    87      * requested */
    88     public String retrieveDocumentMetadata(String collection, String docID) {
    89         return this.getDocumentMetadata(docID);
     89     * requested.
     90     * @param metadata is the list of metadata elements requested. If "all" is specified
     91     * then all metadata is requested. */
     92    public String retrieveDocumentMetadata(String collection, String docID, String[] metadata) {
     93        return this.getDocumentMetadata(docID, metadata);
    9094    }
    9195
     
    96100     * are requested */
    97101    public String retrieveTitleMetadata(String collection, String[] docIDs) {
    98         return this.getTitleMetadata(docIDs);
     102        return this.getDocumentMetadata(docIDs, new String[] {"Title"});
    99103    }
    100104   
     
    105109     * requested */
    106110    public String retrieveTitleMetadata(String collection, String docID) {
    107         return this.getTitleMetadata(docID);
     111        return this.getDocumentMetadata(docID, new String[] {"Title"});
    108112    }
    109113
     
    134138     * hierarchical structures are requested */
    135139    public String retrieveDocumentStructure(String collection, String[] docIDs) {
    136         return this.getDocumentStructure(docIDs);
     140        return this.getDocumentStructure(docIDs, new String[]{"descendants"}, new String[]{""});
    137141    }
    138142   
     
    144148     * structure is requested*/
    145149    public String retrieveDocumentStructure(String collection, String docID) {
    146         return this.getDocumentStructure(docID);
     150        return this.getDocumentStructure(docID, new String[]{"descendants"}, new String[]{""});
    147151    }
    148152
     
    156160     * hierarchical structures are requested */
    157161    public String retrieveDocumentChildren(String collection, String[] docIDs) {
    158         return this.getChildren(docIDs);
     162        return this.getDocumentStructure(docIDs, new String[]{"children"}, new String[]{""});
    159163    }
    160164   
     
    166170     * structure is requested */
    167171    public String retrieveDocumentChildren(String collection, String docID) {
    168         return this.getChildren(docID);
    169     }
    170    
    171     /** @return a String representing Greenstone3 ClassifierBrowse XML
     172        return this.getDocumentStructure(docID, new String[]{"children"}, new String[]{""});
     173    }
     174   
     175    /** @return a String representing Greenstone3 DocumentMetadataRetrieve XML
     176     * containing the requested portion of the document structure of the documents
     177     * indicated by docIDs:
     178     * @param collection is the name of the collection. It's already included in the
     179     * docID for a Fedora DL.
     180     * @param docIDs is an array of document identifiers of documents whose
     181     * hierarchical structures are requested
     182     * @param structure - strings specifying the required structure of each document.
     183     * It can be a combination of: ancestors, parent, siblings, children, descendants, entire.
     184     * @param info - strings specifying the required structural info of each document.
     185     * It can be any combination of: siblingPosition, numSiblings, numChildren.
     186    */
     187    public String retrieveDocumentStructure(String collection, String[] docIDs, String[] structure, String[] info) {
     188    return this.getDocumentStructure(docIDs, structure, info);
     189    }
     190
     191
     192        /** @return a String representing Greenstone3 DocumentMetadataRetrieve XML
     193     * containing the requested portion of the document structure of the documents
     194     * indicated by docIDs:
     195     * @param collection is the name of the collection. It's already included in the
     196     * docID for a Fedora DL.
     197     * @param docID is the document identifier of the document whose hierarchical
     198     * structure is requested
     199     * @param structure - strings specifying the required structure of the document.
     200     * It can be a combination of: ancestors, parent, siblings, children, descendants, entire.
     201     * @param info - strings specifying the required structural info of the document.
     202     * It can be any combination of: siblingPosition, numSiblings, numChildren.
     203    */
     204    public String retrieveDocumentStructure(String collection, String docID, String[] structure, String[] info) {
     205    return this.getDocumentStructure(docID, structure, info);
     206    }
     207
     208
     209    /** @return a String representing Greenstone3 ClassifierBrowse XML
    172210     * giving the entire *structure* of the classification denoted by
    173211     * classifierID (including the structures of document descendents of
     
    177215     * @param collection is the name of the collection
    178216     * @param service is the name of the browse service (=ClassifierBrowse usually)
     217     * @param structure - the requested browse substructure. Can be any combination
     218     * of ancestors, parent, siblings, children, descendants.
     219     * @param info - the requested structural info. Can be numSiblings, siblingPosition,
     220     * numChildren
    179221    */
    180     public String retrieveBrowseStructure(
    181             String collection, String service, String[] classifierIDs)
     222    public String retrieveBrowseStructure(String collection, String service, String[] classifierIDs,
     223            String[] structure, String[] info)
    182224    {
    183         return this.browse(collection, classifierIDs);
     225        return this.browse(collection, classifierIDs, structure, info);
    184226    }
    185227
     
    190232     * out structured sections like CL2.1.3. NodeIDs are generally subsections
    191233     * of top-level classifierNodes (CL#, e.g. CL3).
     234     * @param metafields are the classifier metadata fields that are to be returned.
    192235     * @param collection is the name of the collection
    193236     * @param service is the name of the Browse's MetadataRetrieve service
    194237     * (usually the browse service is ClassifierBrowse, in which case it always
    195238     * has a retrieve service called ClassifierBrowseMetadataRetrieve) */
    196     public String retrieveBrowseMetadata(
    197             String collection, String service, String[] nodeIDs)
     239    public String retrieveBrowseMetadata(String collection, String service,
     240                         String[] nodeIDs, String[] metafields)
    198241    {
    199         return this.browseMetadataRetrieve(nodeIDs);
     242        return this.browseMetadataRetrieve(nodeIDs, metafields);
    200243    }
    201244   
  • other-projects/gs3-webservices-java-client/trunk/src/GS3DemoClient/org/greenstone/gs3client/dlservices/GS3ServicesAPIA.java

    r21835 r22298  
    254254     * @return a String representing Greenstone3 DocumentMetadataRetrieve XML
    255255     * containing all the metadata of all the documents indicated by docIDs
    256     */
    257     public String retrieveDocumentMetadata(String collection, String[] docIDs) {
    258         return this.retrieveAllDocumentMetadata(collection, language, docIDs);
     256     * @param metadata is the list of metadata elements to be retrieved for each doc.
     257    */
     258    public String retrieveDocumentMetadata(String collection, String[] docIDs, String[] metafields) {
     259        return this.retrieveDocumentMetadata(collection, language, docIDs, metafields);
    259260    }
    260261   
     
    266267     * @return a String representing Greenstone3 DocumentMetadataRetrieve XML
    267268     * containing all the metadata of the document denoted by docID
    268     */
    269     public String retrieveDocumentMetadata(String collection, String docID) {
    270         return this.retrieveAllDocumentMetadata(collection, language,
    271                 new String[] { docID });
     269     * @param metadata is the list of metadata elements to be retrieved for each doc.
     270    */
     271    public String retrieveDocumentMetadata(String collection, String docID, String[] metafields) {
     272        return this.retrieveDocumentMetadata(collection, language,
     273                            new String[] { docID }, metafields);
    272274    }
    273275   
     
    298300                new String[] { docID }, titleMetaName);
    299301    }
     302
     303    /** @return a String representing Greenstone3 DocumentMetadataRetrieve XML
     304     * containing the requested portion of the document structure of the documents
     305     * indicated by docIDs:
     306     * @param collection is the name of the collection.
     307     * @param docIDs is an array of document identifiers of documents whose
     308     * hierarchical structures are requested.
     309     * @param structure - strings specifying the required structure of each document.
     310     * It can be a combination of: ancestors, parent, siblings, children, descendants, entire.
     311     * @param info - strings specifying the required structural info of each document.
     312     * It can be any combination of: siblingPosition, numSiblings, numChildren.
     313    */
     314    public String retrieveDocumentStructure(String collection, String[] docIDs, String[] structure, String[] info) {
     315    return retrieveDocumentStructure(collection, language, docIDs, structure, info);
     316    }
     317
     318
     319        /** @return a String representing Greenstone3 DocumentMetadataRetrieve XML
     320     * containing the requested portion of the document structure of the documents
     321     * indicated by docIDs:
     322     * @param collection is the name of the collection.
     323     * @param docID is the document identifier of the document whose hierarchical
     324     * structure is requested.
     325     * @param structure - strings specifying the required structure of the document.
     326     * It can be a combination of: ancestors, parent, siblings, children, descendants, entire.
     327     * @param info - strings specifying the required structural info of the document.
     328     * It can be any combination of: siblingPosition, numSiblings, numChildren.
     329    */
     330    public String retrieveDocumentStructure(String collection, String docID, String[] structure, String[] info) {
     331    return retrieveDocumentStructure(collection, language,
     332                  new String[] {docID}, structure, info);
     333    }
    300334   
    301335    /** Part of the GS3 Java-Client's DigitalLibraryServicesAPIA interface
     
    310344        return this.retrieveEntireDocumentStructure(collection, language, docIDs);
    311345    }
     346
    312347    /** Part of the GS3 Java-Client's DigitalLibraryServicesAPIA interface
    313348     * contract.
     
    322357                new String[] { docID });
    323358    }
     359
    324360   
    325361    /** Part of the GS3 Java-Client's DigitalLibraryServicesAPIA interface
     
    360396     * @param collection is the name of the collection
    361397     * @param service is the name of the browse service (=ClassifierBrowse usually)
    362     */
    363     public String retrieveBrowseStructure(
    364             String collection, String service, String[] classifierIDs)
     398     * @param structure - the requested browse substructure. Can be any combination
     399     * of ancestors, parent, siblings, children, descendants.
     400     * @param info - the requested structural info. Can be numSiblings, siblingPosition,
     401     * numChildren
     402    */
     403    public String retrieveBrowseStructure(String collection, String service,
     404                          String[] classifierIDs, String[] structure, String[] info)
    365405    {
    366         return this.browseDescendants(collection, service,
    367                 language, classifierIDs );
     406        return this.browse(collection, service, language, classifierIDs, structure, info);
    368407    }
    369408   
     
    376415     * out structured sections like CL2.1.3. NodeIDs are generally subsections
    377416     * of top-level classifierNodes (CL#, e.g. CL3).
     417     * @param metafields are the classifier metadata fields that are to be returned.
    378418     * @param collection is the name of the collection
    379419     * @param service is the name of the Browse's MetadataRetrieve service
    380420     * (usually the browse service is ClassifierBrowse, in which case it always
    381421     * has a retrieve service called ClassifierBrowseMetadataRetrieve) */
    382     public String retrieveBrowseMetadata(
    383             String collection, String service, String[] nodeIDs)
     422    public String retrieveBrowseMetadata(String collection, String service,
     423                         String[] nodeIDs, String[] metafields)
    384424    {
    385         return this.retrieveAllBrowseMetadata(collection, service,
    386                 language, nodeIDs);
     425        return this.retrieveBrowseMetadata(collection, service, language, nodeIDs, metafields);
    387426    }
    388427   
  • other-projects/gs3-webservices-java-client/trunk/src/GS3DemoClient/org/greenstone/gs3client/dlservices/GS3WebServicesQBRAPI.java

    r16051 r22298  
    590590     * @see <a href="http://wiki.greenstone.org/wiki/index.php/Greenstone3">The Greenstone 3 Developer's Manual - pages 48, 49</a>
    591591     * @param collection is the name of the Collection whose
    592      * DocumentStructureRetrieve is requested 
    593      * @param lang is the language of the display content in the response 
     592     * DocumentStructureRetrieve is requested.
     593     * @param lang is the language of the display content in the response.
    594594     * @param docNodeIDs is the list of documentNodeIDs for which the
    595595     * structure ought to be retrieved.
    596596     * @param structure specifies what structure information needs to
    597597     * be retrieved. The values can be one or more of ancestors, parent,
    598      * siblings, children, descendents (NOTE SPELLING), entire.
     598     * siblings, children, descendants (NOTE SPELLING), entire.
    599599     * @param info - for specifying extra information to be retrieved.
    600600     * Possible values for info parameters are numSiblings, siblingPosition,
     
    620620     * @see <a href="http://wiki.greenstone.org/wiki/index.php/Greenstone3">The Greenstone 3 Developer's Manual - page 47</a>
    621621     * @param collection is the name of the Collection whose
    622      * DocumentMetadataRetrieve is requested 
    623      * @param lang is the language of the display content in the response 
     622     * DocumentMetadataRetrieve is requested.
     623     * @param lang is the language of the display content in the response.
    624624     * @param docNodeIDs is the list of documentNodeIDs for which the
    625625     * structure ought to be retrieved.
     
    641641     * @see <a href="http://wiki.greenstone.org/wiki/index.php/Greenstone3">The Greenstone 3 Developer's Manual - page 47</a>
    642642     * @param collection is the name of the Collection whose
    643      * DocumentContentRetrieve is requested
     643     * DocumentContentRetrieve is requested.
    644644     * @param lang is the language of the display content in the response
    645645     * @param docNodeIDs is the list of documentNodeIDs for which the
     
    753753     * information is requested. Accepted values are ancestors, parent, siblings,
    754754     * children, descendants.
     755     * @param infoParams - the requested structural info. Can be numSiblings, siblingPosition,
     756     * numChildren
    755757    */
    756758    public String browse(String collection, String browseService, String lang,
    757             String[] classifierNodeIDs, String[] structureParams)
     759                 String[] classifierNodeIDs, String[] structureParams, String[] infoParams)
    758760    {
    759761        call.setOperationName( "browse" );
     
    764766        addArrayParam("classifierNodeIDs");
    765767        addArrayParam("structureParams");
     768        addArrayParam("infoParams");
    766769       
    767770        return invokeWith(new Object[] {collection, browseService, lang,
    768                 classifierNodeIDs, structureParams});
     771                        classifierNodeIDs, structureParams, infoParams});
    769772    }
    770773       
     
    821824            System.out.println("browse children of CL1-CL4:\n" +
    822825                    ws.browse("gs2mgppdemo", "ClassifierBrowse", "",
    823                     new String[]{"CL1", "CL2", "CL3", "CL4"}, new String[]{"children"}));
     826                    new String[]{"CL1", "CL2", "CL3", "CL4"}, new String[]{"children"}, new String[]{"numChildren"}));
    824827           
    825828            System.out.println("browse descendants of CL2.3:\n" +
     
    861864            System.out.println("retrieve all browse meta of CL1, CL2, CL2.1, CL3:\n" +
    862865                    ws.retrieveAllBrowseMetadata("gs2mgppdemo", "", "",
    863                     new String[]{"CL1", "CL2",
    864                     "CL2.1", "CL3"}));
     866                                     new String[]{"CL1", "CL2", "CL2.1", "CL3"}));
    865867           
    866868            System.out.println("retrieve Title, hastxt browse meta of CL1, CL2, CL2.1, CL3:\n" +
Note: See TracChangeset for help on using the changeset viewer.