Skip to main content

Tool Architecture

Sakai tools are modular web applications that provide specific functionality like assignments, gradebook, or forums. Tools integrate with the kernel services and are rendered within the portal framework.

What is a Tool?

A tool is a user interface component that provides specific educational functionality. Tools are:
  • Self-contained: Each tool is a separate web application
  • Service-based: Tools use kernel services for core functionality
  • Portal-rendered: Tools render within the portal’s iframe or portlet containers
  • Site-scoped: Tools are placed within sites and pages

Tool Interface

The core Tool interface defines the contract for all Sakai tools:
Reference: kernel/api/src/main/java/org/sakaiproject/tool/api/Tool.java:27-100

Tool Module Structure

Typical tool structure follows this pattern:

Example: Assignment Tool Structure

Reference: source/assignment/
Not all tools have separate API/implementation modules. Simple tools may only have a tool/ module that uses existing kernel services.

Tool Types

Sakai supports different types of tools based on their rendering approach:
Traditional tools that render full HTML pages within an iframe.
  • Most common tool type
  • Full control over HTML/CSS/JS
  • Rendered via IFrameToolRenderService
Examples: Assignments, Gradebook, Resources
Reference: portal/README.md:25-26

Tool Registration

Tools are registered in the system through configuration files that define:
  • Tool ID (unique identifier)
  • Title and description
  • Categories and keywords
  • Required permissions
  • Configuration properties

Tool Order Configuration

The system maintains a default tool ordering: Reference: kernel/component-manager/src/main/bundle/org/sakaiproject/config/toolOrder.xml

Tool Integration with Kernel Services

Tools should use kernel services for all core functionality:
Don’t implement your own user management, authorization, or content storage. Always use kernel services:
  • User management → UserDirectoryService
  • Authorization → AuthzGroupService
  • Content storage → ContentHostingService
  • Email → EmailService

Tool Placement

A placement is an instance of a tool within a site page. The same tool can be placed multiple times with different configurations.

Portal URL Patterns

Tools can be accessed through various portal URL patterns:

Standard Tool Access

Direct Tool Access

Bypass site navigation and go directly to a tool:
Examples:
  • /portal/directtool/sakai.samigo?sakai.site=e4a2b1db-f452-4ef0-8aee-b4bdde701c8c
  • /portal/directtool/sakai.rsf.evaluation?sakai.site=~
Reference: portal/README.md:36-44

Tool Development Frameworks

Sakai supports multiple frameworks for tool development:
Strategic direction for frontend
  • Encapsulated, reusable components
  • Shadow DOM for style isolation
  • Modern JavaScript (ES2022+)
  • Integration with existing tools
Used in many existing tools
  • Component-based framework
  • Still supported but not recommended for new tools
Component-based web framework
  • Used in several tools
  • Good for complex UIs
  • Not recommended for new development

Best Practices

1. Use Kernel Services

✅ Correct:
❌ Incorrect:

2. Post Events for Significant Actions

3. Internationalization

Always support i18n:

4. Accessibility

Follow accessibility best practices:
  • Semantic HTML
  • ARIA labels where needed
  • Keyboard navigation
  • Screen reader support

5. Responsive Design

Use Bootstrap 5.2 for responsive layouts:

Tool Helper Pattern

Tools can use helper tools for specific functionality:
When the helper completes, it redirects back to HELPER_DONE_URL. Reference: kernel/api/src/main/java/org/sakaiproject/tool/api/Tool.java:56

Next Steps

Architecture Overview

Understand the overall system architecture

Kernel Services

Learn about available kernel services

Sites & Workspaces

Understand how tools are organized in sites