当前位置: 首页>>代码示例>>Java>>正文


Java ServerConfigurationService.getBoolean方法代码示例

本文整理汇总了Java中org.sakaiproject.component.cover.ServerConfigurationService.getBoolean方法的典型用法代码示例。如果您正苦于以下问题:Java ServerConfigurationService.getBoolean方法的具体用法?Java ServerConfigurationService.getBoolean怎么用?Java ServerConfigurationService.getBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.sakaiproject.component.cover.ServerConfigurationService的用法示例。


在下文中一共展示了ServerConfigurationService.getBoolean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: sendSiteNotification

import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
/**
 * Notification sent when a course site is set up automatcally
 * 
 */
private void sendSiteNotification(SessionState state, Site site, List notifySites) {
	boolean courseSite = SiteTypeUtil.isCourseSite(site.getType());
	
	String term_name = "";
	if (state.getAttribute(STATE_TERM_SELECTED) != null) {
		term_name = ((AcademicSession) state
				.getAttribute(STATE_TERM_SELECTED)).getEid();
	}
	// get the request email from configuration
	String requestEmail = getSetupRequestEmailAddress();
	User currentUser = UserDirectoryService.getCurrentUser();
	// read from configuration whether to send out site notification emails, which defaults to be true
	boolean sendSiteNotificationChoice = ServerConfigurationService.getBoolean("site.setup.creation.notification", true);
	if (requestEmail != null && currentUser != null && sendSiteNotificationChoice) {
		userNotificationProvider.notifySiteCreation(site, notifySites, courseSite, term_name, requestEmail);
	} // if

	// reset locale to user default
	
	rb.setContextLocale(null);
	
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:27,代码来源:SiteAction.java

示例2: getDeleteTagsAllowed

import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
public boolean getDeleteTagsAllowed() {
  AuthorizationBean authorizationBean = (AuthorizationBean) ContextUtil.lookupBean("authorization");
  if (authorizationBean.isSuperUser()) {
    return true;
  }else {
    return ServerConfigurationService.getBoolean("samigo.author.allowDeleteTags", true);
  }
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:9,代码来源:ItemAuthorBean.java

示例3: doUpdate_site_access_joinable

import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
/**
 * Apply requested changes to a site's joinability. Only relevant for
 * site edits, not new site creation.
 * 
 * <p>Not intended for direct execution from a Velocity-rendered form
 * submit.</p>
 * 
 * <p>Originally extracted from {@link #doUpdate_site_access(RunData)} to 
 * increase testability when adding special handling for an unspecified
 * joinability parameter. The <code>sEdit</code> param is passed in
 * to avoid repeated hits to the <code>SiteService</code> from
 * {@link #getStateSite(SessionState)}. (It's called <code>sEdit</code> to
 * reduce the scope of the refactoring diff just slightly.) <code>state</code> 
 * is passed in to avoid more proliferation of <code>RunData</code> 
 * downcasts.</p>
 * 
 * @see #CONVERT_NULL_JOINABLE_TO_UNJOINABLE
 * @param data request context -- must not be <code>null</code>
 * @param state session state -- must not be <code>null</code>
 * @param params request parameter facade -- must not be <code>null</code>
 * @param sEdit site to be edited -- must not be <code>null</code>
 */
void doUpdate_site_access_joinable(RunData data,
		SessionState state, ParameterParser params, Site sEdit) {
	boolean joinable = state.getAttribute(STATE_JOINABLE) != null ? ((Boolean) state.getAttribute(STATE_JOINABLE)).booleanValue() : null;
	if (!sEdit.isPublished())
	{
		// reset joinable role if the site is not published
		sEdit.setJoinable(false);
		sEdit.setJoinerRole(null);
	} else if (joinable) {
		sEdit.setJoinable(true);
		String joinerRole = state.getAttribute(STATE_JOINERROLE) != null ? (String) state.getAttribute(STATE_JOINERROLE) : null;
		if (joinerRole != null) {
			sEdit.setJoinerRole(joinerRole);
		} else {
			addAlert(state, rb.getString("java.joinsite") + " ");
		}

		// Handle invalid joinable site settings
		try
		{
			// Update site properties for joinable site settings
			JoinableSiteSettings.updateSitePropertiesFromStateOnSiteUpdate( sEdit.getPropertiesEdit(), state );
		}
		catch (InvalidJoinableSiteSettingsException invalidSettingsException)
		{
			addAlert(state, invalidSettingsException.getFormattedMessage(rb));
		}

	} else if ( !joinable || 
			(!joinable && ServerConfigurationService.getBoolean(CONVERT_NULL_JOINABLE_TO_UNJOINABLE, true))) {
		sEdit.setJoinable(false);
		sEdit.setJoinerRole(null);
	} // else just leave joinability alone
	
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:58,代码来源:SiteAction.java

示例4: getAllowMinScore

import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
public Boolean getAllowMinScore() {
 if(allowMinScore == null){
  allowMinScore = ServerConfigurationService.getBoolean("samigo.allowMinScore", Boolean.FALSE);
 }
    log.debug("Allow min score: {}", allowMinScore);
 return allowMinScore;
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:8,代码来源:ItemAuthorBean.java

示例5: getUserNameOrEid

import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
public String getUserNameOrEid()
{
  try
  {
	String currentUserId = getUserId();
 	    
 	    
	  String userString = "";
	  userString = UserDirectoryService.getUser(currentUserId).getDisplayName();
	  String userEidString = "";
	  userEidString = UserDirectoryService.getUser(currentUserId).getDisplayId();
	  
	  if((userString != null && userString.length() > 0) && ServerConfigurationService.getBoolean("msg.displayEid", true))
	  {
		  return userString + " (" + userEidString + ")";
	  }
	  else if ((userString != null && userString.length() > 0) && !ServerConfigurationService.getBoolean("msg.displayEid", true))
	  {
		  return userString;
	  }
	  else
	  {
		return userEidString;
	  }
	
  }
 	  catch(Exception e)
 	  {
 		log.error(e.getMessage(), e);
 	  }
 	  
 	  return getUserId();
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:34,代码来源:DiscussionForumTool.java

示例6: updateExternalAssessmentComment

import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
@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);
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:33,代码来源:GradebookExternalAssessmentServiceImpl.java

示例7: getTimezoneCheckFooter

import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
private String getTimezoneCheckFooter(Handlebars handlebars, Map<String, Object> context) {
    if (ServerConfigurationService.getBoolean("pasystem.timezone-check", true)) {

        try {
            Template template = handlebars.compile("templates/timezone_footer");

            return template.apply(context);
        } catch (IOException e) {
            log.warn("Timezone footer failed", e);
            return "";
        }
    } else {
        return "";
    }
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:16,代码来源:PASystemImpl.java

示例8: getShowTagsInEvaluationStyle

import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
public String getShowTagsInEvaluationStyle() {
    if (ServerConfigurationService.getBoolean("samigo.evaluation.usetags", Boolean.FALSE)){
        return "";
    }else{
        return "display:none;";
    }
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:8,代码来源:QuestionScoresBean.java

示例9: getMultiTagsSingleQuestionCheck

import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
public boolean getMultiTagsSingleQuestionCheck() {
    AuthorizationBean authorizationBean = (AuthorizationBean) ContextUtil.lookupBean("authorization");
    if (authorizationBean.isSuperUser()) {
        return true;
    }else {
        return (ServerConfigurationService.getBoolean("samigo.author.multitag.singlequestion.check", false) && !getMultiTagsSingleQuestion());
    }
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:9,代码来源:ItemAuthorBean.java

示例10: isShowEssay

import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
/**
 * Should we show short answer/essay question?
 * @return if true
 */
public boolean isShowEssay()
{
  return ServerConfigurationService.getBoolean("samigo.question.show.essay",showEssay); 
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:9,代码来源:ItemConfigBean.java

示例11: getTools

import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
/** 
 * Set the state variables for tool registration list basd on current site type, save to STATE_TOOL_GROUP_LIST.  This list should include
 * all tool types - normal, home, multiples and blti.  Note that if the toolOrder.xml is in the original format, this list will consist of 
 * all tools in a single group
 * @param state
 * @param site
 */
private Map<String,List> getTools(SessionState state, String type, Site site) {

	boolean checkhome =  state.getAttribute(STATE_TOOL_HOME_SELECTED) != null ?((Boolean) state.getAttribute(STATE_TOOL_HOME_SELECTED)).booleanValue():true;
	boolean isNewToolOrderType = ServerConfigurationService.getBoolean("config.sitemanage.useToolGroup", false);
	Map<String,List> toolGroup = new LinkedHashMap<String,List>();
	MyTool newTool = null;
	
	File moreInfoDir = new File(moreInfoPath);
	List toolList;
	
	// if this is legacy format toolOrder.xml file, get all tools by siteType
	if (isNewToolOrderType == false) {
		String defaultGroupName = rb.getString("tool.group.default");
		toolGroup.put(defaultGroupName, getOrderedToolList(state, defaultGroupName, type, checkhome));		
	} else {	
		// get all the groups that are available for this site type
		List groups = ServerConfigurationService.getCategoryGroups(SiteTypeUtil.getTargetSiteType(type));
		for(Iterator<String> itr = groups.iterator(); itr.hasNext();) {
			String groupId = itr.next();
			String groupName = getGroupName(groupId);
			toolList = getGroupedToolList(groupId, groupName, type, checkhome, moreInfoDir);
			if (toolList.size() > 0) {
				toolGroup.put(groupName, toolList);
			}
		}

		// add ungroups tools to end of toolGroup list
		String ungroupedName = getGroupName(UNGROUPED_TOOL_TITLE);
		List ungroupedList = getUngroupedTools(ungroupedName,	 toolGroup, state, moreInfoDir, site);
		if (ungroupedList.size() > 0) {
			toolGroup.put(ungroupedName, ungroupedList );
		}	 
	}

	// add external tools to end of toolGroup list
	String externaltoolgroupname = getGroupName(LTI_TOOL_TITLE);
	List externalTools = getLtiToolGroup(externaltoolgroupname, moreInfoDir, site);
	if (externalTools.size() > 0 ) 
		toolGroup.put(externaltoolgroupname, externalTools);
	
	// Home page should be auto-selected
	if (checkhome==true) {
		state.setAttribute(STATE_TOOL_HOME_SELECTED, new Boolean(true));
	}
	
	// refresh selectedList
	List<String> selectedTools = new ArrayList<String>();
	for(Iterator itr = toolGroup.keySet().iterator();  itr.hasNext(); )  {
		String key = (String) itr.next();
		List toolGroupSelectedList =(List) toolGroup.get(key);
		for (Iterator listItr = toolGroupSelectedList.iterator(); listItr.hasNext();) {
			MyTool tool = (MyTool) listItr.next();
			if (tool.selected) {
				selectedTools.add(tool.id);
			}
		}
	}
	
	List toolRegistrationSelectedList = (List) state.getAttribute(STATE_TOOL_REGISTRATION_SELECTED_LIST);
	
	//If this is the first time through add these selected tools as the default otherwise don't touch this
	if (toolRegistrationSelectedList==null) {
		state.setAttribute(STATE_TOOL_REGISTRATION_SELECTED_LIST, selectedTools);
	}

	return toolGroup;
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:75,代码来源:SiteAction.java

示例12: isAlwaysShowFullDesc

import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
public boolean isAlwaysShowFullDesc(){
	return ServerConfigurationService.getBoolean("mc.alwaysShowFullDesc", false); 
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:4,代码来源:DiscussionForumTool.java

示例13: isUserRequestSynoptic

import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
public Boolean isUserRequestSynoptic() {
	if(userRequestSynoptic == null){
		userRequestSynoptic = ServerConfigurationService.getBoolean(SynopticMsgcntrManager.MYWORKSPACE_USERPROMPT, false);
	}
	return userRequestSynoptic;
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:7,代码来源:MessageForumSynopticBeanLite.java

示例14: isShowMultipleChoiceMultipleCorrect

import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
/**
 * Should we show multiple choice multiple correct question?
 * @return if true
 */
public boolean isShowMultipleChoiceMultipleCorrect()
{
  return ServerConfigurationService.getBoolean("samigo.question.show.multiplechoicemultiplecorrect",showMultipleChoiceMultipleCorrect); 
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:9,代码来源:ItemConfigBean.java

示例15: isEmailForwardDisabled

import org.sakaiproject.component.cover.ServerConfigurationService; //导入方法依赖的package包/类
public boolean isEmailForwardDisabled(){
 return ServerConfigurationService.getBoolean("mc.messages.forwardEmailDisabled", false);
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:4,代码来源:PrivateMessageManagerImpl.java


注:本文中的org.sakaiproject.component.cover.ServerConfigurationService.getBoolean方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。