Sakai

   ,
   -    ,   1-2   , 2008




                  Sakai            构


                         Xingtang Hu(Hu2@iupui.edu)
                      Lance Speelmon(lance@indiana.edu)
                    Michael Korcuska(mkorcuska@gmail.com)

                                        / SAKAI

                               1   21   , 2008
,
            ,
2006                /
2006
2002
2001

Lance Speelmon,
Oncourse      Sakai     构   ,

Michael Korcuska,
Sakai          运
• Sakai
• Sakai   构
  – Tomcat                   (classloader)
  – Spring                      (components
    manager)
• Sakai 开
  –            (Tools and services)
  –            (WebApp structure)
• Sakai
Sakai
•
•    ,   ,
•
•
•            Java
•
Sakai
•              AuthzGroupService
•          SiteService
•            ToolManager
•          SessionManager
•          ContentHostingService
•
    CourseManagementService
Sakai
•
    –                       UserDirectoryProvider – map your local user information
        (eg in LDAP, IMS Enterprise, Kerberos) into Sakai
    –                    GroupProvider
    –                CourseManagementProvider
    –                PortalHandler (new in Sakai 2.4) – register new top-level
        handlers in the Sakai portal URL space
    –                EntityProducer – export primary entities handled by your service as
        1st-class Sakai “Entities” (resolvable by URLs, addressible by Events, searchable)

•                         Sakai
Sakai
• Sakai           J2EE (Servlet)
  (container)
  – Tomcat, WebSphere, WebLogic
• Sakai     (tool)                      ,
             Servlet
• Sakai     (component)     Sakai API   ,
           Spring Beans
,
•       Tools(web)
    –                          (persistence)
    –                              presentation (GUI)
•       Services / Components(API/Impl)
    –                       Must provide documented API
    –                   presentation (not aware of HTML at all)
    –                                     ,           (not data models)
•       Framework(Tomcat)
    –                       tools and service
    –                common capabilities
    –                   domain objects
Sakai
•                  构
                                            Presentation Services (SAF)

     TOOLS
•
•              离                                 Abstract Tool Layout
•

    SERVICES                                    Tool Code (Java)
•
•
•
                               (APIs)
    FRAMEWORK
•                                                          Application Services
•
•
                                        Common Services
                                         (SAF)



                                                   Kernel (SAF)
Sakai                                 构
                                           Shared



         Model                   Logic-api                Public-api
                                 (business logic)            (service)




                                                        Components
        Dao-api
       (data access)
                                                    Logic-impl
                                                    (business logic)

                  Webapps

                                                        Dao-impl
                         Tool                           (data access)
                (presentation)




URL: http://issues.sakaiproject.org/confluence/x/BGo
构
构 3-tier architecture      External


 Presentation              User




Business Logic          Other Apps




 Data Access            Database
Presentation Layer
3-tier architecture    •
                       •            (GUI)
  Presentation
                           (client view)
                       •
 Business Logic            business logic
                                         data
                           access
  Data Access
Logic Layer
3-tier architecture   •                

  Presentation        •
                      •
                          (presentation)
 Business Logic                       (data
                          access)

  Data Access
Data Access Layer
3-tier architecture     •

  Presentation          •

                        •
 Business Logic             (presentation )

                            (business logic)
  Data Access
关
3-tier architecture   •       ,
                          减
  Presentation        •


 Business Logic




  Data Access
Sakai
    Component Manager
•   Spring      bean
        Sakai    ,

•
•      Sakai
Sakai
Component Manager
Tomcat                        (Container)
         Tomcat – The Server
                    Services
                                  Engine (Catalina)
                                        Hosts               Realm

AJP Connector       Valves
                                                Context
  8009
SSL Connector                  Valves      JSPs      Servlets
  8443

HTTP Connector                              Valves
  8080
Tomcat (J2EE)




•                  Java ClassLoaders
•   Servlet   (container)
•   Web            (ClassLoaders)
    ,
Sakai                               (ClassLoaders)

                                             APIs up here
                                                                Components in here




    Tools in here                                        Component1 Component2

•       Sakai        J2EE            ClassLoader layout
•       Sakai                          (webapps)     Servlets
    –               URLClassLoader
    –
•
    –                        components.xml (Spring file),         web      web.xml
    –                            , Servlet       (dispatches)
Sakai                (Tools)
•   Sakai        (Tools)                 Servlet
    –                               RSF, JSF Velocity
    –             web       (web.xml)        file (tools/
        toolname.xml)
         •         App Builder    (Plugin)
    –                          (applicationContext.xml)
                 Spring       (context)       ,    Sakai
        (services)      Spring
    –                      Spring       (JARs )             份,
                           (Web application)
Spring         (beans)

• Spring                            (
        (Dependency Injection)/
    IoC     )
•       Java
      (getters )   (setters)
•                                 Spring
                       ( init()    )
Springy


•                web.xml
             (ContextLoaderListener)
•                    (bean definitions)
•                             Sakai
    (services)
Sakai                    开
• Sakai        (component)
  –                       (API module)
      •            Java        (interface definitions)
          (constants)
      •        JAR                  (shared area)
  –                       (Impl module)
      •            (API interfaces )
      •     Spring               (components.xml )
                     Spring         (context)

      •       WAR                    (components area)
Sakai              (Services)
• Sakai     (services)            Spring
  (context)            Spring beans
• 每 Sakai        (component)      Spring
  components.xml
•              Sakai 启                  ,
             .
Spring                   Sakai                 (Services)
•   Sakai          (APIs) Java        (interfaces)
•   每 Sakai            (APIs)
•   Sakai Spring                   (components.xml)        Spring bean

•       : Spring                  Sakai
    (UserDirectoryService)

    <bean id="org.sakaiproject.user.api.UserDirectoryService“
               class="org.sakaiproject.user.impl.DbUserService"
               init-method=“init”
       destroy-method="destroy"           singleton="true">
        ......
               <property name="autoDdl“ value=“${auto.ddl}”/>
               <property name="cacheMinutes“ value=“5”/>
    </bean>
ComponentManager
    mgr.get(“org.sakaiproject.site.api.SiteService”);




•      Spring
     (ApplicationContext)

•            id      Class
Sakai                                     构
• 4
   –                    Api (interfaces)
       •            Logic - business logic and dao apis
       •            Model - POJOs (value/data objects)
       •            Public - Service API (if you have one)
       •                   Hbm - Hibernate HBM files
   –                          Impl (implementations)
       •            Dao - data access implementation
       •            Logic - business logic implementation
       •        Tests - programmatic tests (unit/integration)
   –                       Pack (component definitions)
       • Spring             (Sakai components.xml)
   –               Tool (webapp)
       • Java         src/java - java classes used by your tool only
       •              关      src/webapp - xml, jsp, html, other meta files
 URL: http://issues.sakaiproject.org/confluence/x/BGo
构




URL: http://issues.sakaiproject.org/confluence/x/BGo
Sakai                                     构
•             org.sakaiproject - base package prefix
     – You could also use your local prefix (e.g. uk.ac.cam.caret)

•             org.sakaiproject.app-name
          • Use something unique for app-name, long is good
     –             dao - data access
     –               hbm – hibernate mapping files
     –             Logic – business logic
     –             Model – value/data objects
     –        Service – public api
     –        Tool – webapp
•                    Add impl to represent implementations



    URL: http://issues.sakaiproject.org/confluence/x/BGo
构




URL: http://issues.sakaiproject.org/confluence/x/BGo
Sakai Java

      :
•                        ( event service)
•         ActiveMQ   构
2




                                           1




m_eventTrackingService = (EventTrackingService)    3
ComponentManager.get("org.sakaiproject.event.api.EventTracking
Service");
Sakai




Sakai
Sakai              Java   (Applications)




           Sakai
                   关




           Sakai                  启


 Sakai 启
http://java.sun.com/products/jsp/


JSF    http://java.sun.com/javaee/javaserverfaces/


       http://www2.caret.cam.ac.uk/rsfwiki/


       http://java.sun.com/products/servlet/


       http://jakarta.apache.org/velocity/


AJAX   http://en.wikipedia.org/wiki/AJAX
Java Server Pages
•    开
•      启    ,
•   Sakai           运
•               ,
•
JSF
              Java Server Faces
•             Java                                 APIs
        (managing state),                                  (handling
  events),                                               (defining
  navigation)
•          JSP        渲
    –                       JSPs                             渲
•                                                      (tag libraries)
•                                 ,


    URL: http://java.sun.com/javaee/javaserverfaces/
JSF
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<html>
<head><title>JSF sample</title></head>
<body>
 <f:view>
  <h1><h:outputText value=“Hello #{user.name}"/></h1>
  <h:dataTable id=“items"
       value="#{itemsBean.items}" var=“item">
   <h:column>
    <h:outputText value="#{item.value}" />
   </h:column>
  </h:dataTable>
 </f:view>
</body>
</html>
Reasonable Server Faces
•     Spring                (web
  programming framework)
•       XHTML       ,    UI
  Code 离
•       Lightweight
•        AJAX Javascript


    URL: http://jakarta.apache.org/velocity/
<html>
<head><title>RSF sample</title></head>
<body>
   <h1>Hello <span rsf:id=“user-name”>User Name</span></h1>
   Today is <span rsf:id=“current-date”>1/1/2006</span><br/>
   <table>
     <tr rsf:id=“items:”>
       <td rsf:id=“item-value”>item value here</td>
     </tr>
   </table>
</body>
</html>
Oncourse CL                                                                                  ,迁
           Su/Fall 04         Spring 05        Su/Fall 05         Spring 06        Su/Fall 06


                                                            We Are Here – December 2005


                                              Oncourse                                              2


                                                Fall ’05 by Web form request only

                        Pilot Period – Limited Release
                                     CL 1.5            CL 2.0          CL 2.1             CL 2.x
Sakai 开                 构
Indiana, Michigan, Stanford                                     Oncourse CL
         and MIT



                                                  05                                      Oncourse CL
Oncourse CL          构




            (IUB):
         (IUPUI):
Sakai
 •
                                           WEB             SYS
INSTITUTION             USERS SITES        SERVE      INTEGRATION
                                             RS
Indiana*            121,468 53,979          16   PeopleSoft
UNISA                   92,000               4      Novell, ActiveDirectory
Michigan                67,281 17,453        8      UMIAC, Kerebos
Yale                    14,569               4      Banner, CAS
Fernando Pessoa          5,250     2,000

UCT                      4,040       48      2      PeopleSoft, Novell Nsure

Etudes Alliance**        2,560       79
UC, Merced               1,230      305      1      Banner, uPortal
Totals              308,398 73,864          34



 *Indiana University:       2006      , 108,190          Oncourse CL          .
 **Etudes Alliance        : 200             , 450       (07 02 ).                 Sakai
                                                                                   (Oncourse)
Sakai

•
•      COMMUNITY PROCESSES —             Sakai    contact Mark Norton, Sakai
    Community Process WG Chair (markjnorton@earthlink.net).

•   开 DEVELOPMENT —              开       join Sakai-Dev DG; review existing projects,
    requirements, feature requests or contribute new tools and/or services; contact Peter
    Knoop, Project Coordinator (knoop@umich.edu), or Anthony Whyte, Sakai Technical
    Liaison (arwhyte@umich.edu).

•            INFRASTRUCTURE —                 QA servers,           JIRA/Confluence
    hosting, contact Peter Knoop.

•      QA —                    join QA Work Group, contact Megan May, QA Coordinator
    (mmmay@indiana.edu).

•           REQUIREMENTS & USE CASE DEVELOPMENT —                                  join the
    Requirements WG; contact Mara Hancock, REQ WG chair
    (mara@media.berkeley.edu).
?




http://sakaiproject.org/
Sakai

   ,
   -    ,   1-2   , 2008




                                      !

                                   (hu2@iupui.edu)
                           Sakai/Oncourse




                           http://www.sakaiproject.org/

Sakai Technical

  • 1.
    Sakai , - , 1-2 , 2008 Sakai 构 Xingtang Hu(Hu2@iupui.edu) Lance Speelmon(lance@indiana.edu) Michael Korcuska(mkorcuska@gmail.com) / SAKAI 1 21 , 2008
  • 2.
    , , 2006 / 2006 2002 2001 Lance Speelmon, Oncourse Sakai 构 , Michael Korcuska, Sakai 运
  • 3.
    • Sakai • Sakai 构 – Tomcat (classloader) – Spring (components manager) • Sakai 开 – (Tools and services) – (WebApp structure) • Sakai
  • 4.
    Sakai • • , , • • • Java •
  • 5.
  • 6.
    AuthzGroupService • SiteService • ToolManager • SessionManager • ContentHostingService • CourseManagementService
  • 7.
    Sakai • – UserDirectoryProvider – map your local user information (eg in LDAP, IMS Enterprise, Kerberos) into Sakai – GroupProvider – CourseManagementProvider – PortalHandler (new in Sakai 2.4) – register new top-level handlers in the Sakai portal URL space – EntityProducer – export primary entities handled by your service as 1st-class Sakai “Entities” (resolvable by URLs, addressible by Events, searchable) • Sakai
  • 8.
    Sakai • Sakai J2EE (Servlet) (container) – Tomcat, WebSphere, WebLogic • Sakai (tool) , Servlet • Sakai (component) Sakai API , Spring Beans
  • 9.
    , • Tools(web) – (persistence) – presentation (GUI) • Services / Components(API/Impl) – Must provide documented API – presentation (not aware of HTML at all) – , (not data models) • Framework(Tomcat) – tools and service – common capabilities – domain objects
  • 10.
    Sakai • 构 Presentation Services (SAF) TOOLS • • 离 Abstract Tool Layout • SERVICES Tool Code (Java) • • • (APIs) FRAMEWORK • Application Services • • Common Services (SAF) Kernel (SAF)
  • 11.
    Sakai 构 Shared Model Logic-api Public-api (business logic) (service) Components Dao-api (data access) Logic-impl (business logic) Webapps Dao-impl Tool (data access) (presentation) URL: http://issues.sakaiproject.org/confluence/x/BGo
  • 12.
    构 构 3-tier architecture External Presentation User Business Logic Other Apps Data Access Database
  • 13.
    Presentation Layer 3-tier architecture • • (GUI) Presentation (client view) • Business Logic business logic data access Data Access
  • 14.
    Logic Layer 3-tier architecture • Presentation • • (presentation) Business Logic (data access) Data Access
  • 15.
    Data Access Layer 3-tierarchitecture • Presentation • • Business Logic (presentation ) (business logic) Data Access
  • 16.
    关 3-tier architecture • , 减 Presentation • Business Logic Data Access
  • 17.
    Sakai Component Manager • Spring bean Sakai , • • Sakai
  • 18.
  • 19.
    Tomcat (Container) Tomcat – The Server Services Engine (Catalina) Hosts Realm AJP Connector Valves Context 8009 SSL Connector Valves JSPs Servlets 8443 HTTP Connector Valves 8080
  • 20.
    Tomcat (J2EE) • Java ClassLoaders • Servlet (container) • Web (ClassLoaders) ,
  • 21.
    Sakai (ClassLoaders) APIs up here Components in here Tools in here Component1 Component2 • Sakai J2EE ClassLoader layout • Sakai (webapps) Servlets – URLClassLoader – • – components.xml (Spring file), web web.xml – , Servlet (dispatches)
  • 22.
    Sakai (Tools) • Sakai (Tools) Servlet – RSF, JSF Velocity – web (web.xml) file (tools/ toolname.xml) • App Builder (Plugin) – (applicationContext.xml) Spring (context) , Sakai (services) Spring – Spring (JARs ) 份, (Web application)
  • 23.
    Spring (beans) • Spring ( (Dependency Injection)/ IoC ) • Java (getters ) (setters) • Spring ( init() )
  • 24.
    Springy • web.xml (ContextLoaderListener) • (bean definitions) • Sakai (services)
  • 25.
    Sakai 开 • Sakai (component) – (API module) • Java (interface definitions) (constants) • JAR (shared area) – (Impl module) • (API interfaces ) • Spring (components.xml ) Spring (context) • WAR (components area)
  • 26.
    Sakai (Services) • Sakai (services) Spring (context) Spring beans • 每 Sakai (component) Spring components.xml • Sakai 启 , .
  • 27.
    Spring Sakai (Services) • Sakai (APIs) Java (interfaces) • 每 Sakai (APIs) • Sakai Spring (components.xml) Spring bean • : Spring Sakai (UserDirectoryService) <bean id="org.sakaiproject.user.api.UserDirectoryService“ class="org.sakaiproject.user.impl.DbUserService" init-method=“init” destroy-method="destroy" singleton="true"> ...... <property name="autoDdl“ value=“${auto.ddl}”/> <property name="cacheMinutes“ value=“5”/> </bean>
  • 28.
    ComponentManager mgr.get(“org.sakaiproject.site.api.SiteService”); • Spring (ApplicationContext) • id Class
  • 29.
    Sakai 构 • 4 – Api (interfaces) • Logic - business logic and dao apis • Model - POJOs (value/data objects) • Public - Service API (if you have one) • Hbm - Hibernate HBM files – Impl (implementations) • Dao - data access implementation • Logic - business logic implementation • Tests - programmatic tests (unit/integration) – Pack (component definitions) • Spring (Sakai components.xml) – Tool (webapp) • Java src/java - java classes used by your tool only • 关 src/webapp - xml, jsp, html, other meta files URL: http://issues.sakaiproject.org/confluence/x/BGo
  • 30.
  • 31.
    Sakai 构 • org.sakaiproject - base package prefix – You could also use your local prefix (e.g. uk.ac.cam.caret) • org.sakaiproject.app-name • Use something unique for app-name, long is good – dao - data access – hbm – hibernate mapping files – Logic – business logic – Model – value/data objects – Service – public api – Tool – webapp • Add impl to represent implementations URL: http://issues.sakaiproject.org/confluence/x/BGo
  • 32.
  • 33.
    Sakai Java : • ( event service) • ActiveMQ 构
  • 35.
    2 1 m_eventTrackingService = (EventTrackingService) 3 ComponentManager.get("org.sakaiproject.event.api.EventTracking Service");
  • 36.
  • 37.
    Sakai Java (Applications) Sakai 关 Sakai 启 Sakai 启
  • 38.
    http://java.sun.com/products/jsp/ JSF http://java.sun.com/javaee/javaserverfaces/ http://www2.caret.cam.ac.uk/rsfwiki/ http://java.sun.com/products/servlet/ http://jakarta.apache.org/velocity/ AJAX http://en.wikipedia.org/wiki/AJAX
  • 39.
    Java Server Pages • 开 • 启 , • Sakai 运 • , •
  • 40.
    JSF Java Server Faces • Java APIs (managing state), (handling events), (defining navigation) • JSP 渲 – JSPs 渲 • (tag libraries) • , URL: http://java.sun.com/javaee/javaserverfaces/
  • 41.
    JSF <%@ taglib uri="http://java.sun.com/jsf/html"prefix="h" %> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> <html> <head><title>JSF sample</title></head> <body> <f:view> <h1><h:outputText value=“Hello #{user.name}"/></h1> <h:dataTable id=“items" value="#{itemsBean.items}" var=“item"> <h:column> <h:outputText value="#{item.value}" /> </h:column> </h:dataTable> </f:view> </body> </html>
  • 42.
    Reasonable Server Faces • Spring (web programming framework) • XHTML , UI Code 离 • Lightweight • AJAX Javascript URL: http://jakarta.apache.org/velocity/
  • 43.
    <html> <head><title>RSF sample</title></head> <body> <h1>Hello <span rsf:id=“user-name”>User Name</span></h1> Today is <span rsf:id=“current-date”>1/1/2006</span><br/> <table> <tr rsf:id=“items:”> <td rsf:id=“item-value”>item value here</td> </tr> </table> </body> </html>
  • 45.
    Oncourse CL ,迁 Su/Fall 04 Spring 05 Su/Fall 05 Spring 06 Su/Fall 06 We Are Here – December 2005 Oncourse 2 Fall ’05 by Web form request only Pilot Period – Limited Release CL 1.5 CL 2.0 CL 2.1 CL 2.x Sakai 开 构 Indiana, Michigan, Stanford Oncourse CL and MIT 05 Oncourse CL
  • 46.
    Oncourse CL 构 (IUB): (IUPUI):
  • 47.
    Sakai • WEB SYS INSTITUTION USERS SITES SERVE INTEGRATION RS Indiana* 121,468 53,979 16 PeopleSoft UNISA 92,000 4 Novell, ActiveDirectory Michigan 67,281 17,453 8 UMIAC, Kerebos Yale 14,569 4 Banner, CAS Fernando Pessoa 5,250 2,000 UCT 4,040 48 2 PeopleSoft, Novell Nsure Etudes Alliance** 2,560 79 UC, Merced 1,230 305 1 Banner, uPortal Totals 308,398 73,864 34 *Indiana University: 2006 , 108,190 Oncourse CL . **Etudes Alliance : 200 , 450 (07 02 ). Sakai (Oncourse)
  • 48.
    Sakai • • COMMUNITY PROCESSES — Sakai contact Mark Norton, Sakai Community Process WG Chair (markjnorton@earthlink.net). • 开 DEVELOPMENT — 开 join Sakai-Dev DG; review existing projects, requirements, feature requests or contribute new tools and/or services; contact Peter Knoop, Project Coordinator (knoop@umich.edu), or Anthony Whyte, Sakai Technical Liaison (arwhyte@umich.edu). • INFRASTRUCTURE — QA servers, JIRA/Confluence hosting, contact Peter Knoop. • QA — join QA Work Group, contact Megan May, QA Coordinator (mmmay@indiana.edu). • REQUIREMENTS & USE CASE DEVELOPMENT — join the Requirements WG; contact Mara Hancock, REQ WG chair (mara@media.berkeley.edu).
  • 49.
  • 50.
    Sakai , - , 1-2 , 2008 ! (hu2@iupui.edu) Sakai/Oncourse http://www.sakaiproject.org/