Presentation is loading. Please wait.

Presentation is loading. Please wait.

Creative Commons Attribution- NonCommercial-ShareAlike 2.5 License Sakai Programmer's Café Sakai development and app/tool tips Aaron Zeckoski

Similar presentations


Presentation on theme: "Creative Commons Attribution- NonCommercial-ShareAlike 2.5 License Sakai Programmer's Café Sakai development and app/tool tips Aaron Zeckoski"— Presentation transcript:

1 Creative Commons Attribution- NonCommercial-ShareAlike 2.5 License Sakai Programmer's Café Sakai development and app/tool tips Aaron Zeckoski azeckoski@gmail.com

2 2 Where to get information and development tips URL: http://bugs.sakaiproject.org/confluence/display/BOOT/Sakai+development+getting+startedhttp://bugs.sakaiproject.org/confluence/display/BOOT/Sakai+development+getting+started

3 3 Sakai foundation website The main website for the Sakai foundation and Sakai project is: –http://www.sakaiproject.org/http://www.sakaiproject.org/ Find information about upcoming Sakai conferences and other Sakai related news Find out what schools are using Sakai Figure out why it is called Sakai

4 4 Programmers Cafe The best source of information for developers wanting to work in Sakai is the programmers café website –http://bugs.sakaiproject.org/confluence/display/BOOT/http://bugs.sakaiproject.org/confluence/display/BOOT/ Info you can find there: –Tutorials –Tips –Documentation –Sample code

5 5 Sakai Collab The Sakai Collab server runs a current version of Sakai and provides a place for the community to collaborate using Sakai, demo Sakai, or try out toolsSakai Collab serverSakai The collab server is also used to manage all the Sakai mailing lists and to manage some documentation –https://collab.sakaiproject.org/portalhttps://collab.sakaiproject.org/portal

6 6 sakai-dev email list The sakai-dev email list is a great place to ask development questions How sign up for sakai-dev email list 1.Create account on Sakai Collab and login –https://collab.sakaiproject.org/portalhttps://collab.sakaiproject.org/portal 2.Click Membership link on left 3.Click Joinable Sites link at top 4.Click Join link for DG: Development Send email to the list at: –sakai-dev@collab.sakaiproject.orgsakai-dev@collab.sakaiproject.org

7 7 Sakai Confluence and JIRA Sakai uses Confluence (an enterprise Wiki) to document projects and Sakai related activityConfluence –http://bugs.sakaiproject.org/confluence/http://bugs.sakaiproject.org/confluence/ Sakai uses JIRA (bug tracker) for issue and bug tracking related to Sakai developmentJIRA –http://bugs.sakaiproject.org/jira/http://bugs.sakaiproject.org/jira/

8 8 Sakai source code The Sakai source code is stored in a Subversion repository Subversion –Main Sakai source Includes the entire Sakai source plus provisional tools https://source.sakaiproject.org/svn/ –Sakai Contrib (contribution) Includes contributed source for various Sakai projects https://source.sakaiproject.org/contrib/

9 9 Eclipse The vast majority of Sakai developers use Eclipse for development Eclipse –You can use other development environments but Eclipse has some advantages: Supported (eclipse files in the Sakai code base) Well understood (support docs and knowledge) Extended tools (appbuilder plugin) Can get commercial support if desired: –http://www.myeclipseide.com/http://www.myeclipseide.com/ URL: http://www.eclipse.org/http://www.eclipse.org/

10 10 Development Environment Getting a good development environment setup is critical to working with Sakai code Complete step by step instructions are available in the programmers café: –Development Setup WalkthroughDevelopment Setup Walkthrough Include various tips that will make developing in Sakai easier

11 11 Sakai API Javadocs The Sakai API Javadocs are available with the release documents here:Javadocs –http://source.sakaiproject.org/release/http://source.sakaiproject.org/release/ The link to the Javadocs is a little over halfway down (link named “JavaDocs”) –Here is the link for the current release (2.3.0) http://source.sakaiproject.org/release/2.3.0/javadoc/ http://source.sakaiproject.org/release/2.3.0/javadoc/ Javadocs for the trunk are available –http://nightly2.sakaiproject.org/javadoc/http://nightly2.sakaiproject.org/javadoc/

12 12 More Sakai javadocs You can build javadocs for the Sakai source code you have checked out Run the following command from the root directory of your copy of the Sakai source –maven sakai:javadoc The javadocs will be generated here – /target/sakai-javadoc.zip URL: http://bugs.sakaiproject.org/confluence/display/BOOT/Javadocs+for+the+Sakai+APIhttp://bugs.sakaiproject.org/confluence/display/BOOT/Javadocs+for+the+Sakai+API

13 13 Naming Best Practices and Tips

14 14 Sakai tool environment Many tools exist in a typical Sakai installation –As a developer, you have to be careful when working in a large scale environment The primary issue is with naming collisions –Some names must be unique in the Sakai instance (not used by any other installed tools) Tools have many interconnections and use a custom request cycle so some programming practices must be followed

15 15 Namespace collisions Most namespace collisions will cause an error to occur on tomcat startup Typically you will see that part of the spring tree died and therefore all spring beans are destroyed Sometimes Sakai will still load but the offending tool will not Tip: Watch tomcat logs when starting up new tools URL: http://bugs.sakaiproject.org/confluence/display/BOOT/Sakai+app+and+tool+naming+tipshttp://bugs.sakaiproject.org/confluence/display/BOOT/Sakai+app+and+tool+naming+tips

16 16 Sakai tool xml file naming The tool id (e.g. sakai.tasklist) in the tool xml file must be unique –Typical id is sakai.toolname –Tool xml file located in tool/src/webapp/tools/ Typical filename is sakai.toolname.xml <tool id="sakai.tasklist" title="Programmer's Cafe - Task List" description="Programmer's Cafe - Task List">

17 17 Sakai project.xml naming The id (e.g. sakai-tasklist-tool) in each project.xml file must be unique –Typical id is sakai-toolname-location –Maven project.xml files are located throughout a typical Sakai app 3../../master/project.xml Programmer's Cafe - Task List sakaiproject sakai-tasklist-tool ${sakai.version}...

18 18 Spring bean naming The id ( e.g. org.sakaiproject.logic.CrudPlusLogic ) of each bean in components.xml must be unique –Convention for the id is to use the fully qualified classpath of the interface for the class –component.xml must be located in impl/pack/src/webapp/WEB-INF/ <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <bean id="org.sakaiproject.crudplus.logic.CrudPlusLogic" class="org.sakaiproject.crudplus.logic.impl.CrudPlusLogicImpl" init-method="init">

19 19 Database table naming Database table names have to be unique since Sakai shares a common schema (or database) Convention is to prefix the table name with the tool name (e.g. TOOLNAME_TABLE) –Good names: SAM_ANSWER, EVAL_ANSWER, GB_GRADES –Bad names: ANSWER, GRADE, CONFIG

20 20 Hibernate HBM files All Hibernate HBM files have to have unique names since Sakai uses one common Hibernate SessionFactory Convention is to prefix the hbm filename with the tool name (e.g. ToolnameItem.hbm.xml) –Good names: EvalAnswer.hbm.xml, TasklistTask.hbm.xml –Bad names: Answer.hbm.xml, Task.hbm.xml, Item.hbm.xml

21 21 Hibernate Persistent Classnames All Hibernate persistent classes must have unique classnames (this does not include the fully qualified classpath) Convention is to prefix the class name with the tool name (e.g. ToolnameItem.java) –Good: EvalAnswer.java, TasklistTask.java –Bad: Answer.java, Task.java

22 22 web.xml servlet name The servlet-name in the web.xml file must match the tool id from the tool xml file –web.xml is located in tool/src/webapp/WEB-INF –If this does not match you will get an uninformative NPE (Null Pointer Exception) in the tomcat log and the tool will fail to load sakai.tasklist org.sakaiproject.tool.tasklist.TasklistTool 1

23 23 Questions?


Download ppt "Creative Commons Attribution- NonCommercial-ShareAlike 2.5 License Sakai Programmer's Café Sakai development and app/tool tips Aaron Zeckoski"

Similar presentations


Ads by Google