private Element retrieveAndConvertPublication(String externalID) { String uri = MessageFormat.format(importURI, externalID); return MCRURIResolver.instance().resolve(uri); }
CustomDescription(String descriptionURI) { description = MCRURIResolver.instance().resolve(descriptionURI); }
private Element resolve(String uri, String sStatic) throws TransformerConfigurationException, TransformerException, TransformerFactoryConfigurationError { Map<String, Element> cache = chooseCacheLevel(uri, sStatic); if (cache.containsKey(uri)) { LOGGER.debug("uri was cached: " + uri); return cache.get(uri); } else { Element xml = MCRURIResolver.instance().resolve(uri); cache.put(uri, xml); return xml; } }
@Override public Source resolve(String href, String base) throws TransformerException { href = href.substring(href.indexOf(":") + 1); String configID = href.substring(0, href.indexOf(':')); href = href.substring(href.indexOf(":") + 1); Element mods = MCRURIResolver.instance().resolve(href); enrichPublication(mods, configID); return new JDOMSource(mods); }
public void loadResource(String uri, String name) { Element resource = MCRURIResolver.instance().resolve(uri); editorSession.getVariables().put(name, resource); }
@Override public Source resolve(String href, String base) throws TransformerException { String subHref = href.substring(href.indexOf(":") + 1); Element mods = MCRURIResolver.instance().resolve(subHref); MCRMODSSorter.sort(mods); return new JDOMSource(mods); }
/** * Tries to resolve publication data for the given identifier. * * @param identifier the identifier's value, e.g. a DOI or ISBN * @return the publication data in MODS format, or null if the data source did not return data for this identifier */ Element resolve(String identifier) { Element resolved = null; try { String uri = MessageFormat.format(uriPattern, identifier, URLEncoder.encode(identifier, "UTF-8")); resolved = MCRURIResolver.instance().resolve(uri); } catch (Exception ex) { LOGGER.info("Exception resolving {}: {} {}", identifier, ex.getClass().getName(), ex.getMessage()); } // Normalize various error/not found cases: if (resolved == null) { return null; } else if (!"mods".equals(resolved.getName())) { return null; } else if (resolved.getChildren().isEmpty()) { return null; } else { return resolved; } } }
protected Element getURI(String uri) { Element e = MCRURIResolver.instance().resolve(uri).detach(); if (LOGGER.isDebugEnabled()) { LOGGER.debug("get {}", uri); XMLOutputter out = new XMLOutputter(Format.getPrettyFormat()); LOGGER.debug(out.outputString(e)); } return e; }
if (attr.getValue().startsWith("resource:")) { File tmpFile = File.createTempFile("resfile", ".xml"); MCRContent source = new MCRJDOMContent(MCRURIResolver.instance().resolve(attr.getValue())); source.sendTo(tmpFile);
LOGGER.info("Request file \"" + request + "\"..."); getLayoutService().doLayout(job.getRequest(), job.getResponse(), new MCRJDOMContent(MCRURIResolver.instance().resolve("resource:setup/" + request))); final Element commands = MCRURIResolver.instance().resolve("resource:setup/install.xml"); cmd.setInputXML(MCRURIResolver.instance().resolve(src));
Element classifications = MCRURIResolver.instance().resolve(CLASSIFICATIONS_CFG);
protected OAIDataList<MCRSet> createSetList() { OAIDataList<MCRSet> setList = new OAIDataList<>(); synchronized (this.setConfigurationMap) { for (MCROAISetConfiguration<?, ?, ?> conf : this.setConfigurationMap.values()) { MCROAISetHandler<?, ?, ?> handler = conf.getHandler(); Map<String, MCRSet> setMap = handler.getSetMap(); synchronized (setMap) { setMap.clear(); Element resolved = MCRURIResolver.instance().resolve(conf.getURI()); if (resolved == null) { throw new MCRException( "Could not resolve set URI " + conf.getURI() + " for set " + conf.getId() + "."); } for (Element setElement : resolved.getChildren("set", OAIConstants.NS_OAI)) { MCRSet set = createSet(conf.getId(), setElement); setMap.put(set.getSpec(), set); if (!contains(set.getSpec(), setList)) { if (!handler.filter(set)) { setList.add(set); } } } } } } return setList; }