Aaron Zeckoski azeckoski@gmail.com Sakai Tool Naming Tips Aaron Zeckoski azeckoski@gmail.com.

Slides:



Advertisements
Similar presentations
RSF Programmers Café and ORM in Sakai with RSF and Hibernate Antranig Basman, CARET, University of Cambridge.
Advertisements

Creative Commons Attribution- NonCommercial-ShareAlike 2.5 License Sakai Programmer's Café Sakai Tool Naming Tips Aaron Zeckoski
Servlets Enterprise Systems Programming. Servlets  Servlets: server-side Java programs that enable dynamic processing of web-based requests  Web-based.
Creative Commons Attribution- NonCommercial-ShareAlike 2.5 License Sakai Programmers’ Café Sakai NWU Workshop, South Africa Recap of Sakai Services Antranig.
MC365 Application Servers: Servlets. Today We Will Cover: What a servlet is The HTTPServlet and some of its more important methods How to configure the.
Object-Oriented Enterprise Application Development Tomcat 3.2 Configuration Last Updated: 03/30/2001.
Intro to Spring CJUG - January What is Spring? “The Spring framework provides central transaction control of various objects.” This means that any.
Creative Commons Attribution- NonCommercial-ShareAlike 2.5 License Sakai Programmer's Café Sakai Montreal CRIM Workshop Data Persistence and Intro to Hibernate.
Creative Commons Attribution- ShareAlike 2.5 License Sakai Programmer's Café Sakai Oxford Tetra ELF Workshop Sakai Persistence and Intro to Hibernate Aaron.
Creative Commons Attribution- NonCommercial-ShareAlike 2.5 License Sakai Programmers’ Café Sakai NWU Workshop, South Africa Introduction to Sakai and Sakai.
The ATLAS Production System. The Architecture ATLAS Production Database Eowyn Lexor Lexor-CondorG Oracle SQL queries Dulcinea NorduGrid Panda OSGLCG The.
SelfDiagnose “who is to blame” ernest micklei, April 2007.
Eric Westfall – Indiana University James Bennett – Indiana University ADMINISTERING A PRODUCTION KUALI RICE INFRASTRUCTURE.
Using JavaBeans and Custom Tags in JSP Lesson 3B / Slide 1 of 37 J2EE Web Components Pre-assessment Questions 1.The _____________ attribute of a JSP page.
1 CS6320 – Deployment and Context L. Grewe 2 The Servlet Container Servlets run in a container sometimes called the Servlet engine. Servlets run in a.
Tomcat Spencer Uresk. Notes This is a training NOT a presentation Please ask questions This is being recorded
Developing for Selenium Grid
CSC 2720 Building Web Applications
Standalone Java Application vs. Java Web Application
CMPUT 391 – Database Management Systems Department of Computing Science University of Alberta CMPUT 391 Database Management Systems Web based Applications,
DRMS GenComm – Goes What: GenComm can be accessed via ( address changed Mar 2010) Address:
Creative Commons Attribution- NonCommercial-ShareAlike 2.5 License RSF Wiki Introduction to Reasonable Server Faces Aaron Zeckoski
Creative Commons Attribution- NonCommercial-ShareAlike 2.5 License Sakai Programmers’ Café Introduction to Sakai and Sakai Services Aaron Zeckoski
Creative Commons Attribution- NonCommercial-ShareAlike 2.5 License Sakai Programmer's Café Sakai Montreal CRIM Workshop Introduction to Spring Framework,
Creative Commons Attribution- ShareAlike 2.5 License Sakai Programmer's Café Sakai Oxford Tetra ELF Workshop Sakai Development Practices, Best, and otherwise.
The Simplest Possible Tool - Iteration 1 Vancouver Bootcamp Mike Osterman
Universidade Fernando Pessoa UFP Tools Development Nuno Fernandes Luís Borges Gouveia Feliz Ribeiro Gouveia.
Introduction to Web Dimitar Nenchev Ivan Nakov
Creative Commons Attribution- NonCommercial-ShareAlike 2.5 License Sakai Programmer's Café Sakai Persistence and Hibernate Aaron Zeckoski
Spring Database Access Ojitha Kumanayaka Copyright © Virtusa, 2007.
Creative Commons Attribution- NonCommercial-ShareAlike 2.5 License RSF Wiki Introduction to Reasonable Server Faces Aaron Zeckoski
Creative Commons Attribution- NonCommercial-ShareAlike 2.5 License Sakai Programmer's Café Sakai Training Workshop Tata Interactive Systems Mumbai, India.
Creative Commons Attribution- NonCommercial-ShareAlike 2.5 License Sakai Programmer's Café Sakai development and app/tool tips Aaron Zeckoski
Persistence – Iteration 4 Vancouver Bootcamp Aaron Zeckoski
Creative Commons Attribution- NonCommercial-ShareAlike 2.5 License Sakai Programmer's Café Sakai Montreal CRIM Workshop Sakai code exercises Aaron Zeckoski.
Sakai WebApp Structure
Java Enterprise Edition Programming Page 1 of 9Configuring Servlets Web Application Context Name  In multiple web applications, a “context name” is used.
Dr. David Roldán Martínez Universidad Politécnica de Valencia, Spain & Nuno Fernandes Universidade Fernando Pessoa, Portugal Site Stats, the power of event.
©SoftMoore ConsultingSlide 1 Filters. Filters can be used in a web application to intercept, examine, and possibly transform requests or responses associated.
Persistence – Iteration 4 Vancouver Bootcamp Aaron Zeckoski
Creative Commons Attribution- NonCommercial-ShareAlike 2.5 License Sakai Programmer's Café Introduction to Reasonable Server Faces Aaron Zeckoski
CTools Build Process David Haines University of Michigan.
Programmer Support. Our Primary Goal: Reproduce the Problem.
Developing with the Framework Zach A. Thomas, Texas State University
CS422 Principles of Database Systems Object-Relational Mapping (ORM) Chengyu Sun California State University, Los Angeles.
Hibernate Online Training. Introduction to Hibernate Hibernate is a high-performance Object-Relational persistence and query service which takes care.
Creative Commons Attribution- NonCommercial-ShareAlike 2.5 License Sakai Programmer's Café Sakai Montreal CRIM Workshop Introduction to Spring Framework.
HIBERNATE/Java Overview of technology for Hibernate by محمد حسن کاظمی پوران Master : M.M.Nematollahi.
Creative Commons Attribution- ShareAlike 2.5 License Sakai Programmer's Café Sakai Oxford Tetra ELF Workshop Comparative Display Technologies in Sakai.
The Purpose of XML Namespaces
CS3220 Web and Internet Programming Introduction to Java Servlets
A very brief introduction
Persistence – Iteration 4 Vancouver Bootcamp
Developing the Tools Montreal 2004
Sakai Persistence and Intro to Hibernate
Pal‐Store E‐commerce Website
Servlet API and Lifecycle
Sakai WebApp Structure
Intro to Spring CJUG - January 2013.
Introduction to Sakai and Sakai Services
Aaron Zeckoski Tomcat Debugging Aaron Zeckoski
Hibernate Bayu Priyambadha, S.Kom.
The Model Layer What is Model?
Objectives In this lesson you will learn about: Need for servlets
Introduction to Spring Framework and Dependency Injection
CS3220 Web and Internet Programming Introduction to Java Servlets
Servlets.
DevOps in action The next level of virtualization
CS4961 Software Design Laboratory Understand Aquila Backend
WebSphere & EJB’s Experiences, Deployment & Best Practices
Presentation transcript:

Aaron Zeckoski azeckoski@gmail.com Sakai Tool Naming Tips Aaron Zeckoski azeckoski@gmail.com

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

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+tips

Sakai tool xml file naming <?xml version="1.0" encoding="UTF-8"?> <registration> <tool id="sakai.tasklist" title="Programmer's Cafe - Task List" description="Programmer's Cafe - Task List"> <category name="course" /> <category name="project" /> </tool> </registration> 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

Sakai project.xml naming <?xml version="1.0" encoding="UTF-8"?> <project> <pomVersion>3</pomVersion> <extend>../../master/project.xml</extend> <name>Programmer's Cafe - Task List</name> <groupId>sakaiproject</groupId> <id>sakai-tasklist-tool</id> <currentVersion>${sakai.version}</currentVersion> ... 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

Spring bean naming <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans> <bean id="org.sakaiproject.crudplus.logic.CrudPlusLogic" class="org.sakaiproject.crudplus.logic.impl.CrudPlusLogicImpl" init-method="init"> </beans> 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/

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

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

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

web.xml servlet name <servlet> <servlet-name>sakai.tasklist</servlet-name> <servlet-class>org.sakaiproject.tool.tasklist.TasklistTool</servlet-class> <load-on-startup>1</load-on-startup> </servlet> 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

Questions?