Showing 41 - 50 of 698 Postings (
summary)
Created by Gustaf Neumann, last modified by Gustaf Neumann 14 Jan 2022, at 09:29 PM
Server-Sent Events (SSE) is a server push technology enabling a client to receive automatic updates from a server via an HTTP connection, and describes how servers can initiate data transmission towards clients once an initial client connection has been established.
A simple approach for implementing SSE on OpenACS with discussed in a forum thread.
The example below shows, how to use SSE to associate a background job with the client. This can be used e.g. when executing longer a running job in the background and to keep the client up incrementally to date what is currently happening. This can be seen as an alternative to streaming HTML.
Page with associated background activity
ad_page_contract {
Sample page for emulating streaming HTML via SSE (server side
events) for a background job. In this example, the same page is
used as the event sink (where the events are displayed) and as an
event source (when called with a session_id).
@author Gustaf Neumann
} {
{session_id:integer ""}
}
set title "Sample HTML streaming job page (SSE)"
set context $title
if {$session_id ne ""} {
#
# We are called by the event handler from JavaScript. This block
# could be a different, generic script, but we keep it here
# together for reducing number of files.
#
#
# Set up SSE: return headers and register reporting channel for
# the session_id.
#
set channel [ns_connchan detach]
ns_connchan write $channel [append _ \
"HTTP/1.1 200 OK\r\n" \
"Cache-Control: no-cache\r\n" \
"X-Accel-Buffering': no\r\n" \
"Content-type: text/event-stream\r\n" \
"\r\n"]
sse::channel $session_id $channel
ad_script_abort
} else {
#
# We are called as an ADP page.
#
set session_id [ns_conn id]
#
# Register the SSE event handler in JavaScript.
#
template::head::add_script -script [subst {
if(typeof(EventSource) !== "undefined") {
var sse = new EventSource("[ns_conn url]?session_id=$session_id");
sse.onmessage = function(event) {
if ('__CLOSE_SSE__' == event.data) {
sse.close(); // stop retry
} else {
document.getElementById("result").innerHTML += event.data;
}
};
} else {
document.getElementById("result").innerHTML = "Sorry, your browser does not support server-sent events...";
}
}]
#
# Run some job in the background and report updates via SSE to the
# current page. The session_id is used to associate the background
# job with the client.
#
sse::job $session_id {
foreach i {1 2 3 4} {
set HTML "<li>finish $i: ...([person::name -person_id [ad_conn user_id]])</li>"
sse::message -localize $session_id $HTML
ns_sleep 1s
}
sse::close $session_id
}
ad_return_template
}
Corresponding ADP page:
@title;literal@
@context;literal@
<h1>Getting updates from job associated with session_id @session_id@</h1>
<ul> </ul>
Library support
Save this under e.g. acs-tcl/tcl/sse-procs.tcl
#############################################################################
# Simple API for SSE messages via a SESSION_ID, e.g. via a job running
# in the background.
#
# Gustaf Neumann fecit
#############################################################################
namespace eval sse {
#
# sse::job
#
ad_proc ::sse::job { {-lang} session_id script} {
Execute some (long running) script in the background. The
background script is associated via the session_id with the client
and can send messages to it via sse::message. When done, the job
should issue sse::close.
@param lang language used for internationalization. If not set,
taken from the calling environment
@param session_id associated session_id, used for reporting back
@param script script to be executed in the background
} {
if {![info exists lang]} {
set lang [uplevel {ad_conn locale}]
}
nsv_set sse_dict $session_id \
[list \
lang $lang \
ad_conn [list array set ::ad_conn [array get ::ad_conn]] \
xo::cc [expr {[info commands ::xo::cc] ne "" ? [::xo::cc serialize] : ""} ] \
]
ns_job queue -detached sse-jobs \
[list ::apply [list session_id "sse::init_job $session_id\n$script"] $session_id]
}
#
# sse::message
#
ad_proc ::sse::message { {-localize:boolean} session_id msg} {
Send a message to the client. In case the channel
was not jet registered, buffer the message in an nsv dict.
@param localize Perform localization of the provided text
@param session_id associated session_id, used for associating output session
@param msg The message to be sent back
} {
if {$localize_p} {
set msg [lang::util::localize $msg [nsv_dict get sse_dict $session_id lang]]
}
if {[nsv_dict get -varname channel sse_dict $session_id channel]} {
#
# The channel is already set up.
#
if {[nsv_dict get -varname messages sse_dict $session_id messages]} {
#
# The "nsv_dict unset" poses a potential race condition,
# ... but not for the job application scenario.
#
nsv_dict unset sse_dict $session_id messages
#ns_log notice "--- sse $session_id get buffered messages '$messages'"
} else {
set messages ""
}
lappend messages $msg
foreach message $messages {
ns_log notice "--- sse $session_id message '$message'"
#
# SSE needs handling of new-lines in the data field; here we
# send two messages in this case. In other cases, maybe coding
# newline as literally \n and decoding it on the client might
# be appropriate.
#
ns_connchan write $channel \
[string cat "data:" [join [split $message \n] "\ndata:"] "\n\n"]
if {$message eq "__CLOSE_SSE__"} {
ns_connchan close $channel
nsv_unset sse_dict $session_id
}
}
} else {
#
# Buffer the message.
#
#ns_log notice "--- sse $session_id must buffer message '$msg'"
nsv_dict lappend sse_dict $session_id messages $msg
}
}
#
# sse::channel: register a channel for the session id. This is
# typically called by the event handler, which is called from
# JavaScript.
#
proc ::sse::channel {session_id channel} {
nsv_dict set sse_dict $session_id channel $channel
}
#
# sse::init_job: setup a context quite similar to a connection thread
#
proc ::sse::init_job {session_id} {
set sse_dict [nsv_get sse_dict $session_id]
eval [dict get $sse_dict ad_conn]
eval [dict get $sse_dict xo::cc]
}
#
# sse::close: provide an API for closing the session
#
proc ::sse::close {session_id} {
::sse::message $session_id __CLOSE_SSE__
}
if {"sse-jobs" ni [ns_job queues]} {
ns_job create sse-jobs 4
nsv_set sse_dict "" ""
#ns_job configure -jobsperthread 10000
}
}
#
# Local variables:
# mode: tcl
# tcl-indent-level: 2
# indent-tabs-mode: nil
# End:
Im case you are running NGINX and you are experiencing problems with SSE, check out this entry on stackoverflow.
Created by Gustaf Neumann, last modified by Paul Babin 14 Oct 2021, at 04:01 PM
OpenACS provides theming functionality, i.e. the customization of the site layout through so-called theme packages with customized CSS and HTML layout.
Each subsite in OpenACS can have its own theme.
By default, the "Openacs-Default-Theme" is activated when installing OpenACS. The "Openacs-Default-Theme" package contains a "tabbed" navigation theme and a "plain" navigation theme (without tabs in main navigation).
OpenACS comes now with a new theme package, the "Openacs-Bootstrap3-Theme" Package, which is based on the Twitter Bootstrap Library. This new package is used on the openacs.org site and available form the openacs repository. The package (and the description below) requires at least OpenACS 5.9.0. In the following section you find some hints on how to use and customize this theme and how the theming can be customized in newer versions of OpenACS.
Step-by-Step Installation of a Theme Package
Installing theme packages and switching between themes can be easily done in a few steps:
- Obtain the theme package (e.g. from CVS or github) and install it under the package directory. You can as well "install from the respository", which makes step 2 below unnecessary.
- Go to /acs-admin/install and install the package
- Navigate to the subsite whose theme you would like to change and go to the "Configure"-Page. If you only have the default subsite set up, this is located at /admin/configure. Choose the theme you want. Click Ok. You should see the new theme now.
Note that a theme package can contain a number of different themes. For instance, the "Openacs-Default-Theme" Package contains a "tabbed" and a "plain" theme; the "Openacs-Bootstrap3-Theme" Package contains a "tabbed" theme in OpenACS style and a "tabbed" theme in turquoise color.
- DONE!
Understanding the Basic Settings of Theme Packages
Where are the themes of a theme package defined?
Open /packages/openacs-bootstrap3-theme/tcl/apm-callback-procs.tcl in your editor. You see that 2 themes are defined here (subsite::new_subsite_theme), with all relevant parameters including css and js files and definition of template files.
You could add another subsite theme here. In order to get it listed on the "Configure"-Page of your subsite, you need to de-install and re-install the Theme Package.
The Theming Parameters allow you to specify, how elements of your page such as forms or lists should be rendered. If the resource which you have defned in your theme is not found, the default is taken from /packages/acs-templating/resources/ as a fallback.
The Theming Parameters
Have a look at the parameter page of your subsite. If you only have the default subsite set up, this is located at /shared/parameters.
In the "Theming"-Section of the subsite parameter page, you find the parameters which you have defined in the apm-callback-procs.tcl file of your theme package. You can modify the parameters here, however it is recommended that you define them in the apm-callback-procs. Why? If you switch the theme or re-install it, the settings of the parameter page are lost!
DefaultDimensionalStyle
- Defines layout of the filter options in a dimensional list. You can find an example at the Download Page of the OpenACS Website.
DefaultFormStyle
- Defines the layout of form templates
DefaultListStyle
- Defines the layout of list templates
DefaultMaster
- Defines the general page layout. The master usually sets the framing for the page layout and places elements such as header, navigation, content area, footer.
ResourceDir
- The directory, from which the resources of acs-templating are loaded. The resources include the template files for dimensionals, forms, lists, masters, templates, widgets. If not set, or the required resource is not found, the default is taken from /packages/acs-templating/resources/.
If for instance, the ResourceDir is set to /packages/openacs-bootstrap3-theme/resources, and you have a dimensional template defined in "Openacs-Bootstrap3-Theme" Package, you only need to specify the name of the -dimensional_template without giving the entire path.
StreamingHead
- Master used for streaming content
ThemeCSS
- List of CSS files used in the theme
ThemeJS
- List of Javascript files used in the theme
ThemeKey
Additional Tools to Layout in a Theme Package
Widgets
Starting with OpenACS 5.9, so-called widgets can be defined. <widget> is very similar to <include>, but uses widget specific name resolution based on themes. If the theme package contains resources/widgets/$specifiedName it is used from there. Otherwise it behaves exactly like <include> (without the resources/templates/theming).
In the "Openacs-Bootstrap3-Theme" Package, widgets are defined e.g. for the main navigation bar and the login area.
Templates
Sometimes, you might want a specific page or include to have a special design or layout which differs from the standard layout defined in that package. For instance, you might want to give the notification widget a new look&feel. You could go to the notification package and edit the correspondend tcl/adp files there. However, when upgrading the package, you always would have to merge your local changes with the upgraded files.
Starting with OpenACS 5.9, you can customize your local templates in your Theme Package. These files "overrule" the tcl/adp files in the corresponding packages. This makes it easier for you to keep the overview of all your layout changes, and also to upgrade your packages with less effort.
How does it work?
Let's take the example from above: you want to change the lokk&feel of the notification widget. The tcl/adp files are situated in /packages/notifications/lib/notification-widget.tcl and /packages/notifications/lib/notification-widget.adp.
Go to the "Openacs-Bootstrap3-Theme" Package. You see a folder resources/templates. Now construct a folder structure in the templates folder, just like this: resources/templates/notifications/lib and create the 2 files notification-widget.tcl/adp. Change the layout as desired.
DONE!
The "Openacs-Bootstrap3-Theme" Package contains a few such template files by default; feel free to change or complement them.
Understanding the Openacs-Bootstrap3-Theme Package
Different master files
The "Openacs-Bootstrap3-Theme" Package comes with a set of master files, which are shortly explained here.
- The "base master" is the plain-master.tcl/adp. It defines the general page layout.
- The tabbed-master.tcl/adp is the addition for a tabbed navigation, i.e. navigation tabs in the header bar which are defined in the parameter page. Tabs can be defined for admins (AdminNavbarTabsList), for members (MembersViewNavbarTabsList), for users (UserNavbarTabsList). You can check if you want the applications to be shown as tabs in the navigation bar.
- The tabbed-master-turquois.tcl/adp is similar tp the tabbed-master.tcl/adp. The difference is in the logo image defined in the .tcl file. In the OpenACS website, it is currently applied in the subsite for the .LRN project.
- The plain-streaming-head.tcl/adp, tabbed-streaming-head.tcl/adp, and tabbed-streaming-head-turquois.tcl/adp files are the corresponding master files for streaming content.
Color css
"Openacs-Bootstrap3-Theme" Package contains a "tabbed" theme in OpenACS style and a "tabbed" theme in turquoise color. The color stylesheets are defined in the apm-callback-procs.tcl file and located at /packages/openacs-bootstrap3-theme/www/resources/css/color/. This makes it very easy to change the color design of the theme. You could either modify one of the color stylesheets "blue.css" or "turquois.css"; or you could add your own color stylesheet and link it in the apm-callback-procs.tcl-file. In the latter case, you should de-activate and re-activate the theme in the "Configure"-Page (see above) to activate the setting.
Twitter Bootstrap
As the name of the package suggests, the "Openacs-Bootstrap3-Theme" Package makes use of the Twitter Bootstrap Library in version 3. The Twitter Bootstrap Library is a HTML, CSS and JAVASCRIPT library for frontend development which is based on a mobile first, responsive approach to web design.
Much has been written about this library. However, here are a few links which should help you to make yourself familiar with the Library in case you are new to Bootstrap:
Designing your own Theme
The following guideline helps you to create your own theme. The easiest approach to develop your own theme is to build up on an existing one. For instance, you could modify the "Openacs-Bootstrap3-Theme" Package as a starting point.
- Make a local copy of the "Openacs-Bootstrap3-Theme" Package
- Rename the package.
- Take particular care of the .info file. Rename all the places where you find "openacs-bootstrap3-theme", and give a unique package key.
- Take particular care of the tcl/apm-callback-procs.tcl file. The subsites defined here through subsite::new_subsite_theme need to have a unique key, so give all the subsites you create here a unique key. Also, take care of the namespace.
- Before starting to modify the package, it is best to try to install and de-install the package on a test instance to make sure that you have all the naming right.
- Now feel free to modify the design as you like.
Themes in .LRN
When installing .LRN, the theme-zen is installed and activated by default.
.LRN comes now with a new theme package, the "Dotlrn-Bootstrap3-Theme" Package (as of July 2016, it is in proof-of-concept state!).
The "Dotlrn-Bootstrap3-Theme" Package builds on the "Openacs-Bootstrap3-Theme" Package and depends on both the "Openacs-Bootstrap3-Theme" Package and the "Theme-Zen" Package.
The Theming specifics described above also apply to .LRN theming, but additionally you should consider the following points:
Portal Pages Design
The Design of a Portal Page is defined on 3 levels:
- The subsite theme (which can be chosen on the "Configure"- Page, as described above)
- The page layout: It defines whether the page has, for instance, a 1-column, 2-column or 3-column layout. In the "Dotlrn-Bootstrap3-Theme" Package, the layouts are defined at lib/layouts.
- The portlet theme: It defines the look&feel of the single portlet. In the "Dotlrn-Bootstrap3-Theme" Package, the themes are defined at lib/themes.
Since every portal which is created, stores the portlet theme ID in the database, and since every portal page that is created, stores the page layout ID in the database, changing a theme in .LRN requires an upgrade of the affected database tables. This is done by the tcl/theme-procs.tcl/xql in the "Dotlrn-Bootstrap3-Theme" Package.
!!!!!! Attention: If you switch to the .LRN-bootstrap3-theme, all the portal pages are updated to the bootstrap3 layout !!!!!!
Installing and De-Installing the "Dotlrn-Bootstrap3-Theme" Package
If the "Dotlrn-Bootstrap3-Theme" Package is de-installed, the above described portal pages design falls back to the theme-zen design. This should make sure that the portal pages are always provided with a working layout.
Created by Gustaf Neumann, last modified by Gustaf Neumann 08 Oct 2021, at 09:57 PM
Here is a summary of steps to upgrade a legacy OpenACS installation (recent OpenACS, but old PostgreSQL version). In general it is possible to restore a "pg_dump" of some older version in newer versions of PostgreSQL. It is not necessary, to upgrade in small steps, version by version, but one can also skip major versions, when keeping certain things in mind. The upgrade on openacs.org was from PostgreSQL 9.6.4 to 13.1.
OIDs
Newer versions of PostgreSQL do not support OIDs anymore. OpenACS does not need OIDs in its queries, but one has to create a pg_dump without OIDs first. This can be achieved by the following commands.
#
# Settings of old PostgreSQL installation
#
PGBIN=/usr/local/pg964/bin
PGPORT=5496
#
# Database from where OIDs should be removed
#
DB=openacs.org
for tbl in `$PGBIN/psql -p $PGPORT -U postgres -qAt -c "select schemaname || '.' || tablename from pg_tables WHERE schemaname <> 'pg_catalog' AND schemaname <> 'information_schema';" $DB`
do
$PGBIN/psql -U postgres -c "alter table $tbl SET WITHOUT OIDS" $DB
done
tsearch2
tsearch2 was an extension in PostgreSQL versions before version 10, but was dropped as an extension at this time, being now integral part of newer PostgreSQL versions. Users who have been continuously upgrading since a long time (from before 8.3) have to manually modify their databases by stripping leftovers from the extension. Otherwise, loading the dump will raise errors doe to missing tsearch2 functions in new versions (e.g. "ERROR: function "dex_init(internal)" does not exist").
By excluding the "pg_ts_*" table, the dump can be imported (although it will complain about the missing tsearch2 module). Nevertheless, the imported dump will be fully functional.
Dump from PostgreSQL 9.6
Here is, what i've used on openacs.org for dumping. For your local installation, you have to replace the database names in the for loop by the names that you use.
#
# Use variable DATE to disambiguate multiple dumps in the same directory
#
DATE=`date +"%Y-%m-%d"`
for DB in 5-9-1 dotlrn-test fisheye oacs-5-8 openacs.org openacs.org-test translate wi1.org wi1.org-test
do
echo "dumping to ~/$DB.dump.$DATE.gz"
$PGBIN/pg_dump -p $PGPORT -U postgres --exclude-table=public.pg_ts_\* $DB | gzip > ~/$DB.dump.$DATE.gz
done
Restore in PostgreSQL 13
After this, restoring went smooth:
#
# Adjust settings to your pg13 installation
#
export PG13=pg13
export PGBIN13=/usr/local/${PG13}/bin
export PGPORT13=5413
for DB in 5-9-1 dotlrn-test oacs-5-8 openacs.org openacs.org-test translate wi1.org wi1.org-test
do
echo "reloading from ~/$DB.dump.$DATE.gz"
$PGBIN13/dropdb -p $PGPORT13 -U nsadmin $DB
$PGBIN13/createdb -p $PGPORT13 -U openacs -T template0 $DB
$PGBIN13/psql -p $PGPORT13 -U openacs $DB -tAc "create extension ltree"
gunzip < ~/$DB.dump.$DATE.gz | $PGBIN13/psql -p $PGPORT13 -U nsadmin $DB > ~/$DB.log
done
You might not need the line with the ltree extension in your installation.
Upgrade from PostgreSQL 13 to PostgreSQL 14
Just dump and restore.
Created by Gustaf Neumann, last modified by Gustaf Neumann 07 Oct 2021, at 01:57 PM
Upgrades from earlier version than OpenACS 5.8 should read upgrade-oacs-5-8 and upgrade-oacs-5-9.
OpenACS 5.10 requires PostgreSQL 9.6 or newer, Tcl 8.6.2 or newer and XOTcl 2.1 or newer (part of the nsf package). XOTcl 2.0 can be installed e.g. via install-ns, or from Debian sid https://packages.debian.org/sid/, or from sources https://next-scripting.org/. In order to check the versions of these packages already installed in your OpenACS installation, check the output of /xotcl/version-numbers in your installation.
Before upgrading to OpenACS 5.10, upgrade all packages in your current installation to recent versions in your OpenACS 5.9 installation, which OpenACA 5.9.1(i.e. in the oacs-5-9 channel).
In general it is always recommended to backup your current installation before overwriting it. Make e.g. a tar archive of all files of the OpenACS tree and a database dump.
After upgrading the packages in the oacs-5-9 channel, the following steps are recommended:
- Restart the server with the newest OpenACS 5.9
- Install newest version of the source files (e.g. from the OpenACS 5.10 tar distributions, or install/upgrade from the oacs-5-10 branch from cvs),
- Upgrade the acs-core packages via package manager, restart server
- Upgrade/install application packages via package manager as needed (from file-system or from repository)
Note: when one installs now from the openacs-5.9.1 tar ball, there will be a problem with a PostgreSQL 11, since the tar ball is older than this PostgreSQL release. However, the version of OpenACS 5.9.1 in the repositories (CVS or github) can be installed as well with newer PostgreSQL versions.
Step by step upgrade to OpenACS 5.10.0
The following steps assume, you have a plain, not modified version of OpenACS running.
- Upgrade to the latest version of OpenACS 5.9.1, e.g. via
cvs -r oacs-5-9 openacs-4
upgrade the packages, restart the server and make sure, you have really upgraded all packages;
under /acs-admin/apm/ you should see a Kernel like 5.9.1* running.
- Either fet release tar file of openacs-5.10.0, unpack it (e.g. under /usr/local), make sure, your configuration file points to the right source tree, and restart server, or upgrade via cvs
cvs -r oacs-5-10 -Pd openacs-4
- Upgrade packages:
Browse to /acs-admin/install click on "upgrade from local", select all packages, restart server - done.
In case, you have a locally modified version of OpenACS, but you have not modified the kernel packages, then make sure to get the tar file of the core packages in step (2), proceed as described, upgrade the acs-core packages first and then the application packages of your installation.
In case you have in your installation as well changes in the acs-core packages (which is not recommended, but it happens), then get the diffs (you local changes) between the acs-core packages of oacs-5-10 and your installation, proceed as with the unmodified acs-core packages (paragraph above) and apply/merge your local changes after upgrading.
These steps are working also with recent versions of PostgreSQL such as 13.3.
Created by Gustaf Neumann, last modified by Gustaf Neumann 02 Oct 2021, at 10:41 AM
XoWiki Content Flow - an XoWiki based workflow system implementing state-based behaviour of wiki pages and forms (short intro).
Package Specification Summary for Package: xowf
| Summary: |
XoWiki Content Flow - an XoWiki based workflow system implementing state-based behavior of wiki pages and forms |
| Description: |
|
| Maturity: |
Mature |
| This package depends on: |
acs-automated-testing acs-tcl acs-templating xotcl-core xowiki |
| Packages that depend on xowf: |
xooauth |
| Package parameters: |
- parameter_page
- ::xowiki::FormPage to search for parameters. The page name has to contain a language prefix and can refer to a different xowiki instance.
Example: //xowiki/en:xowiki-standard-parameter (default , type string, scope instance)
- use_hstore
- Use hstore for accessing instance attributes. Create index for existing values via ::xowiki::hstore::update_form_instance_item_index -package_id $package_id (default 0, type number, scope instance)
|
Bug Tracker Summary for Package: xowf
There is no package with the name "xowf" known to bug-tracker.
Code Metrics Summary for Package: xowf
| # Tcl Procs |
8 |
| # Tcl Lines |
12575 |
| # Tcl Blank Lines |
1112 |
| # Tcl Comment Lines |
3332 |
| # Automated Tests |
6 |
| # Stored Procedures |
PG: 0 ORA: 0 |
| # SQL Lines |
PG: 0 (blank 1 comments 0)
ORA: 0 (blank 1 comments 0) |
| # ADP pages |
1 |
| # ADP lines |
32 |
| # Include pages (xowf/lib/) |
2 |
| # Documentation pages |
0
|
| # Documentation lines |
0 |
| Browse Source |
API-browser |
| Github Repository: |
https://github.com/openacs/xowf/tree/oacs-5-10
|
xowf depends on xowiki.
Workflow Examples:
- A two-chambers legislative process, loosely based on the Italian one. A law proposal is submitted to the first chamber, then passed to the second one. The text keeps being passed between the two chambers until no amendments (changes) are made. Once this condition is met, the law is approved. Workflow example of a legislative process
Created by Gustaf Neumann, last modified by Gustaf Neumann 11 Sep 2021, at 09:58 AM
Streaming HTML can be used to output HTML content to a user incrementally. This is in particular useful for pages for pages with longer response time, to inform during processing about the progress of the tasks.
Newer OpenACS versions come with templates for the standard themes for streaming pages. The template for streaming pages can be retrieved for the current theme via the API call "template::streaming_template". An application developer should structure streaming HTML pages as follows:
Output top of page:
set context ...
set title ...
ad_return_top_of_page [ad_parse_template \
-params [list context title] \
[template::streaming_template]]
Output HTML incrementally:
# Assume, we are collecting HTML in the Tcl variable HTML.
# Send this HTML chunk incrementally to the user
ns_write [lang::util::localize $HTML]
Flush Output from body scripts:
(e.g. template::add_body_script, template::add_event_listener, template::add_body_handler, template::add_script)
ns_write [template::collect_body_scripts]
End of Page:
# Optionally
ns_write [lang::util::localize [template::get_footer_html]]
ns_write [template::collect_body_scripts]
Full sample script:
Putting everything together
set title "Sample HTML streaming page"
set context [list $title]
ad_return_top_of_page [ad_parse_template \
-params [list context title] \
[template::streaming_template]]
ns_write "<ul>\n"
foreach i {1 2 3 4} {
set HTML "<li>finish $i: ...</li>\n"
ns_write [lang::util::localize $HTML]
ns_write [template::collect_body_scripts]
ns_sleep 1s
}
ns_write "</ul>\n"
ns_write "<p>Done.</p>"
ns_write [lang::util::localize [template::get_footer_html]]
ns_write [template::collect_body_scripts]
See this sample script in action: https://openacs.org/streaming
Caveat: Windows PCs having the current (Sept 2020) version of Bitdefender (antivirus software ) installed with HTTP traffic scanning activated don't show the incremental rendering of the page, but just the full page after it has finished. This might be seen as a problem of Bitdefender and affects streaming HTML from all sites.
Created by Gustaf Neumann, last modified by Gustaf Neumann 03 Sep 2021, at 12:00 PM
Wiki pages for the packages available in the OpenACS code repository:
List of the actively maintained packages
In the oacs-5-10 channel, currently 93 packages are actively maintained. Additionally, the packages is use on openacs.org are maintained as well, but not necessarily recommended for new installations. The packages in the main branch are in different states, some of these work perfecty, some of these migh use outdated calls an can be seen as starting points for new projects.
Packages in the oacs-5-9 channel.
Packages in the oacs-5-10 channel.
Created by Gustaf Neumann, last modified by Gustaf Neumann 03 Sep 2021, at 11:59 AM
acs-admin
acs-api-browser
acs-authentication
acs-automated-testing
acs-bootstrap-installer
acs-content-repository
acs-core-docs
acs-datetime
acs-developer-support
acs-events
acs-kernel
acs-lang
acs-mail-lite
acs-messaging
acs-outdated
acs-reference
acs-service-contract
acs-subsite
acs-tcl
acs-templating
acs-translations
ajaxhelper
assessment
assessment-portlet
attachments
bm-portlet
bulk-mail
calendar
calendar-portlet
categories
chat
chat-portlet
dotlrn
dotlrn-assessment
dotlrn-bm
dotlrn-calendar
dotlrn-chat
dotlrn-dotlrn
dotlrn-evaluation
dotlrn-faq
dotlrn-forums
dotlrn-fs
dotlrn-homework
dotlrn-news
dotlrn-portlet
dotlrn-static
dotlrn-xowiki
evaluation
evaluation-portlet
faq
faq-portlet
file-storage
forums
forums-portlet
fs-portlet
general-comments
intermedia-driver
new-portal
news
news-portlet
notifications
oacs-dav
openacs-bootstrap3-theme
openacs-default-theme
profile-provider
ref-countries
ref-language
ref-timezones
richtext-ckeditor4
richtext-tinymce
richtext-xinha
rss-support
search
static-portlet
survey
theme-zen
tsearch2-driver
user-profile
views
xotcl-core
xotcl-request-monitor
xowf
xowiki
xowiki-portlet
Created by Gustaf Neumann, last modified by Gustaf Neumann 09 Aug 2021, at 12:31 PM
In general, HTTP requires that URLs are properly encoded. This is not a big issue, when just plain ASCII characters without special characters are used in URL paths and query variables. However, when the framework allows the end-user to define also URLs (such as in xowiki and derivatives), one has to be careful when extending the framework. The section below refers to the behavior in OpenACS 5.10, earlier version might differ in some details.
URLs in HTML
When URLs are embedded in HTML (href, src, ...) the URL must be both first urlencoded and then HTML quoted to be on the safe side from the
point of view of HTML. Although most characters problematic for HTML are encoded by ns_urlencode, but the single quote is not (this is not a bug but according to the specs, RFC 3986).
ns_urlencode {<a> 'b' "c" &}
# returns: %3ca%3e+'b'+%22c%22+%26
Only, when it can be guaranteed the the URL contains no "funny characters" the URLencoding can be omitted. Note that double encoding with ns_urlencode leads to over-quoting in the same way as double encoding with ns_quotehtml.
Return_urls
In general, return_urls have to be proper URL encoded according to the HTTP specs. Setting these URLs is more complex, since one has to be aware whether or not an URL as encoded before or not before passing it as a return URL.
Here is a short guideline:
1) Query functions return URLs always URLdecoded
- ns_conn url
- ad_conn url
- xo::cc url
2) Output functions return URLs per default URLencoded
- export_vars (input parameter "-base" has to be unencoded)
- ad_return_url
- :pretty_link
3) Redirect operations have to receive encoded input
- ad_returnredirect
- ns_returnredirect
- :returnredirect
4) Query-variables
When setting query variables with URLs, these should be already URL encoded
#
# Setting a query variable
#
set return_url [ad_returnurl]
set url [export_vars -base . {return_url}]
#
# Using query-variable as default value in xo* package
#
ad_returnredirect [:query_parameter return_url:localurl [ad_return_url]]
#
# Usage in classical OpenACS
#
...
# get return_url e.g. via page_contract
...
if {[info exists return_url] && $return_url ne ""} {
ad_returnredirect $return_url
}
Created by Byron Linares, last modified by Gustaf Neumann 26 May 2021, at 12:32 PM
This page is obsolete and kept as a reference.
The how-to for a well maintained Windows installation is here.
OpenACS/dotLRN windows installer how to
Required software:
Download
Installer Sources:
The installer source consists in a main Inno Setup script “installer.iss” and could be found in cvs or obtained with the installer.
Other files:
There are some necessary file numbers in order to build the installer.
- tcl\bintallerw.tcl: the AOLserver configuration script
- Install.xml: this XML file control the packages installed by the OpenAcs installer
- tcl\Windows-procs.tcl: This file includes various hacks to make OpenACS work on Windows.Replaces the TCL exec command on Windows, allowing exec to be called with unix-y arguments.Index.tcl : file used for automatic installation.
- Index-org.tcl: file used for manual installation.
- Installer.tcl: file used in automatic installation.
- Installer-org.tcl: file used in manual installation.
- Stara.bat, stop.bat: batch files for starting and stopping all services.
- Tools/setx.exe, tools/reg.exe ,/tools/uzip.exe, /tools/reg.exe Windows command line tools necessary for the installation process.
- AOLserver_4-0-beta-10_2003-08-04.zip: AOLServer
- cygwin.zip: CygWin Unix environment for Windows. Cygwin.zip also contains the PostgreSQL database
- cygwin.bat: file to launch cygwin unix environment console.
- license_en.txt: license text file.
- important.txt: extra info text file.
- Note.txt : especial notes text file.
Download Resources
Building the installer:
- In order to build this installer we need to place all the resources in a folder.
- Create tools and tcl folders with the files before mentioned.
- Download OpenACS, dotLRN and all desired package and place in a folder and named “oacs-dotlrn”
- Open the file installer.iss and generate the installer.
The installer.iss has to important parts:
[Files] section:
In this section are listed all the sources for the installer, in this part you
Can change or add any source that you want.
[Run] section:
In this section is where all commands are executed, like the cygwin installation, postgreSQL installation and AOLserver.
[Code] section:
Section for define procedures or functions to work around the installation.
These are the main sections in the “installer.iss” script. And the sections that have to be changed form personalize the installer.
developed at the Galileo University (www.galileo.edu) by Byron Haroldo Linares Roman bhlr@galileo.edu as part of the E-LANE project (www.e-lane.org)
Instructions on using the installer are at: