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


Java SiteService.getSite方法代码示例

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


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

示例1: canRead

import org.sakaiproject.site.api.SiteService; //导入方法依赖的package包/类
public boolean canRead(String reference)
{
	Reference ref = getReference(reference);
	EntityProducer ep = getProducer(ref);
	if (ep instanceof SiteService)
	{
		try
		{
			SiteService ss = (SiteService) ep;
			ss.getSite(ref.getId());
			return true;
		}
		catch (Exception ex)
		{
			log.debug(ex.getMessage());
		}
	}
	return false;
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:20,代码来源:SiteContentProducer.java

示例2: getContent

import org.sakaiproject.site.api.SiteService; //导入方法依赖的package包/类
public String getContent(String reference)
{
	Reference ref = getReference(reference);
	EntityProducer ep = getProducer(ref);

	if (ep instanceof SiteService)
	{
		try
		{
			SiteService ss = (SiteService) ep;
			Site s = ss.getSite(ref.getId());
			StringBuilder sb = new StringBuilder();
			SearchUtils.appendCleanString(s.getTitle(), sb);
			sb.append(" ");
			for (HTMLParser hp = new HTMLParser(s.getShortDescription()); hp.hasNext();)
			{
				SearchUtils.appendCleanString(hp.next(), sb);
				sb.append(" ");
			}
			for (HTMLParser hp = new HTMLParser(s.getDescription()); hp.hasNext();)
			{
				SearchUtils.appendCleanString(hp.next(), sb);
				sb.append(" ");
			}
			return sb.toString();

		}
		catch (IdUnusedException e)
		{
			throw new RuntimeException(" Failed to get message content ", e); //$NON-NLS-1$
		}
	}

	throw new RuntimeException(" Not a Message Entity " + reference); //$NON-NLS-1$

}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:37,代码来源:SiteContentProducer.java

示例3: SearchAdminBeanImpl

import org.sakaiproject.site.api.SiteService; //导入方法依赖的package包/类
/**
 * Construct a SearchAdminBean, checking permissions first
 * 
 * @param request
 * @param searchService
 * @param siteService
 * @param toolManager
 * @param sessionManager
 * @param securityService
 * @param serverConfigurationService
 * @throws IdUnusedException
 * @throws PermissionException
 */
public SearchAdminBeanImpl(HttpServletRequest request,
		SearchService searchService, SiteService siteService,
		ToolManager toolManager, SessionManager sessionManager, SecurityService securityService, ServerConfigurationService serverConfigurationService)
		throws IdUnusedException, PermissionException
{
	this.serverConfigurationService = serverConfigurationService;
	siteId = toolManager.getCurrentPlacement().getContext();
	Site currentSite = siteService.getSite(siteId);
	siteCheck = currentSite.getReference();
	userName = sessionManager.getCurrentSessionUserId();
	superUser = securityService.isSuperUser();
	boolean allow = ( superUser ) || ( "true".equals(serverConfigurationService.getString("search.allow.maintain.admin","false")) &&
					siteService.allowUpdateSite(siteId));
	if ( !allow )
	{
		throw new PermissionException(userName, "site.update", siteCheck);
	}
	this.searchService = searchService;

	// process any commands
	String command = request.getParameter(COMMAND);
	if (command != null)
	{
		internCommand = command.intern();
	}
	String indexBuilderName = request.getParameter(INDEX_BUILDER_NAME);
	doCommand(indexBuilderName);
	internCommand = null;
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:43,代码来源:SearchAdminBeanImpl.java

示例4: getIntersectionWithAvailableToolsInSite

import org.sakaiproject.site.api.SiteService; //导入方法依赖的package包/类
/**
 * Intersect an event registry subset with tools available in site.
 * @param eventRegistrySubset An Event Registry subset to intersect with. 
 * @param siteId The id of the site.
 * @return The Event Registry containing events for tools present in site.
 */
public static List<ToolInfo> getIntersectionWithAvailableToolsInSite(SiteService M_ss, List<ToolInfo> eventRegistrySubset, String siteId) {
	List<ToolInfo> intersected = new ArrayList<ToolInfo>();
	Site site = null;
	try{
		site = M_ss.getSite(siteId);
	}catch(IdUnusedException e){
		return eventRegistrySubset;
	}

	// search the pages
	List<ToolConfiguration> siteTools = new ArrayList<ToolConfiguration>();
	for(Iterator<SitePage> iPages = site.getPages().iterator(); iPages.hasNext();){
		SitePage page = iPages.next();
		siteTools.addAll(page.getTools());
	}

	// add only tools in both lists
	Iterator<ToolInfo> iTED = eventRegistrySubset.iterator();
	while (iTED.hasNext()){
		ToolInfo t = iTED.next();
		Iterator<ToolConfiguration> iST = siteTools.iterator();
		while (iST.hasNext()){
			ToolConfiguration tc = iST.next();
			if(tc.getToolId().equals(t.getToolId())){
				intersected.add(t);
				break;
			}
		}
	}

	return intersected;
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:39,代码来源:EventUtil.java

示例5: siteForPID

import org.sakaiproject.site.api.SiteService; //导入方法依赖的package包/类
public static Site siteForPID(SiteService siteservice, String pid) {
	Site togo = null;
	try {
		ToolConfiguration tc = siteservice.findTool(pid);
		String siteID = tc.getSiteId();
		togo = siteservice.getSite(siteID);
	} catch (Exception iue) {
		// In Mercury, we may get an NPE since there is no ToolConfiguration
	}
	return togo;
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:12,代码来源:SakaiNavConversion.java


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