public static String buildIdentifier(String handle) { if (_prefix == null) { _prefix = ConfigurationManager.getProperty("oai", "identifier.prefix"); } return "oai:" + _prefix + ":" + handle; }
private static void getThumbSettings() { showThumbs = ConfigurationManager .getBooleanProperty("webui.browse.thumbnail.show"); if (showThumbs) { thumbItemListMaxHeight = ConfigurationManager .getIntProperty("webui.browse.thumbnail.maxheight"); if (thumbItemListMaxHeight == 0) { thumbItemListMaxHeight = ConfigurationManager .getIntProperty("thumbnail.maxheight"); } thumbItemListMaxWidth = ConfigurationManager .getIntProperty("webui.browse.thumbnail.maxwidth"); if (thumbItemListMaxWidth == 0) { thumbItemListMaxWidth = ConfigurationManager .getIntProperty("thumbnail.maxwidth"); } } String linkBehaviour = ConfigurationManager .getProperty("webui.browse.thumbnail.linkbehaviour"); if ("bitstream".equals(linkBehaviour)) { linkToBitstream = true; } }
public void init() { if(!ConfigurationManager.isConfigured()) { // Get config parameter String config = getServletContext().getInitParameter("dspace-config"); // Load in DSpace config ConfigurationManager.loadConfig(config); } } }
/** * Create an HTML Servlet */ public HTMLServlet() { super(); if (ConfigurationManager.getProperty("webui.html.max-depth-guess") != null) { maxDepthGuess = ConfigurationManager .getIntProperty("webui.html.max-depth-guess"); } else { maxDepthGuess = 3; } }
public InputStream getThumb(Item currentItem, BufferedImage buf, boolean verbose) throws Exception { // get config params float xmax = (float) ConfigurationManager .getIntProperty("thumbnail.maxwidth"); float ymax = (float) ConfigurationManager .getIntProperty("thumbnail.maxheight"); boolean blurring = (boolean) ConfigurationManager .getBooleanProperty("thumbnail.blurring"); boolean hqscaling = (boolean) ConfigurationManager .getBooleanProperty("thumbnail.hqscaling"); return getThumbDim(currentItem, buf, verbose, xmax, ymax, blurring, hqscaling, 0, 0, null); }
/** * Is tag cloud enabled * * @return true or false */ public boolean isTagCloudEnabled() { return ConfigurationManager.getBooleanProperty("webui.browse.index.tagcloud." + number); } }
@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); } }
.getProperty("alert.recipient"); .getEmail(I18nUtil.getEmailFilename( Locale.getDefault(), "internal_error")); email.addRecipient(recipient); email.addArgument(ConfigurationManager .getProperty("dspace.url")); email.addArgument(new Date());
String host = ConfigurationManager.getProperty("dspace.hostname"); String itemUrl = HandleManager.resolveToURL(context,handle); String message = request.getParameter("message"); String siteName = ConfigurationManager.getProperty("dspace.name"); Email email = ConfigurationManager.getEmail(I18nUtil.getEmailFilename(context.getCurrentLocale(), "suggest")); if (ConfigurationManager.getBooleanProperty("webui.suggest.enable", false))
/** * Get a module configuration property as an integer * * @param module the name of the module * @param property the name of the property * @return the value of the property. <code>0</code> is returned if the * property does not exist. To differentiate between this case and * when the property actually is zero, use <code>getProperty</code>. */ public static int getIntProperty(String module, String property) { if (module == null) { return getIntProperty(property); } // Assume "module" properties are always prefixed with the module name return getIntProperty(module + "." + property); }
tempDir = ConfigurationManager.getProperty("upload.temp.dir"); long maxSize = ConfigurationManager.getLongProperty("upload.max");
/** * Set authority controlled fields */ private static void setAuthorizedMetadataFields() { authorityControlled = new HashSet<String>(); Enumeration propertyNames = ConfigurationManager.getProperties().propertyNames(); while (propertyNames.hasMoreElements()) { String key = ((String) propertyNames.nextElement()).trim(); if (key.startsWith(AC_PREFIX) && ConfigurationManager.getBooleanProperty(key, false)) { authorityControlled.add(key.substring(AC_PREFIX.length())); } } }
/** * Get a module configuration property as a long * * @param module the name of the module * @param property the name of the property * @return the value of the property. <code>0</code> is returned if the * property does not exist. To differentiate between this case and * when the property actually is zero, use <code>getProperty</code>. */ public static long getLongProperty(String module, String property) { if (module == null) { return getLongProperty(property); } // Assume "module" properties are always prefixed with the module name return getLongProperty(module + "." + property); }
@Override public boolean getBooleanProperty(String module, String key, boolean defaultValue) { return ConfigurationManager.getBooleanProperty(module, key, defaultValue); } }
@Override public void deleteOldExportArchives() throws Exception { int hours = ConfigurationManager.getIntProperty("org.dspace.app.itemexport.life.span.hours"); Calendar now = Calendar.getInstance(); now.setTime(new Date()); now.add(Calendar.HOUR, (-hours)); File downloadDir = new File(ConfigurationManager.getProperty("org.dspace.app.itemexport.download.dir")); if (downloadDir.exists()) { // Get a list of all the sub-directories, potentially one for each ePerson. File[] dirs = downloadDir.listFiles(); for (File dir : dirs) { // For each sub-directory delete any old files. File[] files = dir.listFiles(); for (File file : files) { if (file.lastModified() < now.getTimeInMillis()) { if (!file.delete()) { log.error("Unable to delete old files"); } } } // If the directory is now empty then we delete it too. if (dir.listFiles().length == 0) { if (!dir.delete()) { log.error("Unable to delete directory"); } } } } }
/** * Get an array of all the browse indices for the current configuration * * @return an array of all the current browse indices * @throws BrowseException if browse error */ public static BrowseIndex[] getBrowseIndices() throws BrowseException { int idx = 1; String definition; ArrayList<BrowseIndex> browseIndices = new ArrayList<BrowseIndex>(); while (((definition = ConfigurationManager.getProperty("webui.browse.index." + idx))) != null) { BrowseIndex bi = new BrowseIndex(definition, idx); bi.displayFrequencies = Boolean.valueOf(ConfigurationManager .getBooleanProperty("webui.browse.metadata.show-freq." + idx, true)); browseIndices.add(bi); idx++; } BrowseIndex[] bis = new BrowseIndex[browseIndices.size()]; bis = browseIndices.toArray(bis); return bis; }
String host = ConfigurationManager.getProperty("dspace.hostname"); String allowedReferrersString = ConfigurationManager.getProperty("mail.allowed.referrers"); Email email = ConfigurationManager.getEmail(I18nUtil.getEmailFilename(context.getCurrentLocale(), "feedback")); email.addRecipient(ConfigurationManager .getProperty("feedback.recipient"));
/** * Get a module configuration property as an integer, with default * * @param module the name of the module * @param property the name of the property * @param defaultValue value to return if property is not found or is not an Integer. * @return the value of the property. <code>default</code> is returned if * the property does not exist or is not an Integer. To differentiate between this case * and when the property actually is false, use * <code>getProperty</code>. */ public static int getIntProperty(String module, String property, int defaultValue) { if (module == null) { return getIntProperty(property, defaultValue); } // Assume "module" properties are always prefixed with the module name return getIntProperty(module + "." + property, defaultValue); }
/** * Get a configuration property as an long, with default * * @param module the module, or <code>null</code> for regular property * @param property the name of the property * @param defaultValue value to return if property is not found or is not a Long. * @return the value of the property. <code>default</code> is returned if * the property does not exist or is not an Integer. To differentiate between this case * and when the property actually is false, use * <code>getProperty</code>. */ public static long getLongProperty(String module, String property, int defaultValue) { if (module == null) { return getLongProperty(property, defaultValue); } // Assume "module" properties are always prefixed with the module name return getLongProperty(module + "." + property, defaultValue); }
private static String getBaseDir() { if (baseDir == null) { String dir = ConfigurationManager.getProperty("oai", "cache.dir") + REQUEST_DIR; baseDir = dir; } return baseDir; }