Creative Commons Attribution- NonCommercial-ShareAlike 2.5 License Sakai Programmer's Café Sakai Montreal CRIM Workshop Sakai code exercises Aaron Zeckoski.

Slides:



Advertisements
Similar presentations
JQuery MessageBoard. Lets use jQuery and AJAX in combination with a database to update and retrieve information without refreshing the page. Here we will.
Advertisements

Creative Commons Attribution- NonCommercial-ShareAlike 2.5 License Sakai Programmer's Café Sakai Montreal CRIM Workshop Intro Sakai Auth Permissions Aaron.
COMPUTER PROGRAMMING I Essential Standard 5.02 Understand Breakpoint, Watch Window, and Try And Catch to Find Errors.
Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Excel Project 7 Using Macros and Visual Basic for Applications (VBA) with Excel.
Chapter 4 Planning Site Navigation. 2 Principles of Web Design Chapter 4 Objectives Understand navigation principles Build navigation schemes that meet.
Getting Started. Edline Web Site Requirements Provide Students and Parents With: 1.A Brief Course Description 2.Your Address 3.Course Syllabus 4.Major.
Creating a Website Part Two Navigation. Creating Usable Navigation Provide enough location information to let the user answer the following navigation.
Chapter 4 Planning Site Navigation Principles of Web Design, 4 th Edition.
® IBM Software Group © 2006 IBM Corporation The Eclipse Data Perspective and Database Explorer This section describes how to use the Eclipse Data Perspective,
Android Development (Basics)
Working with SharePoint Document Libraries. What are document libraries? Document libraries are collections of files that you can share with team members.
COMPREHENSIVE Excel Tutorial 8 Developing an Excel Application.
CST JavaScript Validating Form Data with JavaScript.
Reasonable Sakai Widgets Aaron Zeckoski Gonzalo Silverio Antranig Basman
® IBM Software Group © 2006 IBM Corporation Creating JSF/EGL Template Pages This section describes how to create.JTPL (Java Template Pages) using the Page.
Creative Commons Attribution- NonCommercial-ShareAlike 2.5 License RSF Wiki Introduction to Reasonable Server Faces Aaron Zeckoski and Antranig Basman.
REDCap User Group Meeting New Features for 6.5.x 7/14/15 1.
Chapter 5 Java Script And Forms JavaScript, Third Edition.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
Lorie Stolarchuk Learning Technology Trainer 1 What has changed with the 2.7.X Upgrade to CLEW?
1 HTTPUNIT Lauri Peterson Technology Partners, Inc
Project Implementation for COSC 5050 Distributed Database Applications Lab3.
PHP meets MySQL.
11 Web Services. 22 Objectives You will be able to Say what a web service is. Write and deploy a simple web service. Test a simple web service. Write.
JavaDoc1 JavaDoc DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY July 24, 2006 by Emil Vassev & Joey Paquet revision 1.2 –
FireRMS NEMSIS (Part 2) Presented by Laura Small FireRMS Quality Assurance.
Creative Commons Attribution- NonCommercial-ShareAlike 2.5 License RSF Wiki Introduction to Reasonable Server Faces Aaron Zeckoski
Retail Training Manuel 2 Overview  One stop, secure, and easy-to-use web-based tool that incorporates rate, quote, and bind functions  Enables agents.
JavaScript, Fourth Edition Chapter 5 Validating Form Data with JavaScript.
1 Documenting with Javadoc. 2 Motivation  Why document programs? To make it easy to understand, e.g., for reuse and maintenance  What to document? Interface:
Exceptions Handling Exceptionally Sticky Problems.
Creative Commons Attribution- NonCommercial-ShareAlike 2.5 License Sakai Programmer's Café Sakai Montreal CRIM Workshop Introduction to Spring Framework,
CIS 338: Using Queries in Access as a RecordSource Dr. Ralph D. Westfall May, 2011.
Creative Commons Attribution- NonCommercial-ShareAlike 2.5 License Sakai Programmer's Café Sakai Persistence and Hibernate Aaron Zeckoski
0 This document is confidential and is intended solely for the use and information of the client to whom it is addressed. eCPIC Admin Training: Custom.
Forms and Server Side Includes. What are Forms? Forms are used to get user input We’ve all used them before. For example, ever had to sign up for courses.
Software Documentation Section 5.5 ALBING’s Section JIA’s Appendix B JIA’s.
Week 4 Planning Site Navigation. 2 Creating Usable Navigation Provide enough location information to let the user answer the following navigation questions:
Creative Commons Attribution- NonCommercial-ShareAlike 2.5 License RSF Wiki Introduction to Reasonable Server Faces Aaron Zeckoski
0 eCPIC Admin Training: OMB Submission Packages and Annual Submissions These training materials are owned by the Federal Government. They can be used or.
CSC1401 Classes - 2. Learning Goals Computing concepts Adding a method To show the pictures in the slide show Creating accessors and modifiers That protect.
Creative Commons Attribution- NonCommercial-ShareAlike 2.5 License Sakai Programmer's Café Sakai development and app/tool tips Aaron Zeckoski
Forms Collecting Data CSS Class 5. Forms Create a form Add text box Add labels Add check boxes and radio buttons Build a drop-down list Group drop-down.
Sakai WebApp Structure
COP INTERMEDIATE JAVA Designing Classes. Class Template or blueprint for creating objects. Their definition includes the list of properties (fields)
CSCI 6962: Server-side Design and Programming JSF DataTables and Shopping Carts.
® IBM Software Group © 2006 IBM Corporation Finding Out Which Submit Button Was Clicked – and Other JSF Command Button Techniques This section describes.
GoodOO Programming Practice in Java © Allan C. Milne v
CreatingClasses-SlideShow-part31 Creating Classes part 3 Barb Ericson Georgia Institute of Technology Dec 2009.
Creative Commons Attribution- NonCommercial-ShareAlike 2.5 License Sakai Programmer's Café Introduction to Reasonable Server Faces Aaron Zeckoski
Chapter 12© copyright Janson Industries Java Server Faces ▮ Explain the JSF framework ▮ SDO (service data objects) ▮ Facelets ▮ Pagecode classes.
OpenMRS Create New Module.
SourceAnatomy1 Java Source Anatomy Barb Ericson Georgia Institute of Technology July 2008.
Chapter 5 Introduction To Form Builder. Lesson C Objectives  Use sequences to automatically generate primary key values in a form  Create lists of values.
Using Workflow With Dataforms Tim Borntreger, Director of Client Services.
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Android Boot Camp.
Winter 2006CISC121 - Prof. McLeod1 Stuff We had better discuss a midterm date… –27 Feb. to 3 March or –6 to 10 March.
Python: Building Geoprocessing Tools David Wynne, Ghislain Prince.
XP New Perspectives on Macromedia Dreamweaver MX 2004 Tutorial 5 1 Adding Shared Site Elements.
Spell Checker web service (you build a web client that interacts with the service) The client uses a servlet class and a JSP page. The user passes information.
© 2015 Ex Libris | Confidential & Proprietary Yoel Kortick Senior Librarian Cataloging introductory flow.
Excel Tutorial 8 Developing an Excel Application
JavaScript, Sixth Edition
Chapter 5 Validating Form Data with JavaScript
Y.-H. Chen International College Ming-Chuan University Fall, 2004
Unit 7 Learning Objectives
Objectives Design a form Create a form Create text fields
Sakai WebApp Structure
NextGen Trustee General Ledger Accounting
CS288 Lab Exercise 2.
Presentation transcript:

Creative Commons Attribution- NonCommercial-ShareAlike 2.5 License Sakai Programmer's Café Sakai Montreal CRIM Workshop Sakai code exercises Aaron Zeckoski

2 Add a permission New permission: –myapp.view.summary Requires changing 3 files

3 Add Permission - logic api Update the logic api –Add the method boolean viewSummary(String userId, String context) –Don’t forget the javadoc comment!

4 Add Permission - logic test Update the logic test –Add a test method testViewSummaryString()

5 Add permission - logic impl Update the logic impl –Add the perm using FunctionManager In the init method –Implement the new method Use SecurityService to check the permissionAdd

6 Add Permission - test Test the code using the automated testing in Eclipse Run maven sakai –note that the new test runs Try the app to make sure it still works –There will be no visible changes

7 Add a page (part 1) Summary page –Shows statistics on total entries For now it will just show some text –Permission protected –Accessible from the list items page Requires adding 2 new files Requires changing 3 files

8 Add page - add template Create a new template –Copy the file from an existing template –Name it Summary.html Add in 3 spans or divs (or whatever) with rsf:ids like shown: –total-items –current-context-items –current-user-items

9 Add page - add producer Create a new producer –You can do this using eclipse Add new class –implements ViewComponentProducer –Can also copy an existing producer Connect it to the template –Set the ViewID to Summary –Add in UIOutput for the 3 rsf:ids Use made up strings for the values

10 Add page - requestContext Add a bean definition for the new producer to requestContext.xml –Make it an anonymous bean

11 Add page - list template Update the list template to include a link to the Summary.html file Summary –Add it to the navIntraTool part In Sakai, the general rule is to put internal tool navigation in the navIntraTool part (grey bar at top)

12 Add page - list producer Update the list producer to include a UIInternalLink to the summary page –This ties to the link in the template UIInternalLink.make(tofill, "summary", new AddItemViewParameters(SummaryProducer.VIEW_ID, null) );

13 Add page - test Run maven sakai –Deploy the tool Test in Sakai (try out the new page) –Make sure the link back to list items works

14 Add page - use perm Update the new producer –Add a permission check which throws an exception when a user without permission tries to view the new page –Don’t rely on security through obscurity Update the Items producer to check the perms before rendering the link

15 Questions? We will make the summary page functional next

16 Add page - logic api Add some methods to get the 3 pieces of information we want –countAllItems() –countAllItemsByContext(String context) –countAllItemsByOwner(String userId)

17 Add page - logic test Create test methods for the 3 new methods in the api –Check for multiple sites and multiple users –Positives and negatives

18 Add page - logic impl Implement the 3 methods –Use the dao countByProperties –Get default values if the inputs are null

19 Add page - update summary Update the summary producer to use the security method –Throw an exception if the user does not have permission to view this page –Do not use security through obscurity

20 Add page - update list Update the list producer to use the security check to render the link –Don’t give the user links or options that will not work for them

21 Questions? Next we will update the data model

22 Add a field to the data model Add a description field to the data model –It should be a text field of unlimited length –It should be adjustable on the add/modify page screen

23 Add field - update hbm Update the hbm file with the new description field –Use text as the type

24 Add field - update model class Update the model (value) class with the description property –String –Update full constructor –Add getter and setter Use eclipse to generate

25 Add field - update logic test Fix the logic test to use the new constructor and data model class

26 Add field - update dao test Fix the dao test to use the new constructor and data model class

27 Add field - update dao preload Fix the dao preload to use the new constructor and data model class

28 Add field - update AddItem template Add a new textarea for the description to the AddItem template –Probably should use a row for the label and another for the textarea

29 Add field - update AddItem producer Bind a UIInput to the description field –Do it for creating and updating the item UIInput.make(addupdateitem, "item-description", "#{itemsBean.newItem.description}");

30 Add field - update backing bean Add an if statement to update the description if it is not null –In RSF the unchanged return value is null –Do it like title or hidden

31 Questions?

32 Use Sakai Announcement Service Use the Sakai Announcement Service to create an announcement when new items are added –Need to inject the service and call it

33 AnnouncementService String channelRef = announcementService.channelReference(siteId, SiteService.MAIN_CONTAINER); try { AnnouncementChannel ac = announcementService.getAnnouncementChannel(channelRef); ac.addAnnouncementMessage("New Item", false, null, "A new item was added called: title"); } catch (IdUnusedException e1) { log.error("failure adding message: ref=" + channelRef,e1); } catch (PermissionException e1) { log.error("failure adding message: ref=" + channelRef,e1); }

34 Annc - Update the logic api Add a method to the api to create an announcement –Needed since we are accessing it in the backing bean –Alternative: make the create item trigger a private method in the logic impl

35 Annc - Update the logic test Use mock objects to pretend we are using the Announcement Service

36 Annc - update the logic impl Update the logic impl to include the previously referenced code

37 Annc - update backing bean Call the create announcement method when a new item is created

38 Questions?