Package com.lyncode.xoai.dataprovider.exceptions

Examples of com.lyncode.xoai.dataprovider.exceptions.IdDoesNotExistException


            if (parts.length == 3)
            {
                DSpaceObject obj = HandleManager.resolveToObject(context.getContext(),
                        parts[2]);
                if (obj == null)
                    throw new IdDoesNotExistException();
                if (!(obj instanceof Item))
                    throw new IdDoesNotExistException();

                org.dspace.content.Item item = (org.dspace.content.Item) obj;
                return new DSpaceDatabaseItem(item, this.getMetadata(item), getSets(item));
            }
        }
        catch (NumberFormatException e)
        {
            log.debug(e.getMessage(), e);
            throw new IdDoesNotExistException();
        }
        catch (SQLException e)
        {
            throw new OAIException(e);
        } catch (IOException e) {
            throw new OAIException(e);
        } catch (ContextServiceException e) {
            throw new OAIException(e);
        }
        throw new IdDoesNotExistException();
    }
View Full Code Here


        this.solrQueryResolver = solrQueryResolver;
    }

    @Override
    public Item getItem(String identifier) throws IdDoesNotExistException {
        if (identifier == null) throw new IdDoesNotExistException();
        String parts[] = identifier.split(Pattern.quote(":"));
        if (parts.length == 3)
        {
            try
            {
                SolrQuery params = new SolrQuery("item.handle:" + parts[2]);
                return new DSpaceSolrItem(DSpaceSolrSearch.querySingle(server, params));
            }
            catch (SolrSearchEmptyException ex)
            {
                throw new IdDoesNotExistException(ex);
            }
        }
        throw new IdDoesNotExistException();
    }
View Full Code Here

TOP

Related Classes of com.lyncode.xoai.dataprovider.exceptions.IdDoesNotExistException

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.