public static String buildIdentifier(String handle) { if (_prefix == null) { _prefix = ConfigurationManager.getProperty("oai", "identifier.prefix"); } return "oai:" + _prefix + ":" + handle; }
private static String getBaseDir() { if (baseDir == null) { String dir = ConfigurationManager.getProperty("oai", "cache.dir") + REQUEST_DIR; baseDir = dir; } return baseDir; }
@Override public String getMyDSpaceLink() { return ConfigurationManager.getProperty("dspace.url") + "/mydspace"; } }
public RDFCrosswalk(Properties properties) { super( "http://www.openarchives.org/OAI/2.0/rdf/ http://www.openarchives.org/OAI/2.0/rdf.xsd"); baseUrl = ConfigurationManager.getProperty("dspace.url"); hostName = ConfigurationManager.getProperty("dspace.hostname"); }
@Override public String getProperty(String key) { return ConfigurationManager.getProperty(key); }
protected static String getDefaultedConfiguration(String key, String dfl) { String result = ConfigurationManager.getProperty(key); return (result == null) ? dfl : result; }
private static boolean getKnownExplanation(Throwable t) { if (t instanceof ConnectException) { System.err.println("Solr server (" + ConfigurationManager.getProperty("oai", "solr.url") + ") is down, turn it on."); return true; } return false; }
public LCNameAuthority() { if (url == null) { url = ConfigurationManager.getProperty("lcname.url"); // sanity check if (url == null) { throw new IllegalStateException("Missing DSpace configuration keys for LCName Query"); } } }
public SHERPARoMEOProtocol() { if (url == null) { url = ConfigurationManager.getProperty("sherpa.romeo.url"); // sanity check if (url == null) { throw new IllegalStateException("Missing DSpace configuration keys for SHERPA/RoMEO Query"); } } }
@Override public String getExportWorkDirectory() throws Exception { String exportDir = ConfigurationManager .getProperty("org.dspace.app.itemexport.work.dir"); if (exportDir == null) { throw new Exception( "A dspace.cfg entry for 'org.dspace.app.itemexport.work.dir' does not exist."); } return exportDir; }
/** * Return the specified directory name or fall back to a default value. * * @param directoryValue a specific directory name. Optional. * @return directoryValue if given as a non-blank string. A default directory otherwise. */ private static String makeDirectoryName(String directoryValue) { if (StringUtils.isNotBlank(directoryValue)) { return directoryValue; } return ConfigurationManager.getProperty("dspace.dir") + File.separator + "solr-export" + File.separator; }
private static File getFile() { if (file == null) { String dir = ConfigurationManager.getProperty("oai", "cache.dir") + DATEFILE; file = new File(dir); } return file; }
/** * Get the configured Handle prefix string, or a default * * @return configured prefix or "123456789" */ public static String getPrefix() { String prefix = ConfigurationManager.getProperty("handle.prefix"); if (null == prefix) { prefix = EXAMPLE_PREFIX; // XXX no good way to exit cleanly log.error("handle.prefix is not configured; using " + prefix); } return prefix; }
public static void setAllTasks() throws WingException, UnsupportedEncodingException { String csvList = ConfigurationManager.getProperty("curate", CURATE_TASK_NAMES); String[] properties = csvList.split(","); for (String property : properties) { //System.out.println("set all tasks and property = " + property + "\n"); String[] keyValuePair = property.split("="); allTasks.put(URLDecoder.decode(keyValuePair[0].trim(), "UTF-8"), URLDecoder.decode(keyValuePair[1].trim(), "UTF-8")); } }
/** * Get an array of all the analysis and report files. * * @return array of files */ private static File[] getAnalysisAndReportFileList() { File reportDir = new File(ConfigurationManager.getProperty("log.report.dir")); if (reportDir != null) { return reportDir.listFiles(new AnalysisAndReportFilter()); } return null; }
public static SolrServer getServer() throws SolrServerException { if (_server == null) { try { _server = new HttpSolrServer( ConfigurationManager.getProperty("oai", "solr.url")); log.debug("Solr Server Initialized"); } catch (Exception e) { log.error(e.getMessage(), e); } } return _server; } }
protected String getManifestBitstreamFormat() { return ConfigurationManager.getProperty("mets." + getConfigurationName() + ".ingest.manifestBitstreamFormat"); }
@Override public RequestItemAuthor getRequestItemAuthor(Context context, Item item) throws SQLException { boolean helpdeskOverridesSubmitter = ConfigurationManager .getBooleanProperty("request.item.helpdesk.override", false); String helpDeskEmail = ConfigurationManager.getProperty("mail.helpdesk"); if (helpdeskOverridesSubmitter && StringUtils.isNotBlank(helpDeskEmail)) { return getHelpDeskPerson(context, helpDeskEmail); } else { //Fallback to default logic (author of Item) if helpdesk isn't fully enabled or setup return super.getRequestItemAuthor(context, item); } }
protected HttpSolrServer getSolr() throws MalformedURLException, SolrServerException { if (solr == null) { String solrService = ConfigurationManager.getProperty("solr.authority.server"); log.debug("Solr authority URL: " + solrService); solr = new HttpSolrServer(solrService); solr.setBaseURL(solrService); SolrQuery solrQuery = new SolrQuery().setQuery("*:*"); solr.query(solrQuery); } return solr; }
public void addBody(Body body) throws WingException { Division invalid = body.addDivision("invalid-token","primary"); invalid.setHead(T_head); invalid.addPara(T_para1); Para example1 = invalid.addPara("invalid-token-examlpe","code"); example1.addContent(ConfigurationManager.getProperty("dspace.url") + "/register?token=ABCDEFGHIJK"); Para example2 = invalid.addPara("invalid-token-examlpe","code"); example2.addContent("LMNOP"); invalid.addPara(T_para2); Para example3 = invalid.addPara("valid-token-examlpe","code"); example3.addContent(ConfigurationManager.getProperty("dspace.url") + "/register?token=ABCDEFGHIJKLMNOP"); }