Examples of CannotDisseminateFormatException


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

                int offset = xmlRec.indexOf("?>");
                xmlRec = xmlRec.substring(offset+2);
            }
            return xmlRec;
        } catch (UnsupportedEncodingException e) {
            throw new CannotDisseminateFormatException("An error occurred");
        }
    }
View Full Code Here

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

    public String createMetadata(Object nativeItem)
  throws CannotDisseminateFormatException {
  String fullItem = (String)nativeItem;
  int startOffset = fullItem.indexOf(elementStart);
  if (startOffset == -1) {
      throw new CannotDisseminateFormatException(getSchemaLocation());
  }
  int endOffset = fullItem.indexOf(elementEnd) + elementEnd.length();
  return fullItem.substring(startOffset, endOffset);
    }
View Full Code Here

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

                StringWriter sw = new StringWriter();
                e.printStackTrace(new PrintWriter(sw));
                log.error("*** Stack trace follows:");
                log.error(sw.toString());

            throw new CannotDisseminateFormatException(schemaLabel);
        }
    }
View Full Code Here

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

                    }
                }
            }
                    catch (SQLException e)
                    {
                        throw new CannotDisseminateFormatException(e.toString());
        }
                }
            }
        }
View Full Code Here

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

            if ((schemaURL = getCrosswalks().getSchemaURL(metadataPrefix)) == null)
            {
                log.info(LogManager.getHeader(null, "oai_error",
                        "cannot_disseminate_format"));
                throw new CannotDisseminateFormatException(metadataPrefix);
            }

            record = getRecordFactory().create(itemInfo, schemaURL,
                    metadataPrefix);
        }
View Full Code Here

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

        // Null means bad metadata prefix was bad
        if (m == null)
        {
            log.info(LogManager.getHeader(null, "oai_error",
                    "cannot_disseminate_format"));
            throw new CannotDisseminateFormatException(metadataPrefix);
        }

        // If there were zero results, return the appropriate error
        Iterator i = (Iterator) m.get("records");
View Full Code Here

Examples of org.fao.oaipmh.exceptions.CannotDisseminateFormatException

                final String siteURL = context.getBean(SettingManager.class).getSiteURL(context);
                Element env = Lib.prepareTransformEnv(uuid, changeDate, context.getBaseUrl(), siteURL, gc.getBean(SettingManager.class)
                        .getSiteName());
                md = Lib.transform(schemaDir, env, md, prefix + ".xsl");
            } else {
                throw new CannotDisseminateFormatException("Unknown prefix : " + prefix);
            }
        }

        //--- build header and set some infos
View Full Code Here

Examples of org.fcrepo.oai.CannotDisseminateFormatException

    public Record getRecord(String identifier, String metadataPrefix)
            throws CannotDisseminateFormatException, IDDoesNotExistException,
            RepositoryException {
        if (!metadataPrefix.equals("oai_dc")) {
            throw new CannotDisseminateFormatException("Repository does not provide that format in OAI-PMH responses.");
        }
        String pid = getPID(identifier);
        List l = null;
        try {
            //FIXME: use maxResults from... config instead of hardcoding 100?
            l =
                    m_fieldSearch
                            .findObjects(s_headerAndDCFields,
                                         100,
                                         new FieldSearchQuery(Condition
                                                 .getConditions("pid='"
                                                         + pid
                                                         + "' dcmDate>'2000-01-01'")))
                            .objectFieldsList();
        } catch (ServerException se) {
            throw new RepositoryException(se.getClass().getName() + ": "
                    + se.getMessage());
        }
        if (l.size() > 0) {
            ObjectFields f = (ObjectFields) l.get(0);
            return new SimpleRecord(getHeader(f), getDCXML(f), s_emptySet);
        } else {
            // see if it exists
            try {
                l =
                        m_fieldSearch
                                .findObjects(new String[] {"pid"},
                                             1,
                                             new FieldSearchQuery(Condition
                                                     .getConditions("pid='"
                                                             + pid + "'")))
                                .objectFieldsList();
            } catch (ServerException se) {
                throw new RepositoryException(se.getClass().getName() + ": "
                        + se.getMessage());
            }
            if (l.size() == 0) {
                throw new IDDoesNotExistException("The provided id does not match any item in the repository.");
            } else {
                throw new CannotDisseminateFormatException("The item doesn't even have dc_oai metadata.");
            }
        }
    }
View Full Code Here

Examples of org.fcrepo.oai.CannotDisseminateFormatException

                           String metadataPrefix,
                           String set) throws CannotDisseminateFormatException,
            NoRecordsMatchException, NoSetHierarchyException,
            RepositoryException {
        if (!metadataPrefix.equals("oai_dc")) {
            throw new CannotDisseminateFormatException("Repository does not provide that format in OAI-PMH responses.");
        }
        List l = null;
        FieldSearchResult fsr;
        try {
            fsr =
View Full Code Here

Examples of org.fcrepo.oai.CannotDisseminateFormatException

                           String metadataPrefix,
                           String set) throws CannotDisseminateFormatException,
            NoRecordsMatchException, NoSetHierarchyException,
            RepositoryException {
        if (!metadataPrefix.equals("oai_dc")) {
            throw new CannotDisseminateFormatException("Repository does not provide that format in OAI-PMH responses.");
        }
        List l = null;
        FieldSearchResult fsr;
        try {
            fsr =
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.