/** * {@inheritDoc} */ @Override public int getMaxProfilePictureSize() { return this.serverConfigurationService.getInt("profile2.picture.max", ProfileConstants.MAX_IMAGE_UPLOAD_SIZE); }
/** * {@inheritDoc} */ @Override public int getMaxSearchResults() { return this.serverConfigurationService.getInt( "profile2.search.maxSearchResults", ProfileConstants.DEFAULT_MAX_SEARCH_RESULTS); }
/** * {@inheritDoc} */ @Override public int getMaxSearchResultsPerPage() { return this.serverConfigurationService.getInt( "profile2.search.maxSearchResultsPerPage", ProfileConstants.DEFAULT_MAX_SEARCH_RESULTS_PER_PAGE); }
public void init() { tii_Max_Fil_Size = serverConfigurationService.getInt("turnitin.maxFileSize", TII_DEFAULT_MAX_FILE_SIZE); }
public void init() { max_file_size = serverConfigurationService.getInt("urkund.maxFileSize", DEFAULT_MAX_FILE_SIZE); }
public Integer getScaleFactor() { Integer decimals = m_serverConfigurationService.getInt("assignment.grading.decimals", AssignmentConstants.DEFAULT_DECIMAL_POINT); return (int)Math.pow(10.0, decimals); }
/** * Time in the past which sites deleted before can be deleted. * * @return */ private Date getGraceDate() { // get the gracetime config param in days. int gracetime = serverConfigurationService.getInt( "site.soft.deletion.gracetime", GRACETIME_DEFAULT); // get calendar for gracetime Calendar grace = Calendar.getInstance(); grace.add(Calendar.DATE, -gracetime); Date graceDate = grace.getTime(); log.debug("Grace set to: " + graceDate); return graceDate; }
/** * Time in the past which sites deleted before can be deleted. * * @return */ private Date getGraceDate() { // get the gracetime config param in days. int gracetime = serverConfigurationService.getInt( "site.soft.deletion.gracetime", GRACETIME_DEFAULT); // get calendar for gracetime Calendar grace = Calendar.getInstance(); grace.add(Calendar.DATE, -gracetime); Date graceDate = grace.getTime(); log.debug("Grace set to: " + graceDate); return graceDate; }
public static int getInt(java.lang.String param0, int param1) { org.sakaiproject.component.api.ServerConfigurationService service = getInstance(); if (service == null) return 0; return service.getInt(param0, param1); }
/** * Initialization method (Spring) */ public void init() { // Get the values from sakai.properties if (serverConfigurationService == null) { serverConfigurationService = (ServerConfigurationService) ComponentManager.get(org.sakaiproject.component.api.ServerConfigurationService.class); } if (serverConfigurationService != null) { minEntropy = serverConfigurationService.getInt(SAK_PROP_MIN_PASSWORD_ENTROPY, minEntropy); mediumEntropy = serverConfigurationService.getInt(SAK_PROP_MEDIUM_PASSWORD_ENTROPY, mediumEntropy); highEntropy = serverConfigurationService.getInt(SAK_PROP_HIGH_PASSWORD_ENTROPY, highEntropy); maxSequenceLength = serverConfigurationService.getInt(SAK_PROP_MAX_PASSWORD_SEQ_LENGTH, maxSequenceLength); if (maxSequenceLength < 0) { maxSequenceLength = 0; } if (mediumEntropy < minEntropy) { mediumEntropy = DEFAULT_MEDIUM_ENTROPY; } if (highEntropy < mediumEntropy) { highEntropy = DEFAULT_HIGH_ENTROPY; } } log.info("PasswordPolicyProviderDefaultImpl.init(): minEntropy="+minEntropy+", mediumEntropy="+mediumEntropy+ ", highEntropy="+highEntropy+", maxSequenceLength="+maxSequenceLength); }
public void init() { maxRetry = Long.valueOf(serverConfigurationService.getInt("urkund.maxRetry", 20)); spoofEmailContext = serverConfigurationService.getString("urkund.spoofemailcontext", null); }
private String truncateFileName(String fileName) { int i = serverConfigurationService.getInt(PROP_MAX_FILENAME_LENGTH, DEFAULT_MAX_FILENAME_LENGTH); if(StringUtils.isBlank(fileName)) { return "noname"; } if(i < 0) { return fileName; } if(fileName.length() < i) { return fileName; } // get the extension for later re-use String extension = ""; if (fileName.contains(".")) { extension = fileName.substring(fileName.lastIndexOf(".")); } fileName = fileName.substring(0, i - extension.length()); fileName = fileName + extension; return fileName; }
/** * Construct the Cache. No automatic refresh: expire only, from time and events. * * @param sleep * The number of seconds to sleep between expiration checks. * @param pattern * The "startsWith()" string for all resources that may be in this cache - if null, don't watch events for updates. */ // Modify constructor to allow injecting the server configuration service. public SiteCacheImpl(MemoryService memoryService, long sleep, String pattern, ServerConfigurationService serverConfigurationService) { m_cache = memoryService.newCache( "org.sakaiproject.site.impl.SiteCacheImpl.cache", pattern); // Provide an instance of the server configuration service. this.serverConfigurationService = serverConfigurationService; cacheEventReportInterval = serverConfigurationService.getInt("org.sakaiproject.site.impl.SiteCacheImpl.cache.cacheEventReportInterval", cacheEventReportInterval); }
public void init() { log.info("init()"); secretKey = serverConfigurationService.getString("compilatio.secretKey"); apiURL = serverConfigurationService.getString("compilatio.apiURL", DEFAULT_API_URL); // Timeout period in ms for network connections (default 180s). Set to 0 to disable timeout. compilatioConnTimeout = serverConfigurationService.getInt("compilatio.networkTimeout", DEFAULT_TIMEOUT); }
public void init(){ log.info("init()"); port = serverConfigurationService.getInt("virusScan.port", 3310); host = serverConfigurationService.getString("virusScan.host", "localhost"); enabled = serverConfigurationService.getBoolean("virusScan.enabled", false); }
/** * called by the spring framework after this class has been instantiated, this method reads in the following values from sakai.properties: * <ol> * <li>course_site_publish_service.user </li> * <li>course_site_publish_service.num_days_before_term_starts</li> * </ol> */ public void init() { log.debug("init()"); // get the number of days after a term ends after which course sites that have expired will be removed try{ numDaysBeforeTermStarts= serverConfigurationService.getInt(PROPERTY_COURSE_SITE_PUBLISH_NUM_DAYS_BEFORE_TERM_STARTS, DEFAULT_VALUE_COURSE_SITE_PUBLISH_NUM_DAYS_BEFORE_TERM_STARTS); } catch (NumberFormatException ex) { log.error("The value specified for numDaysBeforeTermStarts in sakai.properties, " + PROPERTY_COURSE_SITE_PUBLISH_NUM_DAYS_BEFORE_TERM_STARTS + ", is not valid. A default value of " + DEFAULT_VALUE_COURSE_SITE_PUBLISH_NUM_DAYS_BEFORE_TERM_STARTS + " will be used instead."); numDaysBeforeTermStarts = DEFAULT_VALUE_COURSE_SITE_PUBLISH_NUM_DAYS_BEFORE_TERM_STARTS; } if (numDaysBeforeTermStarts < 0) { log.error("The value specified for numDaysBeforeTermStartsString in sakai.properties, " + PROPERTY_COURSE_SITE_PUBLISH_NUM_DAYS_BEFORE_TERM_STARTS + ", is not valid. A default value of " + DEFAULT_VALUE_COURSE_SITE_PUBLISH_NUM_DAYS_BEFORE_TERM_STARTS + " will be used instead."); numDaysBeforeTermStarts = DEFAULT_VALUE_COURSE_SITE_PUBLISH_NUM_DAYS_BEFORE_TERM_STARTS; } // get the user which will be used to run the quartz job String userId = serverConfigurationService.getString(PROPERTY_COURSE_SITE_PUBLISH_USER,DEFAULT_VALUE_COURSE_SITE_PUBLISH_USER); try { user = userDirectoryService.getUser(userId); } catch (UserNotDefinedException ex) { user = null; log.error("The user with eid " + userId + " was not found. The course site publish job has been aborted."); } }
/** * called by the spring framework after this class has been instantiated, this method reads in the following values from sakai.properties: * <ol> * <li>course_site_publish_service.user </li> * <li>course_site_publish_service.num_days_before_term_starts</li> * </ol> */ public void init() { log.debug("init()"); // get the number of days after a term ends after which course sites that have expired will be removed try{ numDaysBeforeTermStarts= serverConfigurationService.getInt(PROPERTY_COURSE_SITE_PUBLISH_NUM_DAYS_BEFORE_TERM_STARTS, DEFAULT_VALUE_COURSE_SITE_PUBLISH_NUM_DAYS_BEFORE_TERM_STARTS); } catch (NumberFormatException ex) { log.error("The value specified for numDaysBeforeTermStarts in sakai.properties, " + PROPERTY_COURSE_SITE_PUBLISH_NUM_DAYS_BEFORE_TERM_STARTS + ", is not valid. A default value of " + DEFAULT_VALUE_COURSE_SITE_PUBLISH_NUM_DAYS_BEFORE_TERM_STARTS + " will be used instead."); numDaysBeforeTermStarts = DEFAULT_VALUE_COURSE_SITE_PUBLISH_NUM_DAYS_BEFORE_TERM_STARTS; } if (numDaysBeforeTermStarts < 0) { log.error("The value specified for numDaysBeforeTermStartsString in sakai.properties, " + PROPERTY_COURSE_SITE_PUBLISH_NUM_DAYS_BEFORE_TERM_STARTS + ", is not valid. A default value of " + DEFAULT_VALUE_COURSE_SITE_PUBLISH_NUM_DAYS_BEFORE_TERM_STARTS + " will be used instead."); numDaysBeforeTermStarts = DEFAULT_VALUE_COURSE_SITE_PUBLISH_NUM_DAYS_BEFORE_TERM_STARTS; } // get the user which will be used to run the quartz job String userId = serverConfigurationService.getString(PROPERTY_COURSE_SITE_PUBLISH_USER,DEFAULT_VALUE_COURSE_SITE_PUBLISH_USER); try { user = userDirectoryService.getUser(userId); } catch (UserNotDefinedException ex) { user = null; log.error("The user with eid " + userId + " was not found. The course site publish job has been aborted."); } }
/** * SAK-23567 Gets the shortened version of the title * * Controlled by "site.title.cut.method", "site.title.cut.maxlength", and "site.title.cut.separator" * * @param text the full site title (or desc) to shorten * @param maxLength maximum length for the string before it is shortened (and after shortening) (null defaults to 25) * @param separator the separator string to use (null defaults to '...') * @param cutMethod the string key method for cutting (null defaults to '100:0') * @return the shortened string */ public String makeShortenedText(String text, Integer maxLength, String separator, String cutMethod) { // this method defines the defaults for the 3 configuration options if (maxLength == null || maxLength < 1) { // SAK-31985: New property needed to control the site title maxLength = serverConfigurationService.getInt("site.title.cut.maxlength", serverConfigurationService.getInt("site.title.maxlength", 25)); } if (separator == null) { separator = serverConfigurationService.getString("site.title.cut.separator", " ..."); } if (cutMethod == null) { cutMethod = serverConfigurationService.getString("site.title.cut.method", "100:0"); } return makeShortText(text, cutMethod, maxLength, separator); }
public void init() { log.info("init()"); receiverAddress = serverConfigurationService.getString("urkund.address"); username = serverConfigurationService.getString("urkund.username"); password = serverConfigurationService.getString("urkund.password"); apiURL = serverConfigurationService.getString("urkund.apiURL", DEFAULT_API_URL); // Timeout period in ms for network connections (default 180s). Set to 0 to disable timeout. connTimeout = serverConfigurationService.getInt("urkund.networkTimeout", DEFAULT_TIMEOUT); }
/** * Final initialization, once all dependencies are set. */ public void init() { m_relativeAccessPoint = REFERENCE_ROOT; // construct storage and read m_storage = newStorage(); m_storage.open(); // setup the queue m_digestQueue.clear(); // Resource Bundle String resourceClass = serverConfigurationService.getString(RESOURCECLASS, DEFAULT_RESOURCECLASS); String resourceBundle = serverConfigurationService.getString(RESOURCEBUNDLE, DEFAULT_RESOURCEBUNDLE); rb = new Resource().getLoader(resourceClass, resourceBundle); // USE A TIMER INSTEAD OF CREATING A NEW THREAD -AZ // start(); int digestPeriod = serverConfigurationService.getInt(EMAIL_DIGEST_CHECK_PERIOD_PROPERTY, DIGEST_PERIOD); int digestDelay = serverConfigurationService.getInt(EMAIL_DIGEST_START_DELAY_PROPERTY, DIGEST_DELAY); m_debugBypass = serverConfigurationService.getBoolean(BY_PASS_FOR_DEBUG, false); digestDelay += new Random().nextInt(60); // add some random delay to get the servers out of sync digestTimer.schedule(new DigestTimerTask(), (digestDelay * 1000), (digestPeriod * 1000) ); log.info("init(): email digests will be checked in " + digestDelay + " seconds and then every " + digestPeriod + " seconds while the server is running" ); }