• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ToolManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.sakaiproject.tool.api.ToolManager的典型用法代码示例。如果您正苦于以下问题:Java ToolManager类的具体用法?Java ToolManager怎么用?Java ToolManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ToolManager类属于org.sakaiproject.tool.api包,在下文中一共展示了ToolManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: FullSearchBean

import org.sakaiproject.tool.api.ToolManager; //导入依赖的package包/类
/**
 * Creates a searchBean
 * 
 * @param search
 * @param user
 * @param realm
 * @param objectService
 */
public FullSearchBean(String search, String requestPage, String realm,
		SearchService searchService, ToolManager toolManager)
{
	this.search = search;
	this.realm = realm;
	this.searchService = searchService;
	this.toolManager = toolManager;
	try 
	{
		this.requestPage = Integer.parseInt(requestPage);
	} 
	catch (NumberFormatException e) 
	{
		this.requestPage = 0;
	}
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:25,代码来源:FullSearchBean.java


示例2: isCurrentToolClusterable

import org.sakaiproject.tool.api.ToolManager; //导入依赖的package包/类
/**
 * Checks the current Tool ID to determine if this tool is marked for clustering.
 *
 * @return true if the tool is marked for clustering, false otherwise.
 */
public boolean isCurrentToolClusterable() {
	ToolManager toolManager = toolManager();
	Tool tool = null;
	// ToolManager should exist.  Protect against it being
	// null and just log a message if it is.
	if (toolManager != null) {
		tool = toolManager.getCurrentTool();
		// tool can be null, this is common during startup for example
		if (tool != null) {
			String toolId = tool.getId();
			// if the tool exists, the toolid should.  But protect and only
			// log a message if it is null
			if (toolId != null) {
				return clusterableTools.contains(toolId);
			} else {
				log.error("SessionComponent.isCurrentToolClusterable(): toolId was null.");
			}
		}
	} else {
		log.error("SessionComponent.isCurrentToolClusterable(): toolManager was null.");
	}
	return false;
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:29,代码来源:SessionComponent.java


示例3: getIntersectionWithAvailableToolsInSakaiInstallation

import org.sakaiproject.tool.api.ToolManager; //导入依赖的package包/类
/**
 * Intersect an event registry with tools available in (whole) Sakai installation.
 * @param eventRegistrySubset The Event Registry to intersect with. 
 * @param siteId The id of the site.
 * @return The Event Registry containing events for tools present in (whole) Sakai installation.
 */
public static List<ToolInfo> getIntersectionWithAvailableToolsInSakaiInstallation(ToolManager M_tm, List<ToolInfo> eventRegistrySubset) {
	List<ToolInfo> intersected = new ArrayList<ToolInfo>();

	// search the pages
	List<org.sakaiproject.tool.api.Tool> sakaiTools = new ArrayList<org.sakaiproject.tool.api.Tool>();
	sakaiTools.addAll(M_tm.findTools(null, null));

	// add only tools in both lists
	Iterator<ToolInfo> iTED = eventRegistrySubset.iterator();
	while (iTED.hasNext()){
		ToolInfo t = iTED.next();
		Iterator<org.sakaiproject.tool.api.Tool> iST = sakaiTools.iterator();
		while (iST.hasNext()){
			org.sakaiproject.tool.api.Tool tc = iST.next();
			if(tc.getId().equals(t.getToolId())){
				intersected.add(t);
				break;
			}
		}
	}

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


示例4: init

import org.sakaiproject.tool.api.ToolManager; //导入依赖的package包/类
public void init()
{
	ComponentManager cm = org.sakaiproject.component.cover.ComponentManager
			.getInstance();
	functionManager = (FunctionManager) load(cm, FunctionManager.class
			.getName());

	entityManager = (EntityManager) load(cm, EntityManager.class.getName());
	securityService = (SecurityService) load(cm, SecurityService.class
			.getName());
	sessionManager = (SessionManager) load(cm, SessionManager.class
			.getName());
	siteService = (SiteService) load(cm, SiteService.class.getName());
	toolManager = (ToolManager) load(cm, ToolManager.class.getName());

	List l = functionManager.getRegisteredFunctions("rwiki."); //$NON-NLS-1$
	if (!l.contains(SECURE_READ))
		functionManager.registerFunction(SECURE_READ);
	if (!l.contains(SECURE_UPDATE))
		functionManager.registerFunction(SECURE_UPDATE);
	if (!l.contains(SECURE_CREATE))
		functionManager.registerFunction(SECURE_CREATE);
	if (!l.contains(SECURE_SUPER_ADMIN))
		functionManager.registerFunction(SECURE_SUPER_ADMIN);
	if (!l.contains(SECURE_ADMIN))
		functionManager.registerFunction(SECURE_ADMIN);
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:28,代码来源:RWikiSecurityServiceImpl.java


示例5: getMockedAbstractWebService

import org.sakaiproject.tool.api.ToolManager; //导入依赖的package包/类
public static <U extends AbstractWebService> AbstractWebService getMockedAbstractWebService(Class<U> service) {
	AbstractWebService instance = null;
	try {
		instance = service.newInstance();
		instance.setAreaManager(mock(AreaManager.class));
		instance.setSessionManager(mock(SessionManager.class));
		instance.setAuthenticationManager(mock(AuthenticationManager.class));
		instance.setAssignmentService(mock(AssignmentService.class));
		instance.setAuthzGroupService(mock(AuthzGroupService.class));
		instance.setCalendarService(mock(CalendarService.class));
		instance.setEventTrackingService(mock(EventTrackingService.class));
		instance.setGradebookService(mock(GradebookService.class));
		instance.setSecurityService(mock(SecurityService.class));
		instance.setServerConfigurationService(mock(ServerConfigurationService.class));
		instance.setSiteService(mock(SiteService.class));
		instance.setTimeService(mock(TimeService.class));
		instance.setToolManager(mock(ToolManager.class));
		instance.setUsageSessionService(mock(UsageSessionService.class));
		instance.setUserDirectoryService(mock(UserDirectoryService.class));
		instance.setContentHostingService(mock(ContentHostingService.class));
		instance.setEntityManager(mock(EntityManager.class));
		instance.setDiscussionForumManager(mock(DiscussionForumManager.class));
		instance.setMessageForumsForumManager(mock(MessageForumsForumManager.class));
		instance.setMessageForumsMessageManager(mock(MessageForumsMessageManager.class));
		instance.setMessageForumsTypeManager(mock(MessageForumsTypeManager.class));
		instance.setThreadLocalManager(mock(ThreadLocalManager.class));
		instance.setSchedulerManager(mock(SchedulerManager.class));
		instance.setShortenedUrlService(mock(ShortenedUrlService.class));
		instance.setSamLiteService(mock(SamLiteService.class));
		instance.setIdManager(mock(IdManager.class));
		instance.setGradebookExternalAssessmentService(mock(GradebookExternalAssessmentService.class));
		instance.setActivityService(mock(ActivityService.class));
		instance.setPreferencesService(mock(PreferencesService.class));
		instance.setQuestionPoolServiceImpl(mock(QuestionPoolServiceImpl.class));
	} catch (InstantiationException | IllegalAccessException e) {
		log.error(e.getMessage(), e);
	}
	return instance;
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:40,代码来源:MockingAbstractWebService.java


示例6: allowBufferContent

import org.sakaiproject.tool.api.ToolManager; //导入依赖的package包/类
public boolean allowBufferContent(HttpServletRequest req, Site site, ToolConfiguration siteTool)
{
	String tidAllow = ServerConfigurationService.getString(LEGACY_IFRAME_SUPPRESS_PROP, IFRAME_SUPPRESS_DEFAULT);
	tidAllow = ServerConfigurationService.getString(IFRAME_SUPPRESS_PROP, tidAllow);

	if (tidAllow.indexOf(":none:") >= 0) return false;

	// JSR-168 portlets do not operate in iframes
	if ( portal.isPortletPlacement(siteTool) ) return false;

	// If the property is set and :all: is not specified, then the 
	// tools in the list are the ones that we accept
	if (tidAllow.trim().length() > 0 && tidAllow.indexOf(":all:") < 0)
	{
		if (tidAllow.indexOf(siteTool.getToolId()) < 0) return false;
	}

	// If the property is set and :all: is specified, then the 
	// tools in the list are the ones that we render the old way
	if (tidAllow.indexOf(":all:") >= 0)
	{
		if (tidAllow.indexOf(siteTool.getToolId()) >= 0) return false;
	}

	// Need to make sure the user is allowed to visit this tool
	ToolManager toolManager = (ToolManager) ComponentManager.get(ToolManager.class.getName());
	boolean allowedUser = toolManager.allowTool(site, siteTool);
	if ( ! allowedUser ) return false;

	return true;
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:32,代码来源:SiteHandler.java


示例7: PermissionsHelperAction

import org.sakaiproject.tool.api.ToolManager; //导入依赖的package包/类
public PermissionsHelperAction() {
	super();
	authzGroupService = ComponentManager.get(AuthzGroupService.class);
	functionManager = ComponentManager.get(FunctionManager.class);
	securityService = ComponentManager.get(SecurityService.class);
	entityManager = ComponentManager.get(EntityManager.class);
	siteService = ComponentManager.get(SiteService.class);
	sessionManager = ComponentManager.get(SessionManager.class);
	toolManager = ComponentManager.get(ToolManager.class);
	serverConfigurationService = ComponentManager.get(ServerConfigurationService.class);
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:12,代码来源:PermissionsHelperAction.java


示例8: RealmsAction

import org.sakaiproject.tool.api.ToolManager; //导入依赖的package包/类
public RealmsAction()
{
	authzGroupService = ComponentManager.get(AuthzGroupService.class);
	functionManager = ComponentManager.get(FunctionManager.class);
	groupProvider = ComponentManager.get(GroupProvider.class);
	securityService = ComponentManager.get(SecurityService.class);
	sessionManager = ComponentManager.get(SessionManager.class);
	toolManager = ComponentManager.get(ToolManager.class);
	userDirectoryService = ComponentManager.get(UserDirectoryService.class);
	userAuditRegistration = ComponentManager.get(UserAuditRegistration.class);
	userAuditService = ComponentManager.get(UserAuditService.class);
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:13,代码来源:RealmsAction.java


示例9: SearchBeanImpl

import org.sakaiproject.tool.api.ToolManager; //导入依赖的package包/类
public SearchBeanImpl(String siteId, SearchService ss, String search,ToolManager tm,
		SecurityService securityService, ServerConfigurationService serverConfigurationService) {
	super();
	this.siteId = siteId;
	this.searchService = ss;
	this.search = search;
	this.toolManager = tm;
	this.serverConfigurationService = serverConfigurationService;
	this.securityService = securityService;
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:11,代码来源:SearchBeanImpl.java


示例10: OpenSearchBeanImpl

import org.sakaiproject.tool.api.ToolManager; //导入依赖的package包/类
public OpenSearchBeanImpl(HttpServletRequest request,
		SearchService searchService, SiteService siteService,
		ToolManager toolManager) throws IdUnusedException
{
	this.siteService = siteService;
	this.placementId = toolManager.getCurrentPlacement().getId();
	this.siteId = toolManager.getCurrentPlacement().getContext();
	this.currentSite = this.siteService.getSite(this.siteId);
	if (siteService.isUserSite(siteId)) {
		scope = Scope.MINE.name();
	} else {
		scope = Scope.SITE.name();
	}
	baseURL = getBaseURL();
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:16,代码来源:OpenSearchBeanImpl.java


示例11: SherlockSearchBeanImpl

import org.sakaiproject.tool.api.ToolManager; //导入依赖的package包/类
public SherlockSearchBeanImpl(HttpServletRequest request, ServletContext context,
		SearchService searchService, SiteService siteService,
		ToolManager toolManager) throws IdUnusedException
{
	this.context = context;
	this.siteService = siteService;
	this.placementId = toolManager.getCurrentPlacement().getId();
	this.siteId = toolManager.getCurrentPlacement().getContext();
	this.currentSite = this.siteService.getSite(this.siteId);
	baseURL = getBaseURL();
	portalBaseURL = getPortalBaseURL();
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:13,代码来源:SherlockSearchBeanImpl.java


示例12: init

import org.sakaiproject.tool.api.ToolManager; //导入依赖的package包/类
public void init()
{
	ComponentManager cm = org.sakaiproject.component.cover.ComponentManager
			.getInstance();
	sessionManager = (SessionManager) load(cm, SessionManager.class
			.getName());
	searchService = (SearchService) load(cm, SearchService.class.getName());
	siteService = (SiteService) load(cm, SiteService.class.getName());
	toolManager = (ToolManager) load(cm, ToolManager.class.getName());
	userDirectoryService = (UserDirectoryService) load(cm, UserDirectoryService.class.getName());
	securityService = (SecurityService)load(cm, SecurityService.class.getName());
	serverConfigurationService = (ServerConfigurationService) load(cm, ServerConfigurationService.class.getName());
	
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:15,代码来源:SearchBeanFactoryImpl.java


示例13: SearchAdminBeanImpl

import org.sakaiproject.tool.api.ToolManager; //导入依赖的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


示例14: setUp

import org.sakaiproject.tool.api.ToolManager; //导入依赖的package包/类
protected void setUp() throws Exception {
		super.setUp();
//		sbi = new SearchBeanImpl("defaultSiteId");
		mockSearchService = mock(SearchService.class,"searchService");
		mockToolManager = mock(ToolManager.class,"toolManager");
		mockPlacement = mock(Placement.class,"placement");
		mockProperties = mock(Properties.class,"properties");
		mockSecurityService = mock(SecurityService.class,"securityService");
		mockServerConfiguration = mock(ServerConfigurationService.class, "serverconfigurationService");

		sbi = new SearchBeanImpl(defaultSiteId,(SearchService) mockSearchService.proxy(),
				"defaultSearch", (ToolManager) mockToolManager.proxy(), (SecurityService)mockSecurityService.proxy(), (ServerConfigurationService)mockServerConfiguration.proxy());
	}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:14,代码来源:SearchBeanImplTest.java


示例15: MetadataServiceFromContent

import org.sakaiproject.tool.api.ToolManager; //导入依赖的package包/类
public MetadataServiceFromContent(ContentHostingService contentHostingService, SecurityService securityService, ToolManager toolManager, MetadataParser parser)
{
	this.contentHostingService = contentHostingService;
	this.securityService = securityService;
	this.toolManager = toolManager;
	this.parser = parser;
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:8,代码来源:MetadataServiceFromContent.java


示例16: getToolManager

import org.sakaiproject.tool.api.ToolManager; //导入依赖的package包/类
protected static ToolManager getToolManager() {
    if (toolManager == null) {
        synchronized (LOCK) {
            ToolManager component = (ToolManager) ComponentManager.get(ToolManager.class);
            if (component == null) {
                throw new IllegalStateException("Unable to find the ToolManager using the ComponentManager");
            } else {
                toolManager = component;
            }
        }
    }
    return toolManager;
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:14,代码来源:Placement.java


示例17: init

import org.sakaiproject.tool.api.ToolManager; //导入依赖的package包/类
@Override
public void init(ServletConfig config) throws ServletException {

	super.init(config);

	sessionManager = (SessionManager) ComponentManager
			.get("org.sakaiproject.tool.api.SessionManager");
	activeToolManager = (ActiveToolManager) ComponentManager
			.get("org.sakaiproject.tool.api.ActiveToolManager");
	toolManager = (ToolManager) ComponentManager
			.get("org.sakaiproject.tool.api.ToolManager");
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:13,代码来源:UserAuditJsfTool.java


示例18: getSitePages

import org.sakaiproject.tool.api.ToolManager; //导入依赖的package包/类
public List<SitePage> getSitePages() {
    ArrayList<SitePage> rpgs = new ArrayList<SitePage>(0);
    if (site != null) {
        List<SitePage> pages = site.getOrderedPages();
        rpgs = new ArrayList<SitePage>(pages.size());
        DeveloperHelperService dhs = (DeveloperHelperService) ComponentManager.get(DeveloperHelperService.class);
        ToolManager toolManager = (ToolManager) ComponentManager.get(ToolManager.class.getName()); 
        boolean siteUpdate = false;
        if (dhs != null && dhs.getCurrentUserId() != null) {
            siteUpdate = site.isAllowed(dhs.getCurrentUserId(), "site.upd");
        }
        for (SitePage sitePage : pages) {
            // check if current user has permission to see page
            List<ToolConfiguration> pTools = sitePage.getTools();
            boolean allowPage = false;
            for (ToolConfiguration tc : pTools) {
                boolean thisTool = toolManager.allowTool(site, tc);
                boolean unHidden = siteUpdate || !toolManager.isHidden(tc);
                if (thisTool && unHidden) {
                    allowPage = true;
                }
            }
            if (allowPage) {
                rpgs.add( new EntitySitePage(sitePage) );
            }
        }
    }
    return rpgs;
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:30,代码来源:EntitySite.java


示例19: setToolManager

import org.sakaiproject.tool.api.ToolManager; //导入依赖的package包/类
public void setToolManager(ToolManager toolManager) {
    this.toolManager = toolManager;
}
 
开发者ID:ITYug,项目名称:kaltura-ce-sakai-extension,代码行数:4,代码来源:PermissionController.java


示例20: setToolManager

import org.sakaiproject.tool.api.ToolManager; //导入依赖的package包/类
public void setToolManager(ToolManager toolManager) {
   this.toolManager = toolManager;
}
 
开发者ID:sakaicontrib,项目名称:blogwow,代码行数:4,代码来源:ExternalLogicImpl.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ArbitraryLengthPath类代码示例发布时间:2022-05-22
下一篇:
Java PerspectiveTransform类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap