public boolean available(ContentEntity entity) { return ServerConfigurationService.getBoolean(ContentHostingService.RESOURCES_ZIP_ENABLE, true) || ServerConfigurationService.getBoolean(ContentHostingService.RESOURCES_ZIP_ENABLE_COMPRESS, true); } }
public boolean isAvailable() { if (!setup) { if (!experimental) { available = true; } else if (ServerConfigurationService.getBoolean("wiki.experimental", false)) { available = true; } else { available = false; } setup = true; } return available; }
public boolean getAutoDdl() { boolean autoDdl = false; if(ServerConfigurationService.getString("sitestats.db", "internal").equals("internal")) { autoDdl = ServerConfigurationService.getBoolean("auto.ddl", true); }else{ autoDdl = ServerConfigurationService.getBoolean("sitestats.externalDb.auto.ddl", true); } return autoDdl; } }
@Override public boolean available(ContentEntity entity) { boolean enabled = false; if (entity instanceof ContentResource) { enabled = ServerConfigurationService.getBoolean(ContentHostingService.RESOURCES_ZIP_ENABLE, true) || ServerConfigurationService.getBoolean(ContentHostingService.RESOURCES_ZIP_ENABLE_EXPAND, true); enabled = enabled && entity.getId().toLowerCase().endsWith(".zip"); } return enabled; } }
/********************************************************************************************************************************************************************************************************************************************************** * Init and Destroy *********************************************************************************************************************************************************************************************************************************************************/ public void init() { log.info("init()"); m_addresses.clear(); locks = new Object[nLocks]; for (int i = 0; i < nLocks; i++) locks[i] = new Object(); m_checkEvery = ServerConfigurationService.getInt("courier.maintThreadChecks", 300); m_aggressiveCleanup = ServerConfigurationService.getBoolean("courier.aggressiveCleanup", false); // start the maintenance thread scheduler = Executors.newSingleThreadScheduledExecutor(); scheduler.scheduleWithFixedDelay( this, 0, m_checkEvery, // run every TimeUnit.SECONDS ); }
/** * Determine if this is an inline request. * * @param <code>req</code> * The request object. If you have no access to the request object, * you can leave this null and we will try to pull the request * from ThreadLocal - if we fail it is a RunTime exception. * @return True if this is a request where a tool will be inlined. */ public static boolean isInlineRequest(HttpServletRequest req) { if ( req == null ) req = getRequestFromThreadLocal(); // Note that with wrapped requests, URLUtils.getSafePathInfo may return null // so we use the request URI String uri = req.getRequestURI(); if ( uri != null ) { String[] parts = uri.split("/"); if ((parts.length >= 6) ) { return parts[4].equals("tool"); } return false; } // Fall back to the system default return ServerConfigurationService.getBoolean(PORTAL_INLINE_EXPERIMENTAL, PORTAL_INLINE_EXPERIMENTAL_DEFAULT); }
public void init() { boolean convertMedia = ServerConfigurationService.getBoolean(CONVERT_MEDIA_PROP, false); if (convertMedia) { gq = persistenceService.getAssessmentGradingFacadeQueries(); convert(); } }
boolean doReplaceSiteIds = ServerConfigurationService.getBoolean("samigo.publish.update.siteids", true); if (doReplaceSiteIds == false) { return assessmentStringData;
public void init() { boolean convertMedia = ServerConfigurationService.getBoolean(CONVERT_MEDIA_PROP, false); if (convertMedia) { gq = persistenceService.getAssessmentGradingFacadeQueries(); convert(); } }
/** * Should a basic auth be used * @param req * @return */ protected boolean doBasicAuth(HttpServletRequest req) { boolean allowBasicAuth = ServerConfigurationService.getBoolean( "allow.basic.auth.login", false); if (allowBasicAuth) { if (requestedBasicAuth(req) || !isBrowser(req.getHeader("User-Agent"))) { allowBasicAuth = true; } else { allowBasicAuth = false; } } return allowBasicAuth; }
boolean doReplaceSiteIds = ServerConfigurationService.getBoolean("samigo.publish.update.siteids", true); if (doReplaceSiteIds == false) { return assessmentStringData;
/** * Return ResourceBundle for user's preferred locale * * @return user's ResourceBundle object */ protected ResourceBundle getBundle() { Locale loc = getLocale(); String context = (String) getThreadLocalManager().get(org.sakaiproject.util.RequestFilter.CURRENT_CONTEXT); if (log.isDebugEnabled()) log.debug("Request for bundle " + baseName + "/" + context + "/" + loc.toString()); ResourceBundle bundle = this.bundles.get(loc); if (bundle == null) { bundle = loadBundle(context, loc); } if (ServerConfigurationService.getBoolean("load.bundles.from.db", false)) { Map<String, String> bundleFromDbMap = getMessageBundleService().getBundle(baseName, context, loc); if (!bundleFromDbMap.isEmpty()) { // skip if there are no modified bundle data Map<String, Object> bundleMap = getBundleAsMap(bundle); bundleMap.putAll(bundleFromDbMap); bundle = new MapResourceBundle(bundleMap, baseName, loc); } if (log.isDebugEnabled()) { log.debug("Bundle from db added " + bundleFromDbMap.size() + " properties to " + baseName + "/" + context + "/" + loc.toString()); } } return bundle; }
if (ServerConfigurationService.getBoolean("load.bundles.from.db", false)) {
String filename = resource.getId().substring(rootId.length(),resource.getId().length()); if(ContentHostingService.isInDropbox(rootId) && ServerConfigurationService.getBoolean("dropbox.zip.haveDisplayname", true)) { try { filename = getContainingFolderDisplayName(rootId, filename);
private void addAssessmentMetadata(AssessmentType assessment) { QtimetadataType metadata = assessment.addNewQtimetadata(); AssessmentService service = new AssessmentService(); List metadataList = service.getDefaultMetaDataSet(); Iterator iter = metadataList.iterator(); String automaticSubmissionEditable = "true"; while (iter.hasNext()) { AssessmentMetaData mData = (AssessmentMetaData) iter.next(); if ("automaticSubmission_isInstructorEditable".equals((String) mData.getLabel())) { automaticSubmissionEditable = (String) mData.getEntry(); } else { String label = (String) mData.getLabel(); String entry = (String) mData.getEntry(); buildMetaDataField(metadata, label, entry); } } boolean autoSubmitEnabled = ServerConfigurationService.getBoolean("samigo.autoSubmit.enabled", false); if (!autoSubmitEnabled) { buildMetaDataField(metadata, "automaticSubmission_isInstructorEditable", "false"); } else { buildMetaDataField(metadata, "automaticSubmission_isInstructorEditable", automaticSubmissionEditable); } }
public boolean available(ContentEntity entity) {; return ServerConfigurationService.getBoolean("content.make.site.page",true) // Not in a dropbox && !ContentHostingService.isInDropbox(entity.getId()) // Not in a user site. && !SiteService.isUserSite(EntityManager.newReference(entity.getReference()).getContext()); } }
boolean showSubsitesAsFlyout = ServerConfigurationService.getBoolean("portal.showSubsitesAsFlyout",true); rcontext.put("showSubsitesAsFlyout", showSubsitesAsFlyout);
@Override public void updateExternalAssessmentComment(final String gradebookUid, final String externalId, final String studentUid, final String comment) throws GradebookNotFoundException, AssessmentNotFoundException { final GradebookAssignment asn = getExternalAssignment(gradebookUid, externalId); if(asn == null) { throw new AssessmentNotFoundException("There is no assessment id=" + externalId + " in gradebook uid=" + gradebookUid); } log.debug("BEGIN: Update 1 score for gradebookUid={}, external assessment={} from {}", gradebookUid, externalId, asn.getExternalAppName()); HibernateCallback<?> hc = session -> { // Try to reduce data contention by only updating when the // score has actually changed or property has been set forcing a db update every time. boolean alwaysUpdate = ServerConfigurationService.getBoolean(UPDATE_SAME_SCORE_PROP, false); CommentDefinition gradeComment = getAssignmentScoreComment(gradebookUid, asn.getId(), studentUid); String oldComment = gradeComment != null ? gradeComment.getCommentText() : null; if ( alwaysUpdate || (comment != null && !comment.equals(oldComment)) || (comment == null && oldComment != null) ) { if(comment != null) setAssignmentScoreComment(gradebookUid, asn.getId(), studentUid, comment); else setAssignmentScoreComment(gradebookUid, asn.getId(), studentUid, null); } return null; }; getHibernateTemplate().execute(hc); log.debug("END: Update 1 score for gradebookUid={}, external assessment={} from {}", gradebookUid, externalId, asn.getExternalAppName()); log.debug("External assessment comment updated in gradebookUid={}, externalId={} by userUid={}, new score={}", gradebookUid, externalId, getUserUid(), comment); }
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { Session sakaiSession = SessionManager.getCurrentSession(); String userId = sakaiSession.getUserId(); String eId = sakaiSession.getUserEid(); try { sakaiSession.setUserId("admin"); sakaiSession.setUserEid("admin"); boolean updateSchemaHashes = ServerConfigurationService.getBoolean("metaobj.schemahash.update", false); getStructuredArtifactDefinitionManager().verifySchemaHashes(updateSchemaHashes); } finally { sakaiSession.setUserEid(userId); sakaiSession.setUserId(eId); } }
boolean inFrame = ServerConfigurationService.getBoolean("display.users.present.iframe", false); if ( inFrame )