Package gov.loc.www.zing.srw

Examples of gov.loc.www.zing.srw.ExtraDataType


                        System.out.print("&recordSchema="+schema);
                        searchRequest.setRecordSchema(schema);
                    }
                    if(restrictorSummary) {
                        System.out.print("&x-info-5-restrictorSummary");
                        ExtraDataType edt=new ExtraDataType();
                        MessageElement elems[]=new MessageElement[1];
                        edt.set_any(elems);
                        Document domDoc;
                        DocumentBuilderFactory dbf=
                            DocumentBuilderFactory.newInstance();
                        dbf.setNamespaceAware(true);
                        DocumentBuilder docb=dbf.newDocumentBuilder();
View Full Code Here


        setExplainRecord(sb.toString());
    }


    private static ExtraDataType makeExtraDataType(String extraData) {
        ExtraDataType edt = null;
        // extraData is always encoded as "xml"
        Document domDoc;
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        dbf.setNamespaceAware(true);
        try {
            DocumentBuilder db = dbf.newDocumentBuilder();
            StringReader sr = new StringReader("<bogus>"+extraData+"</bogus>");
            domDoc = db.parse(new InputSource(sr));
            sr.close();
            Element el = domDoc.getDocumentElement();
            NodeList nodes=el.getChildNodes();
            MessageElement elems[] = new MessageElement[nodes.getLength()];
            for(int i=0; i<elems.length; i++)
                elems[i]=new MessageElement((Element)nodes.item(i));
            edt = new ExtraDataType();
            edt.set_any(elems);
            domDoc=null;
        } catch (IOException e) {
            log.error(e, e);
        } catch (ParserConfigurationException e) {
            log.error(e, e);
View Full Code Here

        this.explainRecord=explainRecord;
    }


    static public void setExtraRecordData(RecordType rt, String extraData) {
        ExtraDataType edt=rt.getExtraRecordData();
        StringBuilder extraResponseData = new StringBuilder("<extraData xmlns=\"http://oclc.org/srw/extraData\">");
        if(edt!=null) {
            MessageElement[] elems = edt.get_any();
            String currentExtraData=elems[0].toString();
            int end=currentExtraData.lastIndexOf('<'), start=currentExtraData.indexOf('<', 1);
            extraResponseData.append(currentExtraData.substring(start, end-1));
        }
        extraResponseData.append(extraData).append("</extraData>");
View Full Code Here

        rt.setExtraRecordData(makeExtraDataType(extraResponseData.toString()));
    }


    static public void setExtraResponseData(ScanResponseType response, String extraData) {
        ExtraDataType edt=response.getExtraResponseData();
        StringBuilder extraResponseData = new StringBuilder("<extraData xmlns=\"http://oclc.org/srw/extraData\">");
        if(edt!=null) {
            MessageElement[] elems = edt.get_any();
            String currentExtraData=elems[0].toString();
            int end=currentExtraData.lastIndexOf('<'), start=currentExtraData.indexOf('<', 1);
            extraResponseData.append(currentExtraData.substring(start, end-1));
        }
        extraResponseData.append(extraData).append("</extraData>");
View Full Code Here

        response.setExtraResponseData(makeExtraDataType(extraResponseData.toString()));
    }


    static public void setExtraResponseData(SearchRetrieveResponseType response, String extraData) {
        ExtraDataType edt=response.getExtraResponseData();
        StringBuilder extraResponseData = new StringBuilder("<extraData xmlns=\"http://oclc.org/srw/extraData\">");
        if(edt!=null) {
            MessageElement[] elems = edt.get_any();
            String currentExtraData=elems[0].toString();
            int end=currentExtraData.lastIndexOf('<'), start=currentExtraData.indexOf('<', 1);
            extraResponseData.append(currentExtraData.substring(start, end));
        }
        extraResponseData.append(extraData).append("</extraData>");
View Full Code Here

TOP

Related Classes of gov.loc.www.zing.srw.ExtraDataType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.