development and customization of openacs. openacs package architecture functionality is divided into...
TRANSCRIPT
![Page 1: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/1.jpg)
Development and Customization of OpenACS
![Page 2: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/2.jpg)
OpenACS Package Architecture
• Functionality is divided into packages
• One package contains
• Data Model
• Tcl Libraries
• User interface pages and templates
![Page 3: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/3.jpg)
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
![Page 4: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/4.jpg)
Object Types
• Type hierarchy
• Attributes
• Type specific database table
![Page 5: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/5.jpg)
Kernel Database Schema
![Page 6: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/6.jpg)
User Model and Authentication
• Parties
• Users
• Groups
• Relationship Types
• Relational Segments
• Privileges
• Permissions
![Page 7: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/7.jpg)
![Page 8: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/8.jpg)
Permissions Hierarchy
Admin
Read Create Write Delete
![Page 9: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/9.jpg)
Reporting Bugs
• http://openacs.org/bugtracker/openacs/
![Page 10: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/10.jpg)
Writing a bug report
• Steps to Reproduce
• 1. Browse to http://...
• 2. do ...
• Actual Results
• Expected Result
![Page 11: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/11.jpg)
More information
• http://openacs.org/bugtracker/openacs/bug-submission-instructions
![Page 12: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/12.jpg)
Submitting Patchs
• http://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
![Page 13: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/13.jpg)
Further Documentation
• http://openacs.org/doc/current/
• http://openacs.org/doc/current/acs-admin.html
• http://openacs.org/doc/current/tutorial.html
![Page 14: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/14.jpg)
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/index.html
![Page 15: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/15.jpg)
Programming in Tcl
• Each line of Tcl is interpreted as a seperate command
procedure_name arg1 arg2 arg3
![Page 16: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/16.jpg)
Programming in Tcl
• one command per line
• can continue a command on multiple lines with backslash
![Page 17: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/17.jpg)
Strings
set foo bar
set foo “bar”
set foo {bar}
set foo [bar]
set foo $bar
set foo {$bar}
set foo {[bar]}
![Page 18: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/18.jpg)
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
![Page 19: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/19.jpg)
String Commands
• String commands are usually faster than regexp and regsub
• string match
• string map
• string equal
• append
![Page 20: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/20.jpg)
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
![Page 21: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/21.jpg)
Lists
• lsearch
• lrange
![Page 22: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/22.jpg)
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
![Page 23: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/23.jpg)
Procedures
• OpenACS ad_proc
• Named parameters
• Default values
• Documentation (@author @param @return @see)
![Page 24: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/24.jpg)
ad_proc
ad_proc –public note::new {
-note_id
-name:required
-content:required
{-creation_user “”}
{-creation_ip “”}
{-creation_date “”}
} {
… code goes here …
}
![Page 25: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/25.jpg)
Tcl Documentation
• Tcl for Web Nerds (good overview, slightly out of date)
• Tcl Man pages
![Page 26: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/26.jpg)
Creating a Tcl script
set my_var [ad_conn user_id]
![Page 27: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/27.jpg)
Creating an ADP Template
<master>
@myvar@
![Page 28: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/28.jpg)
Query the database
db_1row get_user \“select * from cc_users where user_id=:user_id” \-column_array user
![Page 29: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/29.jpg)
Bind Vars
select * from cc_users where user_id=:user_id• Prevents SQL injection
![Page 30: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/30.jpg)
Results in ADP
<master>
Name: @user.first_names@ @user.last_names@ <br />@user.email@
![Page 31: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/31.jpg)
Multirow datasource
db_multirow users get_users \ “select * from cc_users limit 10”
![Page 32: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/32.jpg)
Muliple Tag
<master>
<multiple name=”stuff”>@users.first_names@ @users.last_name@ <br /></multiple>
![Page 33: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/33.jpg)
Retreiving Query Vars
ad_page_contract {
doc} {foo_id:integer,notnull{return_url “”}}
![Page 34: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/34.jpg)
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”
![Page 35: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/35.jpg)
Granting permissions
permission::grant \
-party_id $party_id \
-object_id $object_id \
-privilege “admin”
![Page 36: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/36.jpg)
ad_form/formtemplate
• Form processing
• Double-click protection
• Input validation
• Allows in-form error messages
• Form style seperated from form processing
![Page 37: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/37.jpg)
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)”
}
![Page 38: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/38.jpg)
formtemplate
<formtemplate id=“form-name”></formtemplate>
![Page 39: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/39.jpg)
More on Forms
• http://openacs.org/api-doc/proc-view?proc=ad%5fform
• http://openacs.org/doc/acs-templating/developer-guide.html
![Page 40: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/40.jpg)
Template List
• Manage lists of information
• Integrated with multirow datasource
• Sorting, bulk actions, filtering
![Page 41: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/41.jpg)
![Page 42: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/42.jpg)
External Authentication
• ns_ldap AOLserver module• http://
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/
![Page 43: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/43.jpg)
![Page 44: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/44.jpg)
Centralized Services
• Comments
• Notifications
• Search
• Clipboard (new)
• RSS Support
• Categories
![Page 45: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/45.jpg)
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
![Page 46: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/46.jpg)
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
![Page 47: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/47.jpg)
Forums Notifications Example
• Can receive notifications on entire forum, or just replies to one posting
![Page 48: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/48.jpg)
Search
• Search can be enabled for any object type
• Each object type submits specific data to the indexer
![Page 49: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/49.jpg)
Clipboard
• Reference to clipboard enabled objects are saved on clipboard
• Saved objects can be acted on, marked at related to other objects
![Page 50: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/50.jpg)
RSS Support
• Any object type can be enabled to output RSS information
• Weblog, News, File-storage
![Page 51: Development and Customization of OpenACS. OpenACS Package Architecture Functionality is divided into packages One package contains Data Model Tcl Libraries](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649edc5503460f94beced2/html5/thumbnails/51.jpg)
Categories
• Sitewide or package specific
• Objects can be assigned one or many categories