Package ORG.oclc.oai.server.verb

Examples of ORG.oclc.oai.server.verb.OAIInternalServerError


                } catch (SQLException e1) {
                    e1.printStackTrace();
                }
            }
            e.printStackTrace();
            throw new OAIInternalServerError(e.getMessage());
        }
       
        listRecordsMap.put("records", records.iterator());
        return listRecordsMap;
    }
View Full Code Here


                } catch (SQLException e1) {
                    e1.printStackTrace();
                }
            }
            e.printStackTrace();
            throw new OAIInternalServerError(e.getMessage());
        }
       
        listRecordsMap.put("records", records.iterator());
        return listRecordsMap;
    }
View Full Code Here

                    } catch (SQLException e1) {
                        e1.printStackTrace();
                    }
                }
                e.printStackTrace();
                throw new OAIInternalServerError(e.getMessage());
            }
           
            listSetsMap.put("sets", sets.iterator());
            return listSetsMap;
        }
View Full Code Here

                    } catch (SQLException e1) {
                        e1.printStackTrace();
                    }
                }
                e.printStackTrace();
                throw new OAIInternalServerError(e.getMessage());
            }
           
            listSetsMap.put("sets", sets.iterator());
            return listSetsMap;
        }
View Full Code Here

                }
            }
            return setSpecs.iterator();
        } catch (SQLException e) {
            e.printStackTrace();
            throw new OAIInternalServerError(e.getMessage());
        } finally {
            try {
                stmtRs.close();
            } catch (SQLException e) {
                e.printStackTrace();
                throw new OAIInternalServerError(e.getMessage());
            }
        }
    }
View Full Code Here

                }
            }
            return abouts.iterator();
        } catch (SQLException e) {
            e.printStackTrace();
            throw new OAIInternalServerError(e.getMessage());
        } finally {
            try {
                stmtRs.close();
            } catch (SQLException e) {
                e.printStackTrace();
                throw new OAIInternalServerError(e.getMessage());
            }
        }
    }
View Full Code Here

     * the specified metadataPrefix.
     * @exception OAIInternalServerError signals an http status code 500 problem
     */
    public String getMetadata(String identifier, String metadataPrefix)
        throws IdDoesNotExistException, CannotDisseminateFormatException, OAIInternalServerError {
        throw new OAIInternalServerError("You need to override AbstractCatalog.getMetadata()");
    }
View Full Code Here

  while (identifiers.hasNext()) {
      String identifier = (String)identifiers.next();
      try {
    records.add(getRecord(identifier, metadataPrefix));
      } catch (IdDoesNotExistException e) {
    throw new OAIInternalServerError("GetRecord failed to retrieve identifier '"
             + identifier + "'");
      }
  }
  listRecordsMap.put("records", records.iterator());
  if (resumptionToken != null) {
View Full Code Here

  while (identifiers.hasNext()) {
      String identifier = (String)identifiers.next();
      try {
    records.add(getRecord(identifier, metadataPrefix));
      } catch (IdDoesNotExistException e) {
    throw new OAIInternalServerError("GetRecord failed to retrieve identifier '"
             + identifier + "'");
      } catch (CannotDisseminateFormatException e) {
    // someone cheated
    throw new BadResumptionTokenException();
      }
View Full Code Here

                        1,
                        maxListSize,
                "xml");
        } catch (IOException e) {
            e.printStackTrace();
            throw new OAIInternalServerError(e.getMessage());
        } catch (SAXException e) {
            e.printStackTrace();
            throw new OAIInternalServerError(e.getMessage());
        } catch (ParserConfigurationException e) {
            e.printStackTrace();
            throw new OAIInternalServerError(e.getMessage());
        }
        try {
            NodeList nodeList = getRecords(srResponse);
            if (nodeList != null) {
                RecordFactory recordFactory = getRecordFactory();
                for (int i = 0; i < nodeList.getLength(); ++i) {
                    Object rec = getRecordData(nodeList.item(i));
                    HashMap hashMap = new HashMap();
                    hashMap.put("header", rec);
                    String localIdentifier = getRecordFactory().getLocalIdentifier(hashMap);
                    try {
                        hashMap.put("metadata", getNativeMetadata(localIdentifier,
                                metadataPrefix));
                    } catch (IOException e) {
                        e.printStackTrace();
                        throw new OAIInternalServerError(e.getMessage());
                    } catch (TransformerException e) {
                        e.printStackTrace();
                        throw new OAIInternalServerError(e.getMessage());
                    } catch (ParserConfigurationException e) {
                        e.printStackTrace();
                        throw new OAIInternalServerError(e.getMessage());
                    } catch (SAXException e) {
                        e.printStackTrace();
                        throw new OAIInternalServerError(e.getMessage());
                    }
                    String[] header = recordFactory.createHeader(hashMap);
                    headers.add(header[0]);
                    identifiers.add(header[1]);
//                  MessageElement[] elems = rec.get_any();
//                  if (elems.length > 0) {
//                  String[] header = recordFactory.createHeader(elems[0]);
//                  headers.add(header[0]);
//                  identifiers.add(header[1]);
//                  }
                }
                try {
                    String resultSetId = XPathAPI.eval(srResponse, "/srw:searchRetrieveResponse/srw:resultSetId", xmlnsEl).str();
                    String nextRecordPosition = XPathAPI.eval(srResponse, "/srw:searchRetrieveResponse/srw:nextRecordPosition", xmlnsEl).str();
                    if (nextRecordPosition != null && nextRecordPosition.length() > 0) {
                        StringBuffer resumptionToken = new StringBuffer();
                        resumptionToken.append(resultSetId);
                        resumptionToken.append(":");
                        resumptionToken.append(nextRecordPosition);
                        resumptionToken.append(":");
                        resumptionToken.append(metadataPrefix);
                        listIdentifiersMap.put(
                                "resumptionMap",
                                getResumptionMap(resumptionToken.toString()));
                    }
                } catch (TransformerException e) {
//                  logger.warn("failure", e);
                    e.printStackTrace();
                    throw new OAIInternalServerError(e.getMessage());
                }
            } else {
                throw new NoItemsMatchException();
            }
            listIdentifiersMap.put("headers", headers.iterator());
            listIdentifiersMap.put("identifiers", identifiers.iterator());
            return listIdentifiersMap;
        } catch (TransformerException e) {
//          logger.warn("failure", e);
            e.printStackTrace();
            throw new OAIInternalServerError(e.getMessage());
        } catch (SAXException e) {
//          logger.warn("failure", e);
            e.printStackTrace();
            throw new OAIInternalServerError(e.getMessage());
        } catch (IOException e) {
//          logger.warn("failure", e);
            e.printStackTrace();
            throw new OAIInternalServerError(e.getMessage());
        } catch (ParserConfigurationException e) {
//          logger.warn("failure", e);
            e.printStackTrace();
            throw new OAIInternalServerError(e.getMessage());
        }
    }
View Full Code Here

TOP

Related Classes of ORG.oclc.oai.server.verb.OAIInternalServerError

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.