Presentation is loading. Please wait.

Presentation is loading. Please wait.

Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries.

Similar presentations


Presentation on theme: "Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries."— Presentation transcript:

1 Development and Customization of OpenACS

2 OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries User interface pages and templates

3 acs_objects universally unique id any interesting “item” is an object anything that has its own URL is an object can assign permissions on objects allows general services such as search, comments, notifications Extensible data models

4 Object Types Type hierarchy Attributes Type specific database table

5 Kernel Database Schema

6 User Model and Authentication Parties Users Groups Relationship Types Relational Segments Privileges Permissions

7

8 Permissions Hierarchy Admin ReadCreateWriteDelete

9 Reporting Bugs http://openacs.org/bugtracker/openacs/

10 Writing a bug report Steps to Reproduce 1. Browse to http://... 2. do... Actual Results Expected Result

11 More information http://openacs.org/bugtracker/openacs/bug- submission-instructions

12 Submitting Patchs http://openacs.org/bugtracker/openacs/patch- submission-instructions.htmlhttp://openacs.org/bugtracker/openacs/patch- submission-instructions.html Best CVS diff from checkout cvs diff -Nu package-directory > patch-file diff -u package-dir/.../old-file package-dir/.../new- file > patch-file CVS diffs are easier to apply back to OpenACS

13 Further Documentation http://openacs.org/doc/current/ http://openacs.org/doc/current/acs- admin.htmlhttp://openacs.org/doc/current/acs- admin.html http://openacs.org/doc/current/tutorial.html

14 More Documentation http://openacs.org/api-doc/ http://tcl.tk/man/tcl8.4/TclCmd/contents.htm http://philip.greenspun.com/tcl/ http://aolserver.com/docs/devel/tcl/api/ http://www.postgresql.org/docs/7.4/static/in dex.htmlhttp://www.postgresql.org/docs/7.4/static/in dex.html

15 Programming in Tcl Each line of Tcl is interpreted as a seperate command procedure_name arg1 arg2 arg3

16 Programming in Tcl one command per line can continue a command on multiple lines with backslash

17 Strings set foo bar set foo “bar” set foo {bar} set foo [bar] set foo $bar set foo {$bar} set foo {[bar]}

18 Strings strings without whitespace don't require quotes strings with whitespace require quotes or curly braces contents of strings defines with quotes are evaluated contents of strings defined with curly braces are not evaluated

19 String Commands String commands are usually faster than regexp and regsub string match string map string equal append

20 Lists a list holds a sequence of elements elements can be a number, string, or another list set foo [list one two three] lappend foo “four” lindex $foo 1 llength $foo

21 Lists lsearch lrange

22 Arrays array set foo [list key1 value1 key2 value2] keys can be any string set bar $foo(key1) set baz “key2” set bar $foo($key2) array get foo

23 Procedures OpenACS ad_proc Named parameters Default values Documentation (@author @param @return @see)

24 ad_proc ad_proc –public note::new { -note_id -name:required -content:required {-creation_user “”} {-creation_ip “”} {-creation_date “”} } { … code goes here … }

25 Tcl Documentation Tcl for Web Nerds (good overview, slightly out of date) Tcl Man pages

26 Creating a Tcl script set my_var [ad_conn user_id]

27 Creating an ADP Template @myvar@

28 Query the database db_1row get_user \ “select * from cc_users where user_id=:user_id” \ -column_array user

29 Bind Vars select * from cc_users where user_id=:user_id Prevents SQL injection

30 Results in ADP Name: @user.first_names@ @user.last_names@ @user.email@

31 Multirow datasource db_multirow users get_users \ “select * from cc_users limit 10”

32 Muliple Tag @users.first_names@ @users.last_name@

33 Retreiving Query Vars ad_page_contract { doc } { foo_id:integer,notnull {return_url “”} }

34 Users and permissions set user_id [ad_conn user_id] set package_id [ad_conn package_id] permission::require_permission \ - party_id $user_id \ -object_id $package_id \ -privilege “read”

35 Granting permissions permission::grant \ -party_id $party_id \ -object_id $object_id \ -privilege “admin”

36 ad_form/formtemplate Form processing Double-click protection Input validation Allows in-form error messages Form style seperated from form processing

37 ad_form ad_form \ form-name -form { object_id:key name:text(text) { label “Enter Name” } } –on_sumbit { db_dml add_name “insert into names (name) values (:name)” }

38 formtemplate

39 More on Forms http://openacs.org/api-doc/proc- view?proc=ad%5fformhttp://openacs.org/api-doc/proc- view?proc=ad%5fform http://openacs.org/doc/acs- templating/developer-guide.htmlhttp://openacs.org/doc/acs- templating/developer-guide.html

40 Template List Manage lists of information Integrated with multirow datasource Sorting, bulk actions, filtering

41

42 External Authentication ns_ldap AOLserver module http://home.galileo.edu/~obonilla/software/ nsldaphttp://home.galileo.edu/~obonilla/software/ nsldap acs-authentication package http://openacs.org/doc/acs-authentication/ auth-ldap package http://openacs.org/doc/current/acs-ldap- authentication/http://openacs.org/doc/current/acs-ldap- authentication/

43

44 Centralized Services Comments Notifications Search Clipboard (new) RSS Support Categories

45 General Comments Allows comments to be attached to any acs_object Optionally allows files to be uploaded with a comment Centralized user interface to approve or reject comments sitewide

46 Notifications Sends email notifications Usually when an acs_object is created or modified Messages are specific for an object type Instant or batch email One page to manage all notifications

47 Forums Notifications Example Can receive notifications on entire forum, or just replies to one posting

48 Search Search can be enabled for any object type Each object type submits specific data to the indexer

49 Clipboard Reference to clipboard enabled objects are saved on clipboard Saved objects can be acted on, marked at related to other objects

50 RSS Support Any object type can be enabled to output RSS information Weblog, News, File-storage

51 Categories Sitewide or package specific Objects can be assigned one or many categories


Download ppt "Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries."

Similar presentations


Ads by Google