Index: openacs-4/packages/acs-core-docs/www/acs-admin.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/acs-admin.html,v diff -u -N -r1.45.2.4 -r1.45.2.5 --- openacs-4/packages/acs-core-docs/www/acs-admin.html 19 Nov 2016 09:21:52 -0000 1.45.2.4 +++ openacs-4/packages/acs-core-docs/www/acs-admin.html 6 Jan 2017 09:18:41 -0000 1.45.2.5 @@ -1,2 +1,2 @@ -Part II. Administrator's Guide

Part II. Administrator's Guide

Table of Contents

2. Installation Overview
Basic Steps
Prerequisite Software
3. Complete Installation
Install a Unix-like system and supporting software
Install Oracle 8.1.7
Install PostgreSQL
Install AOLserver 4
Install OpenACS 5.9.0
OpenACS Installation Guide for Windows
OpenACS Installation Guide for Mac OS X
4. Configuring a new OpenACS Site
Installing OpenACS packages
Mounting OpenACS packages
Configuring an OpenACS package
Setting Permissions on an OpenACS package
How Do I?
5. Upgrading
Overview
Upgrading 4.5 or higher to 4.6.3
Upgrading OpenACS 4.6.3 to 5.0
Upgrading an OpenACS 5.0.0 or greater installation
Upgrading the OpenACS files
Upgrading Platform components
6. Production Environments
Starting and Stopping an OpenACS instance.
AOLserver keepalive with inittab
Running multiple services on one machine
High Availability/High Performance Configurations
Staged Deployment for Production Networks
Installing SSL Support for an OpenACS service
Set up Log Analysis Reports
External uptime validation
Diagnosing Performance Problems
7. Database Management
Running a PostgreSQL database on another server
Deleting a tablespace
Vacuum Postgres nightly
8. Backup and Recovery
Backup Strategy
Manual backup and recovery
Automated Backup
Using CVS for backup-recovery
A. Install Red Hat 8/9
B. Install additional supporting software
Unpack the OpenACS tarball
Initialize CVS (OPTIONAL)
Add PSGML commands to emacs init file (OPTIONAL)
Install Daemontools (OPTIONAL)
Install qmail (OPTIONAL)
Install Analog web file analyzer
Install nspam
Install Full Text Search using Tsearch2
Install Full Text Search using OpenFTS (deprecated see tsearch2)
Install nsopenssl
Install tclwebtest.
Install PHP for use in AOLserver
Install Squirrelmail for use as a webmail system for OpenACS
Install PAM Radius for use as external authentication
Install LDAP for use as external authentication
Install AOLserver 3.3oacs1
C. Credits
Where did this document come from?
Linux Install Guides
Security Information
Resources
+Part II. Administrator's Guide

Part II. Administrator's Guide

Table of Contents

2. Installation Overview
Basic Steps
Prerequisite Software
3. Complete Installation
Install a Unix-like system and supporting software
Install Oracle 8.1.7
Install PostgreSQL
Install AOLserver 4
Install OpenACS 5.9.0
OpenACS Installation Guide for Windows
OpenACS Installation Guide for Mac OS X
4. Configuring a new OpenACS Site
Installing OpenACS packages
Mounting OpenACS packages
Configuring an OpenACS package
Setting Permissions on an OpenACS package
How Do I?
5. Upgrading
Overview
Upgrading 4.5 or higher to 4.6.3
Upgrading OpenACS 4.6.3 to 5.0
Upgrading an OpenACS 5.0.0 or greater installation
Upgrading the OpenACS files
Upgrading Platform components
6. Production Environments
Starting and Stopping an OpenACS instance.
AOLserver keepalive with inittab
Running multiple services on one machine
High Availability/High Performance Configurations
Staged Deployment for Production Networks
Installing SSL Support for an OpenACS service
Set up Log Analysis Reports
External uptime validation
Diagnosing Performance Problems
7. Database Management
Running a PostgreSQL database on another server
Deleting a tablespace
Vacuum Postgres nightly
8. Backup and Recovery
Backup Strategy
Manual backup and recovery
Automated Backup
Using CVS for backup-recovery
A. Install Red Hat 8/9
B. Install additional supporting software
Unpack the OpenACS tarball
Initialize CVS (OPTIONAL)
Add PSGML commands to emacs init file (OPTIONAL)
Install Daemontools (OPTIONAL)
Install qmail (OPTIONAL)
Install Analog web file analyzer
Install nspam
Install Full Text Search using Tsearch2
Install Full Text Search using OpenFTS (deprecated see tsearch2)
Install nsopenssl
Install tclwebtest.
Install PHP for use in AOLserver
Install Squirrelmail for use as a webmail system for OpenACS
Install PAM Radius for use as external authentication
Install LDAP for use as external authentication
Install AOLserver 3.3oacs1
C. Credits
Where did this document come from?
Linux Install Guides
Security Information
Resources
Index: openacs-4/packages/acs-core-docs/www/acs-package-dev.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/acs-package-dev.html,v diff -u -N -r1.33.2.4 -r1.33.2.5 --- openacs-4/packages/acs-core-docs/www/acs-package-dev.html 19 Nov 2016 09:21:52 -0000 1.33.2.4 +++ openacs-4/packages/acs-core-docs/www/acs-package-dev.html 6 Jan 2017 09:18:41 -0000 1.33.2.5 @@ -2,4 +2,4 @@ Part III. For OpenACS Package Developers

Part III. For OpenACS Package Developers

Tutorials and reference material for creating new OpenACS packages.

Table of Contents

9. Development Tutorial
Creating an Application Package
Setting Up Database Objects
Creating Web Pages
Debugging and Automated Testing
10. Advanced Topics
Write the Requirements and Design Specs
Add the new package to CVS
OpenACS Edit This Page Templates
Adding Comments
Admin Pages
Categories
Profile your code
Prepare the package for distribution.
Distributing upgrades of your package
Notifications
Hierarchical data
Using .vuh files for pretty urls
Laying out a page with CSS instead of tables
Sending HTML email from your application
Basic Caching
Scheduled Procedures
Enabling WYSIWYG
Adding in parameters for your package
Writing upgrade scripts
Connect to a second database
Future Topics
11. Development Reference
OpenACS Packages
OpenACS Data Models and the Object System
The Request Processor
The OpenACS Database Access API
Using Templates in OpenACS
Groups, Context, Permissions
Writing OpenACS Application Pages
Parties in OpenACS
OpenACS Permissions Tediously Explained
Object Identity
Programming with AOLserver
Using Form Builder: building html forms dynamically
12. Engineering Standards
OpenACS Style Guide
CVS Guidelines -
Release Version Numbering
Constraint naming standard
ACS File Naming and Formatting Standards
PL/SQL Standards
Variables
Automated Testing
13. Documentation Standards
OpenACS Documentation Guide
Using PSGML mode in Emacs
Using nXML mode in Emacs
Detailed Design Documentation Template
System/Application Requirements Template
14. Internationalization
Internationalization and Localization Overview
How Internationalization/Localization works in OpenACS
How to Internationalize a Package
Design Notes
Translator's Guide
D. Using CVS with an OpenACS Site
+
Release Version Numbering
Constraint naming standard
ACS File Naming and Formatting Standards
PL/SQL Standards
Variables
Automated Testing
13. Documentation Standards
OpenACS Documentation Guide
Using PSGML mode in Emacs
Using nXML mode in Emacs
Detailed Design Documentation Template
System/Application Requirements Template
14. Internationalization
Internationalization and Localization Overview
How Internationalization/Localization works in OpenACS
How to Internationalize a Package
Design Notes
Translator's Guide
D. Using CVS with an OpenACS Site
Index: openacs-4/packages/acs-core-docs/www/analog-setup.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/analog-setup.html,v diff -u -N -r1.15.2.3 -r1.15.2.4 --- openacs-4/packages/acs-core-docs/www/analog-setup.html 19 Nov 2016 09:21:52 -0000 1.15.2.3 +++ openacs-4/packages/acs-core-docs/www/analog-setup.html 6 Jan 2017 09:18:41 -0000 1.15.2.4 @@ -15,9 +15,9 @@ cp -r /usr/share/analog-5.32/images www/log/

Edit /var/lib/aolserver/$OPENACS_SERVICE_NAME/etc/analog.cfg and change the variable in HOSTNAME "[my organisation]" to reflect your website title. If you -don't want the traffic log to be publicly visible, change +don't want the traffic log to be publicly visible, change OUTFILE /var/lib/aolserver/$OPENACS_SERVICE_NAME/www/log/traffic.html to use a private -directory. You'll also need to edit all instances of service0 to your $OPENACS_SERVICE_NAME.

  • Run it.

    [$OPENACS_SERVICE_NAME $OPENACS_SERVICE_NAME]$ /usr/share/analog-5.32/analog -G -g/var/lib/aolserver/$OPENACS_SERVICE_NAME/etc/analog.cfg
    +directory. You'll also need to edit all instances of service0 to your $OPENACS_SERVICE_NAME.

  • Run it.

    [$OPENACS_SERVICE_NAME $OPENACS_SERVICE_NAME]$ /usr/share/analog-5.32/analog -G -g/var/lib/aolserver/$OPENACS_SERVICE_NAME/etc/analog.cfg
     /usr/share/analog-5.32/analog: analog version 5.32/Unix
     /usr/share/analog-5.32/analog: Warning F: Failed to open DNS input file
       /home/$OPENACS_SERVICE_NAME/dnscache: ignoring it
    Index: openacs-4/packages/acs-core-docs/www/aolserver.adp
    ===================================================================
    RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/aolserver.adp,v
    diff -u -N -r1.1.2.8 -r1.1.2.9
    --- openacs-4/packages/acs-core-docs/www/aolserver.adp	30 Nov 2016 08:15:11 -0000	1.1.2.8
    +++ openacs-4/packages/acs-core-docs/www/aolserver.adp	6 Jan 2017 09:18:41 -0000	1.1.2.9
    @@ -303,8 +303,8 @@
     
  • Install Analog web file analyzer. (OPTIONAL)

  • -
    ($‌Id: aolserver.html,v 1.52.2.12 2016/11/19 -09:21:52 gustafn Exp $)
    +
    ($‌Id: aolserver.xml,v 1.22.14.1 2016/06/23 +08:32:46 gustafn Exp $)
    1. Unpack the Aolserver tarball. Download the aolserver tarball and unpack it.

      [root root]# cd /usr/local/src
       [root src]# wget --passive http://uptime.openacs.org/aolserver-openacs/aolserver3.3oacs1.tar.gz
      @@ -43,7 +43,7 @@
                 the environment variables properly.
               

      conf-inst should contain the location where AOLserver is to be installed. Overwrite the - tarball's default value with our default value, /usr/local/aolserver:

      [root aolserver]# echo "/usr/local/aolserver" > conf-inst
      +          tarball's default value with our default value, /usr/local/aolserver:

      [root aolserver]# echo "/usr/local/aolserver" > conf-inst
       [root aolserver]#

      conf-make should contain the name of the GNU Make command on your system. It defaults to gmake. Debian users: ln -s /usr/bin/make /usr/bin/gmake.

      Set an environment variable that the nspostgres driver @@ -81,7 +81,7 @@ sets database environment variables before starting AOLserver; this allows the AOLserver instance can communicate with the database. There is one script each for - Oracle and PostgreSQL. They don't conflict, so if you plan + Oracle and PostgreSQL. They don't conflict, so if you plan to use both databases, install both.

      • Oracle

        [root aolserver]# cd /usr/local/aolserver/bin
         [root bin]# cp /var/tmp/openacs-5.9.0/packages/acs-core-docs/www/files/nsd-oracle.txt ./nsd-oracle
         [root bin]# chmod 750 nsd-oracle
        @@ -145,7 +145,7 @@
         cp libtdom0.7.8.so /usr/local/aolserver/bin/
         cd /usr/local/aolserver/bin
         ln -s libtdom0.7.8.so libtdom.so
      • Install nsopenssl - (OPTIONAL)

      • Install Full Text Search with OpenFTS (OPTIONAL)

      • Install nspam (OPTIONAL)

      • Test AOLserver. In order to test AOLserver, we'll run it using the + (OPTIONAL)

      • Install Full Text Search with OpenFTS (OPTIONAL)

      • Install nspam (OPTIONAL)

      • Test AOLserver. In order to test AOLserver, we'll run it using the sample-config.tcl file provided in the AOLserver distribution, under the nobody user and web group. The sample-config.tcl configuration writes to the @@ -172,8 +172,8 @@ chmod -R g+w log servers ls -l

      Note: AOLserver4.x does not include a default start page, so we create one for this test. Type echo "Welcome to AOLserver" > /usr/local/aolserver40r8/servers/server1/pages/index.html -

      Now, we'll run a quick test to ensure AOLserver is running - correctly. We'll use the sample config file provided with +

      Now, we'll run a quick test to ensure AOLserver is running + correctly. We'll use the sample config file provided with AOLserver. This file will attempt to guess your IP address and hostname. It will then start up the server at port 8000 of that IP address.

      [root aolserver]# ./bin/nsd -t sample-config.tcl -u nobody -g web
      @@ -182,22 +182,22 @@
       [08/Mar/2003:15:07:18][31175.8192][-main-] Warning: config.tcl: nscp not loaded
       -- user/password is not set.
       [08/Mar/2003:15:07:18][31175.8192][-main-] Notice: config.tcl: finished reading
      -config file.

      The first warning, about nsssl, can be ignored. We won't be using nsssl; we'll be using nsopenssl instead, and we haven't fully configured it yet. The nscp warning refers to the fact that, without a user and password in the config file, the administrative panel of AOLserver won't load. We don't plan to use it and can ignore that error as well. Any other warning or error is unexpected and probably a problem.

      +config file.

      The first warning, about nsssl, can be ignored. We won't be using nsssl; we'll be using nsopenssl instead, and we haven't fully configured it yet. The nscp warning refers to the fact that, without a user and password in the config file, the administrative panel of AOLserver won't load. We don't plan to use it and can ignore that error as well. Any other warning or error is unexpected and probably a problem.

      Test to see if AOLserver is working by starting Mozilla or Lynx on the same computer and surfing over to your web page. If you browse from another computer and the sample config file - didn't guess your hostname or ip correctly, you'll get a + didn't guess your hostname or ip correctly, you'll get a false negative test.

      [root aolserver]# lynx localhost:8000

      You should see a "Welcome to AOLserver" page. If this - doesn't work, try going to + doesn't work, try going to http://127.0.0.1:8000/. If this - still doesn't work, check out the Troubleshooting AOLserver section below. Note that you will not be able to browse to the web page from another machine, because AOLserver is only listening to the local address. + still doesn't work, check out the Troubleshooting AOLserver section below. Note that you will not be able to browse to the web page from another machine, because AOLserver is only listening to the local address.

      Shutdown the test server:

      [root aolserver]# killall nsd
       [root aolserver]#

      @@ -207,7 +207,7 @@ but clearly this is not a good tool to use for managing your services in general. We cover this topic in the Keep AOLserver alive section. -

    2. Troubleshooting. If you can't view the welcome page, it's likely there's a +

    3. Troubleshooting. If you can't view the welcome page, it's likely there's a problem with your server configuration. Start by viewing your AOLserver log, which is in /usr/local/aolserver/log/server.log. @@ -231,10 +231,10 @@ set hostname [ns_info hostname] set address [ns_info address]

      - If you get an error that nssock can't get the requested address, you + If you get an error that nssock can't get the requested address, you can set these manually. If you type 0.0.0.0, AOLserver will try to listen on all available addresses. Note: - ns_info address doesn't appear + ns_info address doesn't appear to be supported in current versions of AOLserver.

      Index: openacs-4/packages/acs-core-docs/www/aolserver4.adp
      ===================================================================
      RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/aolserver4.adp,v
      diff -u -N -r1.1.2.7 -r1.1.2.8
      --- openacs-4/packages/acs-core-docs/www/aolserver4.adp	30 Nov 2016 08:15:11 -0000	1.1.2.7
      +++ openacs-4/packages/acs-core-docs/www/aolserver4.adp	6 Jan 2017 09:18:41 -0000	1.1.2.8
      @@ -234,8 +234,8 @@
       -b yourip:yourport switch)

    4. Test AOLserver.

    5. -
    ($‌Id: aolserver4.html,v 1.27.2.12 2016/11/19 -09:21:52 gustafn Exp $)
    +
    ($‌Id: aolserver4.xml,v 1.31.2.1 2016/06/23 +08:32:46 gustafn Exp $)

    Retrieve Tcl 8.4 (or higher). Download and install Tcl 8.4 from source

    Note for Debian users: you can apt-get install tcl8.4-dev if you have the right version (stable users will need to add tcl8.4 to their sources.list file as described on the - Install Postgres page). You'll + Install Postgres page). You'll have to use /usr/lib/tcl8.4/ instead of /usr/local/lib when you try to find the tcl libraries, however.

    If you have not installed Tcl already, download the latest Tcl version from Sourceforge

    Debian: apt-get install @@ -96,7 +96,7 @@ Note that this section requires you to have OpenACS files available, which you can get through CVS, through a tarball, or by other means. You can come back to this section after you acquire the - OpenACS code, but don't forget to come back. (Note to + OpenACS code, but don't forget to come back. (Note to maintainers: this should be moved to the next page and integrated into the text there)

    • Oracle

      [root aolserver]# cd /usr/local/aolserver/bin
      Index: openacs-4/packages/acs-core-docs/www/apm-design.html
      ===================================================================
      RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/apm-design.html,v
      diff -u -N -r1.40.2.4 -r1.40.2.5
      --- openacs-4/packages/acs-core-docs/www/apm-design.html	19 Nov 2016 09:21:52 -0000	1.40.2.4
      +++ openacs-4/packages/acs-core-docs/www/apm-design.html	6 Jan 2017 09:18:41 -0000	1.40.2.5
      @@ -26,22 +26,22 @@
       Content Repository, the OpenACS Templating
       System, and the OpenACS Kernel, which includes
       APM.

    An installation of the OpenACS includes the OpenACS Kernel, some services that -extend the kernel's functionality, and some applications intended for +extend the kernel's functionality, and some applications intended for end-users. Packages function as individual pieces of subsites. A subsite can contain multiple application and service instances that provide the end-user with capabilities and content customized to the particular subsite.

    This architecture supports the growth of collaborative commerce. For example, Jane User starts a forum focusing on the merits of View Cameras by creating an instance of the Forum application for her personal subsite on an -OpenACS Installation. Jack User discovers Jane's forum and includes a link to -it in his subsite. As interest in Jane's forum grows, she creates a +OpenACS Installation. Jack User discovers Jane's forum and includes a link to +it in his subsite. As interest in Jane's forum grows, she creates a subsite specializing in providing information about View cameras. This subsite now includes several package instances beyond Forum; it could potentially include its own Ecommerce capabilities (ala Yahoo! Shopping). This could include a knowledge management application that allows users to spread expertise about view cameras and a portal application that links to reliable camera models and resellers. Any subsite enabled package that is added to the OpenACS installation through APM is another potential package instance that can -become part of Jane's View Camera subsite.

    The APM provides an architecture for packaging software, making instances +become part of Jane's View Camera subsite.

    The APM provides an architecture for packaging software, making instances of that software available to subsites, specifying configuration parameters for each instance, and managing the creation and release of new packages.

    Historical Considerations

    Prior to ACS 3.3, all packages were lumped together into one monolithic @@ -61,12 +61,12 @@ model should not affect dependent packages. Rather, the package interface should provide a level of abstraction above the data model (as well as the rest of the package implementation). Then, users of the package can -take advantage of implementation improvements that don't affect the +take advantage of implementation improvements that don't affect the interface (e.g., faster performance from intelligent denormalization of the data model), without having to worry that code outside the package will now break.

  • A typical ACS-backed site only uses a few of the modules included in the distribution, yet there was no well-understood way to pick only what you -needed when installing the ACS, or even to uninstall what you didn't +needed when installing the ACS, or even to uninstall what you didn't need, post-installation. Unwanted code had to be removed manually. @@ -123,7 +123,7 @@ subsites across the system, and be available for distribution to other OpenACS installations without doing a monolithic upgrade or reinstall.

  • API

    The APM is composed of systems for accomplishing a set of package-related tasks. Each of these tasks comprise a feature area that has an API, data -model, and a UI:

    • Authoring a Package

    • Maintaining Multiple Versions of a Package

    • Creating Instances of the Package

    • Specifying Configuration Parameters for each Instance

    Authoring a Package

    Full instructions on how to prepare an OpenACS package are available in Packages. The API here can be invoked manually by a package's data model +model, and a UI:

    • Authoring a Package

    • Maintaining Multiple Versions of a Package

    • Creating Instances of the Package

    • Specifying Configuration Parameters for each Instance

    Authoring a Package

    Full instructions on how to prepare an OpenACS package are available in Packages. The API here can be invoked manually by a package's data model creation script, but need not to be used. This API is part of the APM PL/SQL package.

     
    @@ -232,7 +232,7 @@
     ) return apm_package_versions.version_id%TYPE;
     
     

    Versions can be enabled or disabled. Enabling a version instructs APM to -source the package's libraries on startup and to make the package +source the package's libraries on startup and to make the package available to the OpenACS.

     
     procedure enable (
    @@ -467,7 +467,7 @@
     table where each package is registered. When a new application or service is
     installed on an OpenACS instance, a corresponding row in this table is inserted
     with information about the type of package, e.g. if the forum package is installed on your OpenACS server, a row
    -in apm_package_types will be created, noting that it's an
    +in apm_package_types will be created, noting that it's an
     application package type.

    The apm_packages table is used to contain information about the instances of packages currently created in the system. The package_key column references the apm_package_types @@ -504,7 +504,7 @@

  • apm_file_info - Provides a public interface for querying file information.

  • User Interface

    The APM's user interface is part of the + Provides a public interface for querying file information.

    User Interface

    The APM's user interface is part of the OpenACS Administration Service. The UI is the primary point of contact with APM by developers and administrators. It is part of OpenACS Administration, because only the site-wide administrator should be able to Index: openacs-4/packages/acs-core-docs/www/apm-requirements.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/apm-requirements.html,v diff -u -N -r1.36.2.4 -r1.36.2.5 --- openacs-4/packages/acs-core-docs/www/apm-requirements.html 19 Nov 2016 09:21:52 -0000 1.36.2.4 +++ openacs-4/packages/acs-core-docs/www/apm-requirements.html 6 Jan 2017 09:18:41 -0000 1.36.2.5 @@ -11,7 +11,7 @@ 4.

    We gratefully acknowledge the authors of APM 3 for their original design documentation which suggested these features, as well as the influence of the design and open-source implementation of the Red Hat Package manager, the -Debian packaging system, and PERL's CPAN in the development of the ideas +Debian packaging system, and PERL's CPAN in the development of the ideas behind this document.

    Vision Statement

    A typical website will tend to offer its users a number of web-based services or applications, e.g. a bulletin board, calendaring, classified ads, etc. A website may also have underlying subsystems, such as a permissions @@ -37,7 +37,7 @@

  • Web-based tools for package development:

    • Creating new packages locally

    • Releasing new versions of locally-created packages

    • Uploading packages to a global package repository on the web

    • Use of these tools should be safe, i.e. installing or removing a package should never break an OpenACS installation

  • Web-based tools for package configuration:

    • The ability to change package parameter values on-line through a simple web interface.

    • A new ad_parameter which does not require a monolithic site-wide -parameter's file or server restarts for changes to take effect.

    • The ability to manage multiple package instances at the sub-site +parameter's file or server restarts for changes to take effect.

    • The ability to manage multiple package instances at the sub-site level.

  • Use-cases and User-scenarios

    The APM is intended for the following classes of users, which may or may not overlap:

    1. Developers (referred to as 'the developer') use @@ -57,16 +57,16 @@ sub-site level, David configures this option in the package. When the package development is complete, David uses the APM developer UI to construct a distribution file. He assigns it a version number, 1.0, and makes the package -available for download at the OpenACS package repository.

      Initial Package Installation

      Annie Admin learns of David's KM system by browsing +available for download at the OpenACS package repository.

      Initial Package Installation

      Annie Admin learns of David's KM system by browsing the OpenACS package repository. Annie Admin uses the APM administrator UI on her system. She selects to install a package from a URL and types the URL displayed on the system. The APM automatically downloads the package. The -dependency checker notices that Patricia's Super Widget toolkit is +dependency checker notices that Patricia's Super Widget toolkit is required, so it warns Annie of this. Annie selects an option to find a package that satisfies the dependency at the OpenACS APM repository. The -APM informs Annie that it can download and install Jim's Super Widget -toolkit. Annie confirms this option. After successfully installing Jim's -toolkit, Annie proceeds to install David's KM system. The data model is +APM informs Annie that it can download and install Jim's Super Widget +toolkit. Annie confirms this option. After successfully installing Jim's +toolkit, Annie proceeds to install David's KM system. The data model is loaded and all of the files necessary for the software are installed. Because installation was successful, the package is available for use.

      Since the package is available for use, its initialization routines are set to run automatically on server startup. Annie is warned that since there @@ -91,7 +91,7 @@ repository.

      Sally SubAdmin asks Annie Administrator to upgrade the package using the APM UI. This upgrade supersedes the old version of KM at the site-wide level. Once Annie upgrades the package, the new version starts working immediately -in Sally's sub-site.

      Procedural API

      Danielle Developer wants her software to perform +in Sally's sub-site.

      Procedural API

      Danielle Developer wants her software to perform different actions depending on what version of another package is installed. She uses the APM procedural API to check if KM version 1.0 is installed or version 1.1. Based on the results of this procedural call, the software @@ -132,9 +132,9 @@

    2. 4.600.5 The APM will provide a facility to validate both the PGP signature and MD5 stamps information before a package install.

    Requirements: The User Interface

    The user interface is a set of HTML pages that are used to drive the underlying API. It is restricted to site-wide administrators because the -actions taken here can dramatically affect the state of the running OpenACS.

    Requirements: The Developer's Interface

    The intent of the developer's interface is to enable the developer to +actions taken here can dramatically affect the state of the running OpenACS.

    Requirements: The Developer's Interface

    The intent of the developer's interface is to enable the developer to construct and maintain APM packages. It will be possible to disable the -developer's interface for production sites to help reduce the chance of +developer's interface for production sites to help reduce the chance of site failure; much of the functionality here can have cascading effects throughout the OpenACS and should not be used on a production site.

    • 10.0 Define a package.

      The developer must be able to create a new package by specifying some identifying information for the package. This includes a package name, a @@ -147,10 +147,10 @@ information for unique fields specified in the data model requirements, the package cannot be created.

    • 20.0 Add files to a package

      20.1 The developer must be able to add files to the package. This is done by copying the files into the package directory in the -host OS's file system. Files can be added at any point after package +host OS's file system. Files can be added at any point after package creation.

      20.3 Once a package has been versioned and distributed, no new files should be added to the package without incrementing the version -number.

      20.5 The APM's UI should facilitate the process of +number.

      20.5 The APM's UI should facilitate the process of adding new files, by scanning the file system for new files automatically, and allowing the developer to confirm adding them.

      20.10 The developer cannot add files to a given package via the UI that do not exist in the file system already.

      20.15 Package file structure must follow a specified @@ -159,14 +159,14 @@ done in two ways.

      • 30.1 Access the APM UI, browse the file list, and remove files.

        30.1.1If a file is removed from the package list, but not from the file system, an error should be generated at package load time.

      • 30.5 Remove the file from file system.

        30.5.1 The APM UI should take note of the fact that the -file is gone and offer the developer an option to confirm the file's +file is gone and offer the developer an option to confirm the file's deletion.

    • 40.0 Modify files in a package.

      40.1 The developer should be able to modify files in the file system. The APM UI should not interfere with this.

      40.5 However, if the developer modifies files containing procedural definitions, APM UI should allow a means to watch those files and automatically reload them if changed. See requirement 50.0 for more detail.

      40.10 Also, although a change in files implies that the -package distribution file is out of date, it is the developer's +package distribution file is out of date, it is the developer's responsibility to update it.

    • 4.45.0 Manage Package Dependency Information.

      4.45.1 The developer should be able to specify which interfaces the package requires.

      4.45.5 The developer should be able to specify which interfaces the package provides.

      4.45.10 Circular dependencies are not allowed.

    • 50.0 Watch a file

      4.50.1 The developer should be able to assign a watch to @@ -201,7 +201,7 @@ but this is discouraged. In such a case, the sub-package should really be a separate package that is required by the compound package.

      4.400.10 If a sub-package is required for the installation of the compound package, the compound package should have a -registered dependency on the sub-package.

    Requirements: The Site-Wide Administrator's Interface

    The requirement of the administrator's interface is to enable the +registered dependency on the sub-package.

    Requirements: The Site-Wide Administrator's Interface

    The requirement of the administrator's interface is to enable the administrator to install, enable, upgrade, disable, deinstall, and delete packages.

    • 80.0 Package Enable/Disable

      4.80.1 The administrator should be able mark an installed package as enabled. This means that the package is activated and its @@ -259,18 +259,18 @@ consequences throughout a site and should almost never be done.

    • 150.0 Scan for new or modified packages

      150.1 The administrator should be able to scan the file system for any changes made in any of the installed package files.

      150.5 The administrator should be able to scan the file system for any newly installed packages. -

    Requirements: The Sub-Site Administrator's Interface

    +

    Requirements: The Sub-Site Administrator's Interface

    If the developer is in charge of creating packages and the administrator for installing them, then the sub-site administrator is responsible for configuring and enabling packages. In order for a package to be available for -a sub-site it must be associated with the sub-site's type specification. +a sub-site it must be associated with the sub-site's type specification. This interface is part of the sub-site /admin interface.

    • 4.300 Creating a package instance.

      4.300.1 From the sub-site /admin interface, there should be an option to view all packages available in the system as well as an option to add a package to the subsite.

      4.300.5 From the "add" option, the sub-admin can select from a list of packages registered as available in the sub-site type to which the sub-site belongs.

      4.300.19 Once a package instance is added, it is -available on the list of the subsite's available packages.

    • 4.305 Configuring a package instance.

      4.305.1 An automatic web interface that lists all +available on the list of the subsite's available packages.

    • 4.305 Configuring a package instance.

      4.305.1 An automatic web interface that lists all parameters with current values must be available.

      4.305.5 Changing the values for the parameters is accomplished simply by submitting an HTML form.

    • 4.310 Enabling a package instance.

      4.310.1 The sub-admin should be able to enable a package with a single click. Enabling a package means that the OpenACS will serve its Index: openacs-4/packages/acs-core-docs/www/automated-backup.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/automated-backup.html,v diff -u -N -r1.13.2.3 -r1.13.2.4 --- openacs-4/packages/acs-core-docs/www/automated-backup.html 19 Nov 2016 09:21:52 -0000 1.13.2.3 +++ openacs-4/packages/acs-core-docs/www/automated-backup.html 6 Jan 2017 09:18:41 -0000 1.13.2.4 @@ -1,4 +1,4 @@ Automated Backup

      Automated Backup

      The recommended backup strategy for a production sit is to use an automated script which first backs up the database to a file in /var/lib/aolserver/$OPENACS_SERVICE_NAME/database-backup and then backs up all of /var/lib/aolserver/$OPENACS_SERVICE_NAME to a single zip file, and then copies that zip file to another computer.

      1. Make sure that the manual backup process described above works.

      2. Customize the default backup script. Edit /var/lib/aolserver/$OPENACS_SERVICE_NAME/etc/backup.sh with your specific parameters.

      3. Make sure the file is executable:

        chmod +x backup.sh
      4. - Set this file to run automatically by adding a line to root's crontab. (Typically, with export EDITOR=emacs; crontab -e.) This example runs the backup script at 1:30 am every day.

        30 1 * * *        sh /var/lib/aolserver/$OPENACS_SERVICE_NAME/etc/backup.sh
      + Set this file to run automatically by adding a line to root's crontab. (Typically, with export EDITOR=emacs; crontab -e.) This example runs the backup script at 1:30 am every day.

      30 1 * * *        sh /var/lib/aolserver/$OPENACS_SERVICE_NAME/etc/backup.sh
    Index: openacs-4/packages/acs-core-docs/www/automated-testing-best-practices.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/automated-testing-best-practices.adp,v diff -u -N -r1.1.2.7 -r1.1.2.8 --- openacs-4/packages/acs-core-docs/www/automated-testing-best-practices.adp 30 Nov 2016 08:15:11 -0000 1.1.2.7 +++ openacs-4/packages/acs-core-docs/www/automated-testing-best-practices.adp 6 Jan 2017 09:18:41 -0000 1.1.2.8 @@ -51,8 +51,8 @@ Duplicate names.  Make sure that if a duplicate name is entered that there is a reasonable error rather than a server error. Check for insert, move, copy, and rename.

    -
    ($‌Id: automated-testing-best-practices.html,v -1.28.2.12 2016/11/19 09:21:52 gustafn Exp $)
    +
    ($‌Id: auto-testing.xml,v 1.3.14.1 2016/06/23 +08:32:46 gustafn Exp $)

    Best practices in writing OpenACS automated tests

    • Special characters in Tcl.  -Try strings starting with a -Bad and strings containing [BAD], {, \077, and $Bad. For user input, [BAD] should never be evaluated, \077 should not be turned into a ? and $Bad should not be interpolated. The string -Bad [BAD] \077 { $Bad should be valid user input, should pass through the system unaltered, and if it isn't that's a bug. +Try strings starting with a -Bad and strings containing [BAD], {, \077, and $Bad. For user input, [BAD] should never be evaluated, \077 should not be turned into a ? and $Bad should not be interpolated. The string -Bad [BAD] \077 { $Bad should be valid user input, should pass through the system unaltered, and if it isn't that's a bug.

    • Quoting issues. Put some html in plain text fields and make sure the result is properly quoted anywhere it shows up (I use "<b>bold</b>" usually). Look out especially for quoting errors in the context bar and in round trips via an edit form. For fields that disallow html tags you can use &amp; to check that the field is quoted -properly. If it is not displayed as &amp; then the quoting for the field is incorrect. (It's not clear whether this +properly. If it is not displayed as &amp; then the quoting for the field is incorrect. (It's not clear whether this should be considered an error but given that data for text fields can -come from various sources if it's text it should be properly quoted +come from various sources if it's text it should be properly quoted and we should not rely on input validation to prevent XSS security holes.)

    • Whitespace input. Check that whitespace is not considered valid input for a field if it does not make sense. For example, the subject of a forum post is Index: openacs-4/packages/acs-core-docs/www/backup-recovery.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/backup-recovery.adp,v diff -u -N -r1.1.2.14 -r1.1.2.15 --- openacs-4/packages/acs-core-docs/www/backup-recovery.adp 30 Nov 2016 08:15:11 -0000 1.1.2.14 +++ openacs-4/packages/acs-core-docs/www/backup-recovery.adp 6 Jan 2017 09:18:41 -0000 1.1.2.15 @@ -21,16 +21,16 @@ for backup-recovery

    -
    ($‌Id: backup-recovery.html,v 1.43.2.12 -2016/11/19 09:21:52 gustafn Exp $)

    By Don Baccus with additions by Joel Aufrecht +

    ($‌Id: recovery.xml,v 1.17.6.2 2016/10/03 +09:17:51 gustafn Exp $)

    By Don Baccus with additions by Joel Aufrecht

    We will cover some basic backup and recovery strategies. These are intended to be robust but simple enough to set up. For a large scale production site you would probably need to create your own backup strategies (in particular full dumps from oracle, while easy to set up, are far from the best solution).

    There are three basic things which need to be backed up, the database data, the server source tree, and the acs-content-repository (which is in the server source tree).

    -

    Figure 8.1. Backup +

    Figure 8.1. Backup and Recovery Strategy

    Backup and Recovery Strategy


    OpenACS docs are written by the named authors, and may be edited by Index: openacs-4/packages/acs-core-docs/www/backup-recovery.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/backup-recovery.html,v diff -u -N -r1.43.2.12 -r1.43.2.13 --- openacs-4/packages/acs-core-docs/www/backup-recovery.html 19 Nov 2016 09:21:52 -0000 1.43.2.12 +++ openacs-4/packages/acs-core-docs/www/backup-recovery.html 6 Jan 2017 09:18:41 -0000 1.43.2.13 @@ -1,12 +1,12 @@ -Chapter 8. Backup and Recovery

    Chapter 8. Backup and Recovery

    ($Id$)

    By Don Baccus with additions +Chapter 8. Backup and Recovery

    Chapter 8. Backup and Recovery

    ($Id$)

    By Don Baccus with additions by Joel Aufrecht

    We will cover some basic backup and recovery strategies. These are intended to be robust but simple enough to set up. For a large scale production site you would probably need to create your own backup strategies (in particular full dumps from oracle, while easy to set up, are far from the best solution).

    There are three basic things which need to be backed up, the database data, the server source tree, and the acs-content-repository (which is in the server source tree).

    -

    Figure 8.1. Backup and Recovery Strategy

    Backup and Recovery Strategy


    +

    Figure 8.1. Backup and Recovery Strategy

    Backup and Recovery Strategy


    OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff. Index: openacs-4/packages/acs-core-docs/www/backups-with-cvs.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/backups-with-cvs.html,v diff -u -N -r1.13.2.3 -r1.13.2.4 --- openacs-4/packages/acs-core-docs/www/backups-with-cvs.html 19 Nov 2016 09:21:52 -0000 1.13.2.3 +++ openacs-4/packages/acs-core-docs/www/backups-with-cvs.html 6 Jan 2017 09:18:41 -0000 1.13.2.4 @@ -1,5 +1,5 @@ -Using CVS for backup-recovery

    Using CVS for backup-recovery

    CVS-only backup is often appropriate for development sites. If you are already using CVS and your data is not important, you probably don't +Using CVS for backup-recovery

    Using CVS for backup-recovery

    CVS-only backup is often appropriate for development sites. If you are already using CVS and your data is not important, you probably don't need to do anything to back up your files. Just make sure that your current work is checked into the system. You can then roll back based on date - note the Index: openacs-4/packages/acs-core-docs/www/bootstrap-acs.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/bootstrap-acs.adp,v diff -u -N -r1.1.2.6 -r1.1.2.7 --- openacs-4/packages/acs-core-docs/www/bootstrap-acs.adp 30 Nov 2016 08:15:11 -0000 1.1.2.6 +++ openacs-4/packages/acs-core-docs/www/bootstrap-acs.adp 6 Jan 2017 09:18:41 -0000 1.1.2.7 @@ -103,8 +103,8 @@

    At this point, bootstrap.tcl is done executing. AOLserver proceeds to source the remaining files in the /tcl directory (i.e., -unpackaged libraries) and begins listening for connections.

    ($‌Id: bootstrap-acs.html,v 1.49.2.12 2016/11/19 -09:21:53 gustafn Exp $)
    +unpackaged libraries) and begins listening for connections.

    ($‌Id: bootstrap-acs.xml,v 1.7 2006/07/17 +05:38:38 torbenb Exp $)

    Next AOLserver sources, in lexicographical order, each file in the /tcl directory. The first such file is -0-acs-init.tcl, which doesn't do much directly except to +0-acs-init.tcl, which doesn't do much directly except to determine the OpenACS path root (e.g., /var/lib/aolserver/yourservername) by trimming the final component from the path to the Tcl library directory (/var/lib/aolserver/yourservername/tcl). But 0-acs-init.tcl's has an important function, namely sourcing /packages/acs-core/bootstrap.tcl, which does the following:

    1. Initialize some NSVs used by the core. These NSVs are documented in /packages/acs-core/apm-procs.tcl - no need to -worry about them unless you're an OpenACS core hacker. +worry about them unless you're an OpenACS core hacker.

    2. Verify the deletion of obsolete OpenACS files. The /tcl directory has evolved quite a bit over the months and @@ -52,14 +52,14 @@ procedure are needed to perform any of the following steps.

    3. Ensure that the database is available by grabbing and -releasing a handle. If we can't obtain a handle, we terminate -initialization (since OpenACS couldn't possibly start up the server without +releasing a handle. If we can't obtain a handle, we terminate +initialization (since OpenACS couldn't possibly start up the server without access to the database).

    4. Register any new packages in the /packages directory. In each directory inside /packages, we look -for a .info file; if we find a package that hasn't yet been -registered with the package manager (i.e., it's been copied there +for a .info file; if we find a package that hasn't yet been +registered with the package manager (i.e., it's been copied there manually), we insert information about it into the database. (The first time OpenACS starts up, no packages will have been registered in the database yet, so this step will registers every single package in the @@ -68,8 +68,8 @@ before they can be used.

    5. Ensure that the acs-kernel package is -enabled. If the OpenACS core isn't initialized, the server -couldn't possibly be operational, so if there's no enabled version of +enabled. If the OpenACS core isn't initialized, the server +couldn't possibly be operational, so if there's no enabled version of the OpenACS core we simply mark the latest installed one as enabled.

    6. Load *-procs.tcl files for enabled @@ -81,7 +81,7 @@

    7. Verify that the core has been properly initialized by checking for the existence of an NSV created by the request processor -initialization code. If it's not present, the server won't be +initialization code. If it's not present, the server won't be operational, so we log an error.

    At this point, bootstrap.tcl is done executing. AOLserver proceeds to source the remaining files in the /tcl directory Index: openacs-4/packages/acs-core-docs/www/complete-install.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/complete-install.html,v diff -u -N -r1.25.2.4 -r1.25.2.5 --- openacs-4/packages/acs-core-docs/www/complete-install.html 19 Nov 2016 09:21:53 -0000 1.25.2.4 +++ openacs-4/packages/acs-core-docs/www/complete-install.html 6 Jan 2017 09:18:41 -0000 1.25.2.5 @@ -1,2 +1,2 @@ -Chapter 3. Complete Installation

    +Chapter 3. Complete Installation Index: openacs-4/packages/acs-core-docs/www/configuring-configuring-packages.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/configuring-configuring-packages.adp,v diff -u -N -r1.1.2.12 -r1.1.2.13 --- openacs-4/packages/acs-core-docs/www/configuring-configuring-packages.adp 19 Nov 2016 09:21:53 -0000 1.1.2.12 +++ openacs-4/packages/acs-core-docs/www/configuring-configuring-packages.adp 6 Jan 2017 09:18:41 -0000 1.1.2.13 @@ -17,7 +17,7 @@ OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

    -Configuring an OpenACS package

    After you've installed and mounted your package, you can +Configuring an OpenACS package

    After you've installed and mounted your package, you can configure each instance to act as you would like.

    This is done from the Applications page. Log in, go to the Admin or Control Panel, click on the subsite the application is in, and click on Applications. If you click on the 'Parameters' Index: openacs-4/packages/acs-core-docs/www/configuring-configuring-packages.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/configuring-configuring-packages.html,v diff -u -N -r1.10.2.12 -r1.10.2.13 --- openacs-4/packages/acs-core-docs/www/configuring-configuring-packages.html 19 Nov 2016 09:21:53 -0000 1.10.2.12 +++ openacs-4/packages/acs-core-docs/www/configuring-configuring-packages.html 6 Jan 2017 09:18:41 -0000 1.10.2.13 @@ -2,7 +2,7 @@ Configuring an OpenACS package

    Configuring an OpenACS package

    by Jade Rubick

    OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff. -

    Configuring an OpenACS package

    After you've installed and mounted your package, you can +

    Configuring an OpenACS package

    After you've installed and mounted your package, you can configure each instance to act as you would like.

    This is done from the Applications page. Log in, go to the Admin or Control Panel, click on the subsite the application is in, and click on Applications. If you click on the 'Parameters' Index: openacs-4/packages/acs-core-docs/www/configuring-configuring-permissions.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/configuring-configuring-permissions.adp,v diff -u -N -r1.1.2.12 -r1.1.2.13 --- openacs-4/packages/acs-core-docs/www/configuring-configuring-permissions.adp 19 Nov 2016 09:21:53 -0000 1.1.2.12 +++ openacs-4/packages/acs-core-docs/www/configuring-configuring-permissions.adp 6 Jan 2017 09:18:41 -0000 1.1.2.13 @@ -17,7 +17,7 @@ OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

    -Setting Permission on an OpenACS +Setting Permission on an OpenACS package

    After you've installed and mounted your package, you can configure each instance to act as you would like.

    This is done from the Applications page. Log in, go to the Admin or Control Panel, click on the subsite the application is in, and Index: openacs-4/packages/acs-core-docs/www/configuring-configuring-permissions.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/configuring-configuring-permissions.html,v diff -u -N -r1.10.2.12 -r1.10.2.13 --- openacs-4/packages/acs-core-docs/www/configuring-configuring-permissions.html 19 Nov 2016 09:21:53 -0000 1.10.2.12 +++ openacs-4/packages/acs-core-docs/www/configuring-configuring-permissions.html 6 Jan 2017 09:18:41 -0000 1.10.2.13 @@ -2,7 +2,7 @@ Setting Permissions on an OpenACS package

    Setting Permissions on an OpenACS package

    by Jade Rubick

    OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff. -

    Setting Permission on an OpenACS package

    After you've installed and mounted your package, you can +

    Setting Permission on an OpenACS package

    After you've installed and mounted your package, you can configure each instance to act as you would like.

    This is done from the Applications page. Log in, go to the Admin or Control Panel, click on the subsite the application is in, and click on Applications. If you click on the 'Permissions' Index: openacs-4/packages/acs-core-docs/www/configuring-install-packages.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/configuring-install-packages.adp,v diff -u -N -r1.1.2.13 -r1.1.2.14 --- openacs-4/packages/acs-core-docs/www/configuring-install-packages.adp 19 Nov 2016 09:21:53 -0000 1.1.2.13 +++ openacs-4/packages/acs-core-docs/www/configuring-install-packages.adp 6 Jan 2017 09:18:41 -0000 1.1.2.14 @@ -16,7 +16,7 @@ OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

    -Installing OpenACS packages

    An OpenACS package extends your website and lets it do things it +Installing OpenACS packages

    An OpenACS package extends your website and lets it do things it wasn't able to do before. You can have a weblog, a forums, a calendar, or even do sophisticated project-management via your website.

    After you've installed OpenACS, you can congratulate Index: openacs-4/packages/acs-core-docs/www/configuring-install-packages.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/configuring-install-packages.html,v diff -u -N -r1.10.2.12 -r1.10.2.13 --- openacs-4/packages/acs-core-docs/www/configuring-install-packages.html 19 Nov 2016 09:21:53 -0000 1.10.2.12 +++ openacs-4/packages/acs-core-docs/www/configuring-install-packages.html 6 Jan 2017 09:18:41 -0000 1.10.2.13 @@ -2,24 +2,24 @@ Installing OpenACS packages

    Installing OpenACS packages

    by Jade Rubick

    OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff. -

    Installing OpenACS packages

    An OpenACS package extends your website and lets it do - things it wasn't able to do before. You can have a weblog, a +

    Installing OpenACS packages

    An OpenACS package extends your website and lets it do + things it wasn't able to do before. You can have a weblog, a forums, a calendar, or even do sophisticated project-management - via your website.

    After you've installed OpenACS, you can congratulate - yourself for a job well done. Then, you'll probably want to + via your website.

    After you've installed OpenACS, you can congratulate + yourself for a job well done. Then, you'll probably want to install a couple of packages.

    To install packages, you have to be an administrator on - the OpenACS webserver. Log in, and you'll see a link to Admin or + the OpenACS webserver. Log in, and you'll see a link to Admin or the Control Panel. Click on that, then click on 'Install software'. Packages are sometimes also referred to as - applications or software.

    At this point, you'll need to determine whether or not - you're able to install from the repository, or whether you + applications or software.

    At this point, you'll need to determine whether or not + you're able to install from the repository, or whether you should install from local files.

    Basically, if you have a local CVS repository, or have custom code, you need to install from 'Local Files'. Otherwise, you can install from the OpenACS repository

    If you want to install new packages, click on 'Install from Repository' or 'Install from Local'. Select the package, and click 'Install checked applications'. The system will check to make sure you have all necessary packages that the package - you want depends on. If you're installing from Local Files, and + you want depends on. If you're installing from Local Files, and you are missing any packages, you may have to add the packages your desired package depends on: the section called “Upgrading the OpenACS files” Index: openacs-4/packages/acs-core-docs/www/configuring-mounting-packages.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/configuring-mounting-packages.adp,v diff -u -N -r1.1.2.12 -r1.1.2.13 --- openacs-4/packages/acs-core-docs/www/configuring-mounting-packages.adp 19 Nov 2016 09:21:53 -0000 1.1.2.12 +++ openacs-4/packages/acs-core-docs/www/configuring-mounting-packages.adp 6 Jan 2017 09:18:41 -0000 1.1.2.13 @@ -16,7 +16,7 @@ OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

    -Mounting OpenACS packages

    After you've installed your packages, you have to +Mounting OpenACS packages

    After you've installed your packages, you have to 'mount' them in order to make them appear on your website.

    Make sure you are logged in, and then click on the 'Admin' or 'Control Panel' link to get to the Index: openacs-4/packages/acs-core-docs/www/configuring-mounting-packages.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/configuring-mounting-packages.html,v diff -u -N -r1.10.2.12 -r1.10.2.13 --- openacs-4/packages/acs-core-docs/www/configuring-mounting-packages.html 19 Nov 2016 09:21:53 -0000 1.10.2.12 +++ openacs-4/packages/acs-core-docs/www/configuring-mounting-packages.html 6 Jan 2017 09:18:41 -0000 1.10.2.13 @@ -2,17 +2,17 @@ Mounting OpenACS packages

    Mounting OpenACS packages

    by Jade Rubick

    OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff. -

    Mounting OpenACS packages

    After you've installed your packages, you have to 'mount' +

    Mounting OpenACS packages

    After you've installed your packages, you have to 'mount' them in order to make them appear on your website.

    Make sure you are logged in, and then click on the 'Admin' or 'Control Panel' link to get to the Site-Wide - Administration page (at /acs-admin). Click on the subsite you'd + Administration page (at /acs-admin). Click on the subsite you'd like the application to be available at.

    Subsites are a way of dividing your website into logical chunks. Often they represent different groups of users, or parts of an organization.

    Now click on 'Applications' (applications are the same - thing as packages). You'll see a list of Applications and the + thing as packages). You'll see a list of Applications and the URLs that each is located at. To mount a new application, you click on 'Add application', enter the Application, title - (application name), and URL (URL folder name), and you're + (application name), and URL (URL folder name), and you're done.

    Test it out now. The URL is based on a combination of the subsite URL and the application URL. So if you installed a package in the Main Subsite at the URL calendar, it will be Index: openacs-4/packages/acs-core-docs/www/configuring-new-site.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/configuring-new-site.html,v diff -u -N -r1.15.2.3 -r1.15.2.4 --- openacs-4/packages/acs-core-docs/www/configuring-new-site.html 19 Nov 2016 09:21:53 -0000 1.15.2.3 +++ openacs-4/packages/acs-core-docs/www/configuring-new-site.html 6 Jan 2017 09:18:41 -0000 1.15.2.4 @@ -1,5 +1,5 @@ -Chapter 4. Configuring a new OpenACS Site

    Chapter 4. Configuring a new OpenACS Site

    by Joel Aufrecht

    +Chapter 4. Configuring a new OpenACS Site

    Chapter 4. Configuring a new OpenACS Site

    by Joel Aufrecht

    OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

    In this chapter, Configuring refers to making changes to a new OpenACS site through the web interface. In crude terms, these changes happen in the database, and are upgrade-safe. Customizing refers to changes that touch the file system, and require some planning if easy upgradability is to be maintained.

    Index: openacs-4/packages/acs-core-docs/www/credits.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/credits.adp,v diff -u -N -r1.1.2.7 -r1.1.2.8 --- openacs-4/packages/acs-core-docs/www/credits.adp 30 Nov 2016 08:15:11 -0000 1.1.2.7 +++ openacs-4/packages/acs-core-docs/www/credits.adp 6 Jan 2017 09:18:41 -0000 1.1.2.8 @@ -44,8 +44,8 @@ Malte Sussdorff, Stan Kaufman and Pascal Scheffers.

    All questions and comments regarding this guide should be posted on -the OpenACS forums.

    ($‌Id: credits.html,v 1.46.2.12 2016/11/19 -09:21:53 gustafn Exp $)
    +the OpenACS forums.

    ($‌Id: credits.xml,v 1.12.14.2 2016/10/03 +09:17:51 gustafn Exp $)
    -Appendix C. Credits

    Appendix C. Credits

    By Vinod Kurup

    +Appendix C. Credits

    Appendix C. Credits

    By Vinod Kurup

    OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

    Vinod Kurup put @@ -8,7 +8,7 @@ updated the document starting in March 2003.

    -Checkout for Package Development

    If you are actively developing a non-core package, you should +Checkout for Package Development

    If you are actively developing a non-core package, you should work from the latest core release branch. Currently this is oacs-5-9. This ensures that you are working on top of a stable OpenACS core, but still allows you to commit feature changes to @@ -98,7 +98,7 @@ packages and their current state.

    -Checkout for Core Development

    If you are actively developing packages in the OpenACS Core, +Checkout for Core Development

    If you are actively developing packages in the OpenACS Core, work from the HEAD branch. HEAD is used for active development of the next version of core OpenACS. It may be very buggy; it may not even install correctly. Do not use this branch for development of @@ -107,7 +107,7 @@ developer account:

    cvs -d:ext:cvs.openacs.org:/cvsroot checkout acs-core

    To check out HEAD anonymously:

    cvs -d:pserver:anonymous\@cvs.openacs.org:/cvsroot checkout acs-core

    -Checkout .LRN

    .LRN consists of a given version openacs core, plus a set of +Checkout .LRN

    .LRN consists of a given version openacs core, plus a set of packages. These are collectively packages together to form a distrubution of .LRN. F .LRN 2.0.0 sits on top of OpenACS 5.0.0. .LRN also uses an OpenACS install.xml file during installation; @@ -132,7 +132,7 @@

    OpenACS CVS Concepts

    -Modules

    All OpenACS code resides within a single CVS module, +Modules

    All OpenACS code resides within a single CVS module, openacs-4. (The openacs-4 directory contains code for all versions of OpenACS 4 and later, and .LRN 1 and later.) Checking out this module retrieves all @@ -169,7 +169,7 @@ module of the same name.

    - Tags and Branches

    Tags and Branches look similar in commands, but behave + Tags and Branches

    Tags and Branches look similar in commands, but behave differently. A tag is a fixed point on a branch. Check out a tag to get a specific version of OpenACS. Check out a branch to get the most current code for that major-minor version (e.g., 5.0.x or @@ -416,7 +416,7 @@

    - Informal Guidelines

    Informal guidelines which may be obsolete in places and should + Informal Guidelines

    Informal guidelines which may be obsolete in places and should be reviewed:

    Using CVS with OpenACS

    Getting Started

    +

    Using CVS with OpenACS

    Getting Started

    All OpenACS code is available anonymously. To get code anonymously, use the parameter -d:pserver:anonymous@cvs.openacs.org:/cvsroot immediately after cvs in a cvs command to check out or export code. @@ -44,7 +44,7 @@ ~/.cvsrc with the contents:

    cvs -z6
     cvs -q

    -z6 speeds up cvs access over the network quite a bit by enabling compressed - connection by default. -q suppresses some verbose output from commands. For example, it makes the output of cvs up much easier to read.

    Checkout for Package Development

    If you are actively developing a non-core package, you + User yournamehere

    into your ~/.ssh/config file, then you can use -d :ext:cvs-server:/cvsroot instead of -d :ext:cvs.openacs.org:/cvsroot. You can then change the definition of cvs-server by changing one file instead of editing hundreds of CVSROOT/Repository files.

    Checkout for Package Development

    If you are actively developing a non-core package, you should work from the latest core release branch. Currently this is oacs-5-9. This ensures that you are working on top of a stable OpenACS core, but still allows you to commit feature @@ -68,13 +68,13 @@ Inventory and Package maintainers and status for a list of available packages and their current state. -

    Checkout for Core Development

    If you are actively developing packages in the OpenACS +

    Checkout for Core Development

    If you are actively developing packages in the OpenACS Core, work from the HEAD branch. HEAD is used for active development of the next version of core OpenACS. It may be very buggy; it may not even install correctly. Do not use this branch for development of non-core features unless your work depends on some of the HEAD core work. To check out HEAD, omit the - -r tag.

    To check out HEAD for development, which requires an OpenACS developer account:

    cvs -d:ext:cvs.openacs.org:/cvsroot checkout acs-core

    To check out HEAD anonymously:

    cvs -d:pserver:anonymous@cvs.openacs.org:/cvsroot checkout acs-core

    Checkout .LRN

    + -r tag.

    To check out HEAD for development, which requires an OpenACS developer account:

    cvs -d:ext:cvs.openacs.org:/cvsroot checkout acs-core

    To check out HEAD anonymously:

    cvs -d:pserver:anonymous@cvs.openacs.org:/cvsroot checkout acs-core

    Checkout .LRN

    .LRN consists of a given version openacs core, plus a set of packages. These are collectively packages together to form a distrubution of .LRN. F .LRN 2.0.0 sits on top of OpenACS 5.0.0. @@ -89,7 +89,7 @@ mv dotlrn/install.xml ..

    Working with CVS

    Once you have a checkout you can use some commands to track what has changed since you checked out your copy. cvs -n update does not change any files, but reports which changes have been updated or locally modified, or are not present in CVS. -

    To update your files, use cvs update. This will merge changes from the repository with your local files. It has no effect on the cvs.openacs.org repository.

    OpenACS CVS Concepts

    Modules

    +

    To update your files, use cvs update. This will merge changes from the repository with your local files. It has no effect on the cvs.openacs.org repository.

    OpenACS CVS Concepts

    Modules

    All OpenACS code resides within a single CVS module, openacs-4. (The openacs-4 directory contains code for all versions of OpenACS 4 and later, and .LRN 1 and later.) Checking out this module retrieves all openacs code of any type. For convenience, subsets of openacs-4 are repackaged as smaller modules.

    acs-core contains only critical common packages. It does not have any user applications, such as forums, @@ -117,7 +117,7 @@ project-manager-all contains the packages required, in combination with acs-core, to run the project-manager package.

    Each OpenACS package (i.e., directory in openacs-4/packages/) is also aliased as a module of the same name. -

    +

    Tags and Branches

    Tags and Branches look similar in commands, but behave differently. A tag is a fixed point on a branch. Check out @@ -133,7 +133,7 @@ calendar package. All non-core, non-dotlrn packages should have a tag of this style, based on the package name. Many packages have not been re-released since the new naming convention was adopted - and so don't have a tag of this type. + and so don't have a tag of this type.

  • openacs-x-y-compat tags point to the most recent released version of OpenACS X.Y. It is similar to openacs-x-y-z-compat, except that it will always get the most recent dot-release of Core and the @@ -231,9 +231,9 @@ be addressed with another upgrade script. E.g., the last planned upgrade script for a package previously in dev 1 would be upgrade-2.0.0d1-2.0.0b1.sql, not upgrade-2.0.0d1-2.0.0.sql. Note - that using rc1 instead of b1 would be nice, because that's the + that using rc1 instead of b1 would be nice, because that's the convention with release codes in cvs, but the package manager - doesn't support rc tags. + doesn't support rc tags.

  • Database upgrade scripts should never go to the release version, e.g., should always have a letter suffix such as d1 or @@ -312,12 +312,12 @@ OpenACS code so that patches can be generated.

  • - For example, adding a new API function wouldn't require a + For example, adding a new API function wouldn't require a TIP. Changing an existing API function by adding an optional new - flag which defaults to no-effect wouldn't require a TIP. Added a + flag which defaults to no-effect wouldn't require a TIP. Added a new mandatory flag to an existing function would require a TIP. -

    +

    Informal Guidelines

    Informal guidelines which may be obsolete in places and should be reviewed: @@ -368,10 +368,10 @@ Added missing h3 HTML close tag".

  • Commit one cohesive bug fix or feature change at a time. - Don't put a bunch of unrelated changes into one commit. + Don't put a bunch of unrelated changes into one commit.

  • Before you throw out or change a piece of code that you - don't fully understand, use cvs annotate and cvs log on the file to + don't fully understand, use cvs annotate and cvs log on the file to see who wrote the code and why. Consider contacting the author.

  • @@ -397,7 +397,7 @@ OpenACS cvs web and - Jeff's cvs + Jeff's cvs browser are useful tools in understanding what is @@ -418,7 +418,7 @@

  • file locking etc. with cvs

  • - Piskorski's cvs refs + Piskorski's cvs refs

  • backup with cvs

  • Index: openacs-4/packages/acs-core-docs/www/cvs-tips.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/cvs-tips.adp,v diff -u -N -r1.1.2.12 -r1.1.2.13 --- openacs-4/packages/acs-core-docs/www/cvs-tips.adp 19 Nov 2016 09:21:53 -0000 1.1.2.12 +++ openacs-4/packages/acs-core-docs/www/cvs-tips.adp 6 Jan 2017 09:18:41 -0000 1.1.2.13 @@ -19,7 +19,7 @@ OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

  • Add the Service to CVS - -OPTIONAL. These steps take +OPTIONAL. These steps take an existing OpenACS directory and add it to a CVS repository.

    1. Index: openacs-4/packages/acs-core-docs/www/cvs-tips.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/cvs-tips.html,v diff -u -N -r1.34.2.12 -r1.34.2.13 --- openacs-4/packages/acs-core-docs/www/cvs-tips.html 19 Nov 2016 09:21:53 -0000 1.34.2.12 +++ openacs-4/packages/acs-core-docs/www/cvs-tips.html 6 Jan 2017 09:18:41 -0000 1.34.2.13 @@ -1,8 +1,8 @@ -Appendix D. Using CVS with an OpenACS Site

      Appendix D. Using CVS with an OpenACS Site

      By Joel Aufrecht

      +Appendix D. Using CVS with an OpenACS Site

      Appendix D. Using CVS with an OpenACS Site

      By Joel Aufrecht

      OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff. -

      Add the Service to CVS - OPTIONAL. These steps take an existing OpenACS directory and add +

      Add the Service to CVS - OPTIONAL. These steps take an existing OpenACS directory and add it to a CVS repository.

      1. Create and set permissions on a subdirectory in the local cvs repository.

        [root root]# mkdir /cvsroot/$OPENACS_SERVICE_NAME
         [root root]# chown $OPENACS_SERVICE_NAME.$OPENACS_SERVICE_NAME /cvsroot/$OPENACS_SERVICE_NAME
        @@ -60,4 +60,4 @@
         su - $OPENACS_SERVICE_NAME
         cd /var/lib/aolserver
         cvs checkout $OPENACS_SERVICE_NAME
        -exit
      2. If the service starts correctly, come back and remove the temporary copy of the uploaded files.

      +exit
    2. If the service starts correctly, come back and remove the temporary copy of the uploaded files.

    Index: openacs-4/packages/acs-core-docs/www/database-management.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/database-management.html,v diff -u -N -r1.31.2.3 -r1.31.2.4 --- openacs-4/packages/acs-core-docs/www/database-management.html 19 Nov 2016 09:21:53 -0000 1.31.2.3 +++ openacs-4/packages/acs-core-docs/www/database-management.html 6 Jan 2017 09:18:41 -0000 1.31.2.4 @@ -1,5 +1,5 @@ -Chapter 7. Database Management

    Chapter 7. Database Management

    By Joel Aufrecht

    +Chapter 7. Database Management

    Chapter 7. Database Management

    By Joel Aufrecht

    OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.
    Index: openacs-4/packages/acs-core-docs/www/db-api-detailed.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/db-api-detailed.adp,v diff -u -N -r1.1.2.8 -r1.1.2.9 --- openacs-4/packages/acs-core-docs/www/db-api-detailed.adp 30 Nov 2016 08:15:11 -0000 1.1.2.8 +++ openacs-4/packages/acs-core-docs/www/db-api-detailed.adp 6 Jan 2017 09:18:41 -0000 1.1.2.9 @@ -703,8 +703,8 @@ script and should never be referenced directly by user code. Returns the current rdbms type and version.

    -
    ($‌Id: db-api-detailed.html,v 1.48.2.14 -2016/11/19 09:21:53 gustafn Exp $)
    +
    ($‌Id: db-api.xml,v 1.11.2.2 2016/06/23 08:32:47 +gustafn Exp $)
    • Tcl procedures: /packages/acs-kernel/10-database-procs.tcl

    • Tcl initialization: /packages/acs-kernel/database-init.tcl

    The Big Picture

    -One of OpenACS's great strengths is that code written for it is very close to +One of OpenACS's great strengths is that code written for it is very close to the database. It is very easy to interact with the database from anywhere within OpenACS. Our goal is to develop a coherent API for database access which makes this even easier.

    There were four significant problems with the way OpenACS previously used the database (i.e., directly through the ns_db interface):

    1. Handle management. We required code to pass database handles around, and for routines which needed to perform database access but -didn't receive a database handle as input, it was difficult to know from +didn't receive a database handle as input, it was difficult to know from which of the three "magic pools" (main, subquery, and log) to allocate a new handle. @@ -50,7 +50,7 @@ set_variables_after_subquery and subselection). -

    2. Hard-coded reliance on Oracle. It's difficult to +

    3. Hard-coded reliance on Oracle. It's difficult to write code supporting various different databases (dynamically using the appropriate dialect based on the type of database being used, e.g., using DECODE on Oracle and CASE ... WHEN on @@ -66,11 +66,11 @@ be Oracle for now.)

      To be clear, SQL abstraction is not fully implemented in OpenACS 3.3.1. The statement names supplied to each call are not used by the API at -all. The API's design for SQL abstraction is in fact incomplete; +all. The API's design for SQL abstraction is in fact incomplete; unresolved issues include:

      • how to add WHERE clause criteria dynamically

      • how to build a dynamic ORDER BY clause (Ben Adida has a -proposed solution for this)

      • how to define a statement's formal interface (i.e., what bind +proposed solution for this)

      • how to define a statement's formal interface (i.e., what bind variables it expects, what columns its SELECT clause must -contain if it's a query) without actually implementing the statement in a +contain if it's a query) without actually implementing the statement in a specific SQL dialect

      So why is the incremental change of adding statement naming to the API worth the effort? It is worth the effort because we know that giving each SQL @@ -79,25 +79,25 @@ advantage of the new support for bind variables will already require code that uses 3.3.0 version of the API to be updated.

    The Bell Tolls for set_variables_after_query

    -set_variables_after_query is gone! (Well, it's still there, -but you'll never need to use it.) The new API routines set local +set_variables_after_query is gone! (Well, it's still there, +but you'll never need to use it.) The new API routines set local variables automatically. For instance:

     
     db_1row select_names "select first_names, last_name from users where user_id = [ad_conn user_id]"
     doc_body_append "Hello, $first_names $last_name!"
     
     

    -Like ns_db 1row, this will bomb if the query doesn't return -any rows (no such user exists). If this isn't what you want, you can +Like ns_db 1row, this will bomb if the query doesn't return +any rows (no such user exists). If this isn't what you want, you can write:

     
     if { [db_0or1row select_names "select first_names, last_name from users where user_id = [ad_conn user_id]"] } {
         doc_body_append "Hello, $first_names $last_name!"
     } else {
         # Executed if the query returns no rows.
    -    doc_body_append "There's no such user!"
    +    doc_body_append "There's no such user!"
     }
     
     

    @@ -110,7 +110,7 @@ }

    -That's right, db_foreach is now like ns_db +That's right, db_foreach is now like ns_db select plus a while loop plus set_variables_after_query plus an if statement (containing code to be executed if no rows are returned). @@ -120,7 +120,7 @@ db_foreach select_names "select first_names, last_name from users where last_name like 'S%'" { doc_body_append "Say hi to $first_names $last_name for me!<br>" } if_no_rows { - doc_body_append "There aren't any users with last names beginnings with S!" + doc_body_append "There aren't any users with last names beginnings with S!" }

    Handle Management

    @@ -135,7 +135,7 @@ doc_body_append "<li>User $first_names $last_name\n<ul>" db_foreach select_groups "select group_id from user_group_map where user_id = $user_id" { - # There's a selection in progress, so we allocated a database handle + # There's a selection in progress, so we allocated a database handle # from the subquery pool for this selection. doc_body_append "<li>Member of group #$group_id.\n" } if_no_rows { @@ -147,12 +147,12 @@ db_release_unused_handles

    -A new handle isn't actually allocated and released for every selection, +A new handle isn't actually allocated and released for every selection, of course - as a performance optimization, the API keeps old handles around until db_release_unused_handles is invoked (or the script terminates).

    Note that there is no analogue to ns_db gethandle - the -handle is always automatically allocated the first time it's needed.

    Bind Variables

    Introduction

    +handle is always automatically allocated the first time it's needed.

    Bind Variables

    Introduction

    Most SQL statements require that the code invoking the statement pass along data associated with that statement, usually obtained from the user. For instance, in order to delete a WimpyPoint presentation, a Tcl script might @@ -163,7 +163,7 @@

    where some_presentation_id is a number which is a valid -presentation ID of the presentation I want to delete. It's easy to write +presentation ID of the presentation I want to delete. It's easy to write code handling situations like this since SQL statements can include bind variables, which represent placeholders for actual data. A bind variable is specified as a colon followed by an identifier, so @@ -177,7 +177,7 @@

    When this SQL statement is invoked, the value for the bind variable :some_presentation_id is pulled from the Tcl variable -$some_presentation_id (in the caller's environment). Note +$some_presentation_id (in the caller's environment). Note that bind variables are not limited to one per statement; you can use an arbitrary number, and each will pull from the correspondingly named Tcl variable. (Alternatively, you can also specify an list or ns_set @@ -187,7 +187,7 @@ variable, or to use db_quote to escape single-quotes contained in the value. The following works fine, despite the apostrophe:

     
    -set exclamation "That's all, folks!"
    +set exclamation "That's all, folks!"
     db_dml exclamation_insert { insert into exclamations(exclamation) values(:exclamation) }
     
     

    Note that you can use a bind variable in a SQL statement only where you @@ -223,7 +223,7 @@ eliminates this gaping security hole: since bind variable values are taken literally. Oracle will attempt to delete presentations whose presentation ID is literally '3 or 1 = 1' (i.e., no presentations, since -'3 or 1 = 1' can't possibly be a valid integer +'3 or 1 = 1' can't possibly be a valid integer primary key for wp_presentations. In general, since Oracle always considers the values of bind variables to be literals, it becomes more difficult for users to perform URL surgery to trick scripts into running @@ -377,7 +377,7 @@

    • first_names is Jon. last_name is Salz.

    • first_names is Lars. last_name is Pind.

    • first_names is Michael. last_name is Yoon.

    API

    Note that you never have to use ns_db anymore (including ns_db gethandle)! Just start doing stuff, and (if you want) call -db_release_unused_handles when you're done as a hint to +db_release_unused_handles when you're done as a hint to release the database handle.

    db_null @@ -413,7 +413,7 @@ column values. Raises an error if the query does not return exactly 1 row.

    Example:

     
     db_1row select_foo "select foo, bar from greeble where greeble_id = $greeble_id"
    -# Bombs if there's no such greeble!
    +# Bombs if there's no such greeble!
     # Now $foo and $bar are set.
     
     
    db_0or1row
    @@ -424,7 +424,7 @@
     returns 0. If more than one row is returned, throws an error. 

    db_string
     db_string statement-name sql [ -default default ] [ -bind bind_set_id | -bind bind_value_list ]
     

    Returns the first column of the result of SQL query -sql. If sql doesn't return a +sql. If sql doesn't return a row, returns default (or throws an error if default is unspecified). Analogous to database_to_tcl_string and @@ -440,15 +440,15 @@

    db_list
     db_list statement-name sql [ -bind bind_set_id | -bind bind_value_list ]
     

    Returns a Tcl list of the values in the first column of the result of SQL -query sql. If sql doesn't +query sql. If sql doesn't return any rows, returns an empty list. Analogous to database_to_tcl_list.

    db_list_of_lists
     db_list_of_lists statement-name sql [ -bind bind_set_id | -bind bind_value_list ]
     

    Returns a Tcl list, each element of which is a list of all column values in a row of the result of SQL query sql. If -sql doesn't return any rows, returns an empty list. +sql doesn't return any rows, returns an empty list. (Analogous to database_to_tcl_list_list.)

    db_list_of_ns_sets
    @@ -560,11 +560,11 @@
         

    Each row also has a column, rownum, automatically added and set to the row number, starting with 1. Note that this will - override any column in the SQL statement named 'rownum', also if you're + override any column in the SQL statement named 'rownum', also if you're using the Oracle rownum pseudo-column.

    If the -local is passed, the variables defined - by db_multirow will be set locally (useful if you're compiling dynamic templates + by db_multirow will be set locally (useful if you're compiling dynamic templates in a function or similar situations).

    You may supply a code block, which will be executed for each row in @@ -580,7 +580,7 @@ useful for things like constructing a URL for the object retrieved by the query.

    - If you're constructing your multirow through multiple queries with the + If you're constructing your multirow through multiple queries with the same set of columns, but with different rows, you can use the -append switch. This causes the rows returned by this query to be appended to the rows already in the multirow, instead of starting @@ -612,7 +612,7 @@

    db_with_handle
     db_with_handle var code_block
     

    Places a database handle into the variable var and -executes code_block. This is useful when you don't +executes code_block. This is useful when you don't want to have to use the new API (db_foreach, db_1row, etc.), but need to use database handles explicitly.

    Example:

     
    @@ -623,7 +623,7 @@
     }
     
     db_with_handle db {
    -    # Now there's a database handle in $db.
    +    # Now there's a database handle in $db.
         set selection [ns_db select $db "select foo from bar"]
         while { [ns_db getrow $db $selection] } {
             set_variables_after_query
    @@ -677,7 +677,7 @@
     			db_package_supports_rdbms_p db_type_list
     		

    Returns 1 if db_type_list contains the current RDMBS type. A package - intended to run with a given RDBMS must note this in it's package info + intended to run with a given RDBMS must note this in it's package info file regardless of whether or not it actually uses the database.

    Index: openacs-4/packages/acs-core-docs/www/db-api.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/db-api.adp,v diff -u -N -r1.1.2.8 -r1.1.2.9 --- openacs-4/packages/acs-core-docs/www/db-api.adp 30 Nov 2016 08:15:11 -0000 1.1.2.8 +++ openacs-4/packages/acs-core-docs/www/db-api.adp 6 Jan 2017 09:18:41 -0000 1.1.2.9 @@ -602,8 +602,8 @@ -
    ($‌Id: db-api.html,v 1.50.2.14 2016/11/19 -09:21:53 gustafn Exp $)
    +
    ($‌Id: db-api.xml,v 1.13.8.3 2016/10/03 09:17:51 +gustafn Exp $)

    Caching Database API Results

    The database API allows for direct caching of query results. Index: openacs-4/packages/acs-core-docs/www/db-api.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/db-api.html,v diff -u -N -r1.50.2.14 -r1.50.2.15 --- openacs-4/packages/acs-core-docs/www/db-api.html 19 Nov 2016 09:21:53 -0000 1.50.2.14 +++ openacs-4/packages/acs-core-docs/www/db-api.html 6 Jan 2017 09:18:41 -0000 1.50.2.15 @@ -2,7 +2,7 @@ The OpenACS Database Access API

    The OpenACS Database Access API

    By Pete Su and Jon Salz. Modified by Roberto Mello.

    Overview

    - One of OpenACS's great strengths is that code written for it is + One of OpenACS's great strengths is that code written for it is very close to the database. It is very easy to interact with the database from anywhere within OpenACS, and we have a coherent API for database access which makes this even easier. @@ -12,7 +12,7 @@

    DB API Examples

    The OpenACS database API is meant to save developers from making common mistakes and to provide a more structured syntax for - specifying database operations, including transactions. Here's + specifying database operations, including transactions. Here's an example of the API.

     set count 0
    @@ -134,7 +134,7 @@
     
     db_foreach my_query { select :table from some_table where :condition }
         

    - SQL will not allow a literal to occur where we've put the bind + SQL will not allow a literal to occur where we've put the bind variables, so the query is syntactically incorrect. You have to remember that while the bind variable syntax looks similar to variable interpolation in Tcl, It is not the same thing at all. @@ -290,7 +290,7 @@

    Note that you never have to use ns_db anymore (including ns_db gethandle)! Just start doing stuff, and (if you want) call - db_release_unused_handles when you're done as a hint to + db_release_unused_handles when you're done as a hint to release the database handle.

    @@ -318,11 +318,11 @@

    Each row also has a column, rownum, automatically added and set to the row number, starting with 1. Note that this will - override any column in the SQL statement named 'rownum', also if you're + override any column in the SQL statement named 'rownum', also if you're using the Oracle rownum pseudo-column.

    If the -local is passed, the variables defined - by db_multirow will be set locally (useful if you're compiling dynamic templates + by db_multirow will be set locally (useful if you're compiling dynamic templates in a function or similar situations).

    You may supply a code block, which will be executed for each row in @@ -338,7 +338,7 @@ useful for things like constructing a URL for the object retrieved by the query.

    - If you're constructing your multirow through multiple queries with the + If you're constructing your multirow through multiple queries with the same set of columns, but with different rows, you can use the -append switch. This causes the rows returned by this query to be appended to the rows already in the multirow, instead of starting @@ -377,7 +377,7 @@ multirow foreach assets { lappend asset_id_l $asset_id } -

    Technically it's equivalent to using a code block on +

    Technically it's equivalent to using a code block on the end of your db_multirow.

    @@ -444,7 +444,7 @@

    Example:

     
     db_1row select_foo "select foo, bar from greeble where greeble_id = $greeble_id"
    -# Bombs if there's no such greeble!
    +# Bombs if there's no such greeble!
     # Now $foo and $bar are set.
     
     	  
    @@ -487,7 +487,7 @@ db_string statement-name sql [ -default default ] [ -bind bind_set_id | -bind bind_value_list ]

    Returns the first column of the result of SQL query sql. - If sql doesn't return a + If sql doesn't return a row, returns default (or throws an error if @@ -500,15 +500,15 @@

    Returns a Tcl list of the values in the first column of the result of SQL query sql. - If sql doesn't + If sql doesn't return any rows, returns an empty list. Analogous to database_to_tcl_list.

    db_list_of_lists
     db_list_of_lists statement-name sql [ -bind bind_set_id | -bind bind_value_list ]
     	  

    Returns a Tcl list, each element of which is a list of all column values in a row of the result of SQL query sql. If - sql doesn't return any rows, returns an empty list. + sql doesn't return any rows, returns an empty list. (Analogous to database_to_tcl_list_list.)

    db_dml
    @@ -601,7 +601,7 @@
     	  

    db_with_handle
     db_with_handle var code_block
     	  

    Places a database handle into the variable var and - executes code_block. This is useful when you don't + executes code_block. This is useful when you don't want to have to use the new API (db_foreach, db_1row, etc.), but need to use database handles explicitly.

    Example:

     
    @@ -612,7 +612,7 @@
     }
     
     db_with_handle db {
    -    # Now there's a database handle in $db.
    +    # Now there's a database handle in $db.
         set selection [ns_db select $db "select foo from bar"]
         while { [ns_db getrow $db $selection] } {
             set_variables_after_query
    @@ -644,7 +644,7 @@
     set n_rows [db_string unused "select count(*) from foo where baz is null"]
     #
     # $n_rows is 1; in effect, the "baz is null" criterion is matching
    -# the empty string we just inserted (because of Oracle's coercion
    +# the empty string we just inserted (because of Oracle's coercion
     # quirk)
     
     	  

    Index: openacs-4/packages/acs-core-docs/www/docbook-primer.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/docbook-primer.adp,v diff -u -N -r1.1.2.13 -r1.1.2.14 --- openacs-4/packages/acs-core-docs/www/docbook-primer.adp 19 Nov 2016 09:21:53 -0000 1.1.2.13 +++ openacs-4/packages/acs-core-docs/www/docbook-primer.adp 6 Jan 2017 09:18:41 -0000 1.1.2.14 @@ -410,7 +410,7 @@ tools will be marked up to conform to the DocBook XML DTD. The remaining discussion is about publishing using Docbook.

    - is a publishing standard based on XML + is a publishing standard based on XML with similar goals to the OpenACS Documentation project. Some specific reasons why we are using DocBook:

    • It is open-source.

    • A growing community surrounds DocBook (has mailing lists)

    • A number of free and commercial tools are available for editing and publishing DocBook @@ -449,7 +449,7 @@ of elements and use more exotic features in your documents. The list is made up of SGML-elements but basically the same elements are valid in the XML DTD as long as -you remember to: +you remember to:

      • Always close your tags with corresponding end-tags and to not use other tag @@ -491,7 +491,7 @@

        Document Structure

        The documentation for each package will make up a little "book" that is structured like this - examples are -emphasized: +emphasized:

             book                        : Docs for one package - templating
              |
        @@ -516,11 +516,11 @@
         

      Headlines, Sections

      - Given that your job starts at the + Given that your job starts at the sect1-level, all your documents should open with a <sect1>-tag and end with the corresponding </sect1>.

      - You need to feed every <sect1> two attributes. The first + You need to feed every <sect1> two attributes. The first attribute, id, is standard and can be used with all elements. It comes in very handy when interlinking between documents (more about this when talking about @@ -529,7 +529,7 @@ id has to be unique throughout the book you're making since the id's in your sect1's will turn into filenames when the book is parsed into HTML.

      - The other attribute is xreflabel. The value of this is the text + The other attribute is xreflabel. The value of this is the text that will appear as the link when referring to this sect1.

      Right after the opening tag you put the title of the document - this is usually the same as xreflabel-attribute. E.g. the top level of the document you're reading right now looks like this:

      @@ -540,7 +540,7 @@
       
       </sect1>
       

      - Inside this container your document will + Inside this container your document will be split up into <sect2>'s, each with the same requirements - id and xreflabel attributes, and a <title>-tag inside. Actually, the xreflabel is never required in @@ -550,7 +550,7 @@

      Code

      - For displaying a snippet of code, a + For displaying a snippet of code, a filename or anything else you just want to appear as a part of a sentence, we use <computeroutput> and <code> tags. These replace the HTML-tag <code> tag, @@ -564,15 +564,15 @@

      Links

      - Linking falls into two different + Linking falls into two different categories: inside the book you're making and outside:

      1. Inside linking, cross-referencing other parts of your book

      By having unique id's you can cross-reference any part of your book with a simple tag, regardless of where that part is.

      -Check out how I link to a subsection of +Check out how I link to a subsection of the Developer's Guide:

      Put this in your XML:

       - Find information about creating a package in
       <xref linkend="packages-making-a-package"></xref>.
      @@ -596,7 +596,7 @@
       
      2. Linking outside the documentation

      - If you're hyper-linking out of the + If you're hyper-linking out of the documentation, it works almost the same way as HTML - the tag is just a little different (<ulink>):

       <ulink url="http://www.oracle.com/">Oracle Corporation</ulink>
      @@ -615,7 +615,7 @@
       Note: The graphics guidelines are
       not written in stone. Use another valid approach if it works better
       for you.

      - To insert a graphic we use the elements + To insert a graphic we use the elements <mediaobject>, <imageobject>, <imagedata>, @@ -640,7 +640,7 @@

      Lists

      - Here's how you make the DocBook + Here's how you make the DocBook equivalent of the three usual HTML-lists:

      1. How to make an <ul>
      @@ -693,7 +693,7 @@

      Tables

      - DocBook supports several types of tables, + DocBook supports several types of tables, but in most cases, the <informaltable> is enough:

       <informaltable frame="all">
         <tgroup cols="3">
      @@ -739,7 +739,7 @@
       

      Emphasis

      - Our documentation uses two flavors of + Our documentation uses two flavors of emphasis - italics and bold type. DocBook uses one - <emphasis>.

      The <emphasis> tag defaults to italics when parsed. If you're looking for emphasizing with bold type, use <emphasis Index: openacs-4/packages/acs-core-docs/www/docbook-primer.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/docbook-primer.html,v diff -u -N -r1.52.2.12 -r1.52.2.13 --- openacs-4/packages/acs-core-docs/www/docbook-primer.html 19 Nov 2016 09:21:53 -0000 1.52.2.12 +++ openacs-4/packages/acs-core-docs/www/docbook-primer.html 6 Jan 2017 09:18:41 -0000 1.52.2.13 @@ -10,7 +10,7 @@ of OpenACS installations can enjoy the system.

      The history of OpenACS documentation: ..began by - building on a good documentation base from ArsDigita's ACS in the + building on a good documentation base from ArsDigita's ACS in the late 1990's. Some sections of the documentation, however, lacked details and examples; others simply did not exist. The OpenACS community began meeting the challenge by identifying needs and @@ -36,7 +36,7 @@ developers had to learn the system through experience with working with it and discussion in the forums. Informal sharing of experiential and tacit knowledge has become the OpenACS - community's main method of sharing knowledge. + community's main method of sharing knowledge.

      This document attempts to shape ongoing documentation efforts by using principles of continual improvement to re-engineer @@ -166,7 +166,7 @@ book in print, and help new readers visualize how the documentation is organized.

    • - The use licenses between OpenACS and Arsdigita's ACS are not + The use licenses between OpenACS and Arsdigita's ACS are not compatible, thereby creating strict limits on how much OpenACS developers should have access to Arsdigita code and resources. The OpenACS documentation has a new legal @@ -323,8 +323,8 @@

    • Create a long bulleted list of features. Feature list should go deeper than high-level feature lists and look at the - quality of the implementations (from the user's perspective, - not the programmer's). Example issues an end-user may have + quality of the implementations (from the user's perspective, + not the programmer's). Example issues an end-user may have questions about: Ticket Tracker and Ticket Tracker Lite, why would I want one of them vs the other? And, before I specify to download and install it, what credit card gateways are @@ -363,7 +363,7 @@

    • Create a list of administrative tools that are useful to administrating OpenACS, including developer support, - schema-browser and api browser. Link to AOLserver's config + schema-browser and api browser. Link to AOLserver's config file documentation.

    • Resources on high level subjects such as web services, @@ -514,7 +514,7 @@ they are not available elsewhere.

    • Add overview diagrams showing the core parts of the - datamodel including an updated summary of Greenspun's + datamodel including an updated summary of Greenspun's Chapter 4: Data Models and the Object System

    • package design guidelines and development process templates @@ -578,7 +578,7 @@ DTD. The remaining discussion is about publishing using Docbook.

      - + is a publishing standard based on XML with similar goals to the OpenACS Documentation project. Some specific reasons why we are using DocBook:

      • @@ -636,12 +636,12 @@ to represent paper-based books online.

        The following DocBook primer walks you through the basics, and should cover the - needs for 95 percent of the documentation we produce. You are welcome to explore DocBook's + needs for 95 percent of the documentation we produce. You are welcome to explore DocBook's list of elements and use more exotic features in your documents. The list is made up of SGML-elements but basically the same elements are valid in the XML DTD as long as you remember to: - +

        • Always close your tags with corresponding end-tags and to not use other tag minimization @@ -661,7 +661,7 @@ XSL Stylesheets (docbook-xsl) - The stylesheets to convert to HTML. We have been using a stylesheet based upon - NWalsh's chunk.xsl. + NWalsh's chunk.xsl.

        • xsltproc - The processor that will take an XML document and, given a xsl stylesheet, convert @@ -690,7 +690,7 @@ The documentation for each package will make up a little "book" that is structured like this - examples are emphasized: - +

               book                        : Docs for one package - templating
          @@ -703,7 +703,7 @@
                        |
                        +--sect2           : Sections - functional requirements
                            |
          -                 +--sect3       : Subsections - Programmer's API
          +                 +--sect3       : Subsections - Programmer's API
                                |
                               ...         : ...
               

          @@ -714,25 +714,25 @@ sources of these DocBook documents to get an idea of how they are tied together.

        Headlines, Sections

        - + Given that your job starts at the sect1-level, all your documents should open with a <sect1>-tag and end with the corresponding </sect1>.

        - + You need to feed every <sect1> two attributes. The first attribute, id, is standard and can be used with all elements. It comes in very handy when interlinking between documents (more about this when talking about links in the section called “Links”). The value of id has to be unique - throughout the book you're making since the id's in your + throughout the book you're making since the id's in your sect1's will turn into filenames when the book is parsed into HTML.

        - + The other attribute is xreflabel. The value of this is the text that will appear as the link when referring to this sect1.

        Right after the opening tag you put the title of the document - this is usually the same as - xreflabel-attribute. E.g. the top level of the document you're + xreflabel-attribute. E.g. the top level of the document you're reading right now looks like this:

         <sect1 id="docbook-primer" xreflabel="DocBook Primer">
        @@ -742,7 +742,7 @@
         
         </sect1>
         

        - + Inside this container your document will be split up into <sect2>'s, each with the same requirements - id and xreflabel @@ -751,7 +751,7 @@ When it comes to naming your sect2's and below, prefix them with some abbreviation of the id in the sect1 such as requirements-overview.

        Code

        - + For displaying a snippet of code, a filename or anything else you just want to appear as a part of a sentence, we use <computeroutput> @@ -769,12 +769,12 @@ tag around text that has been wrapped by combinations of <computeroutput> and <userinput>

        Links

        - - Linking falls into two different categories: inside the book you're making and outside: + + Linking falls into two different categories: inside the book you're making and outside:

        1. Inside linking, cross-referencing other parts of your book

        By having unique id's you can cross-reference any part of your book with a simple tag, regardless of where that part is. -

        Check out how I link to a subsection of the Developer's Guide:

        Put this in your XML:

        +      

        Check out how I link to a subsection of the Developer's Guide:

        Put this in your XML:

         - Find information about creating a package in
         <xref linkend="packages-making-a-package"></xref>.
         

        And the output is:

        @@ -786,20 +786,20 @@
                 Provide the end-tag, </xref>, or
                   

      • Put a slash before the ending-bracket: <xref linkend="blahblah"/> -

      If the section you link to hasn't a specified xreflabel-attribute, +

    If the section you link to hasn't a specified xreflabel-attribute, the link is going to look like this:

    Put this in your XML:

     -Find information about what a package looks like in 
     <xref linkend="packages-looks"></xref>.
     

    And the output is:

     - Find information about what a package looks like in 
     the section called “What a Package Looks Like”.
     

    - Note that since I haven't provided an xreflabel for the subsection, + Note that since I haven't provided an xreflabel for the subsection, packages-looks, the parser will try its best to explain where the link takes you.

    2. Linking outside the documentation

    - - If you're hyper-linking out of the documentation, it works almost the same way as HTML - the tag is just + + If you're hyper-linking out of the documentation, it works almost the same way as HTML - the tag is just a little different (<ulink>): @@ -819,7 +819,7 @@ for you.

    - + To insert a graphic we use the elements <mediaobject>, <imageobject>, @@ -845,8 +845,8 @@ Put your graphics in a separate directory ("images") and link to them only with relative paths.

    Lists

    - - Here's how you make the DocBook equivalent of the three usual HTML-lists: + + Here's how you make the DocBook equivalent of the three usual HTML-lists:

    1. How to make an <ul>

    Making an unordered list is pretty much like doing the same thing in HTML - if you close your <li>, that is. The only differences are that each list item has to be wrapped in something more, such as <para>, and that the tags are called @@ -870,7 +870,7 @@ </orderedlist>

    3. How to make a <dl>

    - This kind of list is called a variablelist and these are the tags you'll need to + This kind of list is called a variablelist and these are the tags you'll need to make it happen: <variablelist>, <varlistentry>, @@ -890,7 +890,7 @@ </variablelist>

    Tables

    - + DocBook supports several types of tables, but in most cases, the <informaltable> is enough: @@ -927,11 +927,11 @@ <table> for an example.

    Emphasis

    - + Our documentation uses two flavors of emphasis - italics and bold type. DocBook uses one - <emphasis>.

    - The <emphasis> tag defaults to italics when parsed. If you're looking for + The <emphasis> tag defaults to italics when parsed. If you're looking for emphasizing with bold type, use <emphasis role="strong">.

    Indexing Your DocBook Documents

    Words that are marked as index-words are referenced in an index @@ -957,7 +957,7 @@

     bash$ xsltproc -o outputfilename.xml /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/html/html.xsl filename.xml
     

    Note

    - This example uses Daniel Veillard's xsltproc command available + This example uses Daniel Veillard's xsltproc command available as part of libxslt from http://www.xmlsoft.org/XSLT/. If you are using other XML processors such as Xalan or Saxon, you will need to change the command line appropriately. @@ -983,7 +983,7 @@ David Lutterkort wrote an intro to the PSGML Mode in Emacs

  • - James Clark's free Java parser + James Clark's free Java parser XP. Note that this does not validate XML, only parses it.

  • @@ -997,7 +997,7 @@

  • In the process of transforming your HTML into XML, HTML tidy - can be a handy tool to make your HTML "regexp'able". + can be a handy tool to make your HTML "regexp'able". Brandoch Calef has made a Perl script with directions (now via archive.org) Index: openacs-4/packages/acs-core-docs/www/eng-standards-constraint-naming.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/eng-standards-constraint-naming.adp,v diff -u -N -r1.1.2.8 -r1.1.2.9 --- openacs-4/packages/acs-core-docs/www/eng-standards-constraint-naming.adp 30 Nov 2016 08:15:11 -0000 1.1.2.8 +++ openacs-4/packages/acs-core-docs/www/eng-standards-constraint-naming.adp 6 Jan 2017 09:18:41 -0000 1.1.2.9 @@ -127,8 +127,8 @@ immeditately in error debugging (e.g. the error will say something like "Cannot insert null value into column"), we recommend naming not null constraints to be consistent in our -naming of all constraints.

    ($‌Id: eng-standards-constraint-naming.html,v -1.48.2.12 2016/11/19 09:21:53 gustafn Exp $)
    +naming of all constraints.

    ($‌Id: constraint-naming.xml,v 1.6.14.2 +2016/06/23 08:32:46 gustafn Exp $)
  • Constraint typeAbbreviation
    references (foreign key)fk
    uniqueun
    primary keypk
    checkck
    not nullnn
    indexidx

    Format of constraint name

    <table name>_<column_name>_<constraint abbreviation>

    -In reality, this won't be possible because of the character limitation on +In reality, this won't be possible because of the character limitation on names inside oracle. When the name is too long, we will follow these two steps in order: -

    1. Abbreviate the table name with the table's initials (e.g. users -> u and users_contact -> uc). +

      1. Abbreviate the table name with the table's initials (e.g. users -> u and users_contact -> uc).

      2. Truncate the column name until it fits.

      If the constraint name is still too long, you should consider rewriting your entire data model :) @@ -52,8 +52,8 @@ constraint cne_example_id_one_line_unq unique(example_id, one_line_description) ); -

    Why it's good to name primary keys

    -Naming primary keys might not have any obvious advantages. However, here's an +

    Why it's good to name primary keys

    +Naming primary keys might not have any obvious advantages. However, here's an example where naming the primary key really helps (and this is by no means a rare case!

    @@ -71,7 +71,7 @@
        3	1     INDEX (UNIQUE SCAN) OF 'EXAMPLE_TOPICS_TOPIC_ID_PK' (UNI
     	  QUE)
     

    -Isn't it nice to see "EXAMPLE_TOPICS_TOPIC_ID_PK" in the trace +Isn't it nice to see "EXAMPLE_TOPICS_TOPIC_ID_PK" in the trace and know exactly which table oracle is using at each step?

    Naming not null constraints is optional...

    People disagree on whether or not we should be naming not null @@ -81,7 +81,7 @@

    About Naming the not null constraints

    -Though naming "not null" constraints doesn't help immeditately in error +Though naming "not null" constraints doesn't help immeditately in error debugging (e.g. the error will say something like "Cannot insert null value into column"), we recommend naming not null constraints to be consistent in our naming of all constraints. Index: openacs-4/packages/acs-core-docs/www/eng-standards-filenaming.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/eng-standards-filenaming.adp,v diff -u -N -r1.1.2.7 -r1.1.2.8 --- openacs-4/packages/acs-core-docs/www/eng-standards-filenaming.adp 30 Nov 2016 08:15:11 -0000 1.1.2.7 +++ openacs-4/packages/acs-core-docs/www/eng-standards-filenaming.adp 6 Jan 2017 09:18:41 -0000 1.1.2.8 @@ -172,7 +172,7 @@ -- author -- created -- --- $‌Id: eng-standards-filenaming.html,v 1.48.2.12 2016/11/19 09:21:53 gustafn Exp $ +-- $‌Id$

    Of course, replace "--" with the comment delimiter appropriate for the language in which you are programming.

    @@ -216,8 +216,8 @@

    Tcl Library Files

    Further standards for Tcl library files are under discussion; we -plan to include naming conventions for procs.

    ($‌Id: eng-standards-filenaming.html,v 1.48.2.12 -2016/11/19 09:21:53 gustafn Exp $)
    +plan to include naming conventions for procs.

    ($‌Id: filenaming.xml,v 1.7.2.2 2016/11/11 +08:53:59 gustafn Exp $)
    • For naming files that enable a specific action on an object, use this format:

      object-verb.extension

      -For example, the page to erase a user's portrait from the database is +For example, the page to erase a user's portrait from the database is /admin/users/portrait-erase.tcl.

    • However, modules typically deal with only one primary type of object - e.g., -the Bookmarks module deals mainly with bookmarks - and so action-type files in modules don't need to be specified by the object they act on. Example: the user pages +the Bookmarks module deals mainly with bookmarks - and so action-type files in modules don't need to be specified by the object they act on. Example: the user pages for the Bookmarks module live in the /bookmarks/ directory, and so there is no need to name the bookmark editing page with a redundant url: /bookmarks/bookmark-edit.tcl. Instead, we omit the object type, and use this convention:

      @@ -104,9 +104,9 @@ # www/register/user-login-2.tcl ad_page_contract { - Verify the user's password and issue the cookie. + Verify the user's password and issue the cookie. - @param user_id The user's id in users table. + @param user_id The user's id in users table. @param password_from_from The password the user entered. @param return_url What url to return to after successful login. @param persistent_cookie_p Specifies whether a cookie should be set to keep the user logged in forever. @@ -128,7 +128,7 @@ e.g. foo:integer,multiple,trim. In particular, multiple and array are the flags that correspond to the old ad_page_variables flags.

    • There are new flags: trim, notnull and -optional. They do what you'd expect; values will not be +optional. They do what you'd expect; values will not be trimmed, unless you mark them for it; empty strings are valid input, unless you specify notnull; and a specified variable will be considered required, unless you declare it optional.

    • ad_page_contract can do validation for you: the flags integer @@ -144,7 +144,7 @@ For shared Tcl library files, use ad_library after the file path comment. Its only argument is a doc_string in the standard (javadoc-style) format, like -ad_page_contract. Don't forget to put the @cvs-id in +ad_page_contract. Don't forget to put the @cvs-id in there. Here is an example of using ad_library:

       # tcl/wp-defs.tcl
      @@ -160,7 +160,7 @@
       

       -- path relative to the ACS root directory
       --
      --- brief description of the file's purpose
      +-- brief description of the file's purpose
       --
       -- author
       -- created
      @@ -206,7 +206,7 @@
       resource (namely, a database handle) for an unpredictable amount of
       time while sending packets back to the browser, and so it should be
       avoided in most cases. (On the other hand, for a page that requires an
      -expensive database query, it's better to call
      +expensive database query, it's better to call
       
       ad_return_top_of_page
       
      Index: openacs-4/packages/acs-core-docs/www/eng-standards-plsql.adp
      ===================================================================
      RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/eng-standards-plsql.adp,v
      diff -u -N -r1.1.2.6 -r1.1.2.7
      --- openacs-4/packages/acs-core-docs/www/eng-standards-plsql.adp	30 Nov 2016 08:15:11 -0000	1.1.2.6
      +++ openacs-4/packages/acs-core-docs/www/eng-standards-plsql.adp	6 Jan 2017 09:18:41 -0000	1.1.2.7
      @@ -142,8 +142,8 @@
       browsers. This means that we should try to make it as consistent as
       possible to all source code readers.

    • Lowercase everything, with the exception of %TYPE and %ROWTYPE.

    • -
    ($‌Id: eng-standards-plsql.html,v 1.49.2.12 -2016/11/19 09:21:53 gustafn Exp $)
    +
    ($‌Id: plsql.xml,v 1.6.14.1 2016/06/23 08:32:46 +gustafn Exp $)
  • Name parameters as simply as possible, i.e., use the column name - if the parameter corresponds to a table column. We're deprecating + if the parameter corresponds to a table column. We're deprecating the v_* and *_in syntax in favor of named parameters notation:

     
    @@ -117,7 +117,7 @@
         Use %TYPE and %ROWTYPE whenever possible.
        

  • Use 't' and 'f' for booleans, not the PL/SQL "boolean" datatype - because it can't be used in SQL queries. + because it can't be used in SQL queries.

  • All new functions (e.g., acs_object.new, party.new, etc.) should optionally accept an ID: Index: openacs-4/packages/acs-core-docs/www/eng-standards-versioning.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/eng-standards-versioning.adp,v diff -u -N -r1.1.2.6 -r1.1.2.7 --- openacs-4/packages/acs-core-docs/www/eng-standards-versioning.adp 30 Nov 2016 08:15:11 -0000 1.1.2.6 +++ openacs-4/packages/acs-core-docs/www/eng-standards-versioning.adp 6 Jan 2017 09:18:41 -0000 1.1.2.7 @@ -10,8 +10,8 @@

    Release Version Numbering

    -
    ($‌Id: eng-standards-versioning.html,v 1.51.2.12 -2016/11/19 09:21:53 gustafn Exp $)

    By Ron Henderson, Revised by Joel Aufrecht

    +
    ($‌Id: eng-standards-versioning.xml,v 1.10.14.2 +2016/10/28 20:26:53 gustafn Exp $)

    By Ron Henderson, Revised by Joel Aufrecht

    OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

    OpenACS version numbers help identify at a high-level what is in a particular release and what has changed since the last Index: openacs-4/packages/acs-core-docs/www/eng-standards-versioning.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/eng-standards-versioning.html,v diff -u -N -r1.51.2.12 -r1.51.2.13 --- openacs-4/packages/acs-core-docs/www/eng-standards-versioning.html 19 Nov 2016 09:21:53 -0000 1.51.2.12 +++ openacs-4/packages/acs-core-docs/www/eng-standards-versioning.html 6 Jan 2017 09:18:41 -0000 1.51.2.13 @@ -96,7 +96,7 @@

  • Naming Database Upgrade Scripts

    Database upgrade scripts must be named very precisely in order for the Package Manager to run the correct script at the correct time.

    1. Upgrade scripts should be named /packages/myfirstpackage/sql/postgresql/upgrade/upgrade-OLDVERSION-NEWVERSION.sql

    2. If the version you are working on is a later version than the current released version, OLDVERSION should be the current version. The current version is package version in the APM and in /packages/myfirstpackage/myfirstpackage.info. So if forums is at 2.0.1, OLDVERSION should be 2.0.1d1. Note that this means that new version development that includes an upgrade must start at d2, not d1.

    3. If you are working on a pre-release version of a package, use the current package version as OLDVERSION. Increment the package version as appropriate (see above) and use the new version as NEWVERSION. For example, if you are working on 2.0.1d3, make it 2.0.1d4 and use upgrade-2.0.1d3-2.0.1d4.sql.

    4. Database upgrades should be confined to development releases, not alpha or beta releases.

    5. Never use a final release number as a NEWVERSION. If you do, then it is impossible to add any more database upgrades without incrementing the overall package version.

    6. Use only the d, a, and b letters in OLDVERSION and NEWVERSION. rc is not supported by OpenACS APM.

    7. The distance from OLDVERSION to NEWVERSION should never span a release. For example if we had a bug fix in -acs-kernel on 5.1.0 you wouldn't want a file upgrade-5.0.4-5.1.0d1.sql since if you subsequently need to provide a 5.0.4-5.0.5 upgrade you will have to rename the 5.0.4-5.1.0 upgrade since you can't have upgrades which overlap like that. Instead, use upgrade-5.1.0d1-5.1.0d2.sql +acs-kernel on 5.1.0 you wouldn't want a file upgrade-5.0.4-5.1.0d1.sql since if you subsequently need to provide a 5.0.4-5.0.5 upgrade you will have to rename the 5.0.4-5.1.0 upgrade since you can't have upgrades which overlap like that. Instead, use upgrade-5.1.0d1-5.1.0d2.sql

    Index: openacs-4/packages/acs-core-docs/www/ext-auth-requirements.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/ext-auth-requirements.adp,v diff -u -N -r1.1.2.12 -r1.1.2.13 --- openacs-4/packages/acs-core-docs/www/ext-auth-requirements.adp 19 Nov 2016 09:21:53 -0000 1.1.2.12 +++ openacs-4/packages/acs-core-docs/www/ext-auth-requirements.adp 6 Jan 2017 09:18:41 -0000 1.1.2.13 @@ -12,7 +12,7 @@ External Authentication Requirements

    -Vision

    People have plenty of usernames and passwords already, we +Vision

    People have plenty of usernames and passwords already, we don't want them to have yet another. We want people to be able to log in to OpenACS with the same password they use to log in to any other system.

    Besides, administrators have better things to do than create @@ -74,7 +74,7 @@

    Requirements

    -New API

    +New API
    Index: openacs-4/packages/acs-core-docs/www/ext-auth-requirements.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/ext-auth-requirements.html,v diff -u -N -r1.40.2.13 -r1.40.2.14 --- openacs-4/packages/acs-core-docs/www/ext-auth-requirements.html 19 Nov 2016 09:21:53 -0000 1.40.2.13 +++ openacs-4/packages/acs-core-docs/www/ext-auth-requirements.html 6 Jan 2017 09:18:41 -0000 1.40.2.14 @@ -1,34 +1,34 @@ -External Authentication Requirements
    FeatureStatusDescription
    New API
    Prev Chapter 15. Kernel Documentation Next

    External Authentication Requirements

    Vision

    People have plenty of usernames and passwords already, we -don't want them to have yet another. We want people to be able to +External Authentication Requirements

    External Authentication Requirements

    Vision

    People have plenty of usernames and passwords already, we +don't want them to have yet another. We want people to be able to log in to OpenACS with the same password they use to log in to any other system.

    Besides, administrators have better things to do than create accounts for people. So we want them to be able to create just one account on a central server (e.g. LDAP or RADIUS), and when they log on to OpenACS, an account will automatically be created for them here.

    Finally, security is increased with fewer passwords, since -users generally can't remember all those passwords, so they tend to -keep them all the same and never change them.

    Design Goals

    • Transparent: Users don't have to do anything special to +users generally can't remember all those passwords, so they tend to +keep them all the same and never change them.

    Design Goals

    • Transparent: Users don't have to do anything special to get an account on the local OpenACS system, if they already have an - account on the external authentication server.

    • Fall-back: Users who don't have an account on the + account on the external authentication server.

    • Fall-back: Users who don't have an account on the external authentication server are still allowed to create a local account on OpenACS. This could be for external students who should - have access to .LRN, but not to the rest of the university's + have access to .LRN, but not to the rest of the university's resources.

    • Authentication Client Only: We want OpenACS to be able to - authenticate by asking some remote authority to verify the user's + authenticate by asking some remote authority to verify the user's username/password combination. The goal is explicitly not (at this point) to have OpenACS act as an authentication server for other systems, although this could be easily added later. The goal is also not to devise an infrastructure for letting OpenACS access - resources in various other systems on the user's behalf, such as + resources in various other systems on the user's behalf, such as IMAP, iCalendar, SMB file servers, etc., although this is definitely an interesting use-case.

    • Easy configuration: We would like people to be able to configure this without having to write code. In particular, we want to build drivers that know how to talk with LDAP, RADIUS, PAM, - etc., and which won't have to be locally modified. Only + etc., and which won't have to be locally modified. Only configuration and policies should change, code should not.

    • Usability: The solution must be easy to use for end users - and administrators alike. There's frequently a positive feedback + and administrators alike. There's frequently a positive feedback effect between usability and security, because when authentication schemes have poor usability, users will think up ways to circumvent them.

    • Open and modular: The design should be on the one hand @@ -41,11 +41,11 @@ authentication service contract, which talks to an authentication of a certain type, e.g. PAM, RADIUS, LDAP, or Active Directory.

    • Authentication API: The API through which login pages and - applications talk to the authentication service. There's one and + applications talk to the authentication service. There's one and only one implementation of the authentication API, namly the one included in OpenACS Core.

    • Authentication Driver API: The service contract which authentication drivers implement.

    Conceptual Pictures

    Authentication:

    -

    Account Management (NO PICTURE YET)

    Batch Synchronization (NO PICTURE YET)

    Requirements

    New API

    FeatureStatusDescription
    New API
    EXT-AUTH-01AExtend Authentication/Acct Status API
    EXT-AUTH-03AAccount Creation API
    EXT-AUTH-05APassword Management API
    EXT-AUTH-30AAuthority Management API

    Login

    FeatureStatusDescription
    Login
    EXT-AUTH-04ARewrite login, register, and admin pages to use APIs
    EXT-AUTH-38Aad_form complain feature
    EXT-AUTH-19ARewrite password recovery to use API
    EXT-AUTH-21ARewrite email verification with API
    EXT-AUTH-28AUsername is email switch

    Users will log in using a username, a authority, and a +

    Account Management (NO PICTURE YET)

    Batch Synchronization (NO PICTURE YET)

    Requirements

    New API

    FeatureStatusDescription
    New API
    EXT-AUTH-01AExtend Authentication/Acct Status API
    EXT-AUTH-03AAccount Creation API
    EXT-AUTH-05APassword Management API
    EXT-AUTH-30AAuthority Management API

    Login

    FeatureStatusDescription
    Login
    EXT-AUTH-04ARewrite login, register, and admin pages to use APIs
    EXT-AUTH-38Aad_form complain feature
    EXT-AUTH-19ARewrite password recovery to use API
    EXT-AUTH-21ARewrite email verification with API
    EXT-AUTH-28AUsername is email switch

    Users will log in using a username, a authority, and a password. The authority is the source for user/password verification. OpenACS can be an authority itself.

    Each user in OpenACS will belong to exactly one authority, which can either be the "local" OpenACS users table, in which case the @@ -54,12 +54,12 @@ by an authentication driver.

    Username will be separate from email address. It can be an email address, it can look like an email address but not be the name of an actual email mailbox, or it can be something else -entirely.

    We're assuming that user information (name, email, etc.) will +entirely.

    We're assuming that user information (name, email, etc.) will either already be in the users table through a batch synchronization job, or that the relevant authentication implementation supports real-time synchronization of user data. -Specifically, if you want remote users who haven't yet logged in to -OpenACS to show up in user searches, you'll have to do the batch +Specifically, if you want remote users who haven't yet logged in to +OpenACS to show up in user searches, you'll have to do the batch synchronization.

    All in all, the login box will be an includeable template and look like this:

     Username:  ________
    @@ -70,13 +70,13 @@
     
     [Forgot my password]
     [New user registration]
    -

    If there's only one active authority, we don't display the +

    If there's only one active authority, we don't display the authority drop-down element at all.

    Configuration

    FeatureStatusDescription
    Configuration
    EXT-AUTH-07AAdmin pages to control Ext-Auth parameters

    The site-wide systems administrator can configure the authentication process from a page linked under /acs-admin.

    • Authorities - ordered list of authorities defined

    • Account Registration Allowed: Yes/No. Account registration can be disabled altogether.

    • Registration authority - the authority in which accounts should be created, using the relevant driver, if account registration is allowed.

    • Username is email? - instead of asking for username, - we'll ask for email. And we'll store the value in both columns, + we'll ask for email. And we'll store the value in both columns, username and email. This is a setting that spans all authorities, and is primarily meant for backwards compatibility with the old OpenACS login process.

    The local authority driver is an encapsulation of current @@ -93,9 +93,9 @@ options.

  • AuthenticationAllowed - true/false, so you can disable login through some authority without having to delete the authority, and hence also all the users who belong to that authority.

  • ForgottenPasswordUrl - a URL to redirect to instead of - trying to use the authentication driver's password management + trying to use the authentication driver's password management features.

  • ChangePasswordUrl - a URL to redirect to instead of - trying to use the authentication driver's password management + trying to use the authentication driver's password management features.

  • Account Creation Driver, e.g. "RADIUS". In practice, this would be a reference to a service contract implementation. The reason we have separate drivers for authentication and account @@ -114,50 +114,50 @@ find a mechanism for the driver to tell us which configuration options are available, a way to set these, and a way for the driver to access these settings.

    OpenACS will come pre-configured with one authority, which is -the "local" authority, meaning we'll authenticate as normal using the +the "local" authority, meaning we'll authenticate as normal using the local users table. This will, just like any other authority, be implemetned using a service contract.

  • Synchronizing and Linking Users

    FeatureStatusDescription
    Synchronizing and linking users
    EXT-AUTH-28ACreate service contract for Batch Sync.
    EXT-AUTH-38ABatch User Synchronization API
    EXT-AUTH-38AIMS Synchronization driver
    EXT-AUTH-08AAutomation of batch Synchronization
    EXT-AUTH-15BOn-demand syncronization

    Regardless of the login method, the user needs to have a row in the OpenACS users table. This can happen through a batch job, in real-time, or both in combination. We use the IMS Enterprise 1.1 specification.

    Batch job means that we do a synchronization (import new users, modify changed, purge deleted) on a regular interval, e.g. every night. You can also decide to have a monthly full -synchronization, plus daily incremental ones. That's up to you. The +synchronization, plus daily incremental ones. That's up to you. The advantage is that you have all users in OpenACS, so when you search -for a user, you'll see all the organization's users, not just those +for a user, you'll see all the organization's users, not just those who happen to have used the OpenACS-based system. The down-side is that it takes some time for user information to propagate. This can be remedied by using the real-time solution. The batch job will also require error logging and an admin interface to view logs.

    If an email already belongs to some other user, we log it as an error.

    A user will always belong to exactly one authority, which can be -either the "local" authority or some other. Thus, the OpenACS user's +either the "local" authority or some other. Thus, the OpenACS user's table will have to be augmented with the following columns:

    • Authority. Reference to the site-wide authorities list. The authority which can authenticate this user.

    • Authority-specific username.

    Real-time means that the first time the user logs into -OpenACS, we'll query the authority that authenticated him +OpenACS, we'll query the authority that authenticated him for information about this user. That authentication authority will then give us at least first names, last name and email. The pros and cons are the opposite of batch jobs. Using both in combination is ideal.

    Note: One solution to the "two users from different authorities have the same email" problem above would be to allow users to belong to multiple authorities. Then we would notice that the email -already exists, ask the user if he thinks he's the same person, and +already exists, ask the user if he thinks he's the same person, and if so, ask him to prove so by authenticating using the other -authority. Thus he'll have just authenticated in two different -authorities, and we can record that this is the same person. We'd still +authority. Thus he'll have just authenticated in two different +authorities, and we can record that this is the same person. We'd still have a problem if there was an email conflict between two accounts -on the same authority. Hm. I don't think it's worth spending too much +on the same authority. Hm. I don't think it's worth spending too much time trying to solve this problem through software.

    FeatureStatusDescription
    EXT-AUTH-31
    EXT-AUTH-31AUpgrade user data model for ext-auth

    After having authenticated using the relevant authority driver, -we'll look for the username/authority pair in the users table.

    If we don't find any, that means that we're either not doing +we'll look for the username/authority pair in the users table.

    If we don't find any, that means that we're either not doing batch synchronizing, or that the user has been added since the last -sync. In that case, we'll try to do a real-time synchronization, if -the driver supports it. If it does, it'll return email, -first_names, last_name, and other relevant information, and we'll +sync. In that case, we'll try to do a real-time synchronization, if +the driver supports it. If it does, it'll return email, +first_names, last_name, and other relevant information, and we'll create a row in the local users table using that -information.

    If that doesn't work, we'll tell the user that their account -isn't yet available, and the driver will supply a message for us, +information.

    If that doesn't work, we'll tell the user that their account +isn't yet available, and the driver will supply a message for us, which could say "The account should be available tomorrow. If not, contact X."

    Account -Registration

    If a user doesn't have an account, the site-wide +Registration

    If a user doesn't have an account, the site-wide configuration can allow the user to register for one, as defined in the configuration discussed above. This section is about normal account registration through a authority driver.

    The account creation service contract implementation will @@ -175,32 +175,32 @@ the default local account creation above, also store the password in hashed form.

    Password Management

    Password management is about changing password, retrieving -password, and resetting password.

    It's up to the authority driver implementation to decide whether +password, and resetting password.

    It's up to the authority driver implementation to decide whether to support any or all of these features, and to say so using the CanXXX methods (see driver API below).

    Additionally, the authority can be configured with a URL to redirect to in the case of forgotten passwords, or when the user desires to change password.

    Login Pages Over HTTPS

    FeatureStatusDescription
    EXT-AUTH-20
    EXT-AUTH-20ALogin over HTTPS

    Login pages must be able to be sent over a secure connection -(https), so your password won't get sent over the wire in +(https), so your password won't get sent over the wire in cleartext, while leaving the rest of the site non-secure (http). I believe that this requires some (minor) changes to the current session handling code.

    Email Verification

    Email verification needs to be handled both at registration -and at login.

    In both cases, it'll be handled by the driver sending +and at login.

    In both cases, it'll be handled by the driver sending automatically sending the email containing a link for the user to verify his account. Then the driver will return an account status of "closed,temporary", and a message that says "Check your inbox and click the link in the email".

    OpenACS will have a page which receives the email verification, for use by local accounts. Other authorities will -have to implement their own page, most likely on the authority's +have to implement their own page, most likely on the authority's own server.

    Other Items

    There are a number of items which touch on external -authentication and session management. And even though they're not +authentication and session management. And even though they're not directly linked to external authentication, I would recommend that -we handle a number of them, either because they're important for -security, or because it makes sense to fix them while we're messing +we handle a number of them, either because they're important for +security, or because it makes sense to fix them while we're messing with this part of the codebase anyway.

    Recommended: -Untrusted Logins and Login Levels

    FeatureStatusDescription
    EXT-AUTH-33
    EXT-AUTH-33AUntrusted Logins

    I like the idea of having multiple login levels:

    1. Not logged in

    2. Untrusted login: We'll show you un-sensitive personal - content, but won't let you modify anything or see personal data. A +Untrusted Logins and Login Levels

    FeatureStatusDescription
    EXT-AUTH-33
    EXT-AUTH-33AUntrusted Logins

    I like the idea of having multiple login levels:

    1. Not logged in

    2. Untrusted login: We'll show you un-sensitive personal + content, but won't let you modify anything or see personal data. A normal login becomes untrusted after a certain amount of time, and the user will have to re-enter his/her password in order to gain access to personal data. Untrusted login never expires, unless @@ -211,14 +211,14 @@ specified amount of time.

    3. Secure login: The user is logged in over a secure connection (HTTPS), potentially even using a special secure password. This would be for sensitive actions, such as credit card - transactions.

    There are two advantages to this. First, when people's login + transactions.

    There are two advantages to this. First, when people's login expires, we can ask them to re-enter only their password, and not -both username and password, since we'll still remember who they +both username and password, since we'll still remember who they were the last time their login was valid. This is a much faster operation (the password input field will be focused by default, so you just type your password and hit Return) that typing both username and password, which will make it practical to have your -site configured to expire people's login after e.g. 2, 4, or 8 +site configured to expire people's login after e.g. 2, 4, or 8 hours.

    The other advantage is that we can still offer certain functionality to you, even when your login is not trusted. For example, we could let you browse publically available forums, and @@ -228,20 +228,20 @@ bounce to the login page if the user is only logged in at the untrusted level. Only if you explicitly say auth::require_login -untrusted will we give you -the user_id of a user who's only logged in in untrusted +the user_id of a user who's only logged in in untrusted mode.

    Similarly, ad_conn user_id will continue to return 0 (not logged in) when the user is only logged in -untrusted, and we'll supply another variable, ad_conn +untrusted, and we'll supply another variable, ad_conn untrusted_user_id, which wlll be set to the user_id for all login levels.

    This should ensure that we get full access to the new feature, while leaving all current code just as secure as it was before.

    Recommended: Make Non-Persistent Login Work

    FeatureStatusDescription
    EXT-AUTH-34
    EXT-AUTH-34AExpire Logins

    Currently, OpenACS is unusable in practice without persistent login. The login will expire after just a few minutes of -inactivity, and you'll get bounced to the login page where you have +inactivity, and you'll get bounced to the login page where you have to enter both email and password again. Unacceptable in practice.

    We should change the default, so a non-persistent login -doesn't expire until you either close your browser, or a few hours +doesn't expire until you either close your browser, or a few hours have elapsed. Even if you are constantly active, the login should still expire after at most x number of hours. We can still make the login expire after a period of inactivity, but the amount of time @@ -255,24 +255,24 @@ OpenACS accounts, we would instead present the normal login screen, but put a button which says "Login using X", where X is the redirection-based external authority.

    Recommended: -Expire All Logins

    FeatureStatusDescription
    EXT-AUTH-22
    EXT-AUTH-22Brewrite cookie handling

    Currently, if you've ever left a permanent login cookie on +Expire All Logins

    FeatureStatusDescription
    EXT-AUTH-22
    EXT-AUTH-22Brewrite cookie handling

    Currently, if you've ever left a permanent login cookie on someone elses machine, that person will be forever logged in until he/she explicitly logs out. You can change your password, you can do anything you want, but unless a logout is requested from that particular browser, that browser will be logged in forever.

    I want to change our session handling code so that old login cookies can be expired. This would be done automatically whenever you change your password, and we could also offer a link which does -this without changing passwords. It's an important security +this without changing passwords. It's an important security measure.

    The implementation is simply to autogenerate some secret token which is stored in the users table, and is also stored in the -cookie somehow. Then, whenever we want to expire all logins, we'll +cookie somehow. Then, whenever we want to expire all logins, we'll just regenerate a new secret token, and the other cookies will be -void. Of course, we don't want to incur a DB hit on every request, -so we'll need to cache the secret token, or only check it when +void. Of course, we don't want to incur a DB hit on every request, +so we'll need to cache the secret token, or only check it when refreshing the session cookie, which, I believe, normally happens every 10 minutes or so.

    Recommended: Email account owner on password change

    FeatureStatusDescription
    EXT-AUTH-24
    EXT-AUTH-24AEmail on password change

    As an additional security measure, we should email the -account's email address whenever the password is changed, so that +account's email address whenever the password is changed, so that he/she is at least alerted to the fact.

    Optional: Password policy

    FeatureStatusDescription
    EXT-AUTH-25
    EXT-AUTH-25AImplement password policy

    Again, to increase security, we should add password policies, such as passwords needing to be changed after a certain number of @@ -281,52 +281,52 @@ complexity rules, i.e. both upper and lowercase characters, numbers, special chars, etc.

    It would good to extend the current maximum password length from 10 to at least 32 characters.

    Optional: -Login Without Explicit Authority

    FeatureStatusDescription
    EXT-AUTH-26
    EXT-AUTH-26BLogin without explicit domain

    In order to make it easier for people, we've been toying with +Login Without Explicit Authority

    FeatureStatusDescription
    EXT-AUTH-26
    EXT-AUTH-26BLogin without explicit domain

    In order to make it easier for people, we've been toying with the idea of a functionality like this:

    • If the user enters "foobar@ix.urz.uni-heidelberg.de", it is translated to mean username = "foobar", authority = - "ix.urz.uni-heidelberg.de".

    • If the user enters "foobar", it's recognized to not + "ix.urz.uni-heidelberg.de".

    • If the user enters "foobar", it's recognized to not include any authority, and the default authority of - "ix.urz.uni-heidelberg.de" is used.

    • If the user enters "foo@bar.com", it's recognized as not - belonging to any known authority, and as such, it's translated to mean + "ix.urz.uni-heidelberg.de" is used.

    • If the user enters "foo@bar.com", it's recognized as not + belonging to any known authority, and as such, it's translated to mean username = "foo@bar.com", authority = "local".

    If this is deemed desirable, a way to implement this would be -through these settings:

    • Split: A regexp which will split the user's entry into +through these settings:

      • Split: A regexp which will split the user's entry into username and authority parts. For example "^([^@]+)(@[^@]+)?$". An easier to use but less flexible method would be that you simply specify a certain character to split by, such as "@" or "\". If the - regexp doesn't match, or in the latter case, if there's more than + regexp doesn't match, or in the latter case, if there's more than one occurrence of the specified character sequence, the split will - fail, signaling that the user's entry was not valid.

      • Default authority: The default authority will be the first one + fail, signaling that the user's entry was not valid.

      • Default authority: The default authority will be the first one in the sort order.

      The relevant code in user-login.tcl would look like this:

       if { ![auth::split_username -username_var username -authority_var authority] } {
      -    # bounce back to the form with a message saying that the login wasn't valid.
      +    # bounce back to the form with a message saying that the login wasn't valid.
           ad_script_abort
       }
       
       # username will now contain username
       # authority will now contain authority
      -

    Optional: Who's Online

    FeatureStatusDescription
    EXT-AUTH-27
    EXT-AUTH-27BWho's online list

    While we're touching the session handling code, anyway, it -would be nice to add a feature to show who's currently online, a +

    Optional: Who's Online

    FeatureStatusDescription
    EXT-AUTH-27
    EXT-AUTH-27BWho's online list

    While we're touching the session handling code, anyway, it +would be nice to add a feature to show who's currently online, a nice real-time collaboration feature frequently requested by members of the community. This is particularly interesting when integrated with a chat or instant messaging service like -Jabber.

    What I'm concretely suggesting is that we keep a record of +Jabber.

    What I'm concretely suggesting is that we keep a record of which authenticated users have requested pags on the site in the last x minutes (typically about 5), and thus are considered to be -currently online. There's nothing more to it. This lets us display +currently online. There's nothing more to it. This lets us display a list of "active users" somewhere on the site, and make their name -a link to a real-time chat service like Jabber.

    We've already made the changes necessary to -security-procs.tcl to do this on an earlier project, but haven't +a link to a real-time chat service like Jabber.

    We've already made the changes necessary to +security-procs.tcl to do this on an earlier project, but haven't quite finished the work and put it back into the tree.

    Optional: Subsite-level configuration

    FeatureStatusDescription
    EXT-AUTH-28
    EXT-AUTH-28implement subsite-level config

    If we want to, we could let subsite administrators configure the login process for that particular subsite. This would probably only entail letting the subsite admin leave out certain authorities defined site-wide, and change the sort order.

    I think we should leave this out until we have a use case for -it, someone who'd need it.

    Future: +it, someone who'd need it.

    Future: Making the Authentication API itself a service contract

    FeatureStatusDescription
    EXT-AUTH-32
    EXT-AUTH-32AParameters for Service Contract Implementation
    EXT-AUTH-35AMake the Authentication API a service contract

    For completely free-form authentication logic and mechanisms, -something like Andrew Grumet's +something like Andrew Grumet's Pluggable -Authentication for OACS Draft is interesting. He's +Authentication for OACS Draft is interesting. He's proposing a scheme where the entire user interaction is encapsulated in, and left entirely to, a service contract. This certainly opens up more advanced possibilities, such as perhaps @@ -340,35 +340,35 @@ Authenticating against multiple servers simultaneously

    FeatureStatusDescription
    EXT-AUTH-36
    EXT-AUTH-36AAuthenticate against multiple servers

    Both OKI and OpenACS supports a form of stacking, where you can be logged into multiple authorities at the same time. This is useful if, for example, you need to get login tokens such as -Kerberos tickets for access to shared resources.

    I can see the value in this, but for simplicity's sake, I'm +Kerberos tickets for access to shared resources.

    I can see the value in this, but for simplicity's sake, I'm in favor of keeping this use-case out of the loop until we have someone with a real requirement who could help us guide development.

    For now, OpenACS is still more of an integrated suite, it -doesn't access many outside applications. I think it would be +doesn't access many outside applications. I think it would be excellent for OpenACS to do so, e.g. by using an IMAP server to store emails, an iCal server to store calendar appointments, LDAP for user/group data and access control lists, SMB for file storage, -etc. But at the moment, we don't have any users of such things that -are ready. We have some who are on the steps, but let's wait till -they're there.

    Implement +etc. But at the moment, we don't have any users of such things that +are ready. We have some who are on the steps, but let's wait till +they're there.

    Implement Specific Drivers

    FeatureStatusDescription
    Implement specific drivers
    EXT-AUTH-09ACreate Auth. drivers for Local Authority
    EXT-AUTH-10ACreate Acct. Creation driver for Local Authority
    EXT-AUTH-11ACreate Auth. driver for PAM
    EXT-AUTH-12XCreate Acct. Creation driver for PAM - this - functionality is explicitly excluded from PAM
    EXT-AUTH-13ACreate Acct. Creation driver for LDAP
    EXT-AUTH-14ACreate Auth. driver for LDAP

    We'll need drivers for:

    • Operating system (Linux/Solaris) PAM: Delegate to the + functionality is explicitly excluded from PAMEXT-AUTH-13ACreate Acct. Creation driver for LDAPEXT-AUTH-14ACreate Auth. driver for LDAP

    We'll need drivers for:

    • Operating system (Linux/Solaris) PAM: Delegate to the operating system, which can then talk to RADIUS, LDAP, whatever. - This is convenient because there'll be plenty of drivers for the OS - PAM level, so we don't have to write them all ourselves. The - downside is that we can't do things like account creation, password + This is convenient because there'll be plenty of drivers for the OS + PAM level, so we don't have to write them all ourselves. The + downside is that we can't do things like account creation, password management, real-time account synchronization, etc., not supported - by PAM (I'm not entirely sure what is and is not + by PAM (I'm not entirely sure what is and is not supported).

    • RADIUS

    • LDAP

    RADIUS

    RADIUS is a simple username/password-type authentication server.

    It also supports sending a challenge to which the user must -respond with the proper answer (e.g. mother's maiden name, or could +respond with the proper answer (e.g. mother's maiden name, or could be additional password), but we will not support this feature.

    A RADIUS client implementation in Python can be found in the exUserFolder module for Zope -(documentation).

    Feedback

    We'd really appreciate feedback on this proposal. Please follow up at +(documentation).

    Feedback

    We'd really appreciate feedback on this proposal. Please follow up at this openacs.org forums thread.

    • When applicable, a careful demarcation between the functionality of this package and others which - at least superficially - appear to address the same requirements.

    - Note: it's entirely possible that a discussion of what a package + Note: it's entirely possible that a discussion of what a package is not intended to do differs from a discussion of future improvements for the package.

    Historical Considerations

    @@ -51,7 +51,7 @@ team needs to be ready for inquiries regarding features our software lacks.

    Note that such a discussion may differ from a discussion of a - package's potential future improvements. + package's potential future improvements.

    Design Tradeoffs

    No single design solution can optimize every desirable software attribute. For example, an increase in the security of a system will @@ -63,7 +63,7 @@ chosen, and the reasons for your choices. Some areas of importance to keep in mind are:

    Areas of interest to users:

    • Performance: availability and efficiency

    • Flexibility

    • Interoperability

    • Reliability and robustness

    • Usability

    Areas of interest to developers:

    • Maintainability

    • Portability

    • Reusability

    • Testability

    API

    - Here's where you discuss the abstractions used by your package, such + Here's where you discuss the abstractions used by your package, such as the procedures encapsulating the legal transactions on the data model. Explain the organization of procedures and their particulars (detail above and beyond what is documented in the @@ -75,7 +75,7 @@ Remember that the correctness, completeness, and stability of the API and interface are what experienced members of our audience are looking for. This is a cultural shift for us at aD (as of mid-year 2000), in - that we've previously always looked at the data models as key, and + that we've previously always looked at the data models as key, and seldom spent much effort on the API (e.g. putting raw SQL in pages to handle transactions, instead of encapsulating them via procedures). Experience has taught us that we need to focus on the API for @@ -102,8 +102,8 @@ you can organize by the expected classes of users. These may include:

    • Developers

    • OpenACS administrators (previously known as site-wide administrators)

    • Subsite administrators

    • End users

    You may want to include page mockups, site-maps, or other visual aids. - Ideally this section is informed by some prototyping you've done, to - establish the package's usability with the client and other interested + Ideally this section is informed by some prototyping you've done, to + establish the package's usability with the client and other interested parties.

    Note: In order that developer documentation be uniform across @@ -112,7 +112,7 @@ respectively.

    Finally, note that as our templating system becomes more entrenched - within the OpenACS, this section's details are likely to shift from UI + within the OpenACS, this section's details are likely to shift from UI specifics to template interface specifics.

    Configuration/Parameters

    Under OpenACS 5.9.0, parameters are set at two levels: at the global level by @@ -126,8 +126,8 @@ Note that a careful treatment of the earlier "competitive analysis" section can greatly facilitate the documenting of this section.

    Authors

    - Although a system's data model file often contains this information, - this isn't always the case. Furthermore, data model files often + Although a system's data model file often contains this information, + this isn't always the case. Furthermore, data model files often undergo substantial revision, making it difficult to track down the system creator. An additional complication: package documentation may be authored by people not directly involved in coding. Thus to avoid Index: openacs-4/packages/acs-core-docs/www/form-builder.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/form-builder.adp,v diff -u -N -r1.1.2.14 -r1.1.2.15 --- openacs-4/packages/acs-core-docs/www/form-builder.adp 30 Nov 2016 08:15:11 -0000 1.1.2.14 +++ openacs-4/packages/acs-core-docs/www/form-builder.adp 6 Jan 2017 09:18:41 -0000 1.1.2.15 @@ -13,8 +13,8 @@ dynamically

    Overview

    -
    ($‌Id: form-builder.html,v 1.30.2.12 2016/11/19 -09:21:53 gustafn Exp $)
    +
    ($‌Id: form-builder.xml,v 1.9.2.2 2016/06/23 +08:32:46 gustafn Exp $)
    OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

    OpenACS has a form manager called ad_form. Ad_form has an adaptable UI. Error handling includes inline error reporting, and @@ -25,7 +25,7 @@ Multi-part Elements

    Some elements have more than one choice, or can submit more than one value.

    -SELECT elements

    1. +SELECT elements
    1. Creating the form element. Populate a list of lists with values for the option list.

      @@ -106,7 +106,7 @@
       Errors

    Here are some common errors and what to do when you encounter them:

    -Error when selecting values

    This generally happens when there is an error in your query.

    +Error when selecting values

    This generally happens when there is an error in your query.

    Index: openacs-4/packages/acs-core-docs/www/form-builder.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/form-builder.html,v diff -u -N -r1.30.2.12 -r1.30.2.13 --- openacs-4/packages/acs-core-docs/www/form-builder.html 19 Nov 2016 09:21:53 -0000 1.30.2.12 +++ openacs-4/packages/acs-core-docs/www/form-builder.html 6 Jan 2017 09:18:41 -0000 1.30.2.13 @@ -6,7 +6,7 @@ adaptable UI. Error handling includes inline error reporting, and is customizable. However, ad_form can be tricky to use. In addition to this document, the ad_form api - documentation is helpful.

    Multi-part Elements

    Some elements have more than one choice, or can submit more than one value.

    SELECT elements

    1. Creating the form element. Populate a list of lists with values for the option list.

      set foo_options [db_list_of_lists foo_option_list "
      + documentation is helpful.

    Multi-part Elements

    Some elements have more than one choice, or can submit more than one value.

    SELECT elements

    1. Creating the form element. Populate a list of lists with values for the option list.

      set foo_options [db_list_of_lists foo_option_list "
           select foo,
                  foo_id
             from foos
      @@ -29,20 +29,20 @@
           }
           

      What this will do is set the value for pm_task_id and all the other form elements, and resubmit the form. If you then include a - block that extends the form, you'll have the opportunity to add in + block that extends the form, you'll have the opportunity to add in subcategories:

          if {[info exists pm_task_id] && $pm_task_id ne ""} {
           db_1row get_task_values { }
           ad_form -extend -name form_name -form { ... }
           

      Note that you will get strange results when you try to set - the values for the form. You'll need to set them explicitly in an - -on_refresh section of your ad_form. In that section, you'll get + the values for the form. You'll need to set them explicitly in an + -on_refresh section of your ad_form. In that section, you'll get the values from the database, and set the values as so:

          db_1row get_task_values { }
           template::element set_value form_name estimated_hours_work $estimated_hours_work
      -    

    Troubleshooting

    A good way to troubleshoot when you're using ad_form is to +

    Troubleshooting

    A good way to troubleshoot when you're using ad_form is to add the following code at the top of the .tcl page (thanks Jerry Asher):

    -ns_log notice it's my page!
    +ns_log notice it's my page!
     set mypage [ns_getform]
     if {$mypage eq ""} {
         ns_log notice no form was submitted on my page
    @@ -51,5 +51,5 @@
         ns_set print $mypage
     }
         

    Tips for form widgets

    Here are some tips for dealing with some of the form widgets:

    Current widget

    Common Errors

    Here are some common errors and what to do when you - encounter them:

    Error when selecting values

    This generally happens when there is an error in your + encounter them:

    Error when selecting values

    This generally happens when there is an error in your query.

    Index: openacs-4/packages/acs-core-docs/www/groups-design.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/groups-design.html,v diff -u -N -r1.34.2.3 -r1.34.2.4 --- openacs-4/packages/acs-core-docs/www/groups-design.html 19 Nov 2016 09:21:53 -0000 1.34.2.3 +++ openacs-4/packages/acs-core-docs/www/groups-design.html 6 Jan 2017 09:18:41 -0000 1.34.2.4 @@ -13,14 +13,14 @@ that contains only users: The user_groups table may contain the group_id of a parent group, but parent-child relationship support is limited because it only allows one kind of relationship between -groups to be represented. Moreover, the Oracle database's limited support +groups to be represented. Moreover, the Oracle database's limited support for tree-like structures makes the queries over these relationships expensive.

    In addition, the Module Scoping design in OpenACS 3.0 introduced a party abstraction - a thing that is a person or a group of people - though not in the form of an explicit table. Rather, the triple of scope, user_id, and group_id columns was used to identify the party. One disadvantage of this design convention is -that it increases a data model's complexity by requiring the programmer +that it increases a data model's complexity by requiring the programmer to:

    • add these three columns to each "scoped" table

    • define a multi-column check constraint to protect against data corruption (e.g., a row with a scope value of "group" but a null group_id)

    • perform extra checks in Tcl and PL/SQL @@ -45,11 +45,11 @@

      The set of all defined persons. To allow easy sorting of persons, the name requirement 30.10 is met by -splitting the person's name into two columns: first_names and +splitting the person's name into two columns: first_names and last_name.

      users

      The set of all registered users; this table includes information about -the user's email address and the user's visits to the site.

      user_preferences +the user's email address and the user's visits to the site.

      user_preferences

      Preferences for the user.

      groups @@ -76,9 +76,9 @@ When a specialized type of group is required, the group type can be extended by an application developer. Membership constraints can be specified at creation time by passing a parent group to the constructor.

      The membership_rels and composition_rels tables indicate -a group's direct members and direct components; these tables do not +a group's direct members and direct components; these tables do not provide a record of the members or components that are in the group by virtue -of being a member or component of one of the group's component groups. +of being a member or component of one of the group's component groups. Site pages will query group membership often, but the network of component groups can become a very complex directed acyclic graph and traversing this graph for every query will quickly degrade performance. To make membership @@ -162,7 +162,7 @@ person_id persons.person_id%TYPE ) return varchar;

      User

      acs_user.new creates a new user and returns the user_id. -The function must be given the user's email address and the full name of +The function must be given the user's email address and the full name of the user in two pieces: first_names and last_name. All other fields are optional. The interface for this function is:

       function acs_user.new (
      @@ -194,7 +194,7 @@
         user_id       users.user_id%TYPE
       ) return varchar;
       

      Use the procedures acs_user.approve_email and -acs_user.unapprove_email to specify whether the user's email +acs_user.unapprove_email to specify whether the user's email address is valid. The interface for these procedures are:

       procedure acs_user.approve_email (
         user_id       users.user_id%TYPE
      @@ -232,7 +232,7 @@
         party_id      parties.party_id%TYPE,
       ) return char;
       

      Membership Relationship

      membership_rel.new creates a new membership relationship type -between two parties and returns the relationship type's rel_id. +between two parties and returns the relationship type's rel_id. All fields are optional and default to null except for rel_type which defaults to membership_rel. The interface for this function is:

       function membership_rel.new (
      @@ -278,7 +278,7 @@
         rel_id           membership_rels.rel_id%TYPE
       );
       

      Composition Relationship

      composition_rel.new creates a new composition relationship type -and returns the relationship's rel_id. All fields are optional +and returns the relationship's rel_id. All fields are optional and default to null except for rel_type which defaults to composition_rel. The interface for this function is:

       function membership_rel.new (
      Index: openacs-4/packages/acs-core-docs/www/groups-requirements.html
      ===================================================================
      RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/groups-requirements.html,v
      diff -u -N -r1.34.2.4 -r1.34.2.5
      --- openacs-4/packages/acs-core-docs/www/groups-requirements.html	19 Nov 2016 09:21:53 -0000	1.34.2.4
      +++ openacs-4/packages/acs-core-docs/www/groups-requirements.html	6 Jan 2017 09:18:41 -0000	1.34.2.5
      @@ -8,26 +8,26 @@
             particularly to support powerful subsite services; that is, where one OpenACS
             installation can support what appears to the user as distinct web services
             for different user communities.

    Vision Statement

    A powerful web service that can meet the needs of large enterprises must - be able to model the the real world's very rich organizational structures + be able to model the the real world's very rich organizational structures and many ways of decomposing the same organization. For example, a corporation can be broken into structures (the corporation, its divisions, and their departments) or regions (the Boston office, the LA office); a person who is employed by (is a member of) a specific department is also a member of the division and the corporation, and works at (is a member of, but - in a different sense) a particular office. OpenACS's Parties and Groups + in a different sense) a particular office. OpenACS's Parties and Groups system will support such complex relations faithfully.

    Historical Motivations

    The primary limitation of the OpenACS 3.x user group system is that it restricts the application developer to representing a "flat group" that contains only users: The user_groups table may contain the group_id of a parent group, but parent-child relationship support is limited because it only allows one kind of relationship between - groups to be represented. Moreover, the Oracle database's limited support + groups to be represented. Moreover, the Oracle database's limited support for tree-like structures makes the queries over these relationships expensive.

    In addition, the Module Scoping design in OpenACS 3.0 introduced a party abstraction - a thing that is a person or a group of people - though not in the form of an explicit table. Rather, the triple of scope, user_id, and group_id columns was used to identify the party. One disadvantage of this design convention is - that it increases a data model's complexity by requiring the programmer + that it increases a data model's complexity by requiring the programmer to:

    • add these three columns to each "scoped" table

    • define a multi-column check constraint to protect against data corruption (e.g., a row with a scope value of "group" but a null group_id)

    • perform extra checks in Tcl and PL/SQL @@ -63,7 +63,7 @@ modeled as groups, and Eddie would be a user. There would be a composition relationship between each Sierra Club chapter and the Sierra Club. Membership relationships would exist between Eddie and the Massachusetts Chapter, - between Eddie and the Sierra Club (due to Eddie's membership in the + between Eddie and the Sierra Club (due to Eddie's membership in the Massachusetts chapter), and between the Sierra Club and Greenpeace.

      Membership requirements can vary from group to group. The parties and groups system must provide a base type that specifies the bare minimum necessary to join a group.

      The parties and groups system must support constraints between a composite @@ -165,12 +165,12 @@ component of a second group. This API is subject to the constraints laid out in the data model.

      120.0 Remove a party as a member of a group -

      The parties and groups system provides an API for deleting a party's +

      The parties and groups system provides an API for deleting a party's membership in a group. This API is subject to the constraints laid out in the data model.

      125.0 Remove a group as a component of a second group -

      The parties and groups system provides an API for deleting a group's +

      The parties and groups system provides an API for deleting a group's composition in a second group. This API is subject to the constraints laid out in the data model.

      130.0 Membership check Index: openacs-4/packages/acs-core-docs/www/high-avail.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/high-avail.adp,v diff -u -N -r1.1.2.13 -r1.1.2.14 --- openacs-4/packages/acs-core-docs/www/high-avail.adp 19 Nov 2016 09:21:53 -0000 1.1.2.13 +++ openacs-4/packages/acs-core-docs/www/high-avail.adp 6 Jan 2017 09:18:41 -0000 1.1.2.14 @@ -13,7 +13,7 @@ Configurations

    See also the section called “Running a PostgreSQL database on another server”.

    -

    Figure 6.1. Multiple-server +

    Figure 6.1. Multiple-server configuration

    Multiple-server configuration

    Index: openacs-4/packages/acs-core-docs/www/high-avail.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/high-avail.html,v diff -u -N -r1.24.2.12 -r1.24.2.13 --- openacs-4/packages/acs-core-docs/www/high-avail.html 19 Nov 2016 09:21:53 -0000 1.24.2.12 +++ openacs-4/packages/acs-core-docs/www/high-avail.html 6 Jan 2017 09:18:41 -0000 1.24.2.13 @@ -1,2 +1,2 @@ -High Availability/High Performance Configurations

    High Availability/High Performance Configurations

    See also the section called “Running a PostgreSQL database on another server”.

    Figure 6.1. Multiple-server configuration

    Multiple-server configuration

    +High Availability/High Performance Configurations

    High Availability/High Performance Configurations

    See also the section called “Running a PostgreSQL database on another server”.

    Figure 6.1. Multiple-server configuration

    Multiple-server configuration

    Index: openacs-4/packages/acs-core-docs/www/how-do-I.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/how-do-I.adp,v diff -u -N -r1.1.2.12 -r1.1.2.13 --- openacs-4/packages/acs-core-docs/www/how-do-I.adp 19 Nov 2016 09:21:53 -0000 1.1.2.12 +++ openacs-4/packages/acs-core-docs/www/how-do-I.adp 6 Jan 2017 09:18:41 -0000 1.1.2.13 @@ -12,20 +12,20 @@

    How Do I?

    -How do I edit the front page of a new site +How do I edit the front page of a new site through a web interface?

    The easiest way is to install the Edit-This-Page package.

    1. Log in to the web site as an administrator.

    2. Click on Admin > Install Software > Install from OpenACS Repository / Install new application

    3. Choose Edit This Page and install

    4. Follow the instructions within Edit This Page (the link will only work after Edit This Page is installed).

    -How do I let anybody who registers post to +How do I let anybody who registers post to a weblog?

    Go to /admin/permissions and grant Create to Registered Users

    -How do I replace the front page of a new +How do I replace the front page of a new site with the front page of an application on that site

    Suppose you install a new site and install Weblogger, and you want all visitors to see weblogger automatically.

    1. On the front page, click the Admin button.

    2. On the administration page, click Parameters link.

    3. Change the parameter IndexRedirectUrl to be the URI of the @@ -35,7 +35,7 @@

    -How do I put custom functionality on front +How do I put custom functionality on front page of a new site?

    Every page within an OpenACS site is part of a subsiteMore information). The home page of the entire site is the front page is a special, default instance of a subsite, served from /var/lib/aolserver/$OPENACS_SERVICE_NAME/www. If an @@ -50,7 +50,7 @@

    -How do I change the site-wide style?

    Almost all pages on an OpenACS site use ACS Templating, and so +How do I change the site-wide style?

    Almost all pages on an OpenACS site use ACS Templating, and so their appearance is driven by a layer of different files. Let's examine how this works:

    • @@ -74,12 +74,12 @@ navigation "meta" elements such as Translator widgets and Admin widgets.

    -

    Figure 4.1. Site +

    Figure 4.1. Site Templates

    Site Templates

    -How do I diagnose a permissions +How do I diagnose a permissions problem?

    • @@ -124,12 +124,12 @@

    • To grant permissions on a package, start at the site map. Find the event package and click "Set permissions".

    • Click "Grant Permission"

    • Grant the write permission to Registered Users.

      -

      Figure 4.2. Granting +

      Figure 4.2. Granting Permissions

      Granting Permissions

    OpenACS 5.0 offers a prettier version at /admin/applications.

    -

    Figure 4.3. Granting Permissions in +

    Figure 4.3. Granting Permissions in 5.0

    Granting Permissions in 5.0

    Index: openacs-4/packages/acs-core-docs/www/how-do-I.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/how-do-I.html,v diff -u -N -r1.27.2.12 -r1.27.2.13 --- openacs-4/packages/acs-core-docs/www/how-do-I.html 19 Nov 2016 09:21:53 -0000 1.27.2.12 +++ openacs-4/packages/acs-core-docs/www/how-do-I.html 6 Jan 2017 09:18:41 -0000 1.27.2.13 @@ -1,7 +1,7 @@ -How Do I?

    How Do I?

    How do I edit the front page of a new site through a web interface?

    The easiest way is to install the Edit-This-Page package.

    1. Log in to the web site as an administrator.

    2. Click on Admin > Install Software > Install from OpenACS Repository / Install new application

    3. Choose Edit This Page and install

    4. Follow the instructions within Edit This Page (the link will only work after Edit This Page is installed).

    How do I let anybody who registers post to a weblog?

    Go to /admin/permissions and grant Create to Registered Users

    How do I replace the front page of a new site with the front page of an application on that site

    Suppose you install a new site and install Weblogger, and you want all visitors to see weblogger automatically.

    1. On the front page, click the Admin button.

    2. On the administration page, click Parameters link.

    3. Change the parameter IndexRedirectUrl to be the URI of the desired application. For a default weblogger installation, this would be weblogger/. Note the trailing slash.

    How do I put custom functionality on front page of a new site?

    Every page within an OpenACS site is part of a subsite More information). The home page of the entire site is the front page is a special, default instance of a subsite, served from /var/lib/aolserver/$OPENACS_SERVICE_NAME/www. If an index page is not found there, the default index page for all subsites is used. To customize the code on the front page, copy the default index page from the Subsite package to the Main site and edit it:

    1. cp /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/acs-subsite/www/index* /var/lib/aolserver/$OPENACS_SERVICE_NAME/www
    2. Edit the new index.adp to change the text; you shouldn't need to edit index.tcl unless you are adding new functionality.

    How do I change the site-wide style?

    Almost all pages on an OpenACS site use ACS Templating, and so their appearance is driven by a layer of different files. Let's examine how this works:

    • +How Do I?

      How Do I?

      How do I edit the front page of a new site through a web interface?

      The easiest way is to install the Edit-This-Page package.

      1. Log in to the web site as an administrator.

      2. Click on Admin > Install Software > Install from OpenACS Repository / Install new application

      3. Choose Edit This Page and install

      4. Follow the instructions within Edit This Page (the link will only work after Edit This Page is installed).

      How do I let anybody who registers post to a weblog?

      Go to /admin/permissions and grant Create to Registered Users

      How do I replace the front page of a new site with the front page of an application on that site

      Suppose you install a new site and install Weblogger, and you want all visitors to see weblogger automatically.

      1. On the front page, click the Admin button.

      2. On the administration page, click Parameters link.

      3. Change the parameter IndexRedirectUrl to be the URI of the desired application. For a default weblogger installation, this would be weblogger/. Note the trailing slash.

      How do I put custom functionality on front page of a new site?

      Every page within an OpenACS site is part of a subsite More information). The home page of the entire site is the front page is a special, default instance of a subsite, served from /var/lib/aolserver/$OPENACS_SERVICE_NAME/www. If an index page is not found there, the default index page for all subsites is used. To customize the code on the front page, copy the default index page from the Subsite package to the Main site and edit it:

      1. cp /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/acs-subsite/www/index* /var/lib/aolserver/$OPENACS_SERVICE_NAME/www
      2. Edit the new index.adp to change the text; you shouldn't need to edit index.tcl unless you are adding new functionality.

      How do I change the site-wide style?

      Almost all pages on an OpenACS site use ACS Templating, and so their appearance is driven by a layer of different files. Let's examine how this works:

      • A templated page uses an ADP/Tcl pair. The first line in the ADP file is usually:

        <master>

        If it appears exactly like this, without any arguments, the template processer uses default-master for that subsite. For pages in /var/lib/aolserver/$OPENACS_SERVICE_NAME/www, this is /var/lib/aolserver/$OPENACS_SERVICE_NAME/www/default-master.adp and the associated .tcl file. -

      • The default-master is itself a normal ADP page. It draws the subsite navigation elements and invokes site-master (/var/lib/aolserver/$OPENACS_SERVICE_NAME/www/site-master.adp and .tcl)

      • The site-master draws site-wide navigation elements and invokes blank-master (/var/lib/aolserver/$OPENACS_SERVICE_NAME/www/blank-master.adp and .tcl).

      • Blank-master does HTML housekeeping and provides a framework for special sitewide navigation "meta" elements such as Translator widgets and Admin widgets.

      Figure 4.1. Site Templates

      Site Templates

      How do I diagnose a permissions problem?

      • Steps to Reproduce. The events package does not allow users to register for new events.

        1. Go to the http://yourserver.net/events as a visitor (ie, log out and, if necessary, clear cookies). This in on a 4.6.3 site with events version 0.1d3.

        2. Select an available event

        3. A link such as Registration: Deadline is 03/15/2004 10:00am. +

        4. The default-master is itself a normal ADP page. It draws the subsite navigation elements and invokes site-master (/var/lib/aolserver/$OPENACS_SERVICE_NAME/www/site-master.adp and .tcl)

        5. The site-master draws site-wide navigation elements and invokes blank-master (/var/lib/aolserver/$OPENACS_SERVICE_NAME/www/blank-master.adp and .tcl).

        6. Blank-master does HTML housekeeping and provides a framework for special sitewide navigation "meta" elements such as Translator widgets and Admin widgets.

      Figure 4.1. Site Templates

      Site Templates

      How do I diagnose a permissions problem?

      • Steps to Reproduce. The events package does not allow users to register for new events.

        1. Go to the http://yourserver.net/events as a visitor (ie, log out and, if necessary, clear cookies). This in on a 4.6.3 site with events version 0.1d3.

        2. Select an available event

        3. A link such as Registration: Deadline is 03/15/2004 10:00am. » Login or sign up to register for this event. is visible. Click on "Login or sign up" -

        4. Complete a new registration. Afterwards, you should be redirected back to the same page.

        Actual Results: The page says "You do not have permission to register for this event."

        Expected results: A link or form to sign up for the event is shown.

      • Finding the problem. We start with the page that has the error. In the URL it's http://myserver.net/events/event-info.tcl, so open the file /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/events/www/event-info.tcl. It contains this line:

        set can_register_p [events::security::can_register_for_event_p -event_id $event_id]

        We need to know what that procedure does, so go to /api-doc, paste events::security::can_register_for_event_p into the ACS Tcl API Search box, and click Feeling Lucky. The next pages shows the proc, and we click "show source" to see more information. The body of the proc is simply

        return [permission::permission_p -party_id $user_id -object_id $event_id -privilege write]

        This means that a given user must have the write privilige on the event in order to register. Let's assume that the priviliges inherit, so that if a user has the write privilige on the whole package, they will have the write privilege on the event.

      • Setting Permissions. A permission has three parts: the privilige, the object of the privilige, and the subject being granted the privilige. In this case the privilige is "write," the object is the Events package, and the subject is all Registered Users.

        1. To grant permissions on a package, start at the site map. Find the event package and click "Set permissions".

        2. Click "Grant Permission"

        3. Grant the write permission to Registered Users.

          Figure 4.2. Granting Permissions

          Granting Permissions

        OpenACS 5.0 offers a prettier version at /admin/applications.

        Figure 4.3. Granting Permissions in 5.0

        Granting Permissions in 5.0

      +

    • Complete a new registration. Afterwards, you should be redirected back to the same page.

    Actual Results: The page says "You do not have permission to register for this event."

    Expected results: A link or form to sign up for the event is shown.

  • Finding the problem. We start with the page that has the error. In the URL it's http://myserver.net/events/event-info.tcl, so open the file /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/events/www/event-info.tcl. It contains this line:

    set can_register_p [events::security::can_register_for_event_p -event_id $event_id]

    We need to know what that procedure does, so go to /api-doc, paste events::security::can_register_for_event_p into the ACS Tcl API Search box, and click Feeling Lucky. The next pages shows the proc, and we click "show source" to see more information. The body of the proc is simply

    return [permission::permission_p -party_id $user_id -object_id $event_id -privilege write]

    This means that a given user must have the write privilige on the event in order to register. Let's assume that the priviliges inherit, so that if a user has the write privilige on the whole package, they will have the write privilege on the event.

  • Setting Permissions. A permission has three parts: the privilige, the object of the privilige, and the subject being granted the privilige. In this case the privilige is "write," the object is the Events package, and the subject is all Registered Users.

    1. To grant permissions on a package, start at the site map. Find the event package and click "Set permissions".

    2. Click "Grant Permission"

    3. Grant the write permission to Registered Users.

      Figure 4.2. Granting Permissions

      Granting Permissions

    OpenACS 5.0 offers a prettier version at /admin/applications.

    Figure 4.3. Granting Permissions in 5.0

    Granting Permissions in 5.0

  • Index: openacs-4/packages/acs-core-docs/www/i18n-convert.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/i18n-convert.adp,v diff -u -N -r1.1.2.15 -r1.1.2.16 --- openacs-4/packages/acs-core-docs/www/i18n-convert.adp 19 Nov 2016 09:21:53 -0000 1.1.2.15 +++ openacs-4/packages/acs-core-docs/www/i18n-convert.adp 6 Jan 2017 09:18:41 -0000 1.1.2.16 @@ -154,7 +154,7 @@

    -Avoiding common i18n mistakes

      +Avoiding common i18n mistakes
    • Replace complicated keys with longer, simpler Index: openacs-4/packages/acs-core-docs/www/i18n-convert.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/i18n-convert.html,v diff -u -N -r1.26.2.14 -r1.26.2.15 --- openacs-4/packages/acs-core-docs/www/i18n-convert.html 19 Nov 2016 09:21:53 -0000 1.26.2.14 +++ openacs-4/packages/acs-core-docs/www/i18n-convert.html 6 Jan 2017 09:18:41 -0000 1.26.2.15 @@ -36,9 +36,9 @@ See Multilingual APM Parameters

    • Internationalize Date and Time queries. 

      1. Find datetime in .xql files. Use command line tools to find suspect SQL code:

        grep -r "to_char.*H" *
         grep -r "to_date.*H" *
        -
      2. In SQL statements, replace the format string with the ANSI standard format, YYYY-MM-DD HH24:MI:SS and change the field name to *_ansi so that it cannot be confused with previous, improperly formatting fields. For example,

        to_char(timestamp,'MM/DD/YYYY HH:MI:SS') as foo_date_pretty

        becomes

        to_char(timestamp,'YYYY-MM-DD HH24:MI:SS') as foo_date_ansi
      3. In Tcl files where the date fields are used, convert the datetime from local server timezone, which is how it's stored in the database, to the user's timezone for display. Do this with the localizing function lc_time_system_to_conn:

        -set foo_date_ansi [lc_time_system_to_conn $foo_date_ansi]

        When a datetime will be written to the database, first convert it from the user's local time to the server's timezone with lc_time_conn_to_system. -

      4. When a datetime field will be displayed, format it using the localizing function lc_time_fmt. lc_time_fmt takes two parameters, datetime and format code. Several format codes are usable for localization; they are placeholders that format dates with the appropriate codes for the user's locale. These codes are: %x, %X, %q, %Q, and %c.

        set foo_date_pretty [lc_time_fmt $foo_date_ansi "%x %X"]

        +

      5. In SQL statements, replace the format string with the ANSI standard format, YYYY-MM-DD HH24:MI:SS and change the field name to *_ansi so that it cannot be confused with previous, improperly formatting fields. For example,

        to_char(timestamp,'MM/DD/YYYY HH:MI:SS') as foo_date_pretty

        becomes

        to_char(timestamp,'YYYY-MM-DD HH24:MI:SS') as foo_date_ansi
      6. In Tcl files where the date fields are used, convert the datetime from local server timezone, which is how it's stored in the database, to the user's timezone for display. Do this with the localizing function lc_time_system_to_conn:

        +set foo_date_ansi [lc_time_system_to_conn $foo_date_ansi]

        When a datetime will be written to the database, first convert it from the user's local time to the server's timezone with lc_time_conn_to_system. +

      7. When a datetime field will be displayed, format it using the localizing function lc_time_fmt. lc_time_fmt takes two parameters, datetime and format code. Several format codes are usable for localization; they are placeholders that format dates with the appropriate codes for the user's locale. These codes are: %x, %X, %q, %Q, and %c.

        set foo_date_pretty [lc_time_fmt $foo_date_ansi "%x %X"]

        Use the _pretty version in your ADP page.

        • %c: Long date and time (Mon November 18, 2002 12:00 AM) @@ -69,10 +69,10 @@

          where package_key is the key of the package that you want to - test. If you don't provide the package_key argument then all + test. If you don't provide the package_key argument then all packages with catalog files will be checked. The script will run its checks primarily on en_US xml catalog files. -

      Avoiding common i18n mistakes

      • Replace complicated keys with longer, simpler keys. When writing in one language, it is possible to create clever code to make correct text. In English, for example, you can put an if command at the end of a word which adds "s" if a count is anything but 1. This pluralizes nouns correctly based on the data. However, it is confusing to read and, when internationalized, may result in message keys that are both confusing and impossible to set correctly in some languages. While internationalizing, watch out that the automate converter does not create such keys. Also, refactor compound text as you encounter it.

        The automated system can easily get confused by tags within message texts, so that it tries to create two or three message keys for one long string with a tag in the middle. In these cases, uncheck those keys during the conversion and then edit the files directly. For example, this code:

          <p class="form-help-text"><b>Invitations</b> are sent,
        +      

      Avoiding common i18n mistakes

      • Replace complicated keys with longer, simpler keys. When writing in one language, it is possible to create clever code to make correct text. In English, for example, you can put an if command at the end of a word which adds "s" if a count is anything but 1. This pluralizes nouns correctly based on the data. However, it is confusing to read and, when internationalized, may result in message keys that are both confusing and impossible to set correctly in some languages. While internationalizing, watch out that the automate converter does not create such keys. Also, refactor compound text as you encounter it.

        The automated system can easily get confused by tags within message texts, so that it tries to create two or three message keys for one long string with a tag in the middle. In these cases, uncheck those keys during the conversion and then edit the files directly. For example, this code:

          <p class="form-help-text"><b>Invitations</b> are sent,
                   when this wizard is completed and casting begins.</p>

        has a bold tag which confuses the converter into thinking there are two message keys for the text beginning "Invitations ..." where there should be one:

        Instead, we cancel those keys, edit the file manually, and put in a single temporary message tag:

          <p class="form-help-text"> <#Invitations_are_sent <b>Invitations</b> are sent, 
         when this wizard is completed and casting begins.#>
           </p>

        Complex if statements may produce convoluted message keys that are very hard to localize. Rewrite these if statements. For example:

        Select which case <if @simulation.casting_type@ eq "open">and
        @@ -128,7 +128,7 @@
           </if><else>
             <a href="@components.view_bugs_url@" title="#­bug-tracker.View_the_bug_fo_component#">#­bug-tracker.N_bugs#</a>
           </else>
        -</if>
      • Don't combine keys in display text. Converting a phrase from one language to another is usually more complicated than simply replacing each word with an equivalent. When several keys are concatenated, the resulting word order will not be correct for every language. Different languages may use expressions or idioms that don't match the phrase key-for-key. Create complete, distinct keys instead of building text from several keys. For example:

        Original code:

        multirow append links "New [bug_tracker::conn Bug]" 

        Problematic conversion:

        multirow append links "[_ bug-tracker.New] [bug_tracker::conn Bug]"

        Better conversion:

        set bug_label [bug_tracker::conn Bug]
        +</if>
      • Don't combine keys in display text. Converting a phrase from one language to another is usually more complicated than simply replacing each word with an equivalent. When several keys are concatenated, the resulting word order will not be correct for every language. Different languages may use expressions or idioms that don't match the phrase key-for-key. Create complete, distinct keys instead of building text from several keys. For example:

        Original code:

        multirow append links "New [bug_tracker::conn Bug]" 

        Problematic conversion:

        multirow append links "[_ bug-tracker.New] [bug_tracker::conn Bug]"

        Better conversion:

        set bug_label [bug_tracker::conn Bug]
         multirow append links "[_ bug-tracker.New_Bug]" "${url_prefix}bug-add"

        ... and include the variable in the key: "New %bug_label%". This gives translators more control over the phrase.

        In this example of bad i18n, full name is created by concatenating first and last name (admittedly this is pervasive in the toolkit):

        <a href="@past_version.maintainer_url@" title="#­bug-tracker.Email# @past_version.maintainer_email@">
         @past_version.maintainer_first_names@ @past_version.maintainer_last_name@</a>
      • Avoid unnecessary duplicate keys. When phrases are exactly the same in several places, use a single key.

        For common words such as Yes and No, you can use a library of keys at acs-kernel. @@ -141,22 +141,22 @@ across different locales.

        Additional discussion: Re: Bug 961 ("Control Panel" displayed instead of "Administer"), Translation - server upgraded, and Localization questions.

      • Don't internationalize internal code words. Many packages use code words or key words, such as "open" and "closed", which will never be shown to the user. They may match key values in the database, or be used in a switch or if statement. Don't change these.

        For example, the original code is

        workflow::case::add_log_data \ 	    
        +            server upgraded, and Localization questions.

      • Don't internationalize internal code words. Many packages use code words or key words, such as "open" and "closed", which will never be shown to the user. They may match key values in the database, or be used in a switch or if statement. Don't change these.

        For example, the original code is

        workflow::case::add_log_data \ 	    
                -entry_id $entry_id \ 	    
                -key "resolution" \ 	    
                -value [db_string select_resolution_code {}]

        This is incorrectly internationalized to

          workflow::case::add_log_data \ 	    
                -entry_id $entry_id \
                -key "[_ bug-tracker.resolution]" \
        -       -value [db_string select_resolution_code {}]

        But resolution is a keyword in a table and in the code, so this breaks the code. It should not have been internationalized at all. Here's another example of text that should not have been internationalized:

        {show_patch_status "open"}

        It is broken if changed to

        {show_patch_status "[_ bug-tracker.open]"}
      • Fix automatic truncated message keys. The automatic converter may create unique but crytic message keys. Watch out for these and replace them with more descriptive keys. For example:

        +       -value [db_string select_resolution_code {}]

        But resolution is a keyword in a table and in the code, so this breaks the code. It should not have been internationalized at all. Here's another example of text that should not have been internationalized:

        {show_patch_status "open"}

        It is broken if changed to

        {show_patch_status "[_ bug-tracker.open]"}
      • Fix automatic truncated message keys. The automatic converter may create unique but crytic message keys. Watch out for these and replace them with more descriptive keys. For example:

         <msg key="You">You can filter by this %component_name% by viisting %filter_url_string%</msg>
         <msg key="You_1">You do not have permission to map this patch to a bug. Only the submitter of the patch 
         and users with write permission on this Bug Tracker project (package instance) may do so.</msg>
         <msg key="You_2">You do not have permission to edit this patch. Only the submitter of the patch 
        -and users with write permission on the Bug Tracker project (package instance) may do so.</msg>

        These would be more useful if they were, "you_can_filter", "you_do_not_have_permission_to_map_this_patch", and "you_do_not_have_permission_to_edit_this_patch". Don't worry about exactly matching the english text, because that might change; instead try to capture the meaning of the phrase. Ask yourself, if I was a translator and didn't know how this application worked, would this key and text make translation easy for me? -

        Sometimes the automatic converter creates keys that don't semantically match their text. Fix these:

        <msg key="Fix">for version</msg>
        +and users with write permission on the Bug Tracker project (package instance) may do so.</msg>

        These would be more useful if they were, "you_can_filter", "you_do_not_have_permission_to_map_this_patch", and "you_do_not_have_permission_to_edit_this_patch". Don't worry about exactly matching the english text, because that might change; instead try to capture the meaning of the phrase. Ask yourself, if I was a translator and didn't know how this application worked, would this key and text make translation easy for me? +

        Sometimes the automatic converter creates keys that don't semantically match their text. Fix these:

        <msg key="Fix">for version</msg>
         <msg key="Fix_1">for</msg>
         <msg key="Fix_2">for Bugs</msg>

        Another example: Bug-tracker component maintainer was converted to [_ bug-tracker.Bug-tracker]. Instead, it should be bug_tracker_component_maintainer.

      • Translations in Avoid "clever" message reuse. Translations may need to differ depending on the context in which the message appears.

      • Avoid plurals. Different languages create plurals differently. Try to avoid keys which will change based on the value of a number. OpenACS does not currently support internationalization of plurals. If you use two different keys, a plural and a singular form, your application will not localize properly for locales which use different rules or have more than two forms of plurals.

      • Quoting in the message catalog for tcl. Watch out for quoting and escaping when editing text that is also code. For example, the original string

        set title "Patch \"$patch_summary\" is nice."

        breaks if the message text retains all of the escaping that was in the tcl command:

        <msg>Patch \"$patch_summary\" is nice.</msg>

        When it becomes a key, it should be:

        <msg>Patch "$patch_summary" is nice.</msg>

        Also, some keys had %var;noquote%, which is not needed since those - variables are not quoted (and in fact the variable won't even be - recognized so you get the literal %var;noquote% in the output).

      • Be careful with curly brackets. Code within curly brackets isn't evaluated. Tcl uses curly brackets as an alternative way to build lists. But Tcl also uses curly brackets as an alternative to quotation marks for quoting text. So this original code

        array set names { key "Pretty" ...} 

        ... if converted to

        array set names { key "[_bug-tracker.Pretty]" ...} 

        ... won't work since the _ func will not be called. Instead, it should be

        array set names [list key [_bug-tracker.Pretty] ...]
      + variables are not quoted (and in fact the variable won't even be + recognized so you get the literal %var;noquote% in the output).

    • Be careful with curly brackets. Code within curly brackets isn't evaluated. Tcl uses curly brackets as an alternative way to build lists. But Tcl also uses curly brackets as an alternative to quotation marks for quoting text. So this original code

      array set names { key "Pretty" ...} 

      ... if converted to

      array set names { key "[_bug-tracker.Pretty]" ...} 

      ... won't work since the _ func will not be called. Instead, it should be

      array set names [list key [_bug-tracker.Pretty] ...]
    Index: openacs-4/packages/acs-core-docs/www/i18n-design.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/i18n-design.html,v diff -u -N -r1.16.2.3 -r1.16.2.4 --- openacs-4/packages/acs-core-docs/www/i18n-design.html 19 Nov 2016 09:21:53 -0000 1.16.2.3 +++ openacs-4/packages/acs-core-docs/www/i18n-design.html 6 Jan 2017 09:18:41 -0000 1.16.2.4 @@ -1,3 +1,3 @@ -Design Notes

    Design Notes

    User locale is a property of ad_conn, ad_conn locale. The request processor sets this by calling lang::conn::locale, which looks for the following in order of precedence:

    1. Use user preference for this package (stored in ad_locale_user_prefs)

    2. Use system preference for the package (stored in apm_packages)

    3. Use user's general preference (stored in user_preferences)

    4. Use Browser header (Accept-Language HTTP header)

    5. Use system locale (an APM parameter for acs_lang)

    6. default to en_US

    For ADP pages, message key lookup occurs in the templating engine. For Tcl pages, message key lookup happens with the _ function. In both cases, if the requested locale is not found but a locale which is the default for the language which matches your locale's language is -found, then that locale is offered instead.

    +Design Notes

    Design Notes

    User locale is a property of ad_conn, ad_conn locale. The request processor sets this by calling lang::conn::locale, which looks for the following in order of precedence:

    1. Use user preference for this package (stored in ad_locale_user_prefs)

    2. Use system preference for the package (stored in apm_packages)

    3. Use user's general preference (stored in user_preferences)

    4. Use Browser header (Accept-Language HTTP header)

    5. Use system locale (an APM parameter for acs_lang)

    6. default to en_US

    For ADP pages, message key lookup occurs in the templating engine. For Tcl pages, message key lookup happens with the _ function. In both cases, if the requested locale is not found but a locale which is the default for the language which matches your locale's language is +found, then that locale is offered instead.

    Index: openacs-4/packages/acs-core-docs/www/i18n-introduction.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/i18n-introduction.html,v diff -u -N -r1.18.2.7 -r1.18.2.8 --- openacs-4/packages/acs-core-docs/www/i18n-introduction.html 19 Nov 2016 09:21:53 -0000 1.18.2.7 +++ openacs-4/packages/acs-core-docs/www/i18n-introduction.html 6 Jan 2017 09:18:41 -0000 1.18.2.8 @@ -33,7 +33,7 @@ which are static and mostly text, it may be easier to create a new ADP page for each language. In this case, the pages are distinguished by a file naming convention. -

    User Content

    OpenACS does not have a general system for supporting multiple, localized versions of user-input content. This document currently refers only to internationalizing the text in the package user interface.

    Separate Templates for each Locale

    If the request processor finds a file named filename.locale.adp, where locale matches the user's locale, it will process that file instead of filename.adp. For example, for a user with locale tl_PH, the file index.tl_PH.adp, if found, will be used instead of index.adp. The locale-specific file should thus contain text in the language appropriate for that locale. The code in the page, however, should still be in English. Message keys are processed normally.

    Message Catalogs

    Message Keys in Template Files (ADP Files)

    +

    User Content

    OpenACS does not have a general system for supporting multiple, localized versions of user-input content. This document currently refers only to internationalizing the text in the package user interface.

    Separate Templates for each Locale

    If the request processor finds a file named filename.locale.adp, where locale matches the user's locale, it will process that file instead of filename.adp. For example, for a user with locale tl_PH, the file index.tl_PH.adp, if found, will be used instead of index.adp. The locale-specific file should thus contain text in the language appropriate for that locale. The code in the page, however, should still be in English. Message keys are processed normally.

    Message Catalogs

    Message Keys in Template Files (ADP Files)

    Internationalizing templates is about replacing human readable text in a certain language with internal message keys, which can then be dynamically replaced with real human language in @@ -52,7 +52,7 @@ The short: #package_key.message_key#

    - The advantage of the short syntax is that it's short. It's + The advantage of the short syntax is that it's short. It's as simple as inserting the value of a variable. Example: <span>#</span>forum.title#

  • @@ -64,8 +64,8 @@ The verbose syntax allows you to specify a default text in a certain language. This syntax is not recommended anymore, but it can be convenient for development, because - it still works even if you haven't created the message - in the message catalog yet, because what it'll do is + it still works even if you haven't created the message + in the message catalog yet, because what it'll do is create the message key with the default text from the tag as the localized message. Example: <trn key="forum.title" locale="en_US">Title</trn> @@ -76,7 +76,7 @@

    This syntax has been designed to make it easy to internationalize existing pages. This is not a syntax that - stays in the page. As you'll see later, it'll be replaced + stays in the page. As you'll see later, it'll be replaced with the short syntax by a special feature of the APM. You may leave out the message_key by writing an underscore (_) character instead, in which case a message key will be @@ -88,8 +88,8 @@ \#package_key.message_key\#. In Tcl files all message lookups *must* be on either of the following formats:

    -

    • Typical static key lookup: [_ package_key.message_key] - The message key and package key used here must be string literals, they can't result from variable evaluation.

    • - Static key lookup with non-default locale: [lang::message::lookup $locale package_key.message_key] - The message key and package key used here must be string literals, they can't result from variable evaluation.

    • +

      • Typical static key lookup: [_ package_key.message_key] - The message key and package key used here must be string literals, they can't result from variable evaluation.

      • + Static key lookup with non-default locale: [lang::message::lookup $locale package_key.message_key] - The message key and package key used here must be string literals, they can't result from variable evaluation.

      • Dynamic key lookup: [lang::util::localize $var_with_embedded_message_keys] - In this case the message keys in the variable var_with_embedded_message_keys must appear as string literals \#package_key.message_key\# somewhere in the code. Here is an example of a dynamic lookup: set message_key_array { dynamic_key_1 \#package_key.message_key1\# @@ -162,7 +162,7 @@ # in curly braces (should return nothing, or possibly a few lines for inspection) find -iname '*.tcl'|xargs egrep -i '\{.*<#' -# Check if you've forgotten space between default key and text in message tags (should return nothing) +# Check if you've forgotten space between default key and text in message tags (should return nothing) find -iname '*.tcl'|xargs egrep -i '<#_[^ ]' # Review the list of tcl files with no message lookups @@ -171,19 +171,19 @@ When you feel ready you may vist your package in the package manager and run the action "Replace tags with keys - and insert into catalog" on the Tcl files that you've edited to + and insert into catalog" on the Tcl files that you've edited to replace the temporary tags with calls to the message lookup procedure.

        Dates, Times, and Numbers in Tcl files

        Most date, time, and number variables are calculated in Tcl files. Dates and times must be converted when stored in the database, when retrieved from the database, and when displayed. All dates - are stored in the database in the server's timezone, which is an + are stored in the database in the server's timezone, which is an APM Parameter set at /acs-lang/admin/set-system-timezone and readable at lang::system::timezone.. When retrieved from the database and displayed, dates and times must - be localized to the user's locale. + be localized to the user's locale.

      APM Parameters

      Some parameters contain text that need to be localized. In this case, instead of storing the real text in the parameter, @@ -198,7 +198,7 @@ Here are a couple of examples. Say we have the following two parameters, taken directly from the dotlrn package.

      Parameter NameParameter Value
      class_instance_pages_csv<span>#</span>dotlrn.class_page_home_title#,Simple 2-Column;<span>#</span>dotlrn.class_page_calendar_title#,Simple 1-Column;<span>#</span>dotlrn.class_page_file_storage_title#,Simple 1-Column
      departments_pretty_name<span>#</span>departments_pretty_name#

      - Then, depending on how we retrieve the value, here's what we get: + Then, depending on how we retrieve the value, here's what we get:

      Command used to retrieve ValueRetrieved Value
      parameter::get -localize -parameter class_instances_pages_csvKurs Startseite,Simple 2-Column;Kalender,Simple 1-Column;Dateien,Simple 1-Column
      parameter::get -localize -parameter departments_pretty_nameAbteilung
      parameter::get -parameter departments_pretty_name<span>#</span>departments_pretty_name#

      The value in the rightmost column in the table above is the value returned by an invocation of parameter::get. Note that Index: openacs-4/packages/acs-core-docs/www/i18n-overview.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/i18n-overview.html,v diff -u -N -r1.16.2.3 -r1.16.2.4 --- openacs-4/packages/acs-core-docs/www/i18n-overview.html 19 Nov 2016 09:21:53 -0000 1.16.2.3 +++ openacs-4/packages/acs-core-docs/www/i18n-overview.html 6 Jan 2017 09:18:41 -0000 1.16.2.4 @@ -1,2 +1,2 @@ -Internationalization and Localization Overview

      Internationalization and Localization Overview

      Table 14.1. Internationalization and Localization Overview

      StageTaskWho
      InternationalizationPackage Developer uses the acs-lang tools to replace all visible text in a package with message keys. (More information)Package Developer
      Release ManagementThe newly internationalized package is released.Package Developer
      The translation server is updated with the new package.Translation server maintainers
      LocalizationTranslators work in their respective locales to write text for each message key. (More information)Translators
      Release ManagementThe translated text in the database of the translation server is compared to the current translations in the OpenACS code base, conflicts are resolved, and the new text is written to catalog files on the translation server.Translation server maintainers
      The catalog files are committed to the OpenACS code base.Translation server maintainers
      A new version of OpenACS core and/or affected packages is released and published in the OpenACS.org repository.Release Manager
      UpgradingSite Administrators upgrade their OpenACS sites, either via the automatic upgrade from the Repository or via tarball or CVS Site Administrators
      Site Administrators import the new translations. Existing local translations, if they exist, are not overwritten.Site Administrators

      +Internationalization and Localization Overview

      Internationalization and Localization Overview

      Table 14.1. Internationalization and Localization Overview

      StageTaskWho
      InternationalizationPackage Developer uses the acs-lang tools to replace all visible text in a package with message keys. (More information)Package Developer
      Release ManagementThe newly internationalized package is released.Package Developer
      The translation server is updated with the new package.Translation server maintainers
      LocalizationTranslators work in their respective locales to write text for each message key. (More information)Translators
      Release ManagementThe translated text in the database of the translation server is compared to the current translations in the OpenACS code base, conflicts are resolved, and the new text is written to catalog files on the translation server.Translation server maintainers
      The catalog files are committed to the OpenACS code base.Translation server maintainers
      A new version of OpenACS core and/or affected packages is released and published in the OpenACS.org repository.Release Manager
      UpgradingSite Administrators upgrade their OpenACS sites, either via the automatic upgrade from the Repository or via tarball or CVS Site Administrators
      Site Administrators import the new translations. Existing local translations, if they exist, are not overwritten.Site Administrators

      Index: openacs-4/packages/acs-core-docs/www/i18n-requirements.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/i18n-requirements.html,v diff -u -N -r1.26.2.4 -r1.26.2.5 --- openacs-4/packages/acs-core-docs/www/i18n-requirements.html 19 Nov 2016 09:21:53 -0000 1.26.2.4 +++ openacs-4/packages/acs-core-docs/www/i18n-requirements.html 6 Jan 2017 09:18:41 -0000 1.26.2.5 @@ -18,7 +18,7 @@ capability of making itself adaptable to the requirements of different native languages, local customs and coded character sets.

      locale

      - The definition of the subset of a user's environment that depends on + The definition of the subset of a user's environment that depends on language and cultural conventions.

      localization (L10n)

      The process of establishing information within a computer system @@ -82,7 +82,7 @@ content and navigation in multiple languages.

      The site would have an end-user visible UI to support these languages, and the content management system must allow articles to be posted in these languages. In some cases it may be necessary to -make the modules' admin UI's operate in more than one +make the modules' admin UI's operate in more than one supported language, while in other cases the backend admin interface can operate in a single language.

    • A developer is writing a new module, and wants to make it easy for someone to localize it. There should be a clear path to @@ -94,7 +94,7 @@ Analysis

  • Other application servers: ATG Dyanmo, Broadvision, Vignette, ... ? Anyone know how they deal with i18n ?

    Related Links

    Tcl Source File Character Set

    There are two classes of Tcl files loaded by the system; library files loaded at server startup, and page script files, which are run on each page request.

    Should we require all Tcl files be stored as UTF8? That seems too much of a burden on developers.

    50.10 Tcl library files can be authored @@ -198,7 +198,7 @@ override the default system choice of character set when parsing and validating user form data. INCOMPLETE - form widgets in acs-templating/tcl/date-procs.tcl are not - internationalized. Also, acs-templating's UI needs to be + internationalized. Also, acs-templating's UI needs to be internationalized by replacing all user-visible strings with message keys.

    50.30.10In Japan and some other Asian languages where there are multiple character set @@ -243,7 +243,7 @@ data to the content repository as well

    Sorting and Searching

    80.10 Support API for correct collation (sorting order) on lists of strings in locale-dependent way.

    80.20 For the Tcl API, we will say that locale-dependent sorting will use Oracle SQL operations (i.e., we -won't provide a Tcl API for this). We require a Tcl API +won't provide a Tcl API for this). We require a Tcl API function to return the correct incantation of NLS_SORT to use for a given locale with ORDER BY clauses in queries.

    80.40 The system must handle full-text @@ -256,7 +256,7 @@ universal time zone, UTC.

    90.40 For a registered users, a time zone preference should be stored.

    90.50 For a non-registered user a time zone preference should be attached via a session or else UTC should -be used to display every date and time.

    90.60 The default if we can't +be used to display every date and time.

    90.60 The default if we can't determine a time zone is to display all dates and times in some universal time zone such as GMT.

    Database

    100.10 Since UTF8 strings can use up to three (UCS2) or six (UCS4) bytes per character, make sure that Index: openacs-4/packages/acs-core-docs/www/i18n-translators.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/i18n-translators.html,v diff -u -N -r1.16.2.3 -r1.16.2.4 --- openacs-4/packages/acs-core-docs/www/i18n-translators.html 19 Nov 2016 09:21:53 -0000 1.16.2.3 +++ openacs-4/packages/acs-core-docs/www/i18n-translators.html 6 Jan 2017 09:18:41 -0000 1.16.2.4 @@ -1,2 +1,2 @@ -Translator's Guide

    Translator's Guide

    Most translators use the OpenACS Public Translation Server, because the process of getting new message keys onto the server and getting new translations back into the distribution are handled by the maintainers of that machine. You can also do translation work on your own OpenACS site; this makes your own translations more readily available to you but also means that your work will not be shared with other users unless you take extra steps (contacting an OpenACS core developer or submitting a patch) to get your work back to the OpenACS core.

    The basic steps for translators:

    • Go to the Localization page and choose the locale that you are translating to. If the locale is not present you need to visit Administration of Localization and create the locale.

    • Translating with Translator Mode. To translate messages in the pages they appear, Toggle Translator Mode and then browse to the page you want to translate. Untranslated messages will have a yellow background and a red star that you click to translate the message. Translated messages have a green star next to them that is a hyperlink to editing your translation. There is a history mechanism that allows you to see previous translations in case you would want to revert a translation.

      While in Translator mode, a list of all message keys appears at the bottom of each page.

    • Batch translation. To translate many messages at once, go to Administration of Localization, click on the locale to translate, then click on a package, and then click Batch edit these messages.

    When creating a new locale based on an existing one, such as creating the Guatamalan version of Spanish, you can copy the existing locale's catalog files using the script /packages/acs-core-docs/www/files/create-new-catalog.sh.

    +Translator's Guide

    Translator's Guide

    Most translators use the OpenACS Public Translation Server, because the process of getting new message keys onto the server and getting new translations back into the distribution are handled by the maintainers of that machine. You can also do translation work on your own OpenACS site; this makes your own translations more readily available to you but also means that your work will not be shared with other users unless you take extra steps (contacting an OpenACS core developer or submitting a patch) to get your work back to the OpenACS core.

    The basic steps for translators:

    • Go to the Localization page and choose the locale that you are translating to. If the locale is not present you need to visit Administration of Localization and create the locale.

    • Translating with Translator Mode. To translate messages in the pages they appear, Toggle Translator Mode and then browse to the page you want to translate. Untranslated messages will have a yellow background and a red star that you click to translate the message. Translated messages have a green star next to them that is a hyperlink to editing your translation. There is a history mechanism that allows you to see previous translations in case you would want to revert a translation.

      While in Translator mode, a list of all message keys appears at the bottom of each page.

    • Batch translation. To translate many messages at once, go to Administration of Localization, click on the locale to translate, then click on a package, and then click Batch edit these messages.

    When creating a new locale based on an existing one, such as creating the Guatamalan version of Spanish, you can copy the existing locale's catalog files using the script /packages/acs-core-docs/www/files/create-new-catalog.sh.

    Index: openacs-4/packages/acs-core-docs/www/i18n.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/i18n.html,v diff -u -N -r1.34.2.3 -r1.34.2.4 --- openacs-4/packages/acs-core-docs/www/i18n.html 19 Nov 2016 09:21:53 -0000 1.34.2.3 +++ openacs-4/packages/acs-core-docs/www/i18n.html 6 Jan 2017 09:18:41 -0000 1.34.2.4 @@ -1,5 +1,5 @@ -Chapter 14. Internationalization

    Chapter 14. Internationalization

    +Chapter 14. Internationalization

    Chapter 14. Internationalization

    By Peter Marklund and Lars Pind

    Index: openacs-4/packages/acs-core-docs/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/index.adp,v diff -u -N -r1.26.2.14 -r1.26.2.15 --- openacs-4/packages/acs-core-docs/www/index.adp 19 Nov 2016 09:21:53 -0000 1.26.2.14 +++ openacs-4/packages/acs-core-docs/www/index.adp 6 Jan 2017 09:18:41 -0000 1.26.2.15 @@ -9,7 +9,7 @@

    -OpenACS Core Documentation


    +OpenACS Core Documentation

    Table of Contents

    I. OpenACS For Index: openacs-4/packages/acs-core-docs/www/index.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/index.html,v diff -u -N -r1.53.2.12 -r1.53.2.13 --- openacs-4/packages/acs-core-docs/www/index.html 19 Nov 2016 09:21:53 -0000 1.53.2.12 +++ openacs-4/packages/acs-core-docs/www/index.html 6 Jan 2017 09:18:41 -0000 1.53.2.13 @@ -1,4 +1,4 @@ -OpenACS Core Documentation

    OpenACS Core Documentation


    Table of Contents

    I. OpenACS For Everyone
    1. High level information: What is OpenACS?
    Overview
    OpenACS Release Notes
    II. Administrator's Guide
    2. Installation Overview
    Basic Steps
    Prerequisite Software
    3. Complete Installation
    Install a Unix-like system and supporting software
    Install Oracle 8.1.7
    Install PostgreSQL
    Install AOLserver 4
    Install OpenACS 5.9.0
    OpenACS Installation Guide for Windows
    OpenACS Installation Guide for Mac OS X
    4. Configuring a new OpenACS Site
    Installing OpenACS packages
    Mounting OpenACS packages
    Configuring an OpenACS package
    Setting Permissions on an OpenACS package
    How Do I?
    5. Upgrading
    Overview
    Upgrading 4.5 or higher to 4.6.3
    Upgrading OpenACS 4.6.3 to 5.0
    Upgrading an OpenACS 5.0.0 or greater installation
    Upgrading the OpenACS files
    Upgrading Platform components
    6. Production Environments
    Starting and Stopping an OpenACS instance.
    AOLserver keepalive with inittab
    Running multiple services on one machine
    High Availability/High Performance Configurations
    Staged Deployment for Production Networks
    Installing SSL Support for an OpenACS service
    Set up Log Analysis Reports
    External uptime validation
    Diagnosing Performance Problems
    7. Database Management
    Running a PostgreSQL database on another server
    Deleting a tablespace
    Vacuum Postgres nightly
    8. Backup and Recovery
    Backup Strategy
    Manual backup and recovery
    Automated Backup
    Using CVS for backup-recovery
    A. Install Red Hat 8/9
    B. Install additional supporting software
    Unpack the OpenACS tarball
    Initialize CVS (OPTIONAL)
    Add PSGML commands to emacs init file (OPTIONAL)
    Install Daemontools (OPTIONAL)
    Install qmail (OPTIONAL)
    Install Analog web file analyzer
    Install nspam
    Install Full Text Search using Tsearch2
    Install Full Text Search using OpenFTS (deprecated see tsearch2)
    Install nsopenssl
    Install tclwebtest.
    Install PHP for use in AOLserver
    Install Squirrelmail for use as a webmail system for OpenACS
    Install PAM Radius for use as external authentication
    Install LDAP for use as external authentication
    Install AOLserver 3.3oacs1
    C. Credits
    Where did this document come from?
    Linux Install Guides
    Security Information
    Resources
    III. For OpenACS Package Developers
    9. Development Tutorial
    Creating an Application Package
    Setting Up Database Objects
    Creating Web Pages
    Debugging and Automated Testing
    10. Advanced Topics
    Write the Requirements and Design Specs
    Add the new package to CVS
    OpenACS Edit This Page Templates
    Adding Comments
    Admin Pages
    Categories
    Profile your code
    Prepare the package for distribution.
    Distributing upgrades of your package
    Notifications
    Hierarchical data
    Using .vuh files for pretty urls
    Laying out a page with CSS instead of tables
    Sending HTML email from your application
    Basic Caching
    Scheduled Procedures
    Enabling WYSIWYG
    Adding in parameters for your package
    Writing upgrade scripts
    Connect to a second database
    Future Topics
    11. Development Reference
    OpenACS Packages
    OpenACS Data Models and the Object System
    The Request Processor
    The OpenACS Database Access API
    Using Templates in OpenACS
    Groups, Context, Permissions
    Writing OpenACS Application Pages
    Parties in OpenACS
    OpenACS Permissions Tediously Explained
    Object Identity
    Programming with AOLserver
    Using Form Builder: building html forms dynamically
    12. Engineering Standards
    OpenACS Style Guide
    +OpenACS Core Documentation

    OpenACS Core Documentation


    Table of Contents

    I. OpenACS For Everyone
    1. High level information: What is OpenACS?
    Overview
    OpenACS Release Notes
    II. Administrator's Guide
    2. Installation Overview
    Basic Steps
    Prerequisite Software
    3. Complete Installation
    Install a Unix-like system and supporting software
    Install Oracle 8.1.7
    Install PostgreSQL
    Install AOLserver 4
    Install OpenACS 5.9.0
    OpenACS Installation Guide for Windows
    OpenACS Installation Guide for Mac OS X
    4. Configuring a new OpenACS Site
    Installing OpenACS packages
    Mounting OpenACS packages
    Configuring an OpenACS package
    Setting Permissions on an OpenACS package
    How Do I?
    5. Upgrading
    Overview
    Upgrading 4.5 or higher to 4.6.3
    Upgrading OpenACS 4.6.3 to 5.0
    Upgrading an OpenACS 5.0.0 or greater installation
    Upgrading the OpenACS files
    Upgrading Platform components
    6. Production Environments
    Starting and Stopping an OpenACS instance.
    AOLserver keepalive with inittab
    Running multiple services on one machine
    High Availability/High Performance Configurations
    Staged Deployment for Production Networks
    Installing SSL Support for an OpenACS service
    Set up Log Analysis Reports
    External uptime validation
    Diagnosing Performance Problems
    7. Database Management
    Running a PostgreSQL database on another server
    Deleting a tablespace
    Vacuum Postgres nightly
    8. Backup and Recovery
    Backup Strategy
    Manual backup and recovery
    Automated Backup
    Using CVS for backup-recovery
    A. Install Red Hat 8/9
    B. Install additional supporting software
    Unpack the OpenACS tarball
    Initialize CVS (OPTIONAL)
    Add PSGML commands to emacs init file (OPTIONAL)
    Install Daemontools (OPTIONAL)
    Install qmail (OPTIONAL)
    Install Analog web file analyzer
    Install nspam
    Install Full Text Search using Tsearch2
    Install Full Text Search using OpenFTS (deprecated see tsearch2)
    Install nsopenssl
    Install tclwebtest.
    Install PHP for use in AOLserver
    Install Squirrelmail for use as a webmail system for OpenACS
    Install PAM Radius for use as external authentication
    Install LDAP for use as external authentication
    Install AOLserver 3.3oacs1
    C. Credits
    Where did this document come from?
    Linux Install Guides
    Security Information
    Resources
    III. For OpenACS Package Developers
    9. Development Tutorial
    Creating an Application Package
    Setting Up Database Objects
    Creating Web Pages
    Debugging and Automated Testing
    10. Advanced Topics
    Write the Requirements and Design Specs
    Add the new package to CVS
    OpenACS Edit This Page Templates
    Adding Comments
    Admin Pages
    Categories
    Profile your code
    Prepare the package for distribution.
    Distributing upgrades of your package
    Notifications
    Hierarchical data
    Using .vuh files for pretty urls
    Laying out a page with CSS instead of tables
    Sending HTML email from your application
    Basic Caching
    Scheduled Procedures
    Enabling WYSIWYG
    Adding in parameters for your package
    Writing upgrade scripts
    Connect to a second database
    Future Topics
    11. Development Reference
    OpenACS Packages
    OpenACS Data Models and the Object System
    The Request Processor
    The OpenACS Database Access API
    Using Templates in OpenACS
    Groups, Context, Permissions
    Writing OpenACS Application Pages
    Parties in OpenACS
    OpenACS Permissions Tediously Explained
    Object Identity
    Programming with AOLserver
    Using Form Builder: building html forms dynamically
    12. Engineering Standards
    OpenACS Style Guide
    CVS Guidelines -
    Release Version Numbering
    Constraint naming standard
    ACS File Naming and Formatting Standards
    PL/SQL Standards
    Variables
    Automated Testing
    13. Documentation Standards
    OpenACS Documentation Guide
    Using PSGML mode in Emacs
    Using nXML mode in Emacs
    Detailed Design Documentation Template
    System/Application Requirements Template
    14. Internationalization
    Internationalization and Localization Overview
    How Internationalization/Localization works in OpenACS
    How to Internationalize a Package
    Design Notes
    Translator's Guide
    D. Using CVS with an OpenACS Site
    IV. For OpenACS Platform Developers
    15. Kernel Documentation
    Overview
    Object Model Requirements
    Object Model Design
    Permissions Requirements
    Permissions Design
    Groups Requirements
    Groups Design
    Subsites Requirements
    Subsites Design Document
    Package Manager Requirements
    Package Manager Design
    Database Access API
    OpenACS Internationalization Requirements
    Security Requirements
    Security Design
    Security Notes
    Request Processor Requirements
    Request Processor Design
    Documenting Tcl Files: Page Contracts and Libraries
    Bootstrapping OpenACS
    External Authentication Requirements
    16. Releasing OpenACS
    OpenACS Core and .LRN
    How to Update the OpenACS.org repository
    How to package and release an OpenACS Package
    How to Update the translations
    Index
    +
    Release Version Numbering
    Constraint naming standard
    ACS File Naming and Formatting Standards
    PL/SQL Standards
    Variables
    Automated Testing
    13. Documentation Standards
    OpenACS Documentation Guide
    Using PSGML mode in Emacs
    Using nXML mode in Emacs
    Detailed Design Documentation Template
    System/Application Requirements Template
    14. Internationalization
    Internationalization and Localization Overview
    How Internationalization/Localization works in OpenACS
    How to Internationalize a Package
    Design Notes
    Translator's Guide
    D. Using CVS with an OpenACS Site
    IV. For OpenACS Platform Developers
    15. Kernel Documentation
    Overview
    Object Model Requirements
    Object Model Design
    Permissions Requirements
    Permissions Design
    Groups Requirements
    Groups Design
    Subsites Requirements
    Subsites Design Document
    Package Manager Requirements
    Package Manager Design
    Database Access API
    OpenACS Internationalization Requirements
    Security Requirements
    Security Design
    Security Notes
    Request Processor Requirements
    Request Processor Design
    Documenting Tcl Files: Page Contracts and Libraries
    Bootstrapping OpenACS
    External Authentication Requirements
    16. Releasing OpenACS
    OpenACS Core and .LRN
    How to Update the OpenACS.org repository
    How to package and release an OpenACS Package
    How to Update the translations
    Index
    Index: openacs-4/packages/acs-core-docs/www/individual-programs.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/individual-programs.adp,v diff -u -N -r1.1.2.9 -r1.1.2.10 --- openacs-4/packages/acs-core-docs/www/individual-programs.adp 30 Nov 2016 08:15:11 -0000 1.1.2.9 +++ openacs-4/packages/acs-core-docs/www/individual-programs.adp 6 Jan 2017 09:18:41 -0000 1.1.2.10 @@ -316,8 +316,8 @@ from development to production, or get or contribute development code from openacs.org.

    -
    ($‌Id: individual-programs.html,v 1.33.2.13 -2016/11/19 09:21:53 gustafn Exp $)
    +
    ($‌Id: software.xml,v 1.26.2.2 2016/10/03 +09:17:51 gustafn Exp $)
    • GNU/Linux. The installation assumes a linux kernel of 2.2.22 or newer, or 2.4.14 or newer.

    • FreeBSD. FreeBSD guide. The OpenACS Reference Platform uses shell scripts written for bash, which is the standard Linux shell. If you are using a different - shell, you will need to substitute your shell's + shell, you will need to substitute your shell's conventions for setting environment variables when appropriate, and install bash to work with the scripts. Substitute fetch when the instructions suggest you use wget to download software.

    • Mac OS X. the section called “OpenACS Installation Guide for Mac OS X”

    • Windows/VMWare. the section called “OpenACS Installation Guide for Windows” The only @@ -48,7 +48,7 @@ queries in XML files, so we use an AOLserver module called tDOM to parse these files. (This replaces libxml2, which was used prior to 4.6.4.)

    • tclwebtest, OPTIONAL. tclwebtest is a tool for testing web interfaces via Tcl scripts.

    • Web Server. The web server handles incoming HTTP requests, provides - a runtime environment for OpenACS's Tcl code, connects to the + a runtime environment for OpenACS's Tcl code, connects to the database, sends out HTTP responses, and logs requests and errors. OpenACS uses AOLserver; some people have had success running Apache with mod_nsd.

      • AOLserver 4.x, REQUIRED. Provides the base HTTP server

      @@ -58,15 +58,15 @@ distribution. He also has binaries for SuSE 7.3 and OpenBSD 2.8 (and perhaps more to come), currently located at uptime.openacs.org.

      - It's also possible to download all the pieces and patches yourself: + It's also possible to download all the pieces and patches yourself:

      • AOLserver is available at aolserver.com

      • The OpenACS PostgreSQL driver (nspostgres.so) is available from SourceForge. If you do decide to use nspostgres.so, you have to remember to change the AOLserver config file to point to nspostgres.so - instead of postgres.so. This guide uses Mat Kovach's distro + instead of postgres.so. This guide uses Mat Kovach's distro (i.e. postgres.so)

      • Index: openacs-4/packages/acs-core-docs/www/install-cvs.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-cvs.adp,v diff -u -N -r1.1.2.12 -r1.1.2.13 --- openacs-4/packages/acs-core-docs/www/install-cvs.adp 19 Nov 2016 09:21:53 -0000 1.1.2.12 +++ openacs-4/packages/acs-core-docs/www/install-cvs.adp 6 Jan 2017 09:18:41 -0000 1.1.2.13 @@ -10,7 +10,7 @@ rightLink="psgml-for-emacs" rightLabel="Next">

        -Initialize CVS (OPTIONAL)

        CVS is a source control system. Create and initialize a +Initialize CVS (OPTIONAL)

    CVS is a source control system. Create and initialize a directory for a local cvs repository.

     [root tmp]# mkdir /cvsroot
     [root tmp]# cvs -d /cvsroot init
    Index: openacs-4/packages/acs-core-docs/www/install-cvs.html
    ===================================================================
    RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-cvs.html,v
    diff -u -N -r1.40.2.12 -r1.40.2.13
    --- openacs-4/packages/acs-core-docs/www/install-cvs.html	19 Nov 2016 09:21:53 -0000	1.40.2.12
    +++ openacs-4/packages/acs-core-docs/www/install-cvs.html	6 Jan 2017 09:18:41 -0000	1.40.2.13
    @@ -1,5 +1,5 @@
     
    -Initialize CVS (OPTIONAL)

    Initialize CVS (OPTIONAL)

    CVS is a source control system. Create and initialize a +Initialize CVS (OPTIONAL)

    Initialize CVS (OPTIONAL)

    CVS is a source control system. Create and initialize a directory for a local cvs repository.

    [root tmp]# mkdir /cvsroot
     [root tmp]# cvs -d /cvsroot init
     [root tmp]#
    Index: openacs-4/packages/acs-core-docs/www/install-daemontools.adp
    ===================================================================
    RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-daemontools.adp,v
    diff -u -N -r1.1.2.12 -r1.1.2.13
    --- openacs-4/packages/acs-core-docs/www/install-daemontools.adp	19 Nov 2016 09:21:53 -0000	1.1.2.12
    +++ openacs-4/packages/acs-core-docs/www/install-daemontools.adp	6 Jan 2017 09:18:41 -0000	1.1.2.13
    @@ -16,7 +16,7 @@
     svgroup. svgroup is a script for granting permissions, to allow
     users other than root to use daemontools for specific services.

    1. -

      Install Daemontools

      +

      Install Daemontools

      download daemontools and install it.

      • Index: openacs-4/packages/acs-core-docs/www/install-daemontools.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-daemontools.html,v diff -u -N -r1.41.2.12 -r1.41.2.13 --- openacs-4/packages/acs-core-docs/www/install-daemontools.html 19 Nov 2016 09:21:53 -0000 1.41.2.12 +++ openacs-4/packages/acs-core-docs/www/install-daemontools.html 6 Jan 2017 09:18:41 -0000 1.41.2.13 @@ -4,7 +4,7 @@ installed in /package. These commands install daemontools and svgroup. svgroup is a script for granting permissions, to allow users other than root to use daemontools for specific - services.

        1. Install Daemontools

          download daemontools and install it.

          • Red Hat 8

            [root root]# mkdir -p /package
            +      services.

            1. Install Daemontools

              download daemontools and install it.

              • Red Hat 8

                [root root]# mkdir -p /package
                 [root root]# chmod 1755 /package/
                 [root root]# cd /package/
                 [root package]# tar xzf /tmp/daemontools-0.76.tar.gz
                Index: openacs-4/packages/acs-core-docs/www/install-full-text-search-openfts.adp
                ===================================================================
                RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-full-text-search-openfts.adp,v
                diff -u -N -r1.1.2.12 -r1.1.2.13
                --- openacs-4/packages/acs-core-docs/www/install-full-text-search-openfts.adp	19 Nov 2016 09:21:53 -0000	1.1.2.12
                +++ openacs-4/packages/acs-core-docs/www/install-full-text-search-openfts.adp	6 Jan 2017 09:18:41 -0000	1.1.2.13
                @@ -24,7 +24,7 @@
                 with an automated install process using the tsearch2-driver
                 package.

                -Install OpenFTS module

                If you want full text search, and you are running PostgreSQL, +Install OpenFTS module

            If you want full text search, and you are running PostgreSQL, install this module to support FTS. Do this step after you have installed both PostgreSQL and AOLserver. You will need the openfts tarball in @@ -119,7 +119,7 @@

          Install OpenFTS prerequisites in -PostgreSQL instance

          If you are installing Full Text Search, add required packages to +PostgreSQL instance

      If you are installing Full Text Search, add required packages to the new database. (In order for full text search to work, you must also install the PostgreSQL OpenFTS module and prerequisites.)

      Index: openacs-4/packages/acs-core-docs/www/install-full-text-search-openfts.html
      ===================================================================
      RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-full-text-search-openfts.html,v
      diff -u -N -r1.11.2.13 -r1.11.2.14
      --- openacs-4/packages/acs-core-docs/www/install-full-text-search-openfts.html	19 Nov 2016 09:21:53 -0000	1.11.2.13
      +++ openacs-4/packages/acs-core-docs/www/install-full-text-search-openfts.html	6 Jan 2017 09:18:41 -0000	1.11.2.14
      @@ -6,14 +6,14 @@
             Tsearch2. See 
             Install       Full Text Search using Tsearch2. Tsearch2 is much easier to install, requiring only
             compilation of one module from PostgreSQL contrib, with an
      -      automated install process using the tsearch2-driver package.

      Install OpenFTS module

      If you want full text search, and you are running PostgreSQL, install this module to support FTS. Do this step after you have installed both PostgreSQL and + automated install process using the tsearch2-driver package.

      Install OpenFTS module

      If you want full text search, and you are running PostgreSQL, install this module to support FTS. Do this step after you have installed both PostgreSQL and AOLserver. You will need the openfts tarball in /tmp.

      1. Install Tsearch. This is a PostgreSQL module that OpenFTS requires.

        [root root]# su - postgres
         [postgres pgsql]$ cd /usr/local/src/postgresql-7.3.4/contrib/tsearch/
         [postgres tsearch]$ make
         sed 's,MODULE_PATHNAME,$libdir/tsearch,g' tsearch.sql.in >tsearch.sql
        -/usr/bin/flex  -8 -Ptsearch_yy -o'parser.c' parser.l(many lines omitted)
        +/usr/bin/flex  -8 -Ptsearch_yy -o'parser.c' parser.l(many lines omitted)
         rm -f libtsearch.so
         ln -s libtsearch.so.0.0 libtsearch.so
         [postgres tsearch]$ make install
        @@ -81,7 +81,7 @@
         make
         su postgres
         make install
        -exit

      Install OpenFTS prerequisites in PostgreSQL instance

      If you are installing Full Text Search, add required +exit

    Install OpenFTS prerequisites in PostgreSQL instance

    If you are installing Full Text Search, add required packages to the new database. (In order for full text search to work, you must also install the PostgreSQL OpenFTS module and prerequisites.)

    [$OPENACS_SERVICE_NAME $OPENACS_SERVICE_NAME]$ /usr/local/pgsql/bin/psql $OPENACS_SERVICE_NAME -f /usr/local/src/postgresql-7.3.4/contrib/tsearch/tsearch.sql
    @@ -98,7 +98,7 @@
     /usr/local/pgsql/bin/psql $OPENACS_SERVICE_NAME -f /usr/local/src/postgresql-7.3.4/contrib/pgsql_contrib_openfts/openfts.sql

    Note

    If you get the error ERROR: could not access file "$libdir/tsearch": no such file or directory - It is probably because PostgreSQL's libdir configuration variable points to a diffent directory than where tsearch is. + It is probably because PostgreSQL's libdir configuration variable points to a diffent directory than where tsearch is. You can find out where PostgreSQL expects to find tsearch via

    pg_config --pkglibdir

    Enable OpenFTS in config.tcl

    If you have installed OpenFTS, you can enable it for this service. Uncomment this line from config.tcl. (To uncomment a line in a tcl file, remove the # at the beginning of the line.)

    #ns_param   nsfts           ${bindir}/nsfts.so

    Install Full Text Search Engine

    1. Click Admin on the top of the default home page. If prompted, log in with the account and password you entered during install.

    2. Click on the Install Index: openacs-4/packages/acs-core-docs/www/install-full-text-search-tsearch2.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-full-text-search-tsearch2.adp,v diff -u -N -r1.1.2.12 -r1.1.2.13 --- openacs-4/packages/acs-core-docs/www/install-full-text-search-tsearch2.adp 19 Nov 2016 09:21:53 -0000 1.1.2.12 +++ openacs-4/packages/acs-core-docs/www/install-full-text-search-tsearch2.adp 6 Jan 2017 09:18:42 -0000 1.1.2.13 @@ -18,7 +18,7 @@ OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

    -Install Tsearch2 module

    If you want full text search, and you are running PostgreSQL, +Install Tsearch2 module

    If you want full text search, and you are running PostgreSQL, install this module to support FTS. Do this step after you have installed both PostgreSQL and AOLserver. You will need the tseach2 module form PostgreSQL contrib. This is included with the Index: openacs-4/packages/acs-core-docs/www/install-full-text-search-tsearch2.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-full-text-search-tsearch2.html,v diff -u -N -r1.11.2.12 -r1.11.2.13 --- openacs-4/packages/acs-core-docs/www/install-full-text-search-tsearch2.html 19 Nov 2016 09:21:53 -0000 1.11.2.12 +++ openacs-4/packages/acs-core-docs/www/install-full-text-search-tsearch2.html 6 Jan 2017 09:18:42 -0000 1.11.2.13 @@ -6,7 +6,7 @@ V2 Introduction by Andrew J. Kopciuch

    OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff. -

    Install Tsearch2 module

    If you want full text search, and you are running PostgreSQL, install this module to support FTS. Do this step after you have installed both PostgreSQL and +

    Install Tsearch2 module

    If you want full text search, and you are running PostgreSQL, install this module to support FTS. Do this step after you have installed both PostgreSQL and AOLserver. You will need the tseach2 module form PostgreSQL contrib. This is included with the PostgreSQL full source distribution. It is also available with the PostgreSQL contrib Index: openacs-4/packages/acs-core-docs/www/install-more-software.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-more-software.html,v diff -u -N -r1.22.2.3 -r1.22.2.4 --- openacs-4/packages/acs-core-docs/www/install-more-software.html 19 Nov 2016 09:21:53 -0000 1.22.2.3 +++ openacs-4/packages/acs-core-docs/www/install-more-software.html 6 Jan 2017 09:18:42 -0000 1.22.2.4 @@ -1,10 +1,10 @@ -Appendix B. Install additional supporting software

    Appendix B. Install additional supporting software

    By Joel Aufrecht

    +Appendix B. Install additional supporting software

    Appendix B. Install additional supporting software

    By Joel Aufrecht

    OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

    This section assumes that the source tarballs for supporting software are in /tmp. It assumes that you begin each continuous block of commands as root, and you - should end each block as root. It doesn't care which directory + should end each block as root. It doesn't care which directory you start in. Text instructions always precede the commands they refer to.

    Index: openacs-4/packages/acs-core-docs/www/install-next-add-server.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-next-add-server.html,v diff -u -N -r1.17.2.4 -r1.17.2.5 --- openacs-4/packages/acs-core-docs/www/install-next-add-server.html 19 Nov 2016 09:21:53 -0000 1.17.2.4 +++ openacs-4/packages/acs-core-docs/www/install-next-add-server.html 6 Jan 2017 09:18:42 -0000 1.17.2.5 @@ -13,7 +13,7 @@

    set hostname               [ns_info hostname]
     set address                127.0.0.1 

    If you want to install two services with different host - names sharing the same ip, you'll need nsvhr to redirect requests + names sharing the same ip, you'll need nsvhr to redirect requests based on the contents of the tcp headers. See AOLserver Virtual Hosting with TCP by markd.

    Index: openacs-4/packages/acs-core-docs/www/install-next-nightly-vacuum.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-next-nightly-vacuum.adp,v diff -u -N -r1.1.2.6 -r1.1.2.7 --- openacs-4/packages/acs-core-docs/www/install-next-nightly-vacuum.adp 30 Nov 2016 08:15:11 -0000 1.1.2.6 +++ openacs-4/packages/acs-core-docs/www/install-next-nightly-vacuum.adp 6 Jan 2017 09:18:42 -0000 1.1.2.7 @@ -27,8 +27,8 @@

    We'll set vacuum up to run nightly at 1 AM. Add the following line:

     0 1 * * * /usr/local/pgsql/bin/vacuumdb $OPENACS_SERVICE_NAME
    -
    ($‌Id: install-next-nightly-vacuum.html,v -1.23.2.12 2016/11/19 09:21:53 gustafn Exp $)
    +
    ($‌Id: database-maintenance.xml,v 1.8.14.1 +2016/06/23 08:32:46 gustafn Exp $)

    Edit your crontab:

    [joeuser ~]$ crontab -e

    We'll set vacuum up to run nightly at 1 AM. Add the following +

    Edit your crontab:

    [joeuser ~]$ crontab -e

    We'll set vacuum up to run nightly at 1 AM. Add the following line:

     0 1 * * * /usr/local/pgsql/bin/vacuumdb $OPENACS_SERVICE_NAME
    ($Id$)
    Index: openacs-4/packages/acs-core-docs/www/install-nsopenssl.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-nsopenssl.html,v diff -u -N -r1.26.2.3 -r1.26.2.4 --- openacs-4/packages/acs-core-docs/www/install-nsopenssl.html 19 Nov 2016 09:21:53 -0000 1.26.2.3 +++ openacs-4/packages/acs-core-docs/www/install-nsopenssl.html 6 Jan 2017 09:18:42 -0000 1.26.2.4 @@ -6,7 +6,7 @@ https. These commands compile nsopenssl and install it, along with a tcl helper script to handle https connections. You will also need ssl certificates. Because those should - be different for each server service, you won't need those instructions until + be different for each server service, you won't need those instructions until later.

    Install on AOLserver3

    You will need the unpacked Aolserver tarball in /usr/local/src/aolserver and the nsopenssl tarball in Index: openacs-4/packages/acs-core-docs/www/install-openacs-delete-tablespace.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-openacs-delete-tablespace.html,v diff -u -N -r1.13.2.3 -r1.13.2.4 --- openacs-4/packages/acs-core-docs/www/install-openacs-delete-tablespace.html 19 Nov 2016 09:21:53 -0000 1.13.2.3 +++ openacs-4/packages/acs-core-docs/www/install-openacs-delete-tablespace.html 6 Jan 2017 09:18:42 -0000 1.13.2.4 @@ -15,8 +15,8 @@ related to the service, you can also issue the following:

    SVRMGR> drop tablespace $OPENACS_SERVICE_NAME including contents cascade constraints;

    Deleting a PostgreSQL tablespace

    Dropping a PostgreSQL tablespace is easy. You have to stop any AOLserver instances that are using the database that you wish to - drop. If you're using daemontools, this is simple, just use the - 'down' flag (-d). If you're using inittab, you have to comment out + drop. If you're using daemontools, this is simple, just use the + 'down' flag (-d). If you're using inittab, you have to comment out your server in /etc/inittab, reread the inittab with /sbin/init q, and then restart-aolserver Index: openacs-4/packages/acs-core-docs/www/install-openacs-inittab.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-openacs-inittab.html,v diff -u -N -r1.13.2.3 -r1.13.2.4 --- openacs-4/packages/acs-core-docs/www/install-openacs-inittab.html 19 Nov 2016 09:21:53 -0000 1.13.2.3 +++ openacs-4/packages/acs-core-docs/www/install-openacs-inittab.html 6 Jan 2017 09:18:42 -0000 1.13.2.4 @@ -9,10 +9,10 @@

    1. Install a script called restart-aolserver. This - script doesn't actually restart AOLserver - it just kills + script doesn't actually restart AOLserver - it just kills it.

    2. - Ask the OS to restart our service whenever it's not + Ask the OS to restart our service whenever it's not running. We do this by adding a line to /etc/inittab.

    @@ -43,8 +43,8 @@ [root ~]# ln -s /usr/bin/perl /usr/local/bin/perl [root ~]# exit

  • Test the restart-aolserver - script. We'll first kill all running servers to clean the - slate. Then, we'll start one server and use + script. We'll first kill all running servers to clean the + slate. Then, we'll start one server and use restart-aolserver to kill it. If it works, then there should be no more servers running. You should see the following lines.

    Index: openacs-4/packages/acs-core-docs/www/install-openacs-keepalive.adp
    ===================================================================
    RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-openacs-keepalive.adp,v
    diff -u -N -r1.1.2.12 -r1.1.2.13
    --- openacs-4/packages/acs-core-docs/www/install-openacs-keepalive.adp	19 Nov 2016 09:21:53 -0000	1.1.2.12
    +++ openacs-4/packages/acs-core-docs/www/install-openacs-keepalive.adp	6 Jan 2017 09:18:42 -0000	1.1.2.13
    @@ -112,7 +112,7 @@
     commands.

    Most of this information comes from Tom Jackson's AOLserver+Daemontools Mini-HOWTO.

  • -

    Table 6.1. How it +

    Table 6.1. How it Works

    Index: openacs-4/packages/acs-core-docs/www/install-openacs-keepalive.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-openacs-keepalive.html,v diff -u -N -r1.24.2.12 -r1.24.2.13 --- openacs-4/packages/acs-core-docs/www/install-openacs-keepalive.html 19 Nov 2016 09:21:53 -0000 1.24.2.12 +++ openacs-4/packages/acs-core-docs/www/install-openacs-keepalive.html 6 Jan 2017 09:18:42 -0000 1.24.2.13 @@ -62,8 +62,8 @@ [root root]#
  • Verify that the controls work. You may want to tail -f /var/lib/aolserver/$OPENACS_SERVICE_NAME/log/$OPENACS_SERVICE_NAME-error.log in another window, so you can see what happens when you type these commands.

    - Most of this information comes from Tom Jackson's AOLserver+Daemontools + Most of this information comes from Tom Jackson's AOLserver+Daemontools Mini-HOWTO. -

  • Table 6.1. How it Works

    ProgramInvoked by this program ...... using this fileWhere to find errorsLog goes toUse these commands to control it
    svscanboot +

    Table 6.1. How it Works

    ProgramInvoked by this program ...... using this fileWhere to find errorsLog goes toUse these commands to control it
    svscanboot init/etc/inittabps -auxw | grep readproctitlen/a 
    aolserversupervise (a child of svscanboot)/service/$OPENACS_SERVICE_NAME/run/var/lib/aolserver/$OPENACS_SERVICE_NAME/log/error.log/var/lib/aolserver/$OPENACS_SERVICE_NAME/log/$OPENACS_SERVICE_NAME.logsvc -k /service/$OPENACS_SERVICE_NAME
    postgresqlRedhat init scripts during boot/etc/init.d/postgresql/usr/local/pgsql/data/server.log service postgresql start (Red Hat), /etc/init.d/postgresql start (Debian)

    Index: openacs-4/packages/acs-core-docs/www/install-origins.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-origins.html,v diff -u -N -r1.16.2.4 -r1.16.2.5 --- openacs-4/packages/acs-core-docs/www/install-origins.html 19 Nov 2016 09:21:53 -0000 1.16.2.4 +++ openacs-4/packages/acs-core-docs/www/install-origins.html 6 Jan 2017 09:18:42 -0000 1.16.2.5 @@ -1,23 +1,23 @@ Where did this document come from?

    Where did this document come from?

    - This document was created by Vinod Kurup, but it's really + This document was created by Vinod Kurup, but it's really just plagiarism from a number of documents that came before it. If - I've used something that you've written without proper credit, let me - know and I'll fix it right away. + I've used something that you've written without proper credit, let me + know and I'll fix it right away.

    Versions 4.6.2 to present were edited by Joel Aufrecht.

    These are a few of my sources:

    Please also see the Credits section for more acknowledgements.

    Index: openacs-4/packages/acs-core-docs/www/install-overview.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-overview.html,v diff -u -N -r1.33.2.3 -r1.33.2.4 --- openacs-4/packages/acs-core-docs/www/install-overview.html 19 Nov 2016 09:21:53 -0000 1.33.2.3 +++ openacs-4/packages/acs-core-docs/www/install-overview.html 6 Jan 2017 09:18:42 -0000 1.33.2.4 @@ -1,5 +1,5 @@ -Chapter 2. Installation Overview

    Chapter 2. Installation Overview

    by Vinod Kurup

    +Chapter 2. Installation Overview

    Chapter 2. Installation Overview

    by Vinod Kurup

    OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff. -
    +
    Index: openacs-4/packages/acs-core-docs/www/install-qmail.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-qmail.adp,v diff -u -N -r1.1.2.12 -r1.1.2.13 --- openacs-4/packages/acs-core-docs/www/install-qmail.adp 19 Nov 2016 09:21:54 -0000 1.1.2.12 +++ openacs-4/packages/acs-core-docs/www/install-qmail.adp 6 Jan 2017 09:18:42 -0000 1.1.2.13 @@ -48,7 +48,7 @@ ] [ -b backlog ] [ -l localname ] [ -t timeout ] host port program [root ucspi-tcp-0.88]#

    - (I'm not sure if this next step is + (I'm not sure if this next step is 100% necessary, but when I skip it I get problems. If you get the error 553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1) then you need to do @@ -68,7 +68,7 @@

  • -Install Qmail.  +Install Qmail. 

    Download qmail, set up the standard supporting users and build the binaries:

    @@ -131,7 +131,7 @@
     ./collate.sh
     cd netqmail-1.04
     make setup check
    -

    Replace sendmail with qmail's wrapper.

    +

    Replace sendmail with qmail's wrapper.

     [root qmail-1.03]# rm -f /usr/bin/sendmail /usr/sbin/sendmail
     [root qmail-1.03]# ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail
     [root qmail-1.03]#
    @@ -170,7 +170,7 @@
     chmod 644 ~alias/.qmail* 
     /var/qmail/bin/maildirmake ~alias/Maildir/ 
     chown -R alias.nofiles /var/qmail/alias/Maildir
    -

    Configure qmail to use the Maildir delivery format (instead of +

    Configure qmail to use the Maildir delivery format (instead of mbox), and install a version of the qmail startup script modified to use Maildir.

     [root alias]# echo "./Maildir" > /var/qmail/bin/.qmail
    Index: openacs-4/packages/acs-core-docs/www/install-qmail.html
    ===================================================================
    RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-qmail.html,v
    diff -u -N -r1.41.2.13 -r1.41.2.14
    --- openacs-4/packages/acs-core-docs/www/install-qmail.html	19 Nov 2016 09:21:54 -0000	1.41.2.13
    +++ openacs-4/packages/acs-core-docs/www/install-qmail.html	6 Jan 2017 09:18:42 -0000	1.41.2.14
    @@ -1,7 +1,7 @@
     
     Install qmail (OPTIONAL)

    Install qmail (OPTIONAL)

    Qmail is a Mail Transfer Agent. It handles incoming and outgoing mail. Install qmail if you want your OpenACS server to - send and receive mail, and you don't want to use an alternate + send and receive mail, and you don't want to use an alternate MTA.

    Red Hat 9: all djb tools (qmail, daemontools, ucspi) will fail to compile in Red Hat 9 because of changes to glibc (patches)

    1. Install ucspi. This program handles incoming tcp connections. Download ucspi and install it.

      [root root]# cd /usr/local/src
      @@ -30,21 +30,21 @@
       tcpserver: usage: tcpserver [ -1UXpPhHrRoOdDqQv ] [ -c limit ] [ -x rules.cdb ] [ -B banner ] [ -g gid ] [ -u uid
       ] [ -b backlog ] [ -l localname ] [ -t timeout ] host port program
       [root ucspi-tcp-0.88]#
      -

      -(I'm not sure if this next step is 100% necessary, but when I skip it -I get problems. If you get the error 553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1) then you need to do this.) AOLserver sends outgoing mail via the ns_sendmail +

    +(I'm not sure if this next step is 100% necessary, but when I skip it +I get problems. If you get the error 553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1) then you need to do this.) AOLserver sends outgoing mail via the ns_sendmail command, which pipes a command to the sendmail executable. Or, in our case, the qmail replacement wrapper for the sendmail executable. In some cases, though, the outgoing mail requset is apparently sent through tcp/ip, so that it comes to qmail from 127.0.0.1 (a special IP address that means the local machine - the "loopback" interface). Unless this mail is addressed to the same machine, qmail thinks that -it's an attempt to relay mail, and rejects it. So these two commands +it's an attempt to relay mail, and rejects it. So these two commands set up an exception so that any mail sent from 127.0.0.1 is allowed to send outgoing mail.

    [root ucspi-tcp-0.88]# cp /tmp/openacs-5.9.0/packages/acs-core-docs/www/files/tcp.smtp.txt /etc/tcp.smtp
     [root ucspi-tcp-0.88]# tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp
     cp /tmp/openacs-5.9.0/packages/acs-core-docs/www/files/tcp.smtp.txt /etc/tcp.smtp 
    -tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp 
  • Install Qmail. 

    Download qmail, +tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp

  • Install Qmail. 

    Download qmail, set up the standard supporting users and build the binaries:

    [root root]# cd /usr/local/src
     [root src]# wget http://www.qmail.org/netqmail-1.04.tar.gz
     [root src]# tar xzf netqmail-1.04.tar.gz
    @@ -103,11 +103,11 @@
     cd netqmail-1.04
     ./collate.sh
     cd netqmail-1.04
    -make setup check

    Replace sendmail with qmail's wrapper.

    [root qmail-1.03]# rm -f /usr/bin/sendmail /usr/sbin/sendmail
    +make setup check

    Replace sendmail with qmail's wrapper.

    [root qmail-1.03]# rm -f /usr/bin/sendmail /usr/sbin/sendmail
     [root qmail-1.03]# ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail
     [root qmail-1.03]#
     rm -f /usr/bin/sendmail /usr/sbin/sendmail
    -ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail

    Configure qmail - specifically, run the config script to set up files in /var/qmail/control specifying the computer's identity and which addresses it should accept mail for. This command will automatically set up qmail correctly if you have correctly set a valid host nome. If not, you'll want to read /var/qmail/doc/INSTALL.ctl to find out how to configure qmail.

    [root qmail-1.03]# ./config-fast yourserver.test
    +ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail

    Configure qmail - specifically, run the config script to set up files in /var/qmail/control specifying the computer's identity and which addresses it should accept mail for. This command will automatically set up qmail correctly if you have correctly set a valid host nome. If not, you'll want to read /var/qmail/doc/INSTALL.ctl to find out how to configure qmail.

    [root qmail-1.03]# ./config-fast yourserver.test
     Your fully qualified host name is yourserver.test.
     Putting yourserver.test into control/me...
     Putting yourserver.test into control/defaultdomain...
    @@ -117,15 +117,15 @@
     Now qmail will refuse to accept SMTP messages except to yourserver.test.
     Make sure to change rcpthosts if you add hosts to locals or virtualdomains!
     [root qmail-1.03]#
    -./config-fast yourserver.test

    All incoming mail that isn't for a specific user is handled by the alias user. This includes all root mail. These commands prepare the alias user to receive mail.

    [root qmail-1.03]# cd ~alias; touch .qmail-postmaster .qmail-mailer-daemon .qmail-root
    +./config-fast yourserver.test

    All incoming mail that isn't for a specific user is handled by the alias user. This includes all root mail. These commands prepare the alias user to receive mail.

    [root qmail-1.03]# cd ~alias; touch .qmail-postmaster .qmail-mailer-daemon .qmail-root
     [root alias]# chmod 644 ~alias/.qmail*
     [root alias]# /var/qmail/bin/maildirmake ~alias/Maildir/
     [root alias]# chown -R alias.nofiles /var/qmail/alias/Maildir
     [root alias]#
     cd ~alias; touch .qmail-postmaster .qmail-mailer-daemon .qmail-root 
     chmod 644 ~alias/.qmail* 
     /var/qmail/bin/maildirmake ~alias/Maildir/ 
    -chown -R alias.nofiles /var/qmail/alias/Maildir

    Configure qmail to use the Maildir delivery format +chown -R alias.nofiles /var/qmail/alias/Maildir

    Configure qmail to use the Maildir delivery format (instead of mbox), and install a version of the qmail startup script modified to use Maildir.

    [root alias]# echo "./Maildir" > /var/qmail/bin/.qmail
     [root alias]# cp /tmp/openacs-5.9.0/packages/acs-core-docs/www/files/qmail.rc.txt /var/qmail/rc
     [root alias]# chmod 755 /var/qmail/rc
    @@ -172,7 +172,7 @@
     chmod 755 /var/qmail/supervise/qmail-smtpd/run
     chmod 755 /var/qmail/supervise/qmail-smtpd/log/run
     ln -s /var/qmail/supervise/qmail-send /var/qmail/supervise/qmail-smtpd /service
    -

    Wait ten seconds or so, and then verify that that the four qmail processes are running. If uptimes don't rise above 1 second, this may indicate broken scripts that are continuously restarting. In that case, start debugging by checking permissions.

    [root root]# qmailctl stat
    +

    Wait ten seconds or so, and then verify that that the four qmail processes are running. If uptimes don't rise above 1 second, this may indicate broken scripts that are continuously restarting. In that case, start debugging by checking permissions.

    [root root]# qmailctl stat
     /service/qmail-send: up (pid 32700) 430 seconds
     /service/qmail-send/log: up (pid 32701) 430 seconds
     /service/qmail-smtpd: up (pid 32704) 430 seconds
    Index: openacs-4/packages/acs-core-docs/www/install-redhat.adp
    ===================================================================
    RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-redhat.adp,v
    diff -u -N -r1.1.2.12 -r1.1.2.13
    --- openacs-4/packages/acs-core-docs/www/install-redhat.adp	19 Nov 2016 09:21:54 -0000	1.1.2.12
    +++ openacs-4/packages/acs-core-docs/www/install-redhat.adp	6 Jan 2017 09:18:42 -0000	1.1.2.13
    @@ -38,7 +38,7 @@
     Unplug
     the network cable from your computer. We don't want to connect
     to the network until we're sure the computer is secure.
    - (Wherever you see the word secure, you
    + (Wherever you see the word secure, you
     should always read it as, "secure enough for our purposes,
     given the amount of work we're willing to exert and the
     estimated risk and consequences.")

  • Insert Red Hat 8.0 or 9.0 Disk 1 into the CD-ROM and reboot the @@ -76,7 +76,7 @@ screen

  • -

    Configure Networking. Again, if you +

    Configure Networking. Again, if you know what you're doing, do this step yourself, being sure to note the firewall holes. Otherwise, follow the instructions in this step to set up a computer directly connected to the internet with a @@ -105,7 +105,7 @@ development server we'll be setting up.

  • -Select any additional languages you want +Select any additional languages you want the computer to support and then click Next

  • Choose your time zone and click @@ -121,11 +121,11 @@ web server, because that would conflict with the database and web server we'll install later.

    check Editors -(this installs emacs),
    click Details next +(this installs emacs),
    click Details next to Text-based Internet, check lynx, and click OK;
    check Authoring and -Publishing (this installs +Publishing (this installs docbook),
    uncheck Server Configuration Tools,
    uncheck Web Server,
    uncheck Windows File @@ -150,7 +150,7 @@ will appear.

    uncheck apmd (monitors power, not very useful for servers),
    check ImageMagick -(required for the photo-album packages,
    uncheckisdn4k-utils +(required for the photo-album packages,
    uncheckisdn4k-utils (unless you are using isdn, this installs a useless daemon),
    check mutt (a mail program that reads Maildir),
    uncheck nfs-utils (nfs is a major security risk),
    uncheck pam-devel (I @@ -197,7 +197,7 @@

    Lock down SSH

    1. - SSH is the protocol we use to connect + SSH is the protocol we use to connect securely to the computer (replacing telnet, which is insecure). sshd is the daemon that listens for incoming ssh connections. As a security precaution, we are now going to tell ssh not to allow Index: openacs-4/packages/acs-core-docs/www/install-redhat.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-redhat.html,v diff -u -N -r1.41.2.12 -r1.41.2.13 --- openacs-4/packages/acs-core-docs/www/install-redhat.html 19 Nov 2016 09:21:54 -0000 1.41.2.12 +++ openacs-4/packages/acs-core-docs/www/install-redhat.html 6 Jan 2017 09:18:42 -0000 1.41.2.13 @@ -1,12 +1,12 @@ -Appendix A. Install Red Hat 8/9

      Appendix A. Install Red Hat 8/9

      by Joel Aufrecht

      +Appendix A. Install Red Hat 8/9

      Appendix A. Install Red Hat 8/9

      by Joel Aufrecht

      OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

      This section takes a blank PC and sets up some supporting software. You should do this section as-is if you have a machine you can reformat and you want to be sure that your installation works and is secure; it should take about an hour. (In my - experience, it's almost always a net time savings of several hours + experience, it's almost always a net time savings of several hours to install a new machine from scratch compared to installing each of these packages installed independently.)

      The installation guide assumes you have:

      • A PC with hard drive you can reinstall

      • Red Hat 8.0 or 9.0 install discs

      • A CD with the current Security Patches for your version of Red Hat.

      The installation guide assumes that you can do the following on @@ -25,78 +25,78 @@ but if anything goes wrong it may take extra time to understand and correct the problem. Some useful UNIX resources.

      1. Unplug the network cable from your - computer. We don't want to connect to the network - until we're sure the computer is secure. - + computer. We don't want to connect to the network + until we're sure the computer is secure. + (Wherever you see the word secure, you should always read it as, "secure - enough for our purposes, given the amount of work we're + enough for our purposes, given the amount of work we're willing to exert and the estimated risk and consequences.")

      2. Insert Red Hat 8.0 or 9.0 Disk 1 into the CD-ROM and reboot the computer

      3. At the boot: prompt, press Enter for a graphical install. The text install is fairly different, so if you need to do that instead proceed with caution, because - the guide won't match the steps.

      4. Checking the media is probably a waste of + the guide won't match the steps.

      5. Checking the media is probably a waste of time, so when it asks press Tab and then Enter to skip it.

      6. After the graphical introduction page loads, click Next

      7. Choose the language you want to use and then click Next

      8. Select the keyboard layout you will use and Click Next

      9. Choose your mouse type and Click Next

      10. Red Hat has several templates for new - computers. We'll start with the "Server" template and then + computers. We'll start with the "Server" template and then fine-tune it during the rest of the install. Choose Server and click - Next.

      11. Reformat the hard drive. If you know what you're doing, - do this step on your own. Otherwise: we're going to let the + Next.

      12. Reformat the hard drive. If you know what you're doing, + do this step on your own. Otherwise: we're going to let the installer wipe out the everything on the main hard drive and then arrange things to its liking.

        1. Choose Automatically Partition and click Next

        2. Uncheck Review (and modify if needed) the partitions created and click Next

        3. On the pop-up window asking "Are you sure you want to do this?" click Yes - IF YOU ARE WIPING YOUR HARD DRIVE.

        4. Click Next on the boot loader screen

      13. Configure Networking. -Again, if you know what you're doing, do this step + IF YOU ARE WIPING YOUR HARD DRIVE.

      14. Click Next on the boot loader screen

    2. Configure Networking. +Again, if you know what you're doing, do this step yourself, being sure to note the firewall holes. Otherwise, follow the instructions in this step to set up a computer directly connected to the internet with a dedicated IP address.

      1. DHCP is a system by which a computer that joins a network (such as on boot) can request a temporary IP address and other network information. Assuming the machine has a dedicated -IP address (if it doesn't, it will be tricky to access the OpenACS -service from the outside world), we're going to set up that address. -If you don't know your netmask, 255.255.255.0 is usually a pretty safe +IP address (if it doesn't, it will be tricky to access the OpenACS +service from the outside world), we're going to set up that address. +If you don't know your netmask, 255.255.255.0 is usually a pretty safe guess. Click Edit, uncheck Configure using DHCP and type in your IP and netmask. Click Ok.

      2. Type in your host -name, gateway, and DNS server(s). Then click Next.

      3. We're going to use the firewall template for high -security, meaning that we'll block almost all incoming traffic. Then -we'll add a few holes to the firewall for services which we need and +name, gateway, and DNS server(s). Then click Next.

      4. We're going to use the firewall template for high +security, meaning that we'll block almost all incoming traffic. Then +we'll add a few holes to the firewall for services which we need and know are secure. Choose High security level. Check WWW, SSH, and Mail (SMTP). In the Other ports box, enter 443, 8000, 8443. Click Next. -Port 443 is for https (http over ssl), and 8000 and 8443 are http and https access to the development server we'll be setting up.

    3. Select any additional languages you want the +Port 443 is for https (http over ssl), and 8000 and 8443 are http and https access to the development server we'll be setting up.

  • Select any additional languages you want the computer to support and then click Next

  • Choose your time zone and click Next.

  • Type in a root -password, twice.

  • On the Package selection page, we're going to -uncheck a lot of packages that install software we don't need, and add +password, twice.

  • On the Package selection page, we're going to +uncheck a lot of packages that install software we don't need, and add packages that have stuff we do need. You should install everything -we're installing here or the guide may not work for you; you can +we're installing here or the guide may not work for you; you can install extra stuff, or ignore the instructions here to not install -stuff, with relative impunity - at worst, you'll introduce a security -risk that's still screened by the firewall, or a resource hog. Just -don't install a database or web server, because that would conflict -with the database and web server we'll install later. -

    check Editors (this installs emacs),
    click Details next to Text-based Internet, check lynx, and click OK;
    check Authoring and Publishing (this installs docbook),
    uncheck Server Configuration Tools,
    uncheck Web Server,
    uncheck Windows File Server,
    check SQL Database Server (this installs PostgreSQL),
    check Development Tools (this installs gmake and other build tools),
    uncheck Administration Tools, and
    uncheck Printing Support.

    At the bottom, check Select Individual Packages and click Next

  • We need to fine-tune the exact list of packages. +stuff, with relative impunity - at worst, you'll introduce a security +risk that's still screened by the firewall, or a resource hog. Just +don't install a database or web server, because that would conflict +with the database and web server we'll install later. +

    check Editors (this installs emacs),
    click Details next to Text-based Internet, check lynx, and click OK;
    check Authoring and Publishing (this installs docbook),
    uncheck Server Configuration Tools,
    uncheck Web Server,
    uncheck Windows File Server,
    check SQL Database Server (this installs PostgreSQL),
    check Development Tools (this installs gmake and other build tools),
    uncheck Administration Tools, and
    uncheck Printing Support.

    At the bottom, check Select Individual Packages and click Next

  • We need to fine-tune the exact list of packages. The same rules apply as in the last step - you can add more stuff, but -you shouldn't remove anything the guide adds. We're going to go +you shouldn't remove anything the guide adds. We're going to go through all the packages in one big list, so select Flat View and wait. In a minute, a -list of packages will appear.

    uncheck apmd (monitors power, not very useful for servers),
    check ImageMagick (required for the photo-album packages,
    uncheckisdn4k-utils (unless you are using isdn, this installs a useless daemon),
    check mutt (a mail program that reads Maildir),
    uncheck nfs-utils (nfs is a major security risk),
    uncheck pam-devel (I don't remember why, but we don't want this),
    uncheck portmap,
    uncheck postfix (this is an MTA, but we're going to install qmail later),
    check postgresql-devel,
    uncheck rsh (rsh is a security hole),
    uncheck sendmail (sendmail is an insecure MTA; we're going to install qmail instead later),
    check tcl (we need tcl), and
    uncheck xinetd (xinetd handles incoming tcp connections. We'll install a different, more secure program, ucspi-tcp).
    Click Next
  • Red Hat isn't completely happy with the combination -of packages we've selected, and wants to satisfy some dependencies. -Don't let it. On the next screen, choose +list of packages will appear.

    uncheck apmd (monitors power, not very useful for servers),
    check ImageMagick (required for the photo-album packages,
    uncheckisdn4k-utils (unless you are using isdn, this installs a useless daemon),
    check mutt (a mail program that reads Maildir),
    uncheck nfs-utils (nfs is a major security risk),
    uncheck pam-devel (I don't remember why, but we don't want this),
    uncheck portmap,
    uncheck postfix (this is an MTA, but we're going to install qmail later),
    check postgresql-devel,
    uncheck rsh (rsh is a security hole),
    uncheck sendmail (sendmail is an insecure MTA; we're going to install qmail instead later),
    check tcl (we need tcl), and
    uncheck xinetd (xinetd handles incoming tcp connections. We'll install a different, more secure program, ucspi-tcp).
    Click Next
  • Red Hat isn't completely happy with the combination +of packages we've selected, and wants to satisfy some dependencies. +Don't let it. On the next screen, choose Ignore Package Dependencies and click Next. @@ -106,7 +106,7 @@ asked.

  • Wait. Insert Disk 3 when asked.

  • If you know how to use it, create a boot disk. Since you can also boot into recovery mode with the Install CDs, this is less useful than it used to be, and we - won't bother. Select No,I do not want to create a boot disk and click Next.

  • Click Exit, remove the CD, and watch the + won't bother. Select No,I do not want to create a boot disk and click Next.

  • Click Exit, remove the CD, and watch the computer reboot.

  • After it finishes rebooting and shows the login prompt, log in:

    yourserver login: root
    @@ -120,14 +120,14 @@
             upgrading all of that.  Since you are upgrading the kernel,
             reboot after this step.
     

  • Lock down SSH

    1. - + SSH is the protocol we use to connect securely to the computer (replacing telnet, which is insecure). sshd is the daemon that listens for incoming ssh connections. As a security precaution, we are now going to tell ssh not to allow anyone to connect directly to this computer as root. Type this into the shell: -

      emacs /etc/ssh/sshd_config
    2. Search for the word "root" by typing C-s (that's emacs-speak for control-s) and then root.

    3. Make the following changes:

      #Protocol 2,1 to +

      emacs /etc/ssh/sshd_config
    4. Search for the word "root" by typing C-s (that's emacs-speak for control-s) and then root.

    5. Make the following changes:

      #Protocol 2,1 to Protocol 2 (this prevents any connections via SSH 1, which is insecure)
      #PermitRootLogin yes to PermitRootLogin no @@ -136,18 +136,18 @@ account, such as "remadmin", which you can use to get ssh before using "su" to become root)
      #PermitEmptyPasswords no to PermitEmptyPasswords no (this blocks passwordless accounts) and save and exit by typing C-x C-s C-x C-c
    6. Restart sshd so that the change takes effect.

      service sshd restart
    7. - Red Hat still installed a few services we don't need, and + Red Hat still installed a few services we don't need, and which can be security holes. Use the service command to turn them off, and then use chkconfig to automatically edit the System V init directories to permanently (The System V init directories are the ones in /etc/rc.d. They consist of a bunch of scripts for starting and stopping programs, and directories of symlinks for each system level indicating which services should be up and down at any given service - level. We'll use this system for PostgreSQL, but we'll use + level. We'll use this system for PostgreSQL, but we'll use daemontools to perform a similar function for AOLserver. (The reason for this discrepencies is that, while daemontools - is better, it's a pain in the ass to deal with and nobody's + is better, it's a pain in the ass to deal with and nobody's had any trouble leaving PostgreSQL the way it is.)

      [root root]# service pcmcia stop
       [root root]# service netfs stop
      @@ -159,19 +159,19 @@
       chkconfig --del pcmcia
       chkconfig --del netfs

      If you installed PostgreSQL, do also service postgresql start and chkconfig --add postgresql.

    8. Plug in the network cable.

    9. Verify that you have connectivity by going to another - computer and ssh'ing to + computer and ssh'ing to yourserver, logging in as remadmin, and promoting yourself to root:

      [joeuser@someotherserver]$  ssh remadmin@yourserver.test
      -The authenticity of host 'yourserver.test (1.2.3.4)' can't be established.
      +The authenticity of host 'yourserver.test (1.2.3.4)' can't be established.
       DSA key fingerprint is 10:b9:b6:10:79:46:14:c8:2d:65:ae:c1:61:4b:a5:a5.
       Are you sure you want to continue connecting (yes/no)? yes
       Warning: Permanently added 'yourserver.test (1.2.3.4)' (DSA) to the list of known hosts.
       Password:
       Last login: Mon Mar  3 21:15:27 2003 from host-12-01.dsl-sea.seanet.com
       [remadmin remadmin]$ su -
       Password: 
      -[root root]#
    10. If you didn't burn a CD of patches and use it, can still - download and install the necessary patches. Here's how to +[root root]#

    11. If you didn't burn a CD of patches and use it, can still + download and install the necessary patches. Here's how to do it for the kernel; you should also check for other critical packages.

      Upgrade the kernel to fix a security hole. The default Red Hat 8.0 system kernel (2.4.18-14, which you can check Index: openacs-4/packages/acs-core-docs/www/install-resources.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-resources.html,v diff -u -N -r1.16.2.3 -r1.16.2.4 --- openacs-4/packages/acs-core-docs/www/install-resources.html 19 Nov 2016 09:21:54 -0000 1.16.2.3 +++ openacs-4/packages/acs-core-docs/www/install-resources.html 6 Jan 2017 09:18:42 -0000 1.16.2.4 @@ -4,7 +4,7 @@

      Books

      • Philip - and Alex's Guide to Web Publishing - A very readable + and Alex's Guide to Web Publishing - A very readable guide to database-backed community websites.

      • @@ -22,7 +22,7 @@

      • UNIX - System Administrator's Bible - (LePage and Iarerra 1998; + System Administrator's Bible - (LePage and Iarerra 1998; IDG)

      • Index: openacs-4/packages/acs-core-docs/www/install-ssl.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-ssl.html,v diff -u -N -r1.15.2.3 -r1.15.2.4 --- openacs-4/packages/acs-core-docs/www/install-ssl.html 19 Nov 2016 09:21:54 -0000 1.15.2.3 +++ openacs-4/packages/acs-core-docs/www/install-ssl.html 6 Jan 2017 09:18:42 -0000 1.15.2.4 @@ -4,7 +4,7 @@ [$OPENACS_SERVICE_NAME etc]$ chmod 700 /var/lib/aolserver/$OPENACS_SERVICE_NAME/etc/certs [$OPENACS_SERVICE_NAME etc]$ mkdir /var/lib/aolserver/$OPENACS_SERVICE_NAME/etc/certs -chmod 700 /var/lib/aolserver/$OPENACS_SERVICE_NAME/etc/certs

      • It takes two files to support an SSL connection. The certificate is the public half of the key pair - the server sends the certificate to browser requesting ssl. The key is the private half of the key pair. In addition, the certificate must be signed by Certificate Authority or browsers will protest. Each web browser ships with a built-in list of acceptable Certificate Authorities (CAs) and their keys. Only a site certificate signed by a known and approved CA will work smoothly. Any other certificate will cause browsers to produce some messages or block the site. Unfortunately, getting a site certificate signed by a CA costs money. In this section, we'll generate an unsigned certificate which will work in most browsers, albeit with pop-up messages.

        Use an OpenSSL perl script to generate a certificate and key.

        +chmod 700 /var/lib/aolserver/$OPENACS_SERVICE_NAME/etc/certs

      • It takes two files to support an SSL connection. The certificate is the public half of the key pair - the server sends the certificate to browser requesting ssl. The key is the private half of the key pair. In addition, the certificate must be signed by Certificate Authority or browsers will protest. Each web browser ships with a built-in list of acceptable Certificate Authorities (CAs) and their keys. Only a site certificate signed by a known and approved CA will work smoothly. Any other certificate will cause browsers to produce some messages or block the site. Unfortunately, getting a site certificate signed by a CA costs money. In this section, we'll generate an unsigned certificate which will work in most browsers, albeit with pop-up messages.

        Use an OpenSSL perl script to generate a certificate and key.

        Debian users: use /usr/lib/ssl/misc/CA.pl instead of /usr/share/ssl/CA

        Mac OS X users: use perl /System/Library/OpenSSL/misc/CA.pl -newcert instead of /usr/share/ssl/CA @@ -16,7 +16,7 @@ .......++++++ writing new private key to 'newreq.pem' Enter PEM pass phrase:

        Enter a pass phrase for the CA certificate. Then, answer the rest of the questions. At the end you should see this:

        Certificate (and private key) is in newreq.pem
        -[$OPENACS_SERVICE_NAME certs]$

        newreq.pem contains our certificate and private key. The key is protected by a passphrase, which means that we'll have to enter the pass phrase each time the server starts. This is impractical and unnecessary, so we create an unprotected version of the key. Security implication: if anyone gets access to the file keyfile.pem, they effectively own the key as much as you do. Mitigation: don't use this key/cert combo for anything besides providing ssl for the web site.

        [root misc]# openssl rsa -in newreq.pem -out keyfile.pem
        +[$OPENACS_SERVICE_NAME certs]$

        newreq.pem contains our certificate and private key. The key is protected by a passphrase, which means that we'll have to enter the pass phrase each time the server starts. This is impractical and unnecessary, so we create an unprotected version of the key. Security implication: if anyone gets access to the file keyfile.pem, they effectively own the key as much as you do. Mitigation: don't use this key/cert combo for anything besides providing ssl for the web site.

        [root misc]# openssl rsa -in newreq.pem -out keyfile.pem
         read RSA key
         Enter PEM pass phrase:
         writing RSA key
        Index: openacs-4/packages/acs-core-docs/www/install-steps.adp
        ===================================================================
        RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-steps.adp,v
        diff -u -N -r1.1.2.15 -r1.1.2.16
        --- openacs-4/packages/acs-core-docs/www/install-steps.adp	30 Nov 2016 08:15:11 -0000	1.1.2.15
        +++ openacs-4/packages/acs-core-docs/www/install-steps.adp	6 Jan 2017 09:18:42 -0000	1.1.2.16
        @@ -106,8 +106,8 @@
         

      -Paths and Users

      -

      Table 2.1. Default +Paths and Users

      +

      Table 2.1. Default directories for a standard install

      @@ -118,7 +118,7 @@ @@ -183,8 +183,8 @@ there's a SQL error in the Tcl error or in the log, post that too.

    12. If you find errors in this document or if you have ideas about making it better, please post them in our BugTracker.

    13. -
      ($‌Id: install-steps.html,v 1.35.2.12 2016/11/19 -09:21:54 gustafn Exp $)
      +
      ($‌Id: overview.xml,v 1.29.2.2 2016/06/23 +08:32:46 gustafn Exp $)
      su - $OPENACS_SERVICE_NAME svc -d /service/$OPENACS_SERVICE_NAME dropdb $OPENACS_SERVICE_NAME -createdb $OPENACS_SERVICE_NAME

      Setting a global shell variable for cut and paste. In order to cut and paste the instructions into your shell, you must set the environment variable $OPENACS_SERVICE_NAME. In order to set it globally so that it works for any new users or special service users you may create, edit the file /etc/profile ( /etc/share/skel/dot.profile for FreeBSD) and add this line:

      export OPENACS_SERVICE_NAME=service0

      Paths and Users

      Table 2.1. Default directories for a standard install

      name of administrative access accountremadmin
      OpenACS service -$OPENACS_SERVICE_NAME (set to service0 +$OPENACS_SERVICE_NAME (set to service0 in default install)
      OpenACS service account$OPENACS_SERVICE_NAME
      Fully qualified domain name of your serveryourserver.test
      name of administrative access accountremadmin
      OpenACS service +createdb $OPENACS_SERVICE_NAME

      Setting a global shell variable for cut and paste. In order to cut and paste the instructions into your shell, you must set the environment variable $OPENACS_SERVICE_NAME. In order to set it globally so that it works for any new users or special service users you may create, edit the file /etc/profile ( /etc/share/skel/dot.profile for FreeBSD) and add this line:

      export OPENACS_SERVICE_NAME=service0

      Paths and Users

      Table 2.1. Default directories for a standard install

      Fully qualified domain name of your serveryourserver.test
      name of administrative access accountremadmin
      OpenACS service $OPENACS_SERVICE_NAME (set to service0 in default install)
      OpenACS service account$OPENACS_SERVICE_NAME
      OpenACS database name$OPENACS_SERVICE_NAME
      Root of OpenACS service file tree (SERVERROOT)/var/lib/aolserver/$OPENACS_SERVICE_NAME
      Location of source code tarballs for new software/var/tmp
      The OpenACS tarball contains some files which are useful while setting up other software. Those files are located at:/var/tmp/openacs-5.9.0/packages/acs-core-docs/www/files
      Database backup directory/var/lib/aolserver/$OPENACS_SERVICE_NAME/database-backup
      Service config files/var/lib/aolserver/$OPENACS_SERVICE_NAME/etc
      Service log files/var/lib/aolserver/$OPENACS_SERVICE_NAME/log
      Compile directory/usr/local/src
      PostgreSQL directory/usr/local/pgsql
      AOLserver directory/usr/local/aolserver

      - None of these locations are set in stone - they're simply - the values that we've chosen. The values that you'll + None of these locations are set in stone - they're simply + the values that we've chosen. The values that you'll probably want to change, such as service name, are marked like this. The other values we recommend you leave unchanged unless you have a @@ -58,8 +58,8 @@ those recommended in previous versions of this document to improve security and maintainability. See this thread for discussion.

      Getting Help during installation

      - We'll do our best to assure that following our instructions will get - you to the promised land. If something goes wrong, don't + We'll do our best to assure that following our instructions will get + you to the promised land. If something goes wrong, don't panic. There are plenty of ways to get help. Here are some tips:

      • Keep track of the commands you are run and record their output. I @@ -68,30 +68,30 @@ the output if needed. An alternative would be to use the script command.

      • - We'll point out where the error logs for the various pieces of - software are. Output from those logs will help us help you. Don't + We'll point out where the error logs for the various pieces of + software are. Output from those logs will help us help you. Don't worry if you feel overwhelmed by all the information in the error - logs. Over time, you'll find that they make more and more - sense. Soon, you'll actually look forward to errors so that you + logs. Over time, you'll find that they make more and more + sense. Soon, you'll actually look forward to errors so that you can run to the log and diagnose the problem.

      • Search the forums at - openacs.org - you'll often find many people who have - struggled through the same spot that you're in. + openacs.org - you'll often find many people who have + struggled through the same spot that you're in.

      • The bottom of each page has a link to OpenACS.org, where you can post comments and read other users comments about the contents of the page.

      • Ask questions at the irc channel on freenode.net - (#openacs). They're knowledgeable and quite friendly + (#openacs). They're knowledgeable and quite friendly if you can keep them on topic.

      • Post a question on the forums. Make sure - you've done a search first. When you do post, be sure to include + you've done a search first. When you do post, be sure to include your setup information (OS, etc) as well as the exact commands that are failing with the accompanying error. If - there's a SQL error in the Tcl error or in the log, + there's a SQL error in the Tcl error or in the log, post that too.

      • If you find errors in this document or if you have ideas about Index: openacs-4/packages/acs-core-docs/www/ix01.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/ix01.adp,v diff -u -N -r1.1.2.13 -r1.1.2.14 --- openacs-4/packages/acs-core-docs/www/ix01.adp 19 Nov 2016 09:21:54 -0000 1.1.2.13 +++ openacs-4/packages/acs-core-docs/www/ix01.adp 6 Jan 2017 09:18:42 -0000 1.1.2.14 @@ -8,23 +8,23 @@ rightLink="" rightLabel="">

        -Index

        +Index

      C

      -
      computeroutput
      code, Code -
      cvs
      +
      computeroutput
      code, Code +
      cvs
      initializing, Initialize CVS (OPTIONAL)
      setup, Using CVS with an OpenACS Site @@ -33,62 +33,62 @@

      D

      -
      daemontools
      installation, Install Daemontools (OPTIONAL) -
      docbook
      installation, Install Red Hat 8/9 -
      DocBook
      +
      daemontools
      installation, Install Daemontools (OPTIONAL) +
      docbook
      installation, Install Red Hat 8/9 +
      DocBook
      DTD, OpenACS Documentation Strategy: Why DocBook?
      emacs configuration for, Add PSGML commands to emacs init file (OPTIONAL)
      -
      Document structure, Document +
      Document structure, Document Structure

      E

      -
      emacs
      installation, Install Red Hat 8/9 -
      emphasis
      bold, italics, Emphasis +
      emacs
      installation, Install Red Hat 8/9 +
      emphasis
      bold, italics, Emphasis

      G

      -
      Graphics
      Images, Graphics +
      Graphics
      Images, Graphics

      I

      -
      informaltable
      table, Tables +
      informaltable
      table, Tables

      L

      -
      language
      installation, Install Red Hat 8/9 -
      Linking, Links -
      lists, Lists +
      language
      installation, Install Red Hat 8/9 +
      Linking, Links +
      lists, Lists

      Q

      -
      qmail
      +
      qmail
      installation, Install qmail (OPTIONAL)
      Maildir, Install qmail (OPTIONAL) @@ -98,39 +98,39 @@
      -

      T

      The publish point for new +

      T

      The publish point for new packages should be fixed., Prepare the package for distribution.

      U

      -
      ulink, Links -
      upgrade
      +
      ulink, Links +
      upgrade
      OpenACS 4.5 to 4.6.x
      Linux/Unix, Upgrading 4.5 or higher to 4.6.3

      X

      -
      XML guidelines, OpenACS +
      XML guidelines, OpenACS Documentation Strategy: Why DocBook? -
      xref
      linkend, Links -
      xreflabel, Headlines, +
      xref
      linkend, Links +
      xreflabel, Headlines, Sections
      Index: openacs-4/packages/acs-core-docs/www/ix01.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/ix01.html,v diff -u -N -r1.29.2.12 -r1.29.2.13 --- openacs-4/packages/acs-core-docs/www/ix01.html 19 Nov 2016 09:21:54 -0000 1.29.2.12 +++ openacs-4/packages/acs-core-docs/www/ix01.html 6 Jan 2017 09:18:42 -0000 1.29.2.13 @@ -1,3 +1,3 @@ -Index

      Index

      Symbols

      $OPENACS_SERVICE_NAME, Paths and Users

      C

      computeroutput
      code, Code
      cvs
      initializing, Initialize CVS (OPTIONAL)
      setup, Using CVS with an OpenACS Site

      E

      emacs
      installation, Install Red Hat 8/9
      emphasis
      bold, italics, Emphasis

      G

      Graphics
      Images, Graphics

      I

      informaltable
      table, Tables

      L

      language
      installation, Install Red Hat 8/9
      Linking, Links
      lists, Lists

      O

      OpenACS Package, What a Package Looks Like

      P

      photo-album
      installation (see ImageMagick)
      Postgres
      Vacuuming, Installation Option 2: Install from tarball

      Q

      qmail
      installation, Install qmail (OPTIONAL)
      Maildir, Install qmail (OPTIONAL)
      rcpthosts error message, Install qmail (OPTIONAL)

      T

      The publish point for new packages should be - fixed., Prepare the package for distribution.

      U

      ulink, Links
      upgrade
      OpenACS 4.5 to 4.6.x
      Linux/Unix, Upgrading 4.5 or higher to 4.6.3
      +Index

      Index

      Symbols

      $OPENACS_SERVICE_NAME, Paths and Users

      C

      computeroutput
      code, Code
      cvs
      initializing, Initialize CVS (OPTIONAL)
      setup, Using CVS with an OpenACS Site

      E

      emacs
      installation, Install Red Hat 8/9
      emphasis
      bold, italics, Emphasis

      G

      Graphics
      Images, Graphics

      I

      informaltable
      table, Tables

      L

      language
      installation, Install Red Hat 8/9
      Linking, Links
      lists, Lists

      O

      OpenACS Package, What a Package Looks Like

      P

      photo-album
      installation (see ImageMagick)
      Postgres
      Vacuuming, Installation Option 2: Install from tarball

      Q

      qmail
      installation, Install qmail (OPTIONAL)
      Maildir, Install qmail (OPTIONAL)
      rcpthosts error message, Install qmail (OPTIONAL)

      T

      The publish point for new packages should be + fixed., Prepare the package for distribution.

      U

      ulink, Links
      upgrade
      OpenACS 4.5 to 4.6.x
      Linux/Unix, Upgrading 4.5 or higher to 4.6.3
      Index: openacs-4/packages/acs-core-docs/www/mac-installation.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/mac-installation.adp,v diff -u -N -r1.1.2.6 -r1.1.2.7 --- openacs-4/packages/acs-core-docs/www/mac-installation.adp 30 Nov 2016 08:15:11 -0000 1.1.2.6 +++ openacs-4/packages/acs-core-docs/www/mac-installation.adp 6 Jan 2017 09:18:42 -0000 1.1.2.7 @@ -11,8 +11,8 @@

      OpenACS Installation Guide for Mac OS X

      See the wiki for an actual guideline: Installing OpenACS on Mac OS X -

      ($‌Id: mac-installation.html,v 1.42.2.12 -2016/11/19 09:21:54 gustafn Exp $)
      +

      ($‌Id: macinstall.xml,v 1.7 2014/10/27 16:39:31 +victorg Exp $)
      -

      Figure 6.8. Query +

      Figure 6.8. Query Analysis example

      Query Analysis example

      @@ -123,7 +123,7 @@ query, install "autotrace". I usually follow the instructions here http://asktom.oracle.com/~tkyte/article1/autotrace.html.

      -Make sure, that the Oracle CBO works with +Make sure, that the Oracle CBO works with adequate statistics

      The Oracle Cost Based optimizer is a piece of software that tries to find the "optimal" execution plan for a given SQL statement. For that it estimates the costs of running a SQL Index: openacs-4/packages/acs-core-docs/www/maint-performance.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/maint-performance.html,v diff -u -N -r1.29.2.12 -r1.29.2.13 --- openacs-4/packages/acs-core-docs/www/maint-performance.html 19 Nov 2016 09:21:54 -0000 1.29.2.12 +++ openacs-4/packages/acs-core-docs/www/maint-performance.html 6 Jan 2017 09:18:42 -0000 1.29.2.13 @@ -1,8 +1,8 @@ Diagnosing Performance Problems

      Diagnosing Performance Problems

      • Did performance problems happen overnight, or did they sneak up on you? Any clue what caused the performance problems (e.g. loading 20K - users into .LRN)

      • Is the file system out of space? Is the machine swapping to disk constantly?

      • Isolating and solving database problems.

        • Without daily internal maintenance, most databases slowly degrade in performance. For PostGreSQL, see the section called “Vacuum Postgres nightly”. For Oracle, use exec dbms_stats.gather_schema_stats('SCHEMA_NAME') (Andrew Piskorski's Oracle notes).

        • You can track the exact amount of time each database query on a page takes:

          1. Go to Main Site : Site-Wide Administration : Install Software

          2. Click on "Install New Application" in "Install from OpenACS Repository"

          3. Choose "ACS Developer Support">

          4. After install is complete, restart the server.

          5. Browse to Developer Support, which is automatically mounted at /ds. -

          6. Turn on Database statistics

          7. Browse directly to a slow page and click "Request Information" at the bottom of the page.

          8. This should return a list of database queries on the page, including the exact query (so it can be cut-paste into psql or oracle) and the time each query took.

            Figure 6.8. Query Analysis example

            Query Analysis example

        • Identify a runaway Oracle query: first, use ps aux or top to get the UNIX process ID of a runaway Oracle process.

          Log in to SQL*Plus as the admin:

          [$OPENACS_SERVICE_NAME ~]$ svrmgrl
          +    users into .LRN)

        • Is the file system out of space? Is the machine swapping to disk constantly?

        • Isolating and solving database problems.

          • Without daily internal maintenance, most databases slowly degrade in performance. For PostGreSQL, see the section called “Vacuum Postgres nightly”. For Oracle, use exec dbms_stats.gather_schema_stats('SCHEMA_NAME') (Andrew Piskorski's Oracle notes).

          • You can track the exact amount of time each database query on a page takes:

            1. Go to Main Site : Site-Wide Administration : Install Software

            2. Click on "Install New Application" in "Install from OpenACS Repository"

            3. Choose "ACS Developer Support">

            4. After install is complete, restart the server.

            5. Browse to Developer Support, which is automatically mounted at /ds. +

            6. Turn on Database statistics

            7. Browse directly to a slow page and click "Request Information" at the bottom of the page.

            8. This should return a list of database queries on the page, including the exact query (so it can be cut-paste into psql or oracle) and the time each query took.

              Figure 6.8. Query Analysis example

              Query Analysis example

          • Identify a runaway Oracle query: first, use ps aux or top to get the UNIX process ID of a runaway Oracle process.

            Log in to SQL*Plus as the admin:

            [$OPENACS_SERVICE_NAME ~]$ svrmgrl
             
             Oracle Server Manager Release 3.1.7.0.0 - Production
             
            @@ -27,7 +27,7 @@
              where sql.address    = s.sql_address
                and sql.hash_value = s.sql_hash_value
              --and upper(s.username) like 'USERNAME%'
            - order by s.username ,s.sid ,s.serial# ,sql.piece ;

            To kill a troubled process:

            alter system kill session 'SID,SERIAL#';  --substitute values for SID and SERIAL#

            (See Andrew Piskorski's Oracle notes)

          • Identify a runaway Postgres query. First, logging must be enabled in the database. This imposes a performance penalty and should not be done in normal operation.

            Edit the file postgresql.conf - its location depends on the PostGreSQL installation - and change

            #stats_command_string = false

            to

            stats_command_string = true

            Next, connect to postgres (psql service0) and select * from pg_stat_activity;. Typical output should look like:

            + order by s.username ,s.sid ,s.serial# ,sql.piece ;

            To kill a troubled process:

            alter system kill session 'SID,SERIAL#';  --substitute values for SID and SERIAL#

            (See Andrew Piskorski's Oracle notes)

          • Identify a runaway Postgres query. First, logging must be enabled in the database. This imposes a performance penalty and should not be done in normal operation.

            Edit the file postgresql.conf - its location depends on the PostGreSQL installation - and change

            #stats_command_string = false

            to

            stats_command_string = true

            Next, connect to postgres (psql service0) and select * from pg_stat_activity;. Typical output should look like:

               datid   |   datname   | procpid | usesysid | usename |  current_query
             ----------+-------------+---------+----------+---------+-----------------
              64344418 | openacs.org |   14122 |      101 | nsadmin | <IDLE>
            @@ -47,9 +47,9 @@
                   what is going on inside Oracle. Oracle provides Statspack, a package to
                   monitor and save the state of the v$ performance views. These reports
                   help finding severe problems by exposing summary data about the Oracle
            -      wait interface, executed queries. You'll find the installation
            +      wait interface, executed queries. You'll find the installation
                   instructions in $ORACLE_HOME/rdbms/admin/spdoc.txt. Follow the
            -      instructions carefully and take periodic snapshots, this way you'll be
            +      instructions carefully and take periodic snapshots, this way you'll be
                   able to look at historical performance data.
                 

            Also turn on the timed_statistics in your init.ora file, so that @@ -59,7 +59,7 @@

            To be able to get a overview of how Oracle executes a particular query, install "autotrace". I usually follow the instructions here http://asktom.oracle.com/~tkyte/article1/autotrace.html. -

            Make sure, that the Oracle CBO works with adequate statistics

            +

            Make sure, that the Oracle CBO works with adequate statistics

            The Oracle Cost Based optimizer is a piece of software that tries to find the "optimal" execution plan for a given SQL statement. For that it estimates the costs of running a SQL query in a particular way (by default Index: openacs-4/packages/acs-core-docs/www/maintenance-deploy.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/maintenance-deploy.adp,v diff -u -N -r1.1.2.14 -r1.1.2.15 --- openacs-4/packages/acs-core-docs/www/maintenance-deploy.adp 30 Nov 2016 08:15:11 -0000 1.1.2.14 +++ openacs-4/packages/acs-core-docs/www/maintenance-deploy.adp 6 Jan 2017 09:18:42 -0000 1.1.2.15 @@ -11,8 +11,8 @@

            Staged Deployment for Production Networks

            -
            ($‌Id: maintenance-deploy.html,v 1.24.2.12 -2016/11/19 09:21:54 gustafn Exp $)

            By Joel Aufrecht +

            ($‌Id: maintenance.xml,v 1.30.6.1 2016/06/23 +08:32:46 gustafn Exp $)

            By Joel Aufrecht

            OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

            This section describes two minimal-risk methods for deploying @@ -24,7 +24,7 @@ working configuration safely and quickly.

          -Method 1: Deployment with CVS

          With this method, we control the files on a site via CVS. This +Method 1: Deployment with CVS

      With this method, we control the files on a site via CVS. This example uses one developmental server (service0-dev) and one production server (service0). Depending on your needs, you can also have a staging server for extensive testing before you go live. The @@ -103,7 +103,7 @@ tags to follow ...

      -Method 2: A/B Deployment

      The approach taken in this section is to always create a new +Method 2: A/B Deployment

      The approach taken in this section is to always create a new service with the desired changes, running in parallel with the existing site. This guarantees control, at least at the final step of the process: you know what changes you are about to make because @@ -119,28 +119,28 @@ function or risk losing data in the shuffle. It also requires extra steps if the database will be affected.

      -Simple A/B Deployment: Database is not +Simple A/B Deployment: Database is not changed

      -

      Figure 6.2. Simple +

      Figure 6.2. Simple A/B Deployment - Step 1

      Simple A/B Deployment - Step 1

      -

      Figure 6.3. Simple +

      Figure 6.3. Simple A/B Deployment - Step 2

      Simple A/B Deployment - Step 2

      -

      Figure 6.4. Simple +

      Figure 6.4. Simple A/B Deployment - Step 3

      Simple A/B Deployment - Step 3

      -Complex A/B Deployment: Database is +Complex A/B Deployment: Database is changed

      -

      Figure 6.5. Complex A/B Deployment +

      Figure 6.5. Complex A/B Deployment - Step 1

      Complex A/B Deployment - Step 1

      -

      Figure 6.6. Complex A/B Deployment +

      Figure 6.6. Complex A/B Deployment - Step 2

      Complex A/B Deployment - Step 2

      -

      Figure 6.7. Complex A/B Deployment +

      Figure 6.7. Complex A/B Deployment - Step 3

      Complex A/B Deployment - Step 3

      Index: openacs-4/packages/acs-core-docs/www/maintenance-deploy.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/maintenance-deploy.html,v diff -u -N -r1.24.2.12 -r1.24.2.13 --- openacs-4/packages/acs-core-docs/www/maintenance-deploy.html 19 Nov 2016 09:21:54 -0000 1.24.2.12 +++ openacs-4/packages/acs-core-docs/www/maintenance-deploy.html 6 Jan 2017 09:18:42 -0000 1.24.2.13 @@ -2,18 +2,18 @@ Staged Deployment for Production Networks

      Staged Deployment for Production Networks

      ($Id$)

      By Joel Aufrecht

      OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff. -

      This section describes two minimal-risk methods for deploying changes on a production network. The important characteristics of a safe change deployment include: (THIS SECTION IN DEVELOPMENT)

      • Control: You know for sure that the change you are making is the change that you intend to make and is the change that you tested.

      • Rollback: If anything goes wrong, you can return to the previous working configuration safely and quickly.

      Method 1: Deployment with CVS

      With this method, we control the files on a site via +

      This section describes two minimal-risk methods for deploying changes on a production network. The important characteristics of a safe change deployment include: (THIS SECTION IN DEVELOPMENT)

      • Control: You know for sure that the change you are making is the change that you intend to make and is the change that you tested.

      • Rollback: If anything goes wrong, you can return to the previous working configuration safely and quickly.

      Method 1: Deployment with CVS

      With this method, we control the files on a site via CVS. This example uses one developmental server (service0-dev) and one production server (service0). Depending on your needs, you can also have a staging server for extensive testing before you go live. The only way files should move between the server instances is via cvs.

      To set up a developmental installation, first set up either your developmental installation or your production installation, and follow the instructions for committing your - files to CVS. We'll assume in this example that you set up the + files to CVS. We'll assume in this example that you set up the production server (service0). To set up the developmental instance, you then follow the intall guide again, this time creating a new - user (service0-dev) that you'll use for the new installation. To get + user (service0-dev) that you'll use for the new installation. To get the files for service0-dev, you check them out from cvs (check out service0).

       su - service0-dev
      @@ -22,14 +22,14 @@
       ln -s /home/service0-dev/web /var/lib/aolserver/service0-dev
       emacs web/etc/config.tcl
       emacs web/etc/daemontools/run
      -

      In the config.tcl file, you'll probably want to pay attention +

      In the config.tcl file, you'll probably want to pay attention the rollout support section. That will ensure that email on your developmental server will not be sent out to the general world.

      Also, instead of going through the OpenACS online - installer, you'll actually load live data into your production + installer, you'll actually load live data into your production server.

      You can even automate the process of getting live data from your production server. Copy something like this to - /home/service0-dev/bin and put it in service0-dev's crontab to - run once a night. You'll need to make sure the database backups + /home/service0-dev/bin and put it in service0-dev's crontab to + run once a night. You'll need to make sure the database backups are set up in service0's crontab, and that if the servers are on different physical machines, that the database backup is copied to the developmental machine once per night.

      @@ -54,7 +54,7 @@
       if the file is /var/lib/aolserver/service0-dev/www/index.adp, do: 
       
       cd /var/lib/aolserver/service0-dev/www
      -cvs diff index.adp (this is optional; it's just a
      +cvs diff index.adp (this is optional; it's just a
       reality check)
       the lines starting > will be added and the lines
       starting < will be removed, when you commit
      @@ -66,5 +66,5 @@
       cd /var/lib/aolserver/service0/www
       cvs up -Pd index.adp

      If you make changes that require changes to the database, test them out first on service0-dev, using either -create.sql or - upgrade scripts. Once you've tested them, you then update and - run the upgrade scripts from the package manager.

      The production site can run "HEAD" from cvs.

      The drawback to using HEAD as the live code is that you cannot commit new work on the development server without erasing the definition of 'working production code.' So a better method is to use a tag. This guarantees that, at any time in the future, you can retrieve exactly the same set of code. This is useful for both of the characteristics of safe change deployment. For control, you can use tags to define a body of code, test that code, and then know that what you are deploying is exactly that code. For rollback, you can use return to the last working tag if the new tag (or new, untagged changes) cause problems. .... example of using tags to follow ...

      Method 2: A/B Deployment

      The approach taken in this section is to always create a new service with the desired changes, running in parallel with the existing site. This guarantees control, at least at the final step of the process: you know what changes you are about to make because you can see them directly. It does not, by itself, guarantee the entire control chain. You need additional measures to make sure that the change you are making is exactly and completely the change you intended to make and tested previously, and nothing more. Those additional measures typically take the form of source control tags and system version numbers. The parallel-server approach also guarantees rollback because the original working service is not touched; it is merely set aside.

      This approach can has limitations. If the database or file system regularly receiving new data, you must interrupt this function or risk losing data in the shuffle. It also requires extra steps if the database will be affected.

      Simple A/B Deployment: Database is not changed

      Figure 6.2. Simple A/B Deployment - Step 1

      Simple A/B Deployment - Step 1

      Figure 6.3. Simple A/B Deployment - Step 2

      Simple A/B Deployment - Step 2

      Figure 6.4. Simple A/B Deployment - Step 3

      Simple A/B Deployment - Step 3

      Complex A/B Deployment: Database is changed

      Figure 6.5. Complex A/B Deployment - Step 1

      Complex A/B Deployment - Step 1

      Figure 6.6. Complex A/B Deployment - Step 2

      Complex A/B Deployment - Step 2

      Figure 6.7. Complex A/B Deployment - Step 3

      Complex A/B Deployment - Step 3

      + upgrade scripts. Once you've tested them, you then update and + run the upgrade scripts from the package manager.

      The production site can run "HEAD" from cvs.

      The drawback to using HEAD as the live code is that you cannot commit new work on the development server without erasing the definition of 'working production code.' So a better method is to use a tag. This guarantees that, at any time in the future, you can retrieve exactly the same set of code. This is useful for both of the characteristics of safe change deployment. For control, you can use tags to define a body of code, test that code, and then know that what you are deploying is exactly that code. For rollback, you can use return to the last working tag if the new tag (or new, untagged changes) cause problems. .... example of using tags to follow ...

      Method 2: A/B Deployment

      The approach taken in this section is to always create a new service with the desired changes, running in parallel with the existing site. This guarantees control, at least at the final step of the process: you know what changes you are about to make because you can see them directly. It does not, by itself, guarantee the entire control chain. You need additional measures to make sure that the change you are making is exactly and completely the change you intended to make and tested previously, and nothing more. Those additional measures typically take the form of source control tags and system version numbers. The parallel-server approach also guarantees rollback because the original working service is not touched; it is merely set aside.

      This approach can has limitations. If the database or file system regularly receiving new data, you must interrupt this function or risk losing data in the shuffle. It also requires extra steps if the database will be affected.

      Simple A/B Deployment: Database is not changed

      Figure 6.2. Simple A/B Deployment - Step 1

      Simple A/B Deployment - Step 1

      Figure 6.3. Simple A/B Deployment - Step 2

      Simple A/B Deployment - Step 2

      Figure 6.4. Simple A/B Deployment - Step 3

      Simple A/B Deployment - Step 3

      Complex A/B Deployment: Database is changed

      Figure 6.5. Complex A/B Deployment - Step 1

      Complex A/B Deployment - Step 1

      Figure 6.6. Complex A/B Deployment - Step 2

      Complex A/B Deployment - Step 2

      Figure 6.7. Complex A/B Deployment - Step 3

      Complex A/B Deployment - Step 3

      Index: openacs-4/packages/acs-core-docs/www/maintenance-web.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/maintenance-web.html,v diff -u -N -r1.40.2.3 -r1.40.2.4 --- openacs-4/packages/acs-core-docs/www/maintenance-web.html 19 Nov 2016 09:21:54 -0000 1.40.2.3 +++ openacs-4/packages/acs-core-docs/www/maintenance-web.html 6 Jan 2017 09:18:42 -0000 1.40.2.4 @@ -1,5 +1,5 @@ -Chapter 6. Production Environments

      Chapter 6. Production Environments

      by Joel Aufrecht

      +Chapter 6. Production Environments Index: openacs-4/packages/acs-core-docs/www/object-identity.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/object-identity.adp,v diff -u -N -r1.1.2.7 -r1.1.2.8 --- openacs-4/packages/acs-core-docs/www/object-identity.adp 30 Nov 2016 08:15:11 -0000 1.1.2.7 +++ openacs-4/packages/acs-core-docs/www/object-identity.adp 6 Jan 2017 09:18:42 -0000 1.1.2.8 @@ -50,8 +50,8 @@ with an integer primary key that is derived from a globally unique sequence is the key to eliminating redundant code and replacing it with generic object level -services.

      ($‌Id: object-identity.html,v 1.49.2.12 -2016/11/19 09:21:54 gustafn Exp $)
      +services.

      ($‌Id: object-identity.xml,v 1.7 2006/07/17 +05:38:37 torbenb Exp $)
      implied identity. Every mapping between a user and a group could have an arbitrary number of attached values (user_group_member_fields, etc.). In this case it is the pair (group_id, user_id) that implicitly refers to an -object (the person's membership in a group). In the 5.9.0 data model this +object (the person's membership in a group). In the 5.9.0 data model this object identity is made explicit by adding an integer primary key to the table that maps users to groups.

      Coming from a purely relational world, this might seem slightly weird at first. The pair (group_id, user_id) is sufficient to uniquely identify the object in question, so why have the redundant integer primary key? If you -take a closer look, it actually isn't quite so redundant. If you want to -be able to use the object model's permissioning features, and generic +take a closer look, it actually isn't quite so redundant. If you want to +be able to use the object model's permissioning features, and generic attribute features on a table, you need an integer primary key for that -table. This is because you can't really write a data model in oracle that +table. This is because you can't really write a data model in oracle that uses more than one way to represent identity.

      So, this apparently redundant primary key has saved us the trouble of duplicating the entire generic storage system for the special case of the user_group_map, and has saved us from implementing ad-hoc security instead of just using acs-permissions. This design choice is further validated by the -fact that services like journals that weren't previously thought to be +fact that services like journals that weren't previously thought to be generic can in fact be generically applied to membership objects, thereby -allowing us to eliminated membership state auditing columns that weren't +allowing us to eliminated membership state auditing columns that weren't even capable of fully tracking the history of membership state.

      The design choice of explicitly representing object identity with an integer primary key that is derived from a globally unique sequence is the key to eliminating redundant code and replacing it with generic object Index: openacs-4/packages/acs-core-docs/www/object-system-design.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/object-system-design.html,v diff -u -N -r1.34.2.4 -r1.34.2.5 --- openacs-4/packages/acs-core-docs/www/object-system-design.html 19 Nov 2016 09:21:54 -0000 1.34.2.4 +++ openacs-4/packages/acs-core-docs/www/object-system-design.html 6 Jan 2017 09:18:42 -0000 1.34.2.5 @@ -20,7 +20,7 @@ data model that keeps track of the application objects that we wish to manage, and serves as a primary store of metadata. By metadata, we mean data stored on behalf of an application -outside of the application's data model in order to enable +outside of the application's data model in order to enable certain central services. The OpenACS 4 Object Model (or object system) manages several different kinds of data and metadata to allow us to provide general services to applications:

      • Object Identification

        Every application object is given a unique identifier in the system. This @@ -82,7 +82,7 @@ notion of "scoping" was introduced into the core data model.

        "Scope" is a term best explained by example. Consider some hypothetical rows in the address_book table:

        ...scopeuser_idgroup_id...
        ...user123 ...
        ...group 456...
        ...public ...

        The first row represents an entry in User 123's personal address book, the second row represents an entry in User Group 456's shared address -book, and the third row represents an entry in the site's public address +book, and the third row represents an entry in the site's public address book.

        In this way, the scoping columns identify the security context in which a given object belongs, where each context is either a person or a group of people or the general public (itself a group @@ -94,11 +94,11 @@ forum message would probably list a forum topic as its context, and a forum topic might list a subsite as its context. Thus, contexts make it easier to break the site up into security domains according to its natural -structure. An object's context is stored in the context_id -column of the acs_objects table.

        We use an object's context to provide a default answer to questions +structure. An object's context is stored in the context_id +column of the acs_objects table.

        We use an object's context to provide a default answer to questions regarding access control. Whenever we ask a question of the form "can user X perform action Y on object Z", the OpenACS security model will defer -to an object's context if there is no information about user X's +to an object's context if there is no information about user X's permission to perform action Y on object Z.

        The context system forms the basis for the rest of the OpenACS access control system, which is described in in two separate documents: one for the permissions system and another for the party groups system. The context system @@ -138,7 +138,7 @@ these fat tables have a couple of other problems:

        • They degrade performance.

        • Denormalization can make it hard to maintain consistency constraints on the data.

        Object subtypes provide a way to factor the data model while still keeping track of the fact that each member of a subtype (i.e. for each row in the -subtype's table), is also a member of the parent type (i.e. there is a +subtype's table), is also a member of the parent type (i.e. there is a corresponding row in the parent type table). Therefore, applications an use this mechanism without worrying about this bookkeeping themselves, and we avoid having applications pollute the core data model with their specific @@ -202,12 +202,12 @@ easily create a mapping table to do the same thing. The advantage of registering this table as a relation type is that in principle the OpenACS 4 object system could use the meta data in the types table to do useful things -in a generic way on all relation types. But this mechanism doesn't really +in a generic way on all relation types. But this mechanism doesn't really exist yet.

        Relation types are a somewhat abstract idea. To get a better feel for them, you should just skip to the data model.

      Summary and Design Considerations

      The OpenACS 4 Object Model is designed to generalize and unify the following mechanisms that are repeatedly implemented in OpenACS-based systems to manage generic and application specific metadata:

      Why not Object Databases?

      The presence of a framework for subtyping and inheritance always brings up -the question of why we don't just use an object database. The main reason +the question of why we don't just use an object database. The main reason is that all of the major object database vendors ship products that are effectively tied to some set of object oriented programming languages. Their idea is to provide tight language-level integration to lower the @@ -235,7 +235,7 @@ the relational data model while gaining the object oriented features we need most.

      In the context of OpenACS 4, this means using the object model to make our data models more flexible, so that new modules can easily gain access to -generic features. However, while the API itself doesn't enforce the idea +generic features. However, while the API itself doesn't enforce the idea that applications only use the object model for metadata, it is also the case that the data model is not designed to scale to large type hierarchies. In the more limited domain of the metadata model, this is acceptable since the @@ -319,7 +319,7 @@ by the table_name of the corresponding object type, although, as mentioned above, we sometimes store attribute values as key-value pairs in a "skinny" table. However, when you ask the question "What are -the attributes of this type of object?", you don't really care about +the attributes of this type of object?", you don't really care about how the values for each attribute are stored (in a column or as key-value pairs); you expect to receive the complete list of all attributes.

    14. The max_n_values and min_n_values columns encode information about the number of values an attribute may hold. @@ -370,7 +370,7 @@ model, which is discussed next.

    15. Operational-level Data Model

      The operational level data model centers around the acs_objects table. This table contains a single row for every instance of the type acs_object. The table contains the -object's unique identifier, a reference to its type, security +object's unique identifier, a reference to its type, security information, and generic auditing information. Here is what the table looks like:

       
      @@ -395,10 +395,10 @@
       acs_object_context_index that stores the context hierarchy.

      Other tables in the core data model store additional information related to objects. The table acs_attribute_values and acs_static_attr_values are used to store attribute values that -are not stored in a helper table associated with the object's type. The +are not stored in a helper table associated with the object's type. The former is used for instance attributes while the latter is used for class-wide "static" values. These tables have the same basic form, -so we'll only show the first:

      +so we'll only show the first:

       
       create table acs_attribute_values (
               object_id       not null
      @@ -431,8 +431,8 @@
       type. We do this so we can store all the mapping tables in this one
       table.

    16. rel_type is the ID of the relation type to which this object belongs.

    17. The next two object IDs are the IDs of the objects being mapped.

    18. All this table does is store one row for every pair of objects that -we'd like to attach with a relation. Any additional attributes that -we'd like to attach to this pair of objects is specified in the +we'd like to attach with a relation. Any additional attributes that +we'd like to attach to this pair of objects is specified in the attributes of the relation type, and could be stored in any number of places. As in the 3.x user/groups system, these places include helper tables or generic skinny tables.

      This table, along with acs_attributes and @@ -444,9 +444,9 @@ the system. Services can use this table along with the metadata in stored in the knowledge level data model to create, manage, query and manipulate objects in a uniform manner. The acs_rels table has an analogous -role in storing information on relations.

      These are all the tables that we'll discuss in this document. The rest +role in storing information on relations.

      These are all the tables that we'll discuss in this document. The rest of the Kernel data model is described in the documents for subsites, the permissions system and for the groups system.

      Some examples of how these tables are used in the system can be found in -the discussion of the API, which comes next.

      API

      Now we'll examine each piece of the API in detail. Bear in mind that +the discussion of the API, which comes next.

      API

      Now we'll examine each piece of the API in detail. Bear in mind that the Object Model API is defined primarily through PL/SQL packages.

      Object Types and Attributes

      The object system provides an API for creating new object types and then attaching attributes to them. The procedures create_type and drop_type are used to create and delete type definitions.

      The two calls show up in the package acs_object_type.

      @@ -578,7 +578,7 @@
       with the data model at a lower level.

      The function acs_object.new() makes a new object for you. The function acs_object.del() deletes an object. As before, this is an abbreviated interface with all the long type specs removed. See the -data model or developer's guide for the full interface.

      +data model or developer's guide for the full interface.

       
        function new (
         object_id     in acs_objects.object_id%TYPE default null,
      @@ -599,8 +599,8 @@
       
       

      Next, we define some generic functions to manipulate attributes. Again, these interfaces are useful to an extent, but for large scale queries, -it's likely that developers would have to query the data model directly, -and then encapsulate their queries in procedures.

      For names, the default_name function is used if you don't +it's likely that developers would have to query the data model directly, +and then encapsulate their queries in procedures.

      For names, the default_name function is used if you don't want to define your own name function.

       
        function name (
      @@ -667,7 +667,7 @@
       
       
       

      This function will typically be defined in the context of a PL/SQL -package, but we've left it stand-alone here for simplicity.

      To summarize: in order to take advantage of OpenACS 4 services, a new +package, but we've left it stand-alone here for simplicity.

      To summarize: in order to take advantage of OpenACS 4 services, a new application need only do three things:

      • Define a data model to describe application objects. This can just be a normal SQL table.

      • Create an object type, using code like in the example from the previous section.

      • Make sure application objects are created using @@ -776,9 +776,9 @@ ); -

      In this example, we've made groups a subtype of +

      In this example, we've made groups a subtype of acs_object to make the code simpler. The actual data model is -somewhat different. Also, we've assumed that there is a helper table +somewhat different. Also, we've assumed that there is a helper table called groups to store information on groups, and that there is a helper table called group_types that has been defined to store extra attributes on groups.

      Now, assuming we have another object type called person to @@ -851,7 +851,7 @@ end; -

      Summary and Discussion

      The Object Model's API and data model provides a small set of simple +

      Summary and Discussion

      The Object Model's API and data model provides a small set of simple procedures that allow applications to create object types, object instances, and object relations. Most of the data model is straightforward; the relation type mechanism is a bit more complex, but in return it provides functionality Index: openacs-4/packages/acs-core-docs/www/object-system-requirements.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/object-system-requirements.html,v diff -u -N -r1.34.2.3 -r1.34.2.4 --- openacs-4/packages/acs-core-docs/www/object-system-requirements.html 19 Nov 2016 09:21:54 -0000 1.34.2.3 +++ openacs-4/packages/acs-core-docs/www/object-system-requirements.html 6 Jan 2017 09:18:42 -0000 1.34.2.4 @@ -18,7 +18,7 @@ concerned primarily with the storage and management of metadata, on any object within a given instance of OpenACS 4. The term "metadata" refers to any extra data the OM stores on behalf of the application - outside -of the application's data model - in order to enable certain generic +of the application's data model - in order to enable certain generic services. The term "object" refers to any entity being represented within the OpenACS, and typically corresponds to a single row within the relational database.

      Vision Statement

      The OpenACS 4 Object Model must address five high-level requirements that @@ -52,7 +52,7 @@ model.

      "Scope" is a term best explained by example. Consider some hypothetical rows in the address_book table:

      ...scopeuser_idgroup_id...
      ...user123 ...
      ...group 456...
      ...public ...

      The first row represents an entry in User 123's personal address book, the second row represents an entry in User Group 456's shared address -book, and the third row represents an entry in the site's public address +book, and the third row represents an entry in the site's public address book.

      In this way, the scoping columns identify the security context in which a given object belongs, where each context is either a person or a group of people or the general public (itself a group @@ -68,7 +68,7 @@ tables in the system became bloated as they were extended to support an increasing number of modules. The users table is the best case in point: it became full of columns that exist for various special -applications (e.g. user portraits), but that aren't really related to +applications (e.g. user portraits), but that aren't really related to each other in any way except that they store information on users, i.e. the table became grossly denormalized. Normalizing (breaking-down) this table into several pieces, each of which is specific to a particular application, @@ -82,13 +82,13 @@ custom extensions to the existing data models, and the OM does the bookkeeping necessary to make this easier, providing a generic API for object creation that automatically keeps track of the location and relationships -between data.

      Design Note: While this doesn't really belong in a +between data.

      Design Note: While this doesn't really belong in a requirements document, the fact that we are constrained to using relational databases means that certain constraints on the overall design of the object data model exist, which you can read about in Summary and Design Considerations.

      Modifiable Data Models

      Another recurring applications problem is how to store a modifiable data model, or how to store information that may change extensively between releases or in different client installations. Furthermore, we want to avoid -changes to an application's database queries in the face of any custom +changes to an application's database queries in the face of any custom extensions, since such changes are difficult or dangerous to make at runtime, and can make updating the system difficult. Some example applications in OpenACS 3.x with modifiable data models include:

      • User/groups: developers and users can attach custom data to group types, @@ -150,7 +150,7 @@ system.

        The object identifiers should be subject to the following requirements:

        10.10 Uniqueness

        The object ID should be unique among all the IDs in the entire OpenACS system in which the object lives.

        10.20 Useful as a Reference

        Applications should be able to use the unique object ID as a reference, -with which they can fetch any or all of the object's attributes.

        10.30 Storable

        Object IDs should be storable in tables. e.g. you should be able to use +with which they can fetch any or all of the object's attributes.

        10.30 Storable

        Object IDs should be storable in tables. e.g. you should be able to use them to implement mapping tables between objects, to represent relationships.

        10.40 Moveable

        Objects should be mobile between databases. That is, information will often need to be moved between multiple servers (development, staging, and @@ -258,7 +258,7 @@ another. Since it is important that the largest audience of developers possible adopts and uses the OM, it must be easy to incorporate into applications, and it must not impose undue requirements on an -application's data model. In other words, it should be easy to "hook +application's data model. In other words, it should be easy to "hook into" the object model, and that ability should not have a major impact on the application data model.

        Note: Is the API the only way to obtain values? How does this integrate with application level SQL queries?

      Revision History

      -
      Document Revision #Action Taken, NotesWhen?By Whom?
      0.1Creation08/10/2000Bryan Quinn
      0.2Major re-write08/11/2000Pete Su
      0.3Draft completed after initial reviews08/22/2000Pete Su
      0.4Edited, updated to conform to requirements template, pending freeze08/23/2000Kai Wu
      Final edits before freeze08/24/2000Pete Su
      0.5Edited for consistency08/27/2000Kai Wu
      0.6Put Object ID stuff first, because it makes more sense08/28/2000Pete Su
      0.7Added requirement that knowledge-level objects must be moveable between Index: openacs-4/packages/acs-core-docs/www/objects.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/objects.adp,v diff -u -N -r1.1.2.14 -r1.1.2.15 --- openacs-4/packages/acs-core-docs/www/objects.adp 30 Nov 2016 08:15:11 -0000 1.1.2.14 +++ openacs-4/packages/acs-core-docs/www/objects.adp 6 Jan 2017 09:18:42 -0000 1.1.2.15 @@ -86,7 +86,7 @@ for the PG version) file created when we created the package. Then, do the following:

      -Describe the new type to the type +Describe the new type to the type system

      First, add an entry to the acs_object_types table with the following PL/SQL call:

       begin  
      @@ -142,7 +142,7 @@
       attributes, so there is no need for us to define them.

      -Define a table in which to store your +Define a table in which to store your objects

      The next thing we do is make a small modification to the data model to reflect the fact that each row in the notes table represents something that is not only an object of type note, but also an acs_object. The new table definition looks @@ -166,7 +166,7 @@ acs_objects.

      -Define a package for type specific +Define a package for type specific procedures

      The next step is to define a PL/SQL package for your new type, and write some basic procedures to create and delete objects. Here is a package definition for our new type:

      @@ -213,7 +213,7 @@
       only" by default. We'll talk about this more later.

      -Define a package body for type specific +Define a package body for type specific procedures

      The PL/SQL package body contains the implementations of the procedures defined above. The only subtle thing going on here is that we must use acs_object.new @@ -365,8 +365,8 @@ acs_objects. This means you should never use the fields in acs_objects for application-specific purposes. This is especially true for the context_id field.

      -
      ($‌Id: objects.html,v 1.52.2.12 2016/11/19 -09:21:54 gustafn Exp $)
      +
      ($‌Id: objects.xml,v 1.9.14.1 2016/06/23 +08:32:46 gustafn Exp $)

      -We've omitted constraint names for the purpose of clarity. +We've omitted constraint names for the purpose of clarity.

      Thinking further ahead, we can imagine doing any of the following things with Notes as well: -

      • Define access control policies on notes.

      • Attach user comments on notes.

      • Allow users to define custom fields to store on their notes.

      • Automatically generate input forms or output displays for notes.

      • Allow other applications to use notes in ways we don't know of yet.

      +

      • Define access control policies on notes.

      • Attach user comments on notes.

      • Allow users to define custom fields to store on their notes.

      • Automatically generate input forms or output displays for notes.

      • Allow other applications to use notes in ways we don't know of yet.

      In OpenACS, the key to enabling these types of services on your application data is to take advantage of the Object System. The first question, then, is "Just what are objects, and what do you use them for anyway?". The short answer: objects are anything -represented in the application's data model that will need to be +represented in the application's data model that will need to be managed by any central service in OpenACS, or that may be reusable in the context of future applications. Every object in the system is represented using a row in the acs_objects table. This @@ -53,7 +53,7 @@ a general-comments replacement to personalized ranking - will become available to your application "for free."

      How to Use Objects

      -Using ACS objects is straightforward: all that's required are a few +Using ACS objects is straightforward: all that's required are a few extra steps in the design of your application data model.

      In order to hook our Notes application into the object system, we @@ -72,14 +72,14 @@ inherit attributes from a parent type, so the type system forms a hierarchy. Unlike Java, Oracle does not support this inheritance transparently, so we have to make sure we add our own bookkeeping code to -keep everything consistent. Below you'll find the code needed to describe a +keep everything consistent. Below you'll find the code needed to describe a new object type called notes in your system.

      Fire up your text editor and open the ROOT/packages/notes/sql/oracle/notes-create.sql (ROOT/packages/notes/sql/postgresql/notes-create.sql for the PG version) file created when we created the package. Then, do the following: -

      Describe the new type to the type system

      +

      Describe the new type to the type system

      First, add an entry to the acs_object_types table with the following PL/SQL call:

       begin  
      @@ -100,14 +100,14 @@
       note. This type is a subtype of the 
       acs_object type, which means that we want to inherit all
       of the basic attributes of all ACS objects. As mentioned, it will take
      -some work on our part to make this happen, since Oracle can't do it
      +some work on our part to make this happen, since Oracle can't do it
       automatically.  In general, most basic applications will define types
       that are simple subtypes of acs_object.
       

      Add entries to the acs_attributes table to describe the data attributes of the new type. This data can eventually be used to do things like automatically generate user interfaces to manipulate -the notes table, though that functionality isn't yet +the notes table, though that functionality isn't yet available.

       declare 
      @@ -139,7 +139,7 @@
       because the new type note is a subtype of
       acs_object, it will inherit these attributes, so there is
       no need for us to define them.
      -

      Define a table in which to store your objects

      +

      Define a table in which to store your objects

      The next thing we do is make a small modification to the data model to reflect the fact that each row in the notes table represents something that is not only an object of type @@ -164,7 +164,7 @@ use the acs_objects table to find objects will transparently find any objects that are instances of any subtype of acs_objects. -

      Define a package for type specific procedures

      +

      Define a package for type specific procedures

      The next step is to define a PL/SQL package for your new type, and write some basic procedures to create and delete objects. Here is a package definition for our new type: @@ -193,9 +193,9 @@ show errors

      You might be wondering what all the extra parameters are to these -calls, since we haven't mentioned them before. These parameters are +calls, since we haven't mentioned them before. These parameters are needed to fill out information that will be stored about the object -that's not stored directly in the table you defined. The OpenACS Object +that's not stored directly in the table you defined. The OpenACS Object System defines these attributes on the type acs_object since all objects should have these attributes. Internally, there are tables that store this information for you. Most of the data is pretty @@ -210,9 +210,9 @@ then the object inherits its permissions from the context. For example, if I had told you how to use the permissions system to specify that an object OBJ was "read only", then any other object that used OBJ as its -context would also be "read only" by default. We'll talk about this more +context would also be "read only" by default. We'll talk about this more later. -

      Define a package body for type specific procedures

      +

      Define a package body for type specific procedures

      The PL/SQL package body contains the implementations of the procedures defined above. The only subtle thing going on here is that we must use acs_object.new to insert a row into @@ -272,15 +272,15 @@ / show errors;

      -That's pretty much it! As long as you use the note.new +That's pretty much it! As long as you use the note.new function to create notes, and the note.delete function to -delete them, you'll be assured that the relationship each +delete them, you'll be assured that the relationship each note has with its corresponding acs_object is preserved.

      The last thing to do is to make a file -ROOT/packages/notes/sql/notes-drop.sql so it's easy to -drop the data model when, say, you're testing: +ROOT/packages/notes/sql/notes-drop.sql so it's easy to +drop the data model when, say, you're testing:

       begin 
         acs_object_type.drop_type ('note'); 
      @@ -306,7 +306,7 @@
       For example, for most applications, you will want to use objects to
       represent the data in your application that is user visible and thus
       requires access control. But other internal tables, views, mapping
      -tables and so on probably don't need to be objects. As before, this
      +tables and so on probably don't need to be objects. As before, this
       kind of design decision is mostly made on an
       application-by-application basis, but this is a good baseline from
       which to start.
      @@ -333,7 +333,7 @@
       field in any other way whatsoever is guaranteed to make your
       application act strangely.
       

      -As we'll see later, the Notes example will point each note object's +As we'll see later, the Notes example will point each note object's context_id to the package instance in which the note was created. The idea will be that in a real site, the administrator would create one package instance for every separate set of Notes (say, one @@ -362,9 +362,9 @@ are careful to define our own attribute for owner_id rather than overloading creation_user from the objects table. But, since we will probably use creation_date and -so on for their intended purposes, we don't bother to define our own +so on for their intended purposes, we don't bother to define our own attributes to store that data again. This will entail joins with -acs_objects but that's OK because it makes the overall +acs_objects but that's OK because it makes the overall data model cleaner. The real lesson is that deciding exactly how and when to use inherited attributes is fairly straightforward, but requires a good amount of thought at design time even for simple Index: openacs-4/packages/acs-core-docs/www/openacs-overview.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/openacs-overview.html,v diff -u -N -r1.29.2.3 -r1.29.2.4 --- openacs-4/packages/acs-core-docs/www/openacs-overview.html 19 Nov 2016 09:21:54 -0000 1.29.2.3 +++ openacs-4/packages/acs-core-docs/www/openacs-overview.html 6 Jan 2017 09:18:42 -0000 1.29.2.4 @@ -2,7 +2,7 @@ Overview

      Overview

      OpenACS (Open Architecture Community System) is an advanced toolkit for building scalable, community-oriented - web applications. If you're thinking of building an + web applications. If you're thinking of building an enterprise-level web application, OpenACS is a solid, scalable framework for building dynamic content driven sites. @@ -43,7 +43,7 @@ users are actively funding and contributing work back to the project. Formal, consensus driven governance has been established (with semi-annual elections) which ensures the - project serves the needs of it's constituents. + project serves the needs of it's constituents.

      The OpenACS community would like to hear your comments and can help you in your endeavors with the system. Visit our Index: openacs-4/packages/acs-core-docs/www/openacs.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/openacs.adp,v diff -u -N -r1.1.2.15 -r1.1.2.16 --- openacs-4/packages/acs-core-docs/www/openacs.adp 30 Nov 2016 08:15:11 -0000 1.1.2.15 +++ openacs-4/packages/acs-core-docs/www/openacs.adp 6 Jan 2017 09:18:42 -0000 1.1.2.16 @@ -337,7 +337,7 @@ automate vacuuming is to edit the cron file for the database user. Recommended: VACUUM ANALYZE every hour and VACUUM FULL -ANALYZE every day.

      +ANALYZE every day.

       [$OPENACS_SERVICE_NAME $OPENACS_SERVICE_NAME]$ export EDITOR=emacs;crontab -e
       

      Add these lines to the file. The vacuum command cleans up temporary structures within a PostGreSQL database, and can improve @@ -371,7 +371,7 @@ specific port, e.g. port 80. In order for OpenACS to work, you need to configure a virtual server. The Reference Platform uses a configuration file included in the OpenACS tarball, /var/lib/aolserver/$OPENACS_SERVICE_NAME/etc/config.tcl. -Open it in an editor to adjust the parameters.

      +Open it in an editor to adjust the parameters.

       [root root]# su - $OPENACS_SERVICE_NAME
       
       [$OPENACS_SERVICE_NAME $OPENACS_SERVICE_NAME]$ cd /var/lib/aolserver/$OPENACS_SERVICE_NAME/etc
      @@ -611,8 +611,8 @@
       recovery procedure.

    19. Set up the section called “External uptime validation”.

    20. -
      ($‌Id: openacs.html,v 1.51.2.12 2016/11/19 -09:21:54 gustafn Exp $)
      +
      ($‌Id: openacs.xml,v 1.31.14.2 2016/07/05 +16:42:42 gustafn Exp $)

      Set up a user account for each site.

      AOLserver needs to be started as the root user if you want to use port 80. Once it starts, though, it will drop the root privileges and - run as another user, which you must specify on the command line. It's + run as another user, which you must specify on the command line. It's important that this user has as few privileges as possible. Why? - Because if an intruder somehow breaks in through AOLserver, you don't + Because if an intruder somehow breaks in through AOLserver, you don't want her to have any ability to do damage to the rest of your server.

      At the same time, AOLserver needs to have write access to some files on your system in order for OpenACS to function - properly. So, we'll run AOLserver with a different user account + properly. So, we'll run AOLserver with a different user account for each different service. A service name should be a single word, letters and numbers only. If the name of your site is one word, that would be a good choice. For example "$OPENACS_SERVICE_NAME" might be the service name for the $OPENACS_SERVICE_NAME.net - community.

      We'll leave the password blank, which prevents login by + community.

      We'll leave the password blank, which prevents login by password, for increased security. The only way to log in will be with ssh certificates. The only people who should log in are developers for that specific instance. Add this user, and put it in the $OPENACS_SERVICE_NAME group so that it can use database and server commands associated with that group. - (If you don't know how to do this, type + (If you don't know how to do this, type man usermod. You can type groups to find out which groups a user is a part of) @@ -55,7 +55,7 @@ chmod 770 /var/lib/aolserver

      Installation Option 1: Use automated script

      A bash script is available to automate all of the steps for the rest of this section. It requires tclwebtest. The automated script can greatly accelerate the install process, but is very sensitive to the install environment. We recommend that you run the automated install and, if it does not work the first time, consider switching to a manual installation.

      Get the install script from CVS. It is located within the main cvs tree, at /etc/install. Use anonymous CVS checkout to get that directory in the home directory of the - service's dedicated user. We put it there so that it is not + service's dedicated user. We put it there so that it is not overwritten when we do the main CVS checkout to the target location.

      [root root]# su - $OPENACS_SERVICE_NAME
       [$OPENACS_SERVICE_NAME $OPENACS_SERVICE_NAME]$ cvs -d :pserver:anonymous@cvs.openacs.org:/cvsroot co -d install openacs-4/etc/install
      @@ -67,7 +67,7 @@
       U install/tcl/user-procs.tcl
       [$OPENACS_SERVICE_NAME $OPENACS_SERVICE_NAME]$ cd install
       [$OPENACS_SERVICE_NAME install]$ emacs install.tcl
      -

      Edit the installation configuration file, /home/$OPENACS_SERVICE_NAME/install/install.tcl and update the site-specific values, such as the new service's IP address and name, which will be written into the new service's config.tcl file. If your system is different from the one described in the previous sections, check the file paths as well. Set do_checkout=yes to create a new OpenACS site directly from a CVS checkout, or =no if you have a fully configured site and just want to rebuild it (drop and recreate the database and repeat the installation). If you have followed a stock installation, the default configuration will work without changes and will install an OpenACS site at 127.0.0.1:8000.

      Run the install script install.sh as root:

      [$OPENACS_SERVICE_NAME $OPENACS_SERVICE_NAME]$ exit 
      +

      Edit the installation configuration file, /home/$OPENACS_SERVICE_NAME/install/install.tcl and update the site-specific values, such as the new service's IP address and name, which will be written into the new service's config.tcl file. If your system is different from the one described in the previous sections, check the file paths as well. Set do_checkout=yes to create a new OpenACS site directly from a CVS checkout, or =no if you have a fully configured site and just want to rebuild it (drop and recreate the database and repeat the installation). If you have followed a stock installation, the default configuration will work without changes and will install an OpenACS site at 127.0.0.1:8000.

      Run the install script install.sh as root:

      [$OPENACS_SERVICE_NAME $OPENACS_SERVICE_NAME]$ exit 
       [root root]# sh /home/$OPENACS_SERVICE_NAME/install/install.sh
       /home/$OPENACS_SERVICE_NAME/install/install.sh: Starting installation with config_file 
       /home/$OPENACS_SERVICE_NAME/install/install.tcl. Using serverroot=/var/lib/aolserver/
      @@ -105,7 +105,7 @@
       mv openacs-5.9.0 $OPENACS_SERVICE_NAME
       chmod -R 755 $OPENACS_SERVICE_NAME
       chown -R $OPENACS_SERVICE_NAME.$OPENACS_SERVICE_NAME $OPENACS_SERVICE_NAME
      -exit
    21. Add the Service to CVS (OPTIONAL)

    22. Prepare the database

      • Prepare Oracle for OpenACS. If you won't be using Oracle, skip to Prepare PostgreSQL for an OpenACS Service

        +exit

      • Add the Service to CVS (OPTIONAL)

      • Prepare the database

        • Prepare Oracle for OpenACS. If you won't be using Oracle, skip to Prepare PostgreSQL for an OpenACS Service

          You should be sure that your user account (e.g. $OPENACS_SERVICE_NAME) is in the dba group. @@ -152,7 +152,7 @@ /ora8/m01/app/oracle/oradata/ora8/drsys01.dbf

        • Using the above output, you should determine where - to store your tablespace. As a general rule, you'll want to + to store your tablespace. As a general rule, you'll want to store your tablespace on a mount point under the /ora8 directory that is separate from the Oracle system data files. By default, the Oracle system @@ -161,8 +161,8 @@ system and database files to be on separate disks for optimized performance. For more information on such a configuration, see Chapter - 12 of Philip's - book. For this example, we'll use + 12 of Philip's + book. For this example, we'll use /ora8/m02/oradata/ora8/.

        • Create the directory for the datafile; to do this, @@ -179,11 +179,11 @@ Create a tablespace for the service. It is important that the tablespace can autoextend. This - allows the tablespace's storage capacity to grow as the size + allows the tablespace's storage capacity to grow as the size of the data grows. We set the pctincrease to be a very low value - so that our extents won't grow geometrically. We do not set + so that our extents won't grow geometrically. We do not set it to 0 at the tablespace level because this would affect - Oracle's ability to automatically coalesce free space in the + Oracle's ability to automatically coalesce free space in the tablespace.

          [$OPENACS_SERVICE_NAME ~]$ svrmgrl
          @@ -197,7 +197,7 @@
                 extent management local
                 uniform size 32K;
        • Create a database user for this service. Give the - user access to the tablespace and rights to connect. We'll use + user access to the tablespace and rights to connect. We'll use $OPENACS_SERVICE_NAMEpassword as our password.

          Write down what you specify as service_name @@ -223,8 +223,8 @@ ---------- 2001-12-20 SQL> exit;

          - You should see today's date in a format 'YYYY-MM-DD.' - If you can't login, try redoing step 1 again. If the date is + You should see today's date in a format 'YYYY-MM-DD.' + If you can't login, try redoing step 1 again. If the date is in the wrong format, make sure you followed the steps outlined in the section called “Troubleshooting Oracle Dates”

      • Prepare PostgreSQL for an OpenACS Service. 

        • PostgreSQL:

          Create a user in the database matching the service @@ -238,10 +238,10 @@ CREATE DATABASE [$OPENACS_SERVICE_NAME $OPENACS_SERVICE_NAME]$ su - $OPENACS_SERVICE_NAME -/usr/local/pgsql/bin/createdb -E UNICODE $OPENACS_SERVICE_NAME

        • Automate daily database Vacuuming. This is a process which cleans out discarded data from the database. A quick way to automate vacuuming is to edit the cron file for the database user. Recommended: VACUUM ANALYZE every hour and VACUUM FULL ANALYZE every day.

          [$OPENACS_SERVICE_NAME $OPENACS_SERVICE_NAME]$ export EDITOR=emacs;crontab -e

          Add these lines to the file. The vacuum command cleans up temporary structures within a PostGreSQL database, and can improve performance. We vacuum gently every hour and completely every day. The numbers and stars at the beginning are cron columns that specify when the program should be run - in this case, whenever the minute is 0 and the hour is 1, i.e., 1:00 am every day, and every (*) day of month, month, and day of week. Type man 5 crontab for more information.

          0 1-23 * * * /usr/local/pgsql/bin/vacuumdb --analyze $OPENACS_SERVICE_NAME
          +/usr/local/pgsql/bin/createdb -E UNICODE $OPENACS_SERVICE_NAME
        • Automate daily database Vacuuming. This is a process which cleans out discarded data from the database. A quick way to automate vacuuming is to edit the cron file for the database user. Recommended: VACUUM ANALYZE every hour and VACUUM FULL ANALYZE every day.

          [$OPENACS_SERVICE_NAME $OPENACS_SERVICE_NAME]$ export EDITOR=emacs;crontab -e

          Add these lines to the file. The vacuum command cleans up temporary structures within a PostGreSQL database, and can improve performance. We vacuum gently every hour and completely every day. The numbers and stars at the beginning are cron columns that specify when the program should be run - in this case, whenever the minute is 0 and the hour is 1, i.e., 1:00 am every day, and every (*) day of month, month, and day of week. Type man 5 crontab for more information.

          0 1-23 * * * /usr/local/pgsql/bin/vacuumdb --analyze $OPENACS_SERVICE_NAME
           0 0 * * * /usr/local/pgsql/bin/vacuumdb --full --analyze $OPENACS_SERVICE_NAME

          Depending on your distribution, you may receive email when the crontab items are executed. If you - don't want to receive email for those crontab items, + don't want to receive email for those crontab items, you can add > /dev/null 2>&1 to the end of each crontab line

        • Add Full Text Search Support (OPTIONAL)

        • At this point the database should be ready for installing OpenACS.

    23. Configure an AOLserver Service for OpenACS. 

      1. @@ -251,13 +251,13 @@ need to configure a virtual server. The Reference Platform uses a configuration file included in the OpenACS tarball, /var/lib/aolserver/$OPENACS_SERVICE_NAME/etc/config.tcl. - Open it in an editor to adjust the parameters.

        [root root]# su - $OPENACS_SERVICE_NAME
        +	   Open it in an editor to adjust the parameters.

        [root root]# su - $OPENACS_SERVICE_NAME
         [$OPENACS_SERVICE_NAME $OPENACS_SERVICE_NAME]$ cd /var/lib/aolserver/$OPENACS_SERVICE_NAME/etc
         [$OPENACS_SERVICE_NAME etc]$ emacs config.tcl
         

        - You can continue without changing any values in the file. However, if you don't change address to match the computer's ip address, you won't be able to browse to your server from other machines. + You can continue without changing any values in the file. However, if you don't change address to match the computer's ip address, you won't be able to browse to your server from other machines.

        • httpport - If you want your - server on a different port, enter it here. The Reference Platform port is 8000, which is suitable for development use. Port 80 is the standard http port - it's the port used by your browser when you enter http://yourserver.test. So you should use port 80 for your production site.

        • httpsport - This is the + server on a different port, enter it here. The Reference Platform port is 8000, which is suitable for development use. Port 80 is the standard http port - it's the port used by your browser when you enter http://yourserver.test. So you should use port 80 for your production site.

        • httpsport - This is the port for https requests. The Reference Platform https port is 8443. If http port is set to 80, httpsport should be 443 to match the standard.

        • @@ -287,7 +287,7 @@ /etc/passwd and then put those numbers into the command line via -u 501 -g - 502. In AOLserver 4, you must also send a -b flag. Do this by editing the run file as indicated in the comments.

          If you are root then killall will affect all OpenACS services on the machine, so if there's more than one you'll have to do ps -auxw | grep + 502. In AOLserver 4, you must also send a -b flag. Do this by editing the run file as indicated in the comments.

          If you are root then killall will affect all OpenACS services on the machine, so if there's more than one you'll have to do ps -auxw | grep nsd and selectively kill by job number.

          [$OPENACS_SERVICE_NAME etc]$ killall nsd
           nsd: no process killed
           [$OPENACS_SERVICE_NAME $OPENACS_SERVICE_NAME]$ /usr/local/aolserver/bin/nsd-postgres -t /var/lib/aolserver/$OPENACS_SERVICE_NAME/etc/config.tcl
          @@ -299,19 +299,19 @@
                   directory with rm -rf /var/lib/aolserver/$OPENACS_SERVICE_NAME.orig.
           	

          - If you don't see the login page, view your error log + If you don't see the login page, view your error log (/var/lib/aolserver/$OPENACS_SERVICE_NAME/log/$OPENACS_SERVICE_NAME-error.log) to make sure the service is starting without any problems. The most common errors here are trying to start a port 80 server while not root, failing to connect because of a firewall, and aolserver failing to start due to permissions errors or missing files. If you need to make - changes, don't forget to kill any running servers with + changes, don't forget to kill any running servers with killall nsd.

        • Automate AOLserver keepalive (OPTIONAL)

    24. Configure a Service with the OpenACS Installer.  - Now that you've got AOLserver up and running, let's install OpenACS + Now that you've got AOLserver up and running, let's install OpenACS 5.9.0.

      • You should see a page from the webserver titled @@ -328,7 +328,7 @@ The next page shows the results of loading the OpenACS Kernel data model - be prepared to wait a few minutes as it works. You should see a string of output messages from the database as the - datamodel is created. You'll see the line: + datamodel is created. You'll see the line:

         Loading package .info files ... this will take a few minutes

        @@ -359,11 +359,11 @@ fields as appropriate, and click Set System Information

      • - You'll see the final Installer page, "OpenACS + You'll see the final Installer page, "OpenACS Installation: Complete." It will tell you that the server is being restarted; note that unless you already set up a way for AOLserver to restart itself (ie. inittab or daemontools), - you'll need to manually restart your service. + you'll need to manually restart your service.

        [$OPENACS_SERVICE_NAME $OPENACS_SERVICE_NAME]$ /usr/local/aolserver/bin/nsd-postgres -t /var/lib/aolserver/$OPENACS_SERVICE_NAME/config.tcl
      • Give the server a few minutes to start up. Then reload the final page above. You should see the front page, with @@ -386,13 +386,13 @@ packages. (more information)

      • Proceed to the tutorial to learn how to develop your own packages.

      • Set up database environment variables for the site user. Depending on how you installed Oracle or PostGreSQL, these settings may be necessary for working with the database while logged in as the service user. They do not - directly affect the service's run-time connection with the + directly affect the service's run-time connection with the database, because those environmental variables are set by the wrapper scripts nsd-postgres and nsd-oracle.

        [root root]# su - $OPENACS_SERVICE_NAME
         [$OPENACS_SERVICE_NAME $OPENACS_SERVICE_NAME]$ emacs .bashrc

        Put in the appropriate lines for the database you are running. If you will use both databases, put in both sets of lines.

        • PostgreSQL:

          export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/pgsql/lib
           export PATH=$PATH:/usr/local/pgsql/bin
        • Oracle. These environment variables are specific for a local Oracle installation communicating via IPC. If you are connecting to a remote - Oracle installation, you'll need to adjust these appropriately. Also, + Oracle installation, you'll need to adjust these appropriately. Also, make sure that the '8.1.7' matches your Oracle version.

          export ORACLE_BASE=/ora8/m01/app/oracle
           export ORACLE_HOME=$ORACLE_BASE/product/8.1.7
          Index: openacs-4/packages/acs-core-docs/www/oracle.adp
          ===================================================================
          RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/oracle.adp,v
          diff -u -N -r1.1.2.10 -r1.1.2.11
          --- openacs-4/packages/acs-core-docs/www/oracle.adp	4 Dec 2016 11:24:07 -0000	1.1.2.10
          +++ openacs-4/packages/acs-core-docs/www/oracle.adp	6 Jan 2017 09:18:42 -0000	1.1.2.11
          @@ -51,8 +51,8 @@
           

        It is generally useful to run a particular Oracle version with its latest patchset. At the time of writing these were 8.1.7.4 and 9.2.0.5, both of which are considered to be very stable.

        To be able to download a patchset, you need a (to-pay-for) -account on Metalink. You may find the appropriate patchset by -following Andrew's suggestion.

        +account on Metalink. You may find the appropriate patchset +by following Andrew's suggestion.

      Things to Keep in Mind

      Oracle is very well-documented software, the online @@ -970,8 +970,8 @@ access to the Oracle system.

    25. ($‌Id: oracle.html,v 1.49.2.12 2016/11/19 -09:21:54 gustafn Exp $)
      +
      ($‌Id: oracle.xml,v 1.21.14.2 2016/12/04 +11:24:07 gustafn Exp $)
      - + \ No newline at end of file Index: openacs-4/packages/acs-core-docs/www/oracle.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/oracle.html,v diff -u -N -r1.49.2.13 -r1.49.2.14 --- openacs-4/packages/acs-core-docs/www/oracle.html 4 Dec 2016 11:24:07 -0000 1.49.2.13 +++ openacs-4/packages/acs-core-docs/www/oracle.html 6 Jan 2017 09:18:42 -0000 1.49.2.14 @@ -5,27 +5,27 @@

      If you are installing PostGreSQL instead of Oracle, skip this section.

      - OpenACS 5.9.0 will install with Oracle 9i but has not been extensively tested so may still have bugs or tuning issues. See Andrew Piskorski's Oracle 9i notes for guidance. + OpenACS 5.9.0 will install with Oracle 9i but has not been extensively tested so may still have bugs or tuning issues. See Andrew Piskorski's Oracle 9i notes for guidance.

      This installation guide attempts to present all of the information necessary to complete an OpenACS installation. We try hard to make all of the steps possible in one pass, rather than having a step which amounts to "go away and develop a profound understanding of software X and then come back and, in 99% of all cases, type these two lines." The exception to our rule is Oracle production systems. This page describes a set of steps to get a working Oracle development server, but it is unsuitable for production systems. If you will be using OpenACS on Oracle in a production environment, you will experience many problems unless you develop a basic understanding of Oracle which is outside the scope of this document. T

      - This document assumes that you'll be installing Oracle on the same + This document assumes that you'll be installing Oracle on the same box as AOLserver. For more details on a remote Oracle installation, - see Daryl Biberdorf's document. + see Daryl Biberdorf's document.

      Useful links to find help on how to set up Oracle under Linux are:

      Acquire Oracle

      + Roger's company - on Oracle on Linux

    26. Werner Puschitz - Oracle on Red Hat Linux

    27. SuSE/Oracle Support matrix

    28. Acquire Oracle

      Production Oracle systems should run on certified platforms. Follow the metalink - note 223718.1to find certified platforms. If you don't have + note 223718.1to find certified platforms. If you don't have metalink access, take a look at the Oracle on Linux FAQ: Which Linux Distributions Are Directly Supported By Oracle?. In summary, free and inexpensive Linux distributions are not certified.

      - If you don't have an account at OTN + If you don't have an account at OTN get one: you can download the Oracle software from the Oracle Downloads page. It is also get the CDs shipped to you for a nominal fee from the Oracle @@ -45,20 +45,20 @@ both of which are considered to be very stable.

      To be able to download a patchset, you need a (to-pay-for) account on Metalink. You may find the appropriate - patchset by following Andrew's + patchset by following Andrew's suggestion.

      Things to Keep in Mind

      Oracle is very well-documented software, the online documentation comes with printable PDFs and full-text search. Altogether there is more than 20.000 pages of documentation, so do not expect to understand Oracle within in a few hours. The best starting pointing into Oracle is the - Concepts book. Here's the 8i + Concepts book. Here's the 8i version and the 9.2 version.

      To give you an idea of how configurable Oracle is and how much thought you may need to put into buying the proper hardware and creating a sane - setup, you should thoroughly read Cary Millsap's Configuring + setup, you should thoroughly read Cary Millsap's Configuring Oracle Server for VLDB and the Optimal Flexible Architecture standard.

      @@ -87,7 +87,7 @@ For additional resources/documentation, please see this thread and Andrew - Piskorski's mini-guide. + Piskorski's mini-guide.

      Pre-Installation Tasks

      @@ -156,7 +156,7 @@ root:/ora8# chown -R oracle.dba /ora8 root:/ora8# exit

    29. - Set up the oracle user's + Set up the oracle user's environment

      • @@ -326,7 +326,7 @@ oracle:/where/oracle/Disk1$ ls doc index.htm install runInstaller stage starterdb

        - If you don't see + If you don't see runInstaller, you are in the wrong directory. @@ -532,7 +532,7 @@ Run the script. Switch to the oracle user first to set the environment appropriately and then do su to get root privileges, while keeping - the oracle user's enviroment. + the oracle user's enviroment.

         [joeuser ~]$ su - oracle
         Password: *********
        @@ -649,7 +649,7 @@
                     

    30. Congratulations, you have just installed Oracle 8.1.7 Server! However, you still need to create a database which can take about an - hour of non-interactive time, so don't quit yet. + hour of non-interactive time, so don't quit yet.

      Creating the First Database

      This step will take you through the steps of creating a customized database. Be warned that this process takes about an hour on a @@ -744,7 +744,7 @@

    31. Finally, select "Save information to a shell script" and click - "Finish" (We're + "Finish" (We're going to examine the contents of this file before creating our database.)

    32. @@ -775,7 +775,7 @@

       nls_date_format = "YYYY-MM-DD"
    33. Now find the open_cursors line - in the file. If you're using + in the file. If you're using emacs scroll up to the top of the buffer and do CTRL-S and type open_cursors to find the @@ -813,22 +813,22 @@ "ORA-01432: public synonym to be dropped does not exist") Fear not, this is normal.

      - Eventually, you'll be returned to your shell prompt. In the - meantime, relax, you've earned it. + Eventually, you'll be returned to your shell prompt. In the + meantime, relax, you've earned it.

    34. Acceptance Test

      For this step, open up a terminal and su to oracle as usual. You should be running X and Netscape (or other web browser) for this phase.

      • You need to download the "Oracle Acceptance Test" file. - It's available here and at http://philip.greenspun.com/wtr/oracle/acceptance-sql.txt. + It's available here and at http://philip.greenspun.com/wtr/oracle/acceptance-sql.txt. Save the file to /var/tmp

      • In the oracle shell, copy the file.

         [oracle ~]$ cp /var/tmp/acceptance-sql.txt /var/tmp/acceptance.sql
      • - Once you've got the acceptance test file all set, stay in + Once you've got the acceptance test file all set, stay in your term and type the following:

         [oracle ~]$ sqlplus system/manager

        @@ -839,25 +839,25 @@ [oracle ~]$ svrmgrl SVRMGR> connect internal SVRMGR> startup

      • - Now that you're into SQL*Plus, change the default passwords + Now that you're into SQL*Plus, change the default passwords for system, sys, and ctxsys to "alexisahunk" (or to - something you'll remember): + something you'll remember):

         SQL> alter user system identified by alexisahunk;
         SQL> alter user sys identified by alexisahunk;
         SQL> alter user ctxsys identified by alexisahunk;
      • Verify that your date settings are correct.

         SQL> select sysdate from dual;

        - If you don't see a date that fits the format + If you don't see a date that fits the format YYYY-MM-DD, please read the section called “Troubleshooting Oracle Dates”.

      • At this point we are going to hammer your database with an intense acceptance test. This usually takes around 30 minutes.

         SQL> @ /var/tmp/acceptance.sql
         
        -; A bunch of lines will scroll by.  You'll know if the test worked if
        +; A bunch of lines will scroll by.  You'll know if the test worked if
         ; you see this at the end:
         
         SYSDATE
        @@ -879,13 +879,13 @@
                   can set the parameter using the
                   dbassist program or by setting
                   the DB_BLOCK_SIZE parameter in
        -          your database's creation script.
        +          your database's creation script.
                 

        If there were no errors, then consider yourself fortunate. Your Oracle installation is working.

      Automating Startup & Shutdown

      You will want to automate the database startup and shutdown process. - It's probably best to have Oracle spring to life when you boot up + It's probably best to have Oracle spring to life when you boot up your machine.

      • Oracle includes a script called @@ -900,7 +900,7 @@ [oracle ~]$ cp /var/tmp/dbstart.txt /ora8/m01/app/oracle/product/8.1.7/bin/dbstart [oracle ~]$ chmod 755 /ora8/m01/app/oracle/product/8.1.7/bin/dbstart

      • - While you're logged in as + While you're logged in as oracle, you should configure the oratab file to load your database at start. Edit the file @@ -1165,7 +1165,7 @@ the number of seconds elapsed since some date. However, for the purposes of inputing dates into Oracle and getting them back out, Oracle needs to be told to use a specific date format. By default, it - uses an Oracle-specific format which isn't copacetic. You want + uses an Oracle-specific format which isn't copacetic. You want Oracle to use the ANSI-compliant date format which is of form 'YYYY-MM-DD'.

        @@ -1190,7 +1190,7 @@ SQL> select sysdate from dual;

        If the date does not conform to this format, double-check that you included the necessary line in the init scripts. If it still - isn't working, make sure that you have restarted the database + isn't working, make sure that you have restarted the database since adding the line:

         [joeuser ~]$ svrmgrl
        @@ -1202,7 +1202,7 @@
         ORACLE instance shut down.
         SVRMGR> startup
         ORACLE instance started.

        - If you're sure that you have restarted the database since adding + If you're sure that you have restarted the database since adding the line, check your initialization scripts. Make sure that the following line is not included:

        @@ -1214,7 +1214,7 @@
             

         export nls_date_format = 'YYYY-MM-DD'

        Log back in again. If adding the - nls_date_format line doesn't + nls_date_format line doesn't help, you can ask for advice in our OpenACS forums.

      Useful Procedures

      • Dropping a tablespace Index: openacs-4/packages/acs-core-docs/www/os-install.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/os-install.html,v diff -u -N -r1.16.2.4 -r1.16.2.5 --- openacs-4/packages/acs-core-docs/www/os-install.html 19 Nov 2016 09:21:54 -0000 1.16.2.4 +++ openacs-4/packages/acs-core-docs/www/os-install.html 6 Jan 2017 09:18:42 -0000 1.16.2.5 @@ -1,6 +1,6 @@ Linux Install Guides

        Linux Install Guides

        - Here's a list of some helpful documentation for various OS's + Here's a list of some helpful documentation for various OS's

        • Painless Debian GNU/Linux by Stephen van Egmond Index: openacs-4/packages/acs-core-docs/www/os-security.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/os-security.html,v diff -u -N -r1.16.2.3 -r1.16.2.4 --- openacs-4/packages/acs-core-docs/www/os-security.html 19 Nov 2016 09:21:54 -0000 1.16.2.3 +++ openacs-4/packages/acs-core-docs/www/os-security.html 6 Jan 2017 09:18:42 -0000 1.16.2.4 @@ -1,6 +1,6 @@ Security Information

          Security Information

          - Once you get your OS installed, it's imperative that you secure your + Once you get your OS installed, it's imperative that you secure your installation. As Jon Griffin repeatedly warns us, "No distribution is secure out of the box." The Reference Platform implements some basic precautions, but security is a process, not a @@ -13,7 +13,7 @@ Securing and Optimizing Linux - version 2.0

        • Jon - Griffin's notes + Griffin's notes

        • Linux Administrators Security Guide @@ -22,5 +22,5 @@ of a Secure Webserver

        • Bruce - Schneier's Crypto-Gram, especially The + Schneier's Crypto-Gram, especially The security patch treadmill and Monitoring First.

        Index: openacs-4/packages/acs-core-docs/www/packages.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/packages.adp,v diff -u -N -r1.1.2.14 -r1.1.2.15 --- openacs-4/packages/acs-core-docs/www/packages.adp 30 Nov 2016 08:15:11 -0000 1.1.2.14 +++ openacs-4/packages/acs-core-docs/www/packages.adp 6 Jan 2017 09:18:42 -0000 1.1.2.15 @@ -25,7 +25,7 @@

        Server file layout

        Here is how an OpenACS 5 server is laid out starting from the Server root (ROOT):

        -

        Figure 11.1. Server file layout +

        Figure 11.1. Server file layout diagram

         ROOT/
             bin/
        @@ -65,7 +65,7 @@
          To illustrate
         the general structure of a package, let's see what the package
         for the "notes" application should look like.

        -

        Figure 11.2. Package file layout +

        Figure 11.2. Package file layout diagram

         ROOT/
           +-- packages/    APM Root
        @@ -136,7 +136,7 @@
         files are not sourced in these directories. This makes it suitable
         for storing icons, css files, javascript, and other static content
         which can be treated this way.

        -

        Table 11.1. Package +

        Table 11.1. Package files

        @@ -401,8 +401,8 @@ Additional Reading
        ($‌Id: packages.html,v 1.51.2.13 2016/11/19 -09:21:54 gustafn Exp $)
        +
        ($‌Id: packages.xml,v 1.9.14.2 2016/10/03 +09:17:51 gustafn Exp $)

        Server file layout

        Here is how an OpenACS 5 server is laid out starting from the Server root (ROOT): -

        Figure 11.1. Server file layout diagram

        +    

        Figure 11.1. Server file layout diagram

         ROOT/
             bin/
                 Various executables and scripts for server maintanence.
        @@ -44,14 +44,14 @@
               packages that have been installed in the server, where those packages
               have been installed, and a standard way to map URLs that a client
               sends to our server to the right page in the appropriate
        -      package. While we're at it, this tool should also automate
        +      package. While we're at it, this tool should also automate
               package installation, dependency checking, upgrades, and package
               removal. In OpenACS 5, this tool is called the APM.
             

        - To illustrate the general structure of a package, let's see what the + To illustrate the general structure of a package, let's see what the package for the "notes" application should look like. -

        Figure 11.2. Package file layout diagram

        +    

        Figure 11.2. Package file layout diagram

         ROOT/
           +-- packages/    APM Root
                 |
        @@ -124,7 +124,7 @@
               directories.  This makes it suitable for storing icons, css
               files, javascript, and other static content which can be treated
               this way.
        -    

        Table 11.1. Package files

        File TypeIts UseNaming Convention
        Package Specification FileThe package specification file is an XML file generated and +

        Table 11.1. Package files

        File TypeIts UseNaming Convention
        Package Specification FileThe package specification file is an XML file generated and maintained by the OpenACS Package Manager (APM). It specifies information about the package including its parameters and its files.notes.info
        Data Model Creation Script @@ -246,7 +246,7 @@

        The following sections will show you how to make a package for the Notes application. In addition, they will discuss some site - management features in OpenACS 5 that take advantage of the APM's package + management features in OpenACS 5 that take advantage of the APM's package instance model. The two most important of these are subsites, and the site map tool, which can be used to map applications to one or more arbitrary URLs in a running site. @@ -259,7 +259,7 @@

      • Go to the package manager on your server. The URL is /acs-admin/apm.

      • Click on the link /acs-admin/apm/package-add.

      • Fill out the form for adding a new package. The form explains what - everything means, but we'll repeat the important bits here for easy + everything means, but we'll repeat the important bits here for easy reference:

        Package Key @@ -279,8 +279,8 @@

        If your package name is a nice singular noun, this should be the plural form of it. I assume the plural form is used when multiple - instances of the package are used by a single service. We'll talk more - about package instances later. Our example apllication doesn't really + instances of the package are used by a single service. We'll talk more + about package instances later. Our example apllication doesn't really have a good plural name. So just make it also be "Notes".

        Package Type

        @@ -314,7 +314,7 @@ The directory that APM created will be empty except for the notes.info file. Create a file called - ROOT/packages/notes/sql/oracle/notes-create.sql. We'll + ROOT/packages/notes/sql/oracle/notes-create.sql. We'll fill this file with our data model very soon. Create a file called ROOT/packages/notes/sql/oracle/notes-drop.sql. This @@ -347,7 +347,7 @@ Parameter Information" link. Define package callbacks via the "Tcl Callbacks (install, instantiate, mount)" link.

      • The new package has been created and installed in the server. At this point, you should add your package files to your CVS repository. - I'll assume that you have set up your development repository according + I'll assume that you have set up your development repository according to the standards described in this appendix. If so, then you just do this:

        % cd ROOT/packages
        @@ -364,11 +364,11 @@
               you should also consider the tasks outlined in the package development tutorial.
             

      • The Site Map and Package Instances

        At this point, you are probably excited to see your new package in - action. But, we haven't added any user visible pages yet. By + action. But, we haven't added any user visible pages yet. By convention, user visible pages go in the ROOT/packages/notes/www directory. So go there and add a file called hello.html with some text in it. Now we have - to make the user pages visible in the site. Since we didn't put the + to make the user pages visible in the site. Since we didn't put the pages underneath ROOT/www they will not appear on their own. What we have to do is mount the application into the site map. That is, we have to define the URL from which the application @@ -409,7 +409,7 @@ ROOT/packages/notes/www. At this point, you can experiment with the site map by mounting multiple instances of the not yet written Notes application at various places in the site. In a - later document, we'll see how to write your application so that the + later document, we'll see how to write your application so that the code can detect from what URL it was invoked. This is the key to supporting subsites.

        Summary

        @@ -426,5 +426,5 @@ site.

      • Writes out package distribution files for other people to download and - install. We'll cover this later. + install. We'll cover this later.

      • Index: openacs-4/packages/acs-core-docs/www/parties.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/parties.adp,v diff -u -N -r1.1.2.6 -r1.1.2.7 --- openacs-4/packages/acs-core-docs/www/parties.adp 30 Nov 2016 08:15:11 -0000 1.1.2.6 +++ openacs-4/packages/acs-core-docs/www/parties.adp 6 Jan 2017 09:18:42 -0000 1.1.2.7 @@ -323,8 +323,8 @@ a membership relation is an ordinary acs object with object identity, it is as easy to extend the membership relation to store extra information as it is to extend the users table or the -groups table.

        ($‌Id: parties.html,v 1.51.2.12 2016/11/19 -09:21:54 gustafn Exp $)
        +groups table.

        ($‌Id: parties.xml,v 1.9 2006/09/25 20:32:37 +byronl Exp $)

        For programmers, the Permissions API provides a means to work with access -control in a consistent manner. If a programmer's OpenACS package defines new +control in a consistent manner. If a programmer's OpenACS package defines new methods for itself, the Permissions API must provide simple calls to determine whether the current user is authorized to perform the given method. In addition, using the Permissions API, queries should easily select only @@ -92,12 +92,12 @@ a member of

      • privileges get associated with the methods of any other privileges they have taken methods from (at any level) (see acs_privilege_hierarchy)

      • objects get access control from direct grants, or inherit permissions -from their context (unless the "don't inherit" flag is +from their context (unless the "don't inherit" flag is set)

      • Legal Transactions

        There are three essential areas in which all transactions in the permissions system fall:

        • Modification of methods and privileges

        • Modification of permissions

        • Queries on permissions

        "Modification of methods and privileges." This refers to actions that happen mainly at package installation time - a package will create a number of methods for its own use, then associate them with the -system's standard privileges, or new privileges which the package has +system's standard privileges, or new privileges which the package has created. The association step might also happen later, if the site-wide administrator chooses to change permissions policy.

        These steps involve directly manipulating the acs_methods, acs_privileges, and acs_privilege_method_rules tables. A @@ -170,7 +170,7 @@ large sites, some future search mechanism will be necessary.) After choosing privileges to grant, the user is returned to the "edit privileges for one object" screen.

        If it makes sense, the system will also display a checkbox which the user -may select to toggle whether permissions are inherited from the object's +may select to toggle whether permissions are inherited from the object's context.

        There are a number of potential future enhancements for the permissions UI, outlined below.

        Configuration/Parameters

        There are no configuration options for the permissions system.

        Future Improvements/Areas of Likely Change

        The most important future changes to the Permissions system are likely to be in the UI:

        • There should be a page displaying a list of all objects for which the Index: openacs-4/packages/acs-core-docs/www/permissions-requirements.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/permissions-requirements.html,v diff -u -N -r1.34.2.3 -r1.34.2.4 --- openacs-4/packages/acs-core-docs/www/permissions-requirements.html 19 Nov 2016 09:21:54 -0000 1.34.2.3 +++ openacs-4/packages/acs-core-docs/www/permissions-requirements.html 6 Jan 2017 09:18:42 -0000 1.34.2.4 @@ -13,7 +13,7 @@ applications to handle permissions. Consolidating access control in such a manner reduces both cost and risk: cost, in that less code has to be written and maintained for dealing with recurring permissions situations; risk, in -that we need not rely on any single programmer's diligence to ensure +that we need not rely on any single programmer's diligence to ensure access control is implemented and enforced correctly.

          Historical Motivations

          In earlier versions of the OpenACS, permissions and access control was handled on a module-by-module basis, often even on a page-by-page basis. For example, a typical module might allow any registered user to access its pages Index: openacs-4/packages/acs-core-docs/www/permissions-tediously-explained.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/permissions-tediously-explained.adp,v diff -u -N -r1.1.2.12 -r1.1.2.13 --- openacs-4/packages/acs-core-docs/www/permissions-tediously-explained.adp 19 Nov 2016 09:21:54 -0000 1.1.2.12 +++ openacs-4/packages/acs-core-docs/www/permissions-tediously-explained.adp 6 Jan 2017 09:18:42 -0000 1.1.2.13 @@ -130,7 +130,7 @@ Context Hierarchy

        Suppose objects A, B, ..., and F form the following hierarchy.

        -

        Table 11.2. Context Hierarchy +

        Table 11.2. Context Hierarchy Example

        @@ -156,7 +156,7 @@

        This can be represented in the acs_objects table by the following entries:

        -

        Table 11.3. acs_objects example +

        Table 11.3. acs_objects example data

        Index: openacs-4/packages/acs-core-docs/www/permissions-tediously-explained.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/permissions-tediously-explained.html,v diff -u -N -r1.46.2.12 -r1.46.2.13 --- openacs-4/packages/acs-core-docs/www/permissions-tediously-explained.html 19 Nov 2016 09:21:54 -0000 1.46.2.12 +++ openacs-4/packages/acs-core-docs/www/permissions-tediously-explained.html 6 Jan 2017 09:18:42 -0000 1.46.2.13 @@ -105,7 +105,7 @@

        Context Hierarchy

        Suppose objects A, B, ..., and F form the following hierarchy. -

        Table 11.2. Context Hierarchy Example

        +

        Table 11.2. Context Hierarchy Example

        A

        object_id=10 @@ -139,7 +139,7 @@ This can be represented in the acs_objects table by the following entries: -

        Table 11.3. acs_objects example data

        object_idcontext_id
        2010
        3010
        4020
        5020
        6030

        +

        Table 11.3. acs_objects example data

        object_idcontext_id
        2010
        3010
        4020
        5020
        6030

        The first entry tells us that object 20 is the descendant of object 10, and the third entry shows that object 40 is the descendant of object 20. By running a CONNECT BY query, @@ -152,7 +152,7 @@ ..., and F can be derived by ascertaining that these objects are children of A by traversing the context hierarchy. As it turns out, hierarchical queries are expensive. As - Rafael Schloming put it so aptly, Oracle can't deal with hierarchies for shit. + Rafael Schloming put it so aptly, Oracle can't deal with hierarchies for shit.

        One way to solve this problem is to cache a flattened view of the context tree like so:

        objectancestorn_generations
        AA0
        BB0
        BA1
        CC0
        CA1
        DD0
        DB1
        DA2
        EE0
        EB1
        EA2
        FF0
        FC1
        FA2

        @@ -223,7 +223,7 @@

        One final note about acs_objects. By setting - an object's security_inherit_p column to 'f', you can stop permissions + an object's security_inherit_p column to 'f', you can stop permissions from cascading down the context tree. In the following example, Joe does not have the read permissions on C and F.

        -
        @@ -615,7 +615,7 @@ as exists_p char(1); begin - -- XXX This must be fixed: -1 shouldn't be hardcoded (it is the public) + -- XXX This must be fixed: -1 shouldn't be hardcoded (it is the public) select decode(count(*),0,'f','t') into exists_p from acs_object_party_privilege_map where object_id = permission_p.object_id Index: openacs-4/packages/acs-core-docs/www/permissions.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/permissions.adp,v diff -u -N -r1.1.2.8 -r1.1.2.9 --- openacs-4/packages/acs-core-docs/www/permissions.adp 30 Nov 2016 08:15:11 -0000 1.1.2.8 +++ openacs-4/packages/acs-core-docs/www/permissions.adp 6 Jan 2017 09:18:42 -0000 1.1.2.9 @@ -196,8 +196,8 @@ user rights.

      • The Context hierarchy allows you to define organize default permissions in a hierarchical fashion.

      • A PL/SQL or Tcl API is then used to check permissions in -application pages.

        ($‌Id: permissions.html,v 1.50.2.12 2016/11/19 -09:21:54 gustafn Exp $)
        +application pages.

        ($‌Id: permissions.xml,v 1.17.6.1 2016/06/23 +08:32:46 gustafn Exp $)
        ...scopeuser_idgroup_id...
        ...user123 ...
        ...group 456...
        ...public ...

        The first row represents an entry in User 123's personal address book, the second row represents an entry in User Group 456's shared address -book, and the third row represents an entry in the site's public +book, and the third row represents an entry in the site's public address book. In this way, the scoping columns identify the security context in which a given object belongs, where each context is either a person or a group of people or the general public @@ -175,7 +175,7 @@ forum. Then, suppose we grant every user in the system read-access to this forum. By default, they will automatically have read-access to the new message we just inserted, since the system automatically -checks permissions on the message's context. To allow the creator of +checks permissions on the message's context. To allow the creator of the message to change the message after it has been posted we grant the user write-access on the message, and we are done.

        Index: openacs-4/packages/acs-core-docs/www/programming-with-aolserver.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/programming-with-aolserver.adp,v diff -u -N -r1.1.2.6 -r1.1.2.7 --- openacs-4/packages/acs-core-docs/www/programming-with-aolserver.adp 30 Nov 2016 08:15:11 -0000 1.1.2.6 +++ openacs-4/packages/acs-core-docs/www/programming-with-aolserver.adp 6 Jan 2017 09:18:42 -0000 1.1.2.7 @@ -230,8 +230,8 @@ However, when using ns_set get to perform lookup by name, they perform a linear lookup, whereas arrays use a hash table, so ns_sets are slower than arrays when the -number of entries is large.

        ($‌Id: programming-with-aolserver.html,v -1.49.2.12 2016/11/19 09:21:54 gustafn Exp $)
        +number of entries is large.

        ($‌Id: programming-with-aolserver.xml,v 1.7 +2014/10/27 16:39:30 victorg Exp $)

        The global command

        When using AOLserver, remember that there are effectively two types of global namespace, not one: -

        1. Server-global: As you'd expect, there is +

          1. Server-global: As you'd expect, there is only one server-global namespace per server, and variables set within it can -be accessed by any Tcl code running subsequently, in any of the server's +be accessed by any Tcl code running subsequently, in any of the server's threads. To set/get server-global variables, use AOLserver 3's nsv API (which supersedes ns_share from the pre-3.0 API).

          2. Script-global: Each Tcl script (ADP, Tcl page, @@ -21,23 +21,23 @@ procedure. This distinction is important to understand in order to use global correctly when programming AOLserver.

            Also, AOLserver purges all script-global variables in a thread (i.e., Tcl -interpreter) between HTTP requests. If it didn't, that would affect (and +interpreter) between HTTP requests. If it didn't, that would affect (and complicate) our use of script-global variables dramatically, which would then be better described as thread-global variables. Given -AOLserver's behaviour, however, "script-global" is a more +AOLserver's behaviour, however, "script-global" is a more appropriate term.

          Threads and Scheduled Procedures

          ns_schedule_proc and ad_schedule_proc each take a -thread flag to cause a scheduled procedure to run asychronously, in its own thread. It almost always seems like a good idea to -specify this switch, but there's a problem. +specify this switch, but there's a problem.

          It turns out that whenever a task scheduled with ns_schedule_proc -thread or ad_schedule_proc -thread t is run, AOLserver creates a brand new thread and a brand new interpreter, and reinitializes the procedure table (essentially, loads all procedures that were created during server initialization into the new interpreter). This happens every time the task is executed - and it is a very expensive process that should not be taken lightly!

          The moral: if you have a lightweight scheduled procedure -which runs frequently, don't use the -thread +which runs frequently, don't use the -thread switch.

          Note also that thread is initialized with a copy of what was installed during server startup, so if the procedure table have changed since startup (e.g. using the APM watch @@ -50,7 +50,7 @@ that can be triggered from inside a procedure e.g., a permission denied exception. At this point, the procedure that detects invalid permission wants to write an error message to the user, and completely abort execution of the -caller thread. return doesn't work, because the procedure may be +caller thread. return doesn't work, because the procedure may be nested several levels deep. We therefore use ad_script_abort to abort the remainder of the thread. Note that using return instead of ad_script_abort may raise some security issues: an attacker could @@ -62,7 +62,7 @@

          Returning More Than One Value From a Function

          Many functions have a single return value. For instance, util_email_valid_p returns a number: 1 or 0. Other functions need to return a composite value. -For instance, consider a function that looks up a user's name and email +For instance, consider a function that looks up a user's name and email address, given an ID. One way to implement this is to return a three-element list and document that the first element contains the name, and the second contains the email address. The problem with this technique is that, because @@ -106,14 +106,14 @@ }

          Using Arrays and Pass-By-Reference

          -Sometimes pass-by-value incurs too much overhead, and you'd rather -pass-by-reference. Specifically, if you're writing a proc that uses +Sometimes pass-by-value incurs too much overhead, and you'd rather +pass-by-reference. Specifically, if you're writing a proc that uses arrays internally to build up some value, there are many entries in the -array, and you're planning on iterating over the proc many times. In this -case, pass-by-value is expensive, and you'd use pass-by-reference. +array, and you're planning on iterating over the proc many times. In this +case, pass-by-value is expensive, and you'd use pass-by-reference.

          The transformation of the array into a list and back to an array takes, in our test environment, approximately 10 microseconds per entry -of 100 character's length. Thus you can process about 100 entries per +of 100 character's length. Thus you can process about 100 entries per milisecond. The time depends almost completely on the number of entries, and almost not at all on the size of the entries.

          You implement pass-by-reference in Tcl by taking the name of an array @@ -139,18 +139,18 @@

          We prefer pass-by-value over pass-by-reference. Pass-by-reference makes the code harder to read and debug, because changing a value in one place has side effects in other places. Especially if have a chain of -upvars through several layers of the call stack, you'll have +upvars through several layers of the call stack, you'll have a hard time debugging.

          Multisets: Using ns_sets and Pass-By-Reference

          -An array is a type of set, which means you can't have multiple +An array is a type of set, which means you can't have multiple entries with the same key. Data structures that can have multiple entries for the same key are known as a multiset or bag.

          If your data can have multiple entries with the same key, you should use the AOLserver built-in ns_set. You can also do a case-insensitive lookup on an -ns_set, something you can't easily do on an array. This is +ns_set, something you can't easily do on an array. This is especially useful for things like HTTP headers, which happen to have these exact properties.

          You always use pass-by-reference with ns_sets, since they -don't have any built-in way of generating and reconstructing themselves +don't have any built-in way of generating and reconstructing themselves from a string representation. Instead, you pass the handle to the set.

           
           ad_proc ad_get_user_info {
          @@ -170,10 +170,10 @@
           doc_body_append "[ns_set get $user_info namelink] ([ns_set get $user_info emaillink])"
           
           

          -We don't recommend ns_set as a general mechanism for passing +We don't recommend ns_set as a general mechanism for passing sets (as opposed to multisets) of data. Not only do they inherently use -pass-by-reference, which we dis-like, they're also somewhat clumsy to -use, since Tcl doesn't have built-in syntactic support for them. +pass-by-reference, which we dis-like, they're also somewhat clumsy to +use, since Tcl doesn't have built-in syntactic support for them.

          Consider for example a loop over the entries in a ns_set as compared to an array:

           
          Index: openacs-4/packages/acs-core-docs/www/psgml-for-emacs.adp
          ===================================================================
          RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/psgml-for-emacs.adp,v
          diff -u -N -r1.1.2.12 -r1.1.2.13
          --- openacs-4/packages/acs-core-docs/www/psgml-for-emacs.adp	19 Nov 2016 09:21:54 -0000	1.1.2.12
          +++ openacs-4/packages/acs-core-docs/www/psgml-for-emacs.adp	6 Jan 2017 09:18:42 -0000	1.1.2.13
          @@ -12,7 +12,7 @@
           

          Add PSGML commands to emacs init file (OPTIONAL)

          - If you plan to write or edit any + If you plan to write or edit any documentation with emacs, install a customized emacs configuration file with DocBook commands in the skeleton directory, so it will be used for all new users. The file also fixes the backspace -> Index: openacs-4/packages/acs-core-docs/www/psgml-for-emacs.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/psgml-for-emacs.html,v diff -u -N -r1.41.2.12 -r1.41.2.13 --- openacs-4/packages/acs-core-docs/www/psgml-for-emacs.html 19 Nov 2016 09:21:54 -0000 1.41.2.12 +++ openacs-4/packages/acs-core-docs/www/psgml-for-emacs.html 6 Jan 2017 09:18:42 -0000 1.41.2.13 @@ -1,5 +1,5 @@ -Add PSGML commands to emacs init file (OPTIONAL)

          Add PSGML commands to emacs init file (OPTIONAL)

          +Add PSGML commands to emacs init file (OPTIONAL)

          Add PSGML commands to emacs init file (OPTIONAL)

          If you plan to write or edit any documentation with emacs, install a customized emacs configuration file with DocBook commands in the skeleton directory, so it will be used for all new users. The file also Index: openacs-4/packages/acs-core-docs/www/psgml-mode.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/psgml-mode.adp,v diff -u -N -r1.1.2.8 -r1.1.2.9 --- openacs-4/packages/acs-core-docs/www/psgml-mode.adp 30 Nov 2016 08:15:11 -0000 1.1.2.8 +++ openacs-4/packages/acs-core-docs/www/psgml-mode.adp 6 Jan 2017 09:18:42 -0000 1.1.2.9 @@ -145,8 +145,8 @@ Further reading

          Start with the the section called “OpenACS Documentation Guide” -

          ($‌Id: psgml-mode.html,v 1.48.2.13 2016/11/19 -09:21:54 gustafn Exp $)
          +

          ($‌Id: psgml-mode.xml,v 1.8 2006/07/17 05:38:37 +torbenb Exp $)

        Where to get it

        Most newer emacsen come with PSGML mode preinstalled. You can find out whether your emacs has it with the locate-library command. In Emacs, type M-x locate-library and enter psgml. Emacs will tell -you if it found it or not.

        If you don't have PSGML preinstalled in your Emacs, there are two +you if it found it or not.

        If you don't have PSGML preinstalled in your Emacs, there are two things you can do:

        1. On Linux: Get the -psgml rpm from RedHat's +psgml rpm from RedHat's docbook-tools and install it as usual.

        2. On other systems: Get the tarball from the PSGML Website. Unpack it and follow the install instructions.

        Using CATALOG files

        The easiest way to teach PSGML mode about a DTD is by adding it to your own CATALOG. Here is an example of how you can set that up for the @@ -27,9 +27,9 @@ CATALOG "docbook-xml/docbook.cat"

        in it. By maintaining your own CATALOG, it is easy to add more -DTD's without changing your emacs settings. (How about that HTML 4.01 DTD you +DTD's without changing your emacs settings. (How about that HTML 4.01 DTD you always wanted to get from W3C ? The -DTD is in the zip archives and tarballs available on the site.)

        That's it. Now you are ready to tell emacs all about PSGML mode and +DTD is in the zip archives and tarballs available on the site.)

        That's it. Now you are ready to tell emacs all about PSGML mode and that funky CATALOG

        What to tell emacs

        If you installed PSGML mode in a non-standard location, e.g., somewhere in your home directory, you need to add this to the load-path by adding this line to your .emacs file:

        @@ -79,8 +79,8 @@
            
         

        Which says that the parent of this document can be found in the file top.xml, that the element in the parent that will enclose the -current document is a book and that the current file's topmost +current document is a book and that the current file's topmost element is a sect1.

        How to use it

        Of course, you should read the emacs texinfo pages that come with PSGML mode from start to finish. Barring that, here are some handy commands:

        KeyCommand
        C-c C-eInsert an element. Uses completion and only lets you insert elements that -are valid
        C-c C-aEdit attributes of enclosing element.
        C-c C-x C-iShow information about the document's DTD.
        C-c C-x C-eDescribe element. Shows for one element which elements can be parents, +are valid
        C-c C-aEdit attributes of enclosing element.
        C-c C-x C-iShow information about the document's DTD.
        C-c C-x C-eDescribe element. Shows for one element which elements can be parents, what its contents can be and lists its attributes.

        Further reading

        Start with the the section called “OpenACS Documentation Guide”

        ($Id$)
        Index: openacs-4/packages/acs-core-docs/www/release-notes.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/release-notes.adp,v diff -u -N -r1.1.2.15 -r1.1.2.16 --- openacs-4/packages/acs-core-docs/www/release-notes.adp 30 Nov 2016 08:15:11 -0000 1.1.2.15 +++ openacs-4/packages/acs-core-docs/www/release-notes.adp 6 Jan 2017 09:18:42 -0000 1.1.2.16 @@ -402,20 +402,20 @@ turned off by default via the acs-kernel parameter ExcludedFiles in section request-processor (The variable provides a string match glob list of files and is defaulted to "*/CVS/* *~")

        -
        ($‌Id: release-notes.html,v 1.55.2.12 2016/11/19 -09:21:54 gustafn Exp $)
        +
        ($‌Id: release-notes.xml,v 1.30.2.7 2016/06/23 +08:32:46 gustafn Exp $)

        -Release 4.6.3

        Release Notes for 4.6.3

        +Release 4.6.3

        Release Notes for 4.6.3

        -Release 4.6.2

        Release Notes for 4.6.2

        +Release 4.6.2

        Release Notes for 4.6.2

        -Release 4.6

        Release Notes for 4.6

        +Release 4.6

        Release Notes for 4.6

        -Release 4.5

        Release Notes for 4.5

        +Release 4.5

        Release Notes for 4.5

        -OpenACS Release Notes

        OpenACS Release Notes

        Release 5.9.0

        • +OpenACS Release Notes

          OpenACS Release Notes

          Release 5.9.0

          • The release of OpenACS 5.9.0 contains the 78 packages of the oacs-5-9 branch. These packages include the OpenACS core packages, the major application packages (e.g. most the ones used on OpenACS.org), and @@ -263,21 +263,21 @@ more than 18.000 modifications (781 commits) contributed by 7 committers.

          Release 5.7.0

          • - Made changes that extend acs-kernel's create_type and create_attribute procs, - so they're optionally able to create sql tables and columns. Optional metadata + Made changes that extend acs-kernel's create_type and create_attribute procs, + so they're optionally able to create sql tables and columns. Optional metadata params allow for the automatic generation of foreign key references, check exprs, etc.

          Release 5.6.0

          • Added new package dependency type, "embeds". This is a variant of the "extends" package dependency type added in OpenACS 5.5.0. It allows one to write embeddable packages, with scripts made visible in client packages - using URLs which include the embedded package's package key. An example + using URLs which include the embedded package's package key. An example embeddable package might be a rewritten "attachments" package. The current implementation requires a global instance be mounted, and client packages generate urls to that global instance. Among other things, this leads to the user navigating to the top-level subsite, losing any subsite theming that might be associated with a community. Using "embeds", a rewritten - package would run in the client package's context, maintaining theming and + package would run in the client package's context, maintaining theming and automatically associating attachments with the client package.

            Added global package parameters - parameters can now have scope "local" or "global", @@ -335,12 +335,12 @@ site-wide one if not. This will cause message keys (entered as <span>#</span>....# strings) to be replaced with the language text for the chosen locale.

          Release 5.4.2

          • This is a minor bugfix release. -

            Site node caching was removed as doesn't work correctly

            Critical issues with search on oracle were fixed

            More html strict work etc

          Release 5.4.1

          • This is a minor bugfix release. +

            Site node caching was removed as doesn't work correctly

            Critical issues with search on oracle were fixed

            More html strict work etc

          Release 5.4.1

          • This is a minor bugfix release.

          Release 5.4.0

          • New Templating API added to add scripts, css, etc to the HTML HEAD and BODY sections of the generated HTML document. Please see /packages/acs-templating/tcl/head-procs.tcl or visit the template::head procs in the API browser for details. -

            Templates have been modified to comply with HTML strict

            The Search package's results page has been improved

            TinyMCE WYSIWYG support has been added, RTE and HTMLArea support dropped

            acs-mail-lite's send has been cleaned up to properly encode content, to handle +

            Templates have been modified to comply with HTML strict

            The Search package's results page has been improved

            TinyMCE WYSIWYG support has been added, RTE and HTMLArea support dropped

            acs-mail-lite's send has been cleaned up to properly encode content, to handle file attachments, etc. "complex-send" will disappear from acs-core in a future release.

          The ChangeLogs include an annotated list of changes (???) since the last release and in the entire 5.9 release sequence ???.

          Release 5.3.1

          • Bug fixes.

            New TIPs implemented.

            All Core Automated Tests for Postgres pass.

            New Site and Blank master templates and CSS compatible with the .LRN Zen @@ -371,7 +371,7 @@ You may want to begin by reading our installation documentation for the section called “a Unix-like system”. Note that the Windows documentation is not current for OpenACS 5.9.0, but an alternative is to use John - Sequeira's Oasis VM + Sequeira's Oasis VM project.

            After installation, the full documentation set can be found by visiting @@ -392,7 +392,7 @@ authentication, password management, account creation, and account import mechanisms. This includes improvements to the basic cookie handling, so logins can be expired without the - user's identity being completely lost. You can set login to expire after a certain period + user's identity being completely lost. You can set login to expire after a certain period (e.g. 8 hours, then password must be refreshed), or you can have all issues login cookies expired at once, e.g. if you have left a permanent login cookie on a public machine somewhere.

          • @@ -406,12 +406,12 @@ administration, your workspace, and login/logout, and is rendered using CSS. - And there's a new community template + And there's a new community template (/packages/acs-subsite/www/group-master), which provides useful navigation to the applications and administrative UI in a subsite. - In addition, there's new, simpler UI for managing members of a + In addition, there's new, simpler UI for managing members of a subsite, instantiating and mounting applications, setting permissions, parameters, etc. @@ -422,7 +422,7 @@ The list builder has been added for easily generating templated tables and lists, with features such as filtering, sorting, - actions on multiple rows with checkboxes, etc. Most of all, it's + actions on multiple rows with checkboxes, etc. Most of all, it's fast to use, and results in consistently-looking, consistently-behaving, templated tables.

          • @@ -439,7 +439,7 @@

          • Oracle 9i support.

          • - Who's online feature. + Who's online feature.

          • Spell checking.

          @@ -458,4 +458,4 @@

        • Serving backup files and files from the CVS directories is turned off by default via the acs-kernel parameter ExcludedFiles in section request-processor (The variable provides a string match glob list of files and is defaulted to "*/CVS/* *~") -

        ($Id$)
        +

        ($Id$)
        Index: openacs-4/packages/acs-core-docs/www/releasing-openacs-core.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/releasing-openacs-core.adp,v diff -u -N -r1.1.2.8 -r1.1.2.9 --- openacs-4/packages/acs-core-docs/www/releasing-openacs-core.adp 30 Nov 2016 08:15:11 -0000 1.1.2.8 +++ openacs-4/packages/acs-core-docs/www/releasing-openacs-core.adp 6 Jan 2017 09:18:42 -0000 1.1.2.9 @@ -264,8 +264,8 @@ # Clean up after ourselves... cd $BASE && rm -rf dotlrn-tarball tarball openacs-4 dotlrn-packages -
        ($‌Id: releasing-openacs-core.html,v 1.20.2.14 -2016/11/19 09:21:55 gustafn Exp $)
        +
        ($‌Id: releasing-openacs.xml,v 1.22.2.3 +2016/10/03 09:17:51 gustafn Exp $)
        OpenACS Core and .LRN

        OpenACS Core and .LRN

        1. Update Translations. the section called “How to Update the translations”

        2. Rebuild the Changelog. Rebuild the Changelog. I use a tool called cvs2cl. Run this command from the package root to automatically generate a Changelog file in the same dir. We generate two changelogs, one for the minor branch and one for the most recent release. The example below is for OpenACS 5.0.2:

          cd /var/lib/aolserver/$OPENACS_SERVICE_NAME
           cvs2cl -F oacs-5-0 --delta openacs-5-0-0-final:oacs-5-0 -f ChangeLog
          -cvs2cl -F oacs-5-0 --delta openacs-5-0-1-final:oacs-5-0 -f ChangeLog-recent
        3. Update Version Numbers. The version numbers in the documentation and in the packages must be updated. This should only happen after a release candidate is approved.

          .LRN: this must be repeated for .LRN modules (dotlrn-core in the dotlrn cvs tree) and for any modified modules in the .LRN prerequisites (dotlrn-prereq in openacs cvs tree). My current working model is that I bulk-update .LRN and OpenACS core but that I don't touch dotlrn-prereq modules - I just use the most recent release and it's up to individual package developers to tag and release those packages when they change. This model is already broken because following it means that dotlrn-prereqs don't get new translations.

          1. Update /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/acs-core-docs/www/xml/variables.ent with the new version number. +cvs2cl -F oacs-5-0 --delta openacs-5-0-1-final:oacs-5-0 -f ChangeLog-recent

          2. Update Version Numbers. The version numbers in the documentation and in the packages must be updated. This should only happen after a release candidate is approved.

            .LRN: this must be repeated for .LRN modules (dotlrn-core in the dotlrn cvs tree) and for any modified modules in the .LRN prerequisites (dotlrn-prereq in openacs cvs tree). My current working model is that I bulk-update .LRN and OpenACS core but that I don't touch dotlrn-prereq modules - I just use the most recent release and it's up to individual package developers to tag and release those packages when they change. This model is already broken because following it means that dotlrn-prereqs don't get new translations.

            1. Update /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/acs-core-docs/www/xml/variables.ent with the new version number.

            2. Add new section in /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/acs-core-docs/www/xml/for-everyone/release-notes.xml

            3. Regenerate all HTML docs

              cd /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/acs-core-docs/www/xml
               make
            4. Update /var/lib/aolserver/$OPENACS_SERVICE_NAME/readme.txt with the new version number

            5. Update version number and release date in all of the @@ -18,18 +18,18 @@ mkdir dotlrn-packages cd dotlrn-packages cvs -d /dotlrn-cvsroot checkout -r dotlrn-2-0 dotlrn-all -

            6. Tag the tree. If it's a final release of core, move or create the appropriate openacs-major-minor-compat tag. (Ie, if releasing 5.0.3 final, move the openacs-5-0-compat flag.)

              cd /var/tmp/openacs-4
              +
            7. Tag the tree. If it's a final release of core, move or create the appropriate openacs-major-minor-compat tag. (Ie, if releasing 5.0.3 final, move the openacs-5-0-compat flag.)

              cd /var/tmp/openacs-4
               cvs tag -F openacs-5-0-0a1
               cvs tag -F openacs-5-0-compat
              -

              Branching

              When we feature-freeze on HEAD as part of the release process, we are blocking new development. To avoid this, we branch the code at this point, so that new work can continue on HEAD while the branch is stabilized for release. However, branching means that bug fixes have to be synchronized between HEAD and the branch, and bug fixes tend to be more frequent right at this time. Therefore, our actual branch point is as late as possible - essentially, we do not branch until and unless new feature work is actively blocked by the feature freeze. Branching is almost the same as tagging, except for the flag and slightly different tag nomenclature. To see the list of old branches, cvs status -v somefile.

              cvs tag -b oacs-5-0

              If doing .LRN: Since the .LRN packages aren't all in one +

              Branching

              When we feature-freeze on HEAD as part of the release process, we are blocking new development. To avoid this, we branch the code at this point, so that new work can continue on HEAD while the branch is stabilized for release. However, branching means that bug fixes have to be synchronized between HEAD and the branch, and bug fixes tend to be more frequent right at this time. Therefore, our actual branch point is as late as possible - essentially, we do not branch until and unless new feature work is actively blocked by the feature freeze. Branching is almost the same as tagging, except for the flag and slightly different tag nomenclature. To see the list of old branches, cvs status -v somefile.

              cvs tag -b oacs-5-0

              If doing .LRN: Since the .LRN packages aren't all in one module, we iterate through all of the modules. Log in first - (cvs login) so that you don't have to log in for each + (cvs login) so that you don't have to log in for each module.

              cd /var/tmp/dotlrn-packages
               for dir in *; do ( cd $dir && cvs tag dotlrn-2-0-2-final ); done
               for dir in *; do ( cd $dir && cvs tag -F openacs-5-0-compat ); done
               

              Note that for the compat tag we use the -F flag which will force the tag to the new version (just in case someone has created the tag already on another version). Excercise care when doing this since - you don't want to inadvertently move a prior release tag. Also if the tagging goes horribly wrong + you don't want to inadvertently move a prior release tag. Also if the tagging goes horribly wrong for some reason you can delete the tag via cvs tag -d <symbolic_tag>.

            8. Apply the final tag across the tree. First, check out the entire OpenACS tree, getting the most recent stable version of each package. This is most simply done on openacs.org:

              cd /var/tmp
               cvs -d /cvsroot checkout -r openacs-5-1-compat openacs-4
               cd openacs-4
              @@ -57,7 +57,7 @@
               
        4. Test the new tarball(s). Download the tarballs just created and install them and make sure everything looks okay and that automated tests pass.

        5. Update Web site. Update the different places on OpenACS.org where we track status.

          • Release Status for the current version - something like http://openacs.org/projects/openacs/5.0/milestones

          • Home page of openacs.org

          • Post a new news item

        6. Clean Up. Clean up after yourself.

          cd /var/tmp
           rm -rf tarball dotlrn-tarball dotlrn-packages openacs-5.0.0a1
           rm -rf /var/tmp/openacs-4

        - Here is a shell script that automates packaging the tarball (it's a bit out of date with the new steps - I've been doing everything manually or with little throwaway scripts as detailed above until the process is stabilized). + Here is a shell script that automates packaging the tarball (it's a bit out of date with the new steps - I've been doing everything manually or with little throwaway scripts as detailed above until the process is stabilized).

        #!/bin/bash
         
         # if TAG=1 create the cvs tags otherwise assume they exist.
        Index: openacs-4/packages/acs-core-docs/www/remote-postgres.html
        ===================================================================
        RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/remote-postgres.html,v
        diff -u -N -r1.13.2.3 -r1.13.2.4
        --- openacs-4/packages/acs-core-docs/www/remote-postgres.html	19 Nov 2016 09:21:55 -0000	1.13.2.3
        +++ openacs-4/packages/acs-core-docs/www/remote-postgres.html	6 Jan 2017 09:18:42 -0000	1.13.2.4
        @@ -1,12 +1,12 @@
         
         Running a PostgreSQL database on another server

        Running a PostgreSQL database on another server

        To run a database on a different machine than the webserver requires changes to the database configuration file - and access control file, and to the OpenACS service's + and access control file, and to the OpenACS service's configuration file.

        • Edit the database configuration file, which in a Reference install is located at /usr/local/pgsql/data/postgresql.conf and change

          #tcpip_socket = false

          to

          tcpip_socket = true
        • Change the access control file for the database to permit specific remote clients to access. Access can be - controlled ... (add notes from forum post)

        • Change the OpenACS service's configuration file to + controlled ... (add notes from forum post)

        • Change the OpenACS service's configuration file to point to the remote database. Edit /var/lib/aolserver/$OPENACS_SERVICE_NAME/etc/config.tcl and change

          to

        Index: openacs-4/packages/acs-core-docs/www/request-processor.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/request-processor.adp,v diff -u -N -r1.1.2.7 -r1.1.2.8 --- openacs-4/packages/acs-core-docs/www/request-processor.adp 30 Nov 2016 08:15:11 -0000 1.1.2.7 +++ openacs-4/packages/acs-core-docs/www/request-processor.adp 6 Jan 2017 09:18:42 -0000 1.1.2.8 @@ -106,8 +106,8 @@ name of the package.

        [ad_conn path_info]

        In a .vuh file, path_info is the trailing part of the URL not matched by the .vuh file.

        -
        ($‌Id: request-processor.html,v 1.49.2.13 -2016/11/19 09:21:55 gustafn Exp $)
        +
        ($‌Id: rp.xml,v 1.12.6.2 2016/10/03 09:17:51 +gustafn Exp $)
        Stage 2: Authentication

        Next, the Request Processor examines the request for session information. Session information is generally sent from the client -(the user's browser) to the server via cookies. The security/session handler is described in +(the user's browser) to the server via cookies. The security/session handler is described in detail in its own document. It examines the client request and either extracts or sets up new session tokens for the user.

        Stage 3: Authorization

        @@ -51,24 +51,24 @@ extensions, i.e. files that end with: .html, .tcl and .adp.

        -If the RP can't find any matching files with the expected extensions, +If the RP can't find any matching files with the expected extensions, it will look for virtual-url-handler files, or .vuh files. A .vuh file will be executed as if it were a Tcl file, but with the tail end of the URL removed. This allows the code in the .vuh file to act like a registered procedure for an entire subtree of the URL namespace. Thus a .vuh file can be thought of as a replacement for filters and registered procs, -except that they integrate cleanly and correctly with the RP's URL +except that they integrate cleanly and correctly with the RP's URL mapping mechanisms. The details of how to use these files are described in OpenACS 4 Request Processor Design.

        Once the appropriate file is found, it is either served directly if -it's static content, or sent to the template system or the standard -Tcl interpreter if it's a dynamic page. +it's static content, or sent to the template system or the standard +Tcl interpreter if it's a dynamic page.

        Basic API

        Once the flow of control reaches a dynamic page, the Request Processor has populated the environment of the request with several pieces of -useful information. The RP's environment is accessible through the +useful information. The RP's environment is accessible through the ad_conn interface, and the following calls should be useful to you when developing dynamic pages:

        [ad_conn user_id] Index: openacs-4/packages/acs-core-docs/www/requirements-template.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/requirements-template.adp,v diff -u -N -r1.1.2.7 -r1.1.2.8 --- openacs-4/packages/acs-core-docs/www/requirements-template.adp 30 Nov 2016 08:15:11 -0000 1.1.2.7 +++ openacs-4/packages/acs-core-docs/www/requirements-template.adp 6 Jan 2017 09:18:42 -0000 1.1.2.8 @@ -127,8 +127,8 @@
        0.1Created8/21/2000Josh Finkler, Audrey McLoghlin
        ($‌Id: requirements-template.html,v 1.49.2.12 -2016/11/19 09:21:55 gustafn Exp $)
        +
        ($‌Id: requirements-template.xml,v 1.6.14.1 +2016/06/23 08:32:46 gustafn Exp $)
        Very broadly, describe how the system meets a need of a business, group, the OpenACS as a whole, etc. Make sure that technical and non-technical readers alike would understand what the system would do - and why it's useful. Whenever applicable, you should explicitly state + and why it's useful. Whenever applicable, you should explicitly state what the business value of the system is.

        System/Application Overview

        Discuss the high-level breakdown of the components that make up the system. You can go by functional areas, by the main transactions the system allows, etc.

        You should also state the context and dependencies of the system - here, e.g. if it's an application-level package for OpenACS 4, briefly + here, e.g. if it's an application-level package for OpenACS 4, briefly describe how it uses kernel services, like permissions or subsites.

        Use-cases and User-scenarios

        Determine the types or classes of users who would use the @@ -34,18 +34,18 @@ take, and how the system would support them.

        Optional: Competitive Analysis

        Describe other systems or services that are comparable to what - you're building. If applicable, say why your implementation will be + you're building. If applicable, say why your implementation will be superior, where it will match the competition, and where/why it will lack existing best-of-breed capabilities. This section is also in the Design doc, so write about it where you deem most appropriate.

        Related Links

        Include all pertinent links to supporting and related material, - such as:

        • System/Package "coversheet" - where all documentation for this software is linked off of

        • Design document

        • Developer's guide

        • User's guide

        • Other-cool-system-related-to-this-one document

        • Test plan

        • Competitive system(s)

        Requirements

        + such as:

        • System/Package "coversheet" - where all documentation for this software is linked off of

        • Design document

        • Developer's guide

        • User's guide

        • Other-cool-system-related-to-this-one document

        • Test plan

        • Competitive system(s)

        Requirements

        The main course of the document, requirements. Break up the requirements sections (A, B, C, etc.) as needed. Within each section, create a list denominated with unique identifiers that reflect any functional hierarchy present, e.g. 20.5.13. - for the first number, leave generous gaps on the first writing of requirements (e.g. 1, 10, - 20, 30, 40, etc.) because you'll want to leave room for any missing + 20, 30, 40, etc.) because you'll want to leave room for any missing key requirements that may arise.

        • 10.0 A Common Solution

          Programmers and designers should only have to learn a single Index: openacs-4/packages/acs-core-docs/www/rp-design.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/rp-design.html,v diff -u -N -r1.37.2.3 -r1.37.2.4 --- openacs-4/packages/acs-core-docs/www/rp-design.html 19 Nov 2016 09:21:55 -0000 1.37.2.3 +++ openacs-4/packages/acs-core-docs/www/rp-design.html 6 Jan 2017 09:18:42 -0000 1.37.2.4 @@ -25,10 +25,10 @@ (/var/lib/aolserver/servicename/packages/package_key/www) -- This is the pageroot for the package_key package.

        • request environment (ad_conn) -- This is a global namespace containing variables associated with the current -request.

        • abstract URL -- A URL with no extension that doesn't +request.

        • abstract URL -- A URL with no extension that doesn't directly correspond to a file in the filesystem.

        • abstract file or abstract path -- A URL that has been translated into a file system path (probably by prepending the -appropriate pageroot), but still doesn't have any extension and so does +appropriate pageroot), but still doesn't have any extension and so does not directly correspond to a file in the filesystem.

        • concrete file or concrete path -- A file or path that actually references something in the filesystem.

        System Overview

        Package Lookup

        One of the first things the request processor must do is to determine which package instance a given request references, and based on this @@ -90,7 +90,7 @@ number of entries in the mapping.

        Request Environment

        The request environment is managed by the procedure ad_conn. Variables can be set and retrieved through use of the ad_conn procedure. The following variables are available for public use. -If the ad_conn procedure doesn't recognize a variable being passed to it +If the ad_conn procedure doesn't recognize a variable being passed to it for a lookup, it tries to get a value using ns_conn. This guarantees that ad_conn subsumes the functionality of ns_conn.

        -
        Request processor
        [ad_conn urlv] A list containing each element of the URL
        [ad_conn url] The URL associated with the request.
        [ad_conn query] The portion of the URL from the ? on (i.e. GET variables) associated with the request.
        [ad_conn file] The filepath including filename of the file being served
        [ad_conn request] The number of requests since the server was last started
        [ad_conn start_clicks] The system time when the RP starts handling the request
        Session System Variables: set in Index: openacs-4/packages/acs-core-docs/www/rp-requirements.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/rp-requirements.html,v diff -u -N -r1.33.2.3 -r1.33.2.4 --- openacs-4/packages/acs-core-docs/www/rp-requirements.html 19 Nov 2016 09:21:55 -0000 1.33.2.3 +++ openacs-4/packages/acs-core-docs/www/rp-requirements.html 6 Jan 2017 09:18:42 -0000 1.33.2.4 @@ -8,7 +8,7 @@ mounted at arbitrary urls, and tighter integration with the database to allow for flexible user controlled url structures, and subsites.

        Vision Statement

        Most web servers are designed to serve pages from exactly one static pageroot. This restriction can become cumbersome when trying to build a web -toolkit full of reusable and reconfigurable components.

        System Overview

        The request processor's functionality can be split into two main +toolkit full of reusable and reconfigurable components.

        System Overview

        The request processor's functionality can be split into two main pieces.

        1. Set up the environment in which a server side script expects to run. This includes things like:

          • Initialize common variables associated with a request.

          • Authenticate the connecting party.

          • Check that the connecting party is authorized to proceed with the request.

          • Invoke any filters associated with the request URI.

        2. Determine to which entity the request URI maps, and deliver the content @@ -20,7 +20,7 @@ for the delivered content.

        It is essential that any errors that occur during the above steps be reported to developers in an easily decipherable manner.

        Requirements

        10.0 Multiple Pageroots

        10.10 Pageroots may be combined into one URL space.

        10.20 Pageroots may be mounted at more than one location in the URL space.

        20.0 Application Context

        20.10 The request processor must be able to determine a primary context -or state associated with a pageroot based on it's location within the URL +or state associated with a pageroot based on it's location within the URL space.

        30.0 Authentication

        30.10 The request processor must be able to verify that the connecting browser actually represents the party it claims to represent.

        40.0 Authorization

        40.10 The request processor must be able to verify that the party the connecting browser represents is allowed to make the request.

        50.0 Scalability

        Index: openacs-4/packages/acs-core-docs/www/security-design.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/security-design.html,v diff -u -N -r1.35.2.3 -r1.35.2.4 --- openacs-4/packages/acs-core-docs/www/security-design.html 19 Nov 2016 09:21:55 -0000 1.35.2.3 +++ openacs-4/packages/acs-core-docs/www/security-design.html 6 Jan 2017 09:18:42 -0000 1.35.2.4 @@ -44,7 +44,7 @@ with each cookie serving a different purpose. These cookies are:

        namevaluemax-agesecure?
        ad_session_idsession_id,user_idSessionTimeoutno
        ad_user_loginuser_idInfinityno
        ad_user_login_secureuser_id,randomInfinityyes
        ad_secure_tokensession_id,user_id,randomSessionLifetimeyes
        • ad_session_id

          • reissued on any hit separated by more than SessionRenew seconds from the previous hit that received a cookie

          • is valid only for SessionTimeout seconds

          • is the canonical source for the session ID in ad_conn

        • ad_user_login

          • is used for permanent logins

        • ad_user_login_secure

          • is used for permanent secure logins

          • contains random garbage (ns_time) to prevent attack against the secure hash

        • ad_secure_token -

          • is a session-level cookie from the browser's standpoint

          • its signature expires in SessionLifetime seconds

          • contains random garbage (ns_time) to prevent attack against the secure +

            • is a session-level cookie from the browser's standpoint

            • its signature expires in SessionLifetime seconds

            • contains random garbage (ns_time) to prevent attack against the secure hash

            • user_id is extraneous

        Authentication Process

        The Tcl function (sec_handler) is called by the request processor to authenticate the user. It first checks the ad_session_id cookie. If there is no valid session in progress, @@ -185,7 +185,7 @@ value and the signature. In addition to the expiration of the digital signature, RFC 2109 specifies an optional max age that is returned to the client. For most cookies, this max age matches the expiration date of the -cookie's signature. The standard specifies that when the max age is not +cookie's signature. The standard specifies that when the max age is not included, the cookie should be "discarded when the user agent exits." Because we can not trust the client to do this, we must specify a timeout for the signature. The SessionLifetime parameter is used for this @@ -215,7 +215,7 @@ the thread is destroyed by AOLserver.

        Security

        Storing information on a client always presents an additional security risk.

        Since we are only validating the information and not trying to protect it -as a secret, we don't use salt. Cryptographic salt is useful if you are +as a secret, we don't use salt. Cryptographic salt is useful if you are trying to protect information from being read (e.g., hashing passwords).

        External SSL

        External SSL mechanisms (firewall, dedicated hardware, etc.) can be used by creating two pools of AOLservers. In one pool the servers should be Index: openacs-4/packages/acs-core-docs/www/security-notes.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/security-notes.adp,v diff -u -N -r1.1.2.5 -r1.1.2.6 --- openacs-4/packages/acs-core-docs/www/security-notes.adp 30 Nov 2016 08:15:11 -0000 1.1.2.5 +++ openacs-4/packages/acs-core-docs/www/security-notes.adp 6 Jan 2017 09:18:42 -0000 1.1.2.6 @@ -68,8 +68,8 @@

        The set of string match expressions in the procedure above should be extended appropriately for other registration pages. This procedure does not use ad_parameter or regular expressions for -performance reasons, as it is called by the request processor.

        ($‌Id: security-notes.html,v 1.48.2.12 -2016/11/19 09:21:55 gustafn Exp $)
        +performance reasons, as it is called by the request processor.

        ($‌Id: security-notes.xml,v 1.7 2014/10/27 +16:39:32 victorg Exp $)

        Security System Overview

        The security system consists of a number of subsystems.

        Signed Cookies

        Cookies play a key role in storing user information. However, since they are -stored in plaintext on a user's system, the validity of cookies is an +stored in plaintext on a user's system, the validity of cookies is an important issue in trusting cookie information. Thus, we want to be able to validate a cookie, but we also want to validate the cookie without a database hit. Index: openacs-4/packages/acs-core-docs/www/snapshot-backup.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/snapshot-backup.html,v diff -u -N -r1.13.2.4 -r1.13.2.5 --- openacs-4/packages/acs-core-docs/www/snapshot-backup.html 19 Nov 2016 09:21:55 -0000 1.13.2.4 +++ openacs-4/packages/acs-core-docs/www/snapshot-backup.html 6 Jan 2017 09:18:42 -0000 1.13.2.5 @@ -43,11 +43,11 @@ . exporting pre-schema procedural objects and actions . exporting foreign function library names for user SERVICE_NAME . exporting object type definitions for user SERVICE_NAME - About to export SERVICE_NAME's objects ... + About to export SERVICE_NAME's objects ... . exporting database links . exporting sequence numbers . exporting cluster definitions - . about to export SERVICE_NAME's tables via Conventional Path ... + . about to export SERVICE_NAME's tables via Conventional Path ... . exporting synonyms . exporting views . exporting stored procedures @@ -79,7 +79,7 @@ unneccesary and has complicated permissions.

        In the tar command,

        • c create a new tar archive

        • p preserves permissions.

        • s preserves file sort order

        • z compresses the output with gzip.

        • The --exclude clauses skips some daemontools files that are owned by root and thus cannot be backed up by the - service owner. These files are autogenerated and we don't + service owner. These files are autogenerated and we don't break anything by omitting them.

        • The --file clause specifies the name of the output file to be generated; we manually add the correct extensions.

        • The last clause, @@ -89,7 +89,7 @@ [$OPENACS_SERVICE_NAME $OPENACS_SERVICE_NAME]$ tar -cpsz --exclude /var/lib/aolserver/$OPENACS_SERVICE_NAME/etc/daemontools/supervise \ --file /var/tmp/$OPENACS_SERVICE_NAME-backup.tar.gz /var/lib/aolserver/$OPENACS_SERVICE_NAME/ tar: Removing leading `/' from member names -[$OPENACS_SERVICE_NAME $OPENACS_SERVICE_NAME]$

        • Suffer a catastrophic failure on your production system. (We'll simulate this step)

          [root root]# svc -d /service/$OPENACS_SERVICE_NAME
          +[$OPENACS_SERVICE_NAME $OPENACS_SERVICE_NAME]$
        • Suffer a catastrophic failure on your production system. (We'll simulate this step)

          [root root]# svc -d /service/$OPENACS_SERVICE_NAME
           [root root]# mv /var/lib/aolserver/$OPENACS_SERVICE_NAME/ /var/lib/aolserver/$OPENACS_SERVICE_NAME.lost
           [root root]# rm /service/$OPENACS_SERVICE_NAME
           rm: remove symbolic link `/service/$OPENACS_SERVICE_NAME'? y
          Index: openacs-4/packages/acs-core-docs/www/style-guide.adp
          ===================================================================
          RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/style-guide.adp,v
          diff -u -N -r1.1.2.8 -r1.1.2.9
          --- openacs-4/packages/acs-core-docs/www/style-guide.adp	30 Nov 2016 08:15:11 -0000	1.1.2.8
          +++ openacs-4/packages/acs-core-docs/www/style-guide.adp	6 Jan 2017 09:18:42 -0000	1.1.2.9
          @@ -99,8 +99,8 @@
           
        0.1Creation12/2003Jeff Davis
        ($‌Id: style-guide.html,v 1.28.2.13 2016/11/19 -09:21:55 gustafn Exp $)
        +
        ($‌Id: style-guide.xml,v 1.3.14.2 2016/10/03 +09:17:51 gustafn Exp $)

        - When confronted by this much complexity it's important to be + When confronted by this much complexity it's important to be able to make sense of it without having to wade through it all. Things should be coherent, things should be named predictably and behave like you would expect, and your guess about what @@ -35,7 +35,7 @@ scripts and tcl library files must be named properly to be used), while some are suggestions (the object-verb naming convention) which - if ignored won't break anything, but if you follow the + if ignored won't break anything, but if you follow the rules people will be able to understand your package much more easily.

      • Be literate in your programming.  @@ -59,17 +59,17 @@

      • Follow the code formatting guidelines.  The code base is very large and if things are formatted consistently it is easier to read. Also, if it conforms - to the standard it won't be reformatted (which can mask + to the standard it won't be reformatted (which can mask the change history and making tracking down bugs much harder). Using spaces rather than tabs makes patches easier to read and manage and does not force other programmers to decipher what tab settings you had in place in your editor.

      • Use the standard APIs.  - Don't reinvent the wheel. Prefer extending an existing + Don't reinvent the wheel. Prefer extending an existing core API to creating your own. If something in the core - does not meet your particular needs it probably won't meet - others as well and fleshing out the core API's makes the + does not meet your particular needs it probably won't meet + others as well and fleshing out the core API's makes the toolkit more useful for everyone and more easily extended.

      • Make sure your datamodel create/drop scripts work.  Break the table creation out from the package/stored @@ -83,7 +83,7 @@ patch and bug numbers in your commit messages.

        Create bug tracker tickets for things you are going to work - on yourself (just in case you don't get to it and to act as + on yourself (just in case you don't get to it and to act as a pointer for others who might encounter the same problem).

      • Solicit code reviews.  Ask others to look over your code and provide feedback and do Index: openacs-4/packages/acs-core-docs/www/subsites-design.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/subsites-design.html,v diff -u -N -r1.35.2.3 -r1.35.2.4 --- openacs-4/packages/acs-core-docs/www/subsites-design.html 19 Nov 2016 09:21:55 -0000 1.35.2.3 +++ openacs-4/packages/acs-core-docs/www/subsites-design.html 6 Jan 2017 09:18:42 -0000 1.35.2.4 @@ -192,7 +192,7 @@ [ad_conn subsite_url] -

        Data Model Discussion

        The subsites implementation doesn't really have it's own data +

        Data Model Discussion

        The subsites implementation doesn't really have it's own data model, although it depends heavily on the site-nodes data model, and the APM data model.

        User Interface

        The primary elements of the subsite user interface consist of the subsite admin pages. These pages are divided up into two areas: Group administration, Index: openacs-4/packages/acs-core-docs/www/subsites-requirements.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/subsites-requirements.html,v diff -u -N -r1.34.2.3 -r1.34.2.4 --- openacs-4/packages/acs-core-docs/www/subsites-requirements.html 19 Nov 2016 09:21:55 -0000 1.34.2.3 +++ openacs-4/packages/acs-core-docs/www/subsites-requirements.html 6 Jan 2017 09:18:42 -0000 1.34.2.4 @@ -31,7 +31,7 @@ forum messages associated with the current package instance. Joe is happy to realize that parameter::get is already smart enough to return configuration parameters for the current package instance, and so he has to do no extra -work to tailor configuration parameters to the current subsite.

        Jane Admin maintains www.company.com. She learns of Joe's work and +work to tailor configuration parameters to the current subsite.

        Jane Admin maintains www.company.com. She learns of Joe's work and would like to set up individual forums for the Boston and Austin offices of her company. The first thing she does is use the APM to install the new forum package.

        Next, Jane uses the Subsite UI to create subsites for the Boston and @@ -40,13 +40,13 @@ http://www.company.com/offices/boston/forum, and similarly for the Austin office. At this point, the Boston and Austin office admins can customize the configurations for each of their forums, or they can just use the -defaults.

        Related Links

        Requirements: Programmer's API

        A subsite API is required for programmers to ensure their packages are +defaults.

        Related Links

        Requirements: Programmer's API

        A subsite API is required for programmers to ensure their packages are subsite-aware. The following functions should be sufficient for this:

        10.10.0 Package creation

        The system must provide an API call to create a package, and it must be possible for the context (to which the package belongs) to be specified.

        10.20.0 Package deletion

        The system must provide an API call to delete a package and all related -objects in the subsite's context.

        10.30.0 Object's package information

        Given an object ID, the system must provide an API call to determine the +objects in the subsite's context.

        10.30.0 Object's package information

        Given an object ID, the system must provide an API call to determine the package (ID) to which the object belongs.

        10.40.0 URL from package

        Given a package (ID), the system must provide an API call to return the -canonical URL for that package.

        10.50.0 Main subsite's package_id

        The system must provide an API call to return a package ID corresponding -to the main subsite's package ID (the degenerate subsite).

        Requirements: The User Interface

        The Programmer's User Interface

        There is no programmer's UI, other than the API described above.

        The Administrator's User Interface

        The UI for administrators is a set of HTML pages that are used to drive +canonical URL for that package.

        10.50.0 Main subsite's package_id

        The system must provide an API call to return a package ID corresponding +to the main subsite's package ID (the degenerate subsite).

        Requirements: The User Interface

        The Programmer's User Interface

        There is no programmer's UI, other than the API described above.

        The Administrator's User Interface

        The UI for administrators is a set of HTML pages that are used to drive the underlying API for package instance management (i.e. adding, removing, or altering packages). It is restricted to administrators of the current subsite such that administrators can only manage their own subsites. Of course, Index: openacs-4/packages/acs-core-docs/www/subsites.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/subsites.adp,v diff -u -N -r1.1.2.7 -r1.1.2.8 --- openacs-4/packages/acs-core-docs/www/subsites.adp 30 Nov 2016 08:15:11 -0000 1.1.2.7 +++ openacs-4/packages/acs-core-docs/www/subsites.adp 6 Jan 2017 09:18:42 -0000 1.1.2.8 @@ -242,8 +242,8 @@ that appears to provide each user in a system with their own private notes database.

        We also saw how to use the templating system's forms API in a simple way, to create forms based pages with minimal duplication -of code.

        ($‌Id: subsites.html,v 1.48.2.12 2016/11/19 -09:21:55 gustafn Exp $)
        +of code.

        ($‌Id: subsites.xml,v 1.9.2.1 2016/06/23 +08:32:46 gustafn Exp $)

        Overview

        -In this document, we'll examine the user interface pages of the Notes +In this document, we'll examine the user interface pages of the Notes application in more detail, covering two separate aspects of page -development in OpenACS. First, we'll talk about the code needed to make +development in OpenACS. First, we'll talk about the code needed to make your pages aware of which application instance they are running -in. Second, we'll talk about using the form builder to develop +in. Second, we'll talk about using the form builder to develop form-based user interfaces in OpenACS. While these seem like unrelated topics, they both come up in the example page that we are going to look at, so it makes sense to address them at the same time. @@ -20,7 +20,7 @@ application instances to particular URLs within a site. We call creating such a mapping mounting the application instance at a particular URL. The tutorial also showed how a given URL is -translated into a physical file to serve using the site map. We'll +translated into a physical file to serve using the site map. We'll repeat this description here, assuming that you have mounted an instance of Notes at the URL /notes as we did in the packages-example:

        • @@ -67,7 +67,7 @@

        In the Notes example, we are particularly interested in the package_id field. If you study the data model and code, -you'll see why. As we said before in the data modeling tutorial, the Notes application points the +you'll see why. As we said before in the data modeling tutorial, the Notes application points the context_id of each Note object that it creates to the package instance that created it. That is, the context_id corresponds exactly to the package_id that comes in from @@ -123,7 +123,7 @@ template system. This API allows you to write forms-based pages without generating a lot of duplicated HTML in your pages. It also encapsulates most of the common logic that we use in dealing with -forms, which we'll discuss next. +forms, which we'll discuss next.

        Using Forms

        The forms API is pretty simple: You use calls in the template::form namespace in your Tcl script to create @@ -238,7 +238,7 @@ }

        -In this simple example, we don't do any custom validation. The nice +In this simple example, we don't do any custom validation. The nice thing about using this API is that the forms library handles all of the HTML rendering, input validation and database transaction logic on your behalf. This means that you can write pages without duplicating @@ -249,7 +249,7 @@ repository, mount an instance of Notes somewhere in your server and then try out the user interface pages. It should become clear that in a real site, you would be able to, say, create a custom instance of -Notes for every registered user, mount that instance at the user's +Notes for every registered user, mount that instance at the user's home page, and set up the permissions so that the instance is only visible to that user. The end result is a site where users can come and write notes to themselves. @@ -272,6 +272,6 @@ appears to provide each user in a system with their own private notes database.

        -We also saw how to use the templating system's forms API in a simple +We also saw how to use the templating system's forms API in a simple way, to create forms based pages with minimal duplication of code.

        ($Id$)
        Index: openacs-4/packages/acs-core-docs/www/tcl-doc.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tcl-doc.adp,v diff -u -N -r1.1.2.7 -r1.1.2.8 --- openacs-4/packages/acs-core-docs/www/tcl-doc.adp 30 Nov 2016 08:15:11 -0000 1.1.2.7 +++ openacs-4/packages/acs-core-docs/www/tcl-doc.adp 6 Jan 2017 09:18:42 -0000 1.1.2.8 @@ -26,7 +26,7 @@ # # author's email address, file creation date # -# $‌Id: tcl-doc.html,v 1.49.2.12 2016/11/19 09:21:55 gustafn Exp $ +# $‌Id: tcl-doc.xml,v 1.7 2006/07/17 05:38:38 torbenb Exp $ #

        In addition, the inputs expected by a Tcl page (i.e., form variables) would be enumerated in a call to ad_page_variables, in effect, documenting @@ -86,7 +86,7 @@ \@author Jon Salz (jsalz\@mit.edu) \@creation-date 3 Jul 2000 - \@cvs-id $‌Id: tcl-doc.html,v 1.49.2.12 2016/11/19 09:21:55 gustafn Exp $ + \@cvs-id $‌Id$ }

        Note that:

          @@ -195,7 +195,7 @@ # # jsalz\@mit.edu, 7 Jun 2000 # -# $‌Id: tcl-doc.html,v 1.49.2.12 2016/11/19 09:21:55 gustafn Exp $ +# $‌Id: tcl-doc.xml,v 1.7 2006/07/17 05:38:38 torbenb Exp $

          you'll now write:

           
          @@ -207,7 +207,7 @@
           
               \@creation-date 7 Jun 2000
               \@author Jon Salz (jsalz\@mit.edu)
          -    \@cvs-id $‌Id: tcl-doc.html,v 1.49.2.12 2016/11/19 09:21:55 gustafn Exp $
          +    \@cvs-id $‌Id$
           
           }
           
          @@ -222,8 +222,8 @@
           page's CVS identification string. Just use $‌Id: tcl-documentation.html,v 1.2 2000/09/19
           07:22:35 ron Exp $ when creating the file, and CVS will
           substitute an appropriate string when you check the file in.

          -
        ($‌Id: tcl-doc.html,v 1.49.2.12 2016/11/19 -09:21:55 gustafn Exp $)
        +
        ($‌Id: tcl-doc.xml,v 1.7 2006/07/17 05:38:38 +torbenb Exp $)
        path from server home/filename # -# Brief description of the file's purpose +# Brief description of the file's purpose # -# author's email address, file creation date +# author's email address, file creation date # # $Id$ #

        In addition, the inputs expected by a Tcl page (i.e., form variables) would be enumerated in a call to ad_page_variables, in effect, -documenting the page's argument list. +documenting the page's argument list.

        The problem with these practices is that the documentation is only accessible by reading the source file itself. For this reason, ACS 3.4 introduces a new API for documenting Tcl files and, on top of that, a @@ -36,17 +36,17 @@ sites' UIs, e.g., what properties are available in templates.

      • Allows the request processor to be intelligent: a script can specify in its contract which type of abstract document it returns, and the request processor can transform it automatically into -something useful to a particular user agent. (Don't worry about this for -now - it's not complete for ACS 3.4.)

      • ad_page_contract

        +something useful to a particular user agent. (Don't worry about this for +now - it's not complete for ACS 3.4.)

        ad_page_contract

        Currently ad_page_contract serves mostly as a replacement for ad_page_variables. Eventually, it will be integrated closely -with the documents API so that each script's contract will document +with the documents API so that each script's contract will document precisely the set of properties available to graphical designers in -templates. (Document API integration is subject to change, so we don't +templates. (Document API integration is subject to change, so we don't decsribe it here yet; for now, you can just consider ad_page_contract a newer, better, documented ad_page_variables.) -

        Let's look at an example usage of ad_page_contract:

        +

        Let's look at an example usage of ad_page_contract:

         
         # /packages/acs-kernel/api-doc/www/package-view.tcl
         ad_page_contract {
        @@ -72,7 +72,7 @@
         

        Note that:

        • By convention, ad_page_contract should be preceded -by a comment line containing the file's path. The comment is on +by a comment line containing the file's path. The comment is on line 1, and the contract starts on line 2.

        • ad_page_contract's first argument is the list of expected arguments from the HTTP query (version_id, @@ -85,9 +85,9 @@

        • Arguments can have flags, specified by following the name of the query argument with a colon and one or more of the following -strings (separated by commas):

          • optional: the query argument doesn't -need to be provided; if it's not, the variable for that argument simply -won't be set. For instance, if I call the script above without a +strings (separated by commas):

            • optional: the query argument doesn't +need to be provided; if it's not, the variable for that argument simply +won't be set. For instance, if I call the script above without a public_p in the query, then in the page body [info exists public_p] will return 0.

            • integer: the argument must be an integer @@ -104,7 +104,7 @@

            • multiple: the argument may be specified arbitrarily many times in the query string, and the variable will be set to a -list of all those values (or an empty list if it's unspecified). This is +list of all those values (or an empty list if it's unspecified). This is analogous to the -multiple-list flag to ad_page_variables, and is useful for handling form input generated by <SELECT MULTIPLE> tags and checkboxes.

              For instance, if dest_user_id:multiple is specified in the @@ -128,7 +128,7 @@

        then $dest_user_id is set to [list 913 891 9].

      • You can provide structured, HTML-formatted documentation for your contract. Note that format is derived heavily from Javadoc: a -general description of the script's functionality, followed optionally by +general description of the script's functionality, followed optionally by a series of named attributes tagged by at symbols (@). You are encouraged to provide:

        • A description of the functionality of the page. If the description @@ -141,8 +141,8 @@ @param parameter-name description...

        • An @author tag for each author. Specify the -author's name, followed his or her email address in parentheses.

        • A @creation-date tag indicating when the -script was first created.

        • A @cvs-id tag containing the page's CVS +author's name, followed his or her email address in parentheses.

        • A @creation-date tag indicating when the +script was first created.

        • A @cvs-id tag containing the page's CVS identification string. Just use $Id: tcl-documentation.html,v 1.2 2000/09/19 07:22:35 ron Exp $ when creating the file, and CVS will substitute an appropriate string when you check the file in.

        @@ -160,7 +160,7 @@ # $Id$

        -you'll now write: +you'll now write:

         
         # /packages/acs-kernel/00-proc-procs.tcl
        @@ -177,12 +177,12 @@
         
         

        Note that format is derived heavily from Javadoc: a general description of -the script's functionality, followed optionally by a series of named +the script's functionality, followed optionally by a series of named attributes tagged by at symbols (@). HTML formatting is allowed. You are encouraged to provide:

        • An @author tag for each author. Specify the -author's name, followed his or her email address in parentheses.

        • A @creation-date tag indicating when the -script was first created.

        • A @cvs-id tag containing the page's CVS +author's name, followed his or her email address in parentheses.

        • A @creation-date tag indicating when the +script was first created.

        • A @cvs-id tag containing the page's CVS identification string. Just use $Id: tcl-documentation.html,v 1.2 2000/09/19 07:22:35 ron Exp $ when creating the file, and CVS will substitute an appropriate string when you check the file in.

        ($Id$)
        Index: openacs-4/packages/acs-core-docs/www/templates.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/templates.adp,v diff -u -N -r1.1.2.6 -r1.1.2.7 --- openacs-4/packages/acs-core-docs/www/templates.adp 30 Nov 2016 08:15:11 -0000 1.1.2.6 +++ openacs-4/packages/acs-core-docs/www/templates.adp 6 Jan 2017 09:18:42 -0000 1.1.2.7 @@ -153,8 +153,8 @@ sources.

        -Documentation

        Templating system documentation

        ($‌Id: templates.html,v 1.49.2.12 2016/11/19 -09:21:55 gustafn Exp $)
        +Documentation

        Templating system documentation

        ($‌Id: templates.xml,v 1.12.2.1 2016/06/23 +08:32:46 gustafn Exp $)
        . The intent is to have all of the logic related to manipulating the database and other application state data in one place, and all the logic related to displaying the state of the -application in another place. This gives developer's quicker +application in another place. This gives developer's quicker customization and easier upgrades, and also allows developers and graphic designers to work more independently.

        @@ -25,7 +25,7 @@ In the overall context of our example OpenACS Notes application, this document will show you how to set up a simple templated page that displays a form to the user for entering new notes into the system. In -later sections of the DG, we'll discuss how to develop the pages that +later sections of the DG, we'll discuss how to develop the pages that actually add notes to the database, how to provide a separate instance of the Notes application to every user and how to design appropriate access control policies for the system. @@ -35,8 +35,8 @@ pages: one that displays a form for data entry, and another page that runs the code to update the database and tells the user whether the operation failed. In this document, we will use the template system to -build the first of these pages. This isn't a very interesting use of -the system since we won't be displaying much data, but we'll cover +build the first of these pages. This isn't a very interesting use of +the system since we won't be displaying much data, but we'll cover more on that end later.

        The .tcl file for the form entry template is pretty @@ -80,14 +80,14 @@ Some things to note about this code:

        • The procedure ad_page_contract is -always the first thing a .tcl file calls, if it's under +always the first thing a .tcl file calls, if it's under the www/ directory (i.e. not a Tcl library file). It does validation of input values from the HTTP request (i.e. form variables) and in this case, the -properties clause is used to set up the data sources that we will ship over to the .adp part of the page. In this case, we only use the simplest possible kind of data source, called a onevalue, which hold just a single -string value. Later on, we'll see how to use more powerful kinds of +string value. Later on, we'll see how to use more powerful kinds of data sources for representing multiple rows from an SQL query. You also include overall documentation for the page in the contract, and OpenACS has automatic tools that extract this documentation and make it @@ -149,7 +149,7 @@ data sources that are used by the display part of the page. The display part of the page is an .adp file with some special tags and notations for dealing with display logic and -inserting properties into the text of the page. Later on we'll get +inserting properties into the text of the page. Later on we'll get into templates more deeply, and show how to use database queries as data sources.

        Documentation

        Index: openacs-4/packages/acs-core-docs/www/tutorial-admin-pages.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-admin-pages.html,v diff -u -N -r1.14.2.3 -r1.14.2.4 --- openacs-4/packages/acs-core-docs/www/tutorial-admin-pages.html 19 Nov 2016 09:21:55 -0000 1.14.2.3 +++ openacs-4/packages/acs-core-docs/www/tutorial-admin-pages.html 6 Jan 2017 09:18:42 -0000 1.14.2.4 @@ -7,13 +7,13 @@ could provide checkboxes next to every item seen on a list and the Delete Selected button on the bottom of the list.

      • Dedicated admin pages. If you want admins to have - access to data that users aren't interested in or aren't allowed + access to data that users aren't interested in or aren't allowed to see you will need dedicated admin pages. The conventional place to put those dedicated admin pages is in the /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/myfirstpackage/www/admin directory.

        [$OPENACS_SERVICE_NAME www]$ mkdir admin
        [$OPENACS_SERVICE_NAME www]$ cd admin

        - Even if your application doesn't need any admin pages of its own you will + Even if your application doesn't need any admin pages of its own you will usually need at least one simple page with a bunch of links to existing administration UI such as Category Management or standard Parameters UI. Adding the link to Category Management is described in the section on @@ -49,12 +49,12 @@

        Now that you have the first admin page it would be nice to have a link to it -somewhere in the system so that admins don't have to type in the +somewhere in the system so that admins don't have to type in the /admin every time they need to reach it. You could put a static link to the toplevel index.adp but that might be distracting for people who are not admins. Besides, some people consider it impolite to first -offer a link and then display a nasty "You don't have permission to access this +offer a link and then display a nasty "You don't have permission to access this page" message.

        In order to display the link to the admin page only to users that have admin Index: openacs-4/packages/acs-core-docs/www/tutorial-advanced.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-advanced.html,v diff -u -N -r1.35.2.4 -r1.35.2.5 --- openacs-4/packages/acs-core-docs/www/tutorial-advanced.html 19 Nov 2016 09:21:55 -0000 1.35.2.4 +++ openacs-4/packages/acs-core-docs/www/tutorial-advanced.html 6 Jan 2017 09:18:42 -0000 1.35.2.5 @@ -5,4 +5,4 @@

        This tutorial covers topics which are not essential to creating a minimal working package. Each section can be used independently of all of the others; all sections assume that - you've completed the basic tutorial.

        + you've completed the basic tutorial.

        Index: openacs-4/packages/acs-core-docs/www/tutorial-caching.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-caching.html,v diff -u -N -r1.11.2.3 -r1.11.2.4 --- openacs-4/packages/acs-core-docs/www/tutorial-caching.html 19 Nov 2016 09:21:55 -0000 1.11.2.3 +++ openacs-4/packages/acs-core-docs/www/tutorial-caching.html 6 Jan 2017 09:18:42 -0000 1.11.2.4 @@ -8,4 +8,4 @@ return [util_memoize [list my_proc_not_cached -foo $foo]] }
      • In your code, always call my_proc. There will be a seperate cache item for each unique call to my_proc_not_cached so that calls with different arguments are cached seperately. You can flush the cache for each cache key by calling util_memoize_flush my_proc_not_cached args.

      • The cached material will of course become obsolete over time. There are two ways to handle this.

        • Timed Expiration: pass in max_age to util_memoize. If the content is older than max_age, it will be re-generated.

        • - Direct Flushing. In any proc which invalidates the cached content, call util_memoize_flush my_proc_not_cached args.

      • If you are correctly flushing the cached value, then it will need to be reloaded. You may wish to pre-load it, so that the loading delay does not impact users. If you have a sequence of pages, you could call the cached proc in advance, to increase the chances that it's loaded and current when the user reaches it. Or, you can call (and discard) it immediately after flushing it.

      • + Direct Flushing. In any proc which invalidates the cached content, call util_memoize_flush my_proc_not_cached args.

      • If you are correctly flushing the cached value, then it will need to be reloaded. You may wish to pre-load it, so that the loading delay does not impact users. If you have a sequence of pages, you could call the cached proc in advance, to increase the chances that it's loaded and current when the user reaches it. Or, you can call (and discard) it immediately after flushing it.

      • Index: openacs-4/packages/acs-core-docs/www/tutorial-categories.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-categories.html,v diff -u -N -r1.14.2.7 -r1.14.2.8 --- openacs-4/packages/acs-core-docs/www/tutorial-categories.html 19 Nov 2016 09:21:55 -0000 1.14.2.7 +++ openacs-4/packages/acs-core-docs/www/tutorial-categories.html 6 Jan 2017 09:18:42 -0000 1.14.2.8 @@ -3,18 +3,18 @@ OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

        You can associate any ACS Object with one or more categories. - In this tutorial we'll show how to equip your application with user + In this tutorial we'll show how to equip your application with user interface to take advantage of the Categories service.

        - We'll start by installing the Categories service. Go to + We'll start by installing the Categories service. Go to /acs/admin and install it. This step - won't be necessary for the users of your applications because you'll create + won't be necessary for the users of your applications because you'll create a dependency with the Package Manager which will take care that the Categories service always gets installed when your application gets installed.

        Now that we have installed the Categories service we can proceed to - modifying our application so that it can take advantage of it. We'll do it + modifying our application so that it can take advantage of it. We'll do it in three steps:

        1. The Categories service provides a mechanism to associate one or @@ -59,8 +59,8 @@ to categorize items. The easiest way to do this is by adding the category widget type of the form builder to note-edit.tcl. - To achieve this we'll need to use the -extend - switch to the ad_form command. Here's the "meat" of the + To achieve this we'll need to use the -extend + switch to the ad_form command. Here's the "meat" of the note-edit.tcl page:

           			# extend the form to support categories
           			set package_id [ad_conn package_id]
          @@ -95,7 +95,7 @@
           should initially be absert.  If it is absent, we create a form to
           allow the user to confirm the deletion.  Note that in
           entry-edit.tcl we used ad_form to access the Form Template
          -commands; here, we call them directly because we don't need the extra
          +commands; here, we call them directly because we don't need the extra
           features of ad_form.  The form calls itself, but
           with hidden variables carrying both
           note_id and
          @@ -226,7 +226,7 @@
                   		set category_name [category::get_name $category_id]
                   		if { $category_name eq "" } {
                       		ad_return_exception_page 404 "No such category" "Site-wide \
          -          			Category with ID $category_id doesn't exist"
          +          			Category with ID $category_id doesn't exist"
                       		return
                   		}
                   		# Show Category in context bar
          Index: openacs-4/packages/acs-core-docs/www/tutorial-comments.html
          ===================================================================
          RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-comments.html,v
          diff -u -N -r1.15.2.3 -r1.15.2.4
          --- openacs-4/packages/acs-core-docs/www/tutorial-comments.html	19 Nov 2016 09:21:55 -0000	1.15.2.3
          +++ openacs-4/packages/acs-core-docs/www/tutorial-comments.html	6 Jan 2017 09:18:42 -0000	1.15.2.4
          @@ -1,5 +1,5 @@
           
          -Adding Comments

          Adding Comments

          You can track comments for any ACS Object. Here we'll track +Adding Comments

          Adding Comments

          You can track comments for any ACS Object. Here we'll track comments for notes. On the note-edit.tcl/adp pair, which is used to display individual notes, we want to put a link to add comments at the bottom of the screen. If there are any comments, we want to Index: openacs-4/packages/acs-core-docs/www/tutorial-css-layout.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-css-layout.adp,v diff -u -N -r1.1.2.13 -r1.1.2.14 --- openacs-4/packages/acs-core-docs/www/tutorial-css-layout.adp 19 Nov 2016 09:21:55 -0000 1.1.2.13 +++ openacs-4/packages/acs-core-docs/www/tutorial-css-layout.adp 6 Jan 2017 09:18:42 -0000 1.1.2.14 @@ -12,7 +12,7 @@ Laying out a page with CSS instead of tables

        -.LRN home page with table-based +.LRN home page with table-based layout

        A sample of the HTML code (full source)

         <table border="0" width="100%">
           <tr>
        @@ -40,7 +40,7 @@
         

        -.LRN Home with CSS-based layout

        A sample of the HTML code (full source)

        +.LRN Home with CSS-based layout

        A sample of the HTML code (full source)

         <div class="left">
           <div class="portlet-wrap-shadow">
             <div class="portlet-wrap-bl">
        Index: openacs-4/packages/acs-core-docs/www/tutorial-css-layout.html
        ===================================================================
        RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-css-layout.html,v
        diff -u -N -r1.12.2.12 -r1.12.2.13
        --- openacs-4/packages/acs-core-docs/www/tutorial-css-layout.html	19 Nov 2016 09:21:55 -0000	1.12.2.12
        +++ openacs-4/packages/acs-core-docs/www/tutorial-css-layout.html	6 Jan 2017 09:18:42 -0000	1.12.2.13
        @@ -1,5 +1,5 @@
         
        -Laying out a page with CSS instead of tables

        Laying out a page with CSS instead of tables

        .LRN home page with table-based layout

        A sample of the HTML code (full source)

        <table border="0" width="100%">
        +Laying out a page with CSS instead of tables

        Laying out a page with CSS instead of tables

        .LRN home page with table-based layout

        A sample of the HTML code (full source)

        <table border="0" width="100%">
           <tr>
             <td valign="top" width="50%">
               <table class="element" border=0 cellpadding="0" cellspacing="0" width="100%">
        @@ -21,7 +21,7 @@
                           <table border="0" bgcolor="white" cellpadding="0" cellspacing="0" width="100%">
                             <tr>
                               <td class=element-text>
        -                        MBA 101

        .LRN Home with CSS-based layout

        A sample of the HTML code (full source)

        <div class="left">
        +                        MBA 101

        .LRN Home with CSS-based layout

        A sample of the HTML code (full source)

        <div class="left">
           <div class="portlet-wrap-shadow">
             <div class="portlet-wrap-bl">
               <div class="portlet-wrap-tr">
        Index: openacs-4/packages/acs-core-docs/www/tutorial-cvs.adp
        ===================================================================
        RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-cvs.adp,v
        diff -u -N -r1.1.2.12 -r1.1.2.13
        --- openacs-4/packages/acs-core-docs/www/tutorial-cvs.adp	19 Nov 2016 09:21:55 -0000	1.1.2.12
        +++ openacs-4/packages/acs-core-docs/www/tutorial-cvs.adp	6 Jan 2017 09:18:42 -0000	1.1.2.13
        @@ -71,7 +71,7 @@
         (many lines omitted)
         [$OPENACS_SERVICE_NAME myfirstpackage]$
         
        -

        Figure 10.1. Upgrading a local CVS +

        Figure 10.1. Upgrading a local CVS repository

        Upgrading a local CVS repository

        Index: openacs-4/packages/acs-core-docs/www/tutorial-cvs.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-cvs.html,v diff -u -N -r1.26.2.12 -r1.26.2.13 --- openacs-4/packages/acs-core-docs/www/tutorial-cvs.html 19 Nov 2016 09:21:55 -0000 1.26.2.12 +++ openacs-4/packages/acs-core-docs/www/tutorial-cvs.html 6 Jan 2017 09:18:42 -0000 1.26.2.13 @@ -1,7 +1,7 @@ Add the new package to CVS

        Add the new package to CVS

        Before you do any more work, make sure that your work is protected by putting it all into cvs. The cvs - add command is not recursive, so you'll have to + add command is not recursive, so you'll have to traverse the directory tree manually and add as you go. (More on CVS)

        [$OPENACS_SERVICE_NAME xml]$ cd ..
         [$OPENACS_SERVICE_NAME doc]$ cd ..
        @@ -59,4 +59,4 @@
         initial revision: 1.1
         done
         (many lines omitted)
        -[$OPENACS_SERVICE_NAME myfirstpackage]$

        Figure 10.1. Upgrading a local CVS repository

        Upgrading a local CVS repository

        +[$OPENACS_SERVICE_NAME myfirstpackage]$

        Figure 10.1. Upgrading a local CVS repository

        Upgrading a local CVS repository

        Index: openacs-4/packages/acs-core-docs/www/tutorial-database.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-database.adp,v diff -u -N -r1.1.2.14 -r1.1.2.15 --- openacs-4/packages/acs-core-docs/www/tutorial-database.adp 30 Nov 2016 08:15:11 -0000 1.1.2.14 +++ openacs-4/packages/acs-core-docs/www/tutorial-database.adp 6 Jan 2017 09:18:42 -0000 1.1.2.15 @@ -15,7 +15,7 @@ OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

        -Code the data model

        We create all database objects with scripts in the myfirstpackage/sql/ directory. All database +Code the data model

        We create all database objects with scripts in the myfirstpackage/sql/ directory. All database scripts are database-specific and are thus in either the myfirstpackage/sql/oracle or myfirstpackage/sql/postgresql @@ -42,17 +42,16 @@ simplify our database creation. (More information about ACS Objects. More information about the Content Repository.)

        -

        Figure 9.2. Tutorial Data +

        Figure 9.2. Tutorial Data Model

        Tutorial Data Model

        The top of each sql file has some standard comments, including doc tags such as \@author which -will be picked up by the API browser. The string $‌Id: tutorial-database.html,v 1.44.2.12 2016/11/19 -09:21:55 gustafn Exp $ will automatically be expanded when +will be picked up by the API browser. The string $‌Id:$ will automatically be expanded when the file is checked in to cvs.

         [$OPENACS_SERVICE_NAME ~]$ cd /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/myfirstpackage/sql/postgresql
         [$OPENACS_SERVICE_NAME postgresql]$ emacs myfirstpackage-create.sql
         

        Paste the text below into the file, save, and close.

        -

        Figure 9.3. The +

        Figure 9.3. The Database Creation Script

         -- creation script
         --
        @@ -82,7 +81,7 @@
         uninstalled.

         [$OPENACS_SERVICE_NAME postgresql]$ emacs myfirstpackage-drop.sql
         
        -

        Figure 9.4. Database Deletion +

        Figure 9.4. Database Deletion Script

         -- drop script
         --
        Index: openacs-4/packages/acs-core-docs/www/tutorial-database.html
        ===================================================================
        RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-database.html,v
        diff -u -N -r1.44.2.12 -r1.44.2.13
        --- openacs-4/packages/acs-core-docs/www/tutorial-database.html	19 Nov 2016 09:21:55 -0000	1.44.2.12
        +++ openacs-4/packages/acs-core-docs/www/tutorial-database.html	6 Jan 2017 09:18:42 -0000	1.44.2.13
        @@ -2,7 +2,7 @@
         Setting Up Database Objects

        Setting Up Database Objects

        by Joel Aufrecht

        OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff. -

        Code the data model

        We create all database objects with scripts in the +

        Code the data model

        We create all database objects with scripts in the myfirstpackage/sql/ directory. All database scripts are database-specific and are thus in either the myfirstpackage/sql/oracle or @@ -32,13 +32,13 @@ repository functions to simplify our database creation. (More information about ACS Objects. More information about the Content Repository.) -

        Figure 9.2. Tutorial Data Model

        Tutorial Data Model

        The top of each sql file has some +

        Figure 9.2. Tutorial Data Model

        Tutorial Data Model

        The top of each sql file has some standard comments, including doc tags such as @author which will be picked up by the API browser. The string $Id$ will automatically be expanded when the file is checked in to cvs.

        [$OPENACS_SERVICE_NAME ~]$ cd /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/myfirstpackage/sql/postgresql
        -[$OPENACS_SERVICE_NAME postgresql]$ emacs myfirstpackage-create.sql

        Paste the text below into the file, save, and close.

        Figure 9.3. The Database Creation Script

        -- creation script
        +[$OPENACS_SERVICE_NAME postgresql]$ emacs myfirstpackage-create.sql

        Paste the text below into the file, save, and close.

        Figure 9.3. The Database Creation Script

        -- creation script
         --
         -- @author joel@aufrecht.org
         -- @cvs-id &Id:$
        @@ -62,7 +62,7 @@
             object.  Notice the use of "mfp."  This is derived from "My
             First Package" and ensures that our object is unlikely to conflict
             with objects from other packages.

        Create a database file to drop everything if the package is uninstalled.

        -[$OPENACS_SERVICE_NAME postgresql]$ emacs myfirstpackage-drop.sql

        Figure 9.4. Database Deletion Script

        -- drop script
        +[$OPENACS_SERVICE_NAME postgresql]$ emacs myfirstpackage-drop.sql

        Figure 9.4. Database Deletion Script

        -- drop script
         --
         -- @author joel@aufrecht.org
         -- @cvs-id &Id:$
        @@ -82,7 +82,7 @@
                                  0
         (1 row)
         
        -[$OPENACS_SERVICE_NAME postgresql]$

        If there are errors, use them to debug the sql file and try again. If there are errors in the database table creation, you may need to run the drop script to drop the table so that you can recreate it. The drop script will probably have errors since some of the things it's trying to drop may be missing. They can be ignored.

        Once you get the same output as shown above, test the drop script:

        [$OPENACS_SERVICE_NAME postgresql]$ psql service0 -f myfirstpackage-drop.sql
        +[$OPENACS_SERVICE_NAME postgresql]$

        If there are errors, use them to debug the sql file and try again. If there are errors in the database table creation, you may need to run the drop script to drop the table so that you can recreate it. The drop script will probably have errors since some of the things it's trying to drop may be missing. They can be ignored.

        Once you get the same output as shown above, test the drop script:

        [$OPENACS_SERVICE_NAME postgresql]$ psql service0 -f myfirstpackage-drop.sql
         
          content_type__drop_type
         -------------------------
        Index: openacs-4/packages/acs-core-docs/www/tutorial-debug.adp
        ===================================================================
        RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-debug.adp,v
        diff -u -N -r1.1.2.13 -r1.1.2.14
        --- openacs-4/packages/acs-core-docs/www/tutorial-debug.adp	19 Nov 2016 09:21:55 -0000	1.1.2.13
        +++ openacs-4/packages/acs-core-docs/www/tutorial-debug.adp	6 Jan 2017 09:18:42 -0000	1.1.2.14
        @@ -15,7 +15,7 @@
         OpenACS docs are written by the named authors, and may be edited by
         OpenACS documentation staff.

        -Debugging

        +Debugging

        Developer Support. The Developer Support package adds several goodies: debug information for every page; the ability to log comments to the page instead of the error @@ -45,7 +45,7 @@           

        -Manual testing

        Make a list of basic tests to make sure it works

        +Manual testing

        Make a list of basic tests to make sure it works

        @@ -73,11 +73,11 @@ to delete your own note. Edit your own note. Search for a note.

        -Write automated tests

        +Write automated tests

        by Simon Carstensen and Joel Aufrecht

        OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

        - It seems to me that a lot of people have + It seems to me that a lot of people have been asking for some guidelines on how to write automated tests. I've done several tests by now and have found the process to be extremely easy and useful. It's a joy to work with automated @@ -148,7 +148,7 @@ myfirstpackage. You should see your test case. Run it and examine the results.

        -TCLWebtest tests

        API testing can only test part of our package - it doesn't +TCLWebtest tests

        API testing can only test part of our package - it doesn't test the code in our adp/tcl pairs. For this, we can use TCLwebtest. TCLwebtest must be installed for this test to work. This provides a library of functions that make it easy to call a page @@ -158,7 +158,7 @@ integrating them.

        -Example

        Now we can add the rest of the API tests, including a test with +Example

        Now we can add the rest of the API tests, including a test with deliberately bad data. The complete test looks like:

         ad_library {
             Test cases for my first package.
        Index: openacs-4/packages/acs-core-docs/www/tutorial-debug.html
        ===================================================================
        RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-debug.html,v
        diff -u -N -r1.43.2.13 -r1.43.2.14
        --- openacs-4/packages/acs-core-docs/www/tutorial-debug.html	19 Nov 2016 09:21:55 -0000	1.43.2.13
        +++ openacs-4/packages/acs-core-docs/www/tutorial-debug.html	6 Jan 2017 09:18:42 -0000	1.43.2.14
        @@ -2,7 +2,7 @@
         Debugging and Automated Testing
        Test NumActionExpected Result
        Prev Chapter 9. Development Tutorial Next

        Debugging and Automated Testing

        by Joel Aufrecht

        OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff. -

        Debugging

        Developer Support. The Developer Support package adds several goodies: debug +

        Debugging

        Developer Support. The Developer Support package adds several goodies: debug information for every page; the ability to log comments to the page instead of the error log, and fast user switching so that you can test pages as anonymous and as dummy users without logging @@ -14,7 +14,7 @@ database name. You can use C-(up arrow) and C-(down arrow) for command history.

        Hint: "Parse error near *" usually means that an xql file - wasn't recognized, because the tcl file is choking on the *SQL* + wasn't recognized, because the tcl file is choking on the *SQL* placeholder that it falls back on.

        Watching the server log. 

        To set up real-time monitoring of the AOLserver error log, type

        less /var/lib/aolserver/$OPENACS_SERVICE_NAME/log/openacs-dev-error.log

        F to show new log entries in real time (like tail -f)
        @@ -23,39 +23,39 @@ ? searches backward 
        / searches forward. 
                  

        -

        Manual testing

        Make a list of basic tests to make sure it works

        Test NumActionExpected Result
        001Browse to the index page while not logged in and +

        Manual testing

        Make a list of basic tests to make sure it works

        Test NumActionExpected Result
        001Browse to the index page while not logged in and while one or more notes exist.No edit or delete or add links should appear.
        002Browse to the index page while logged in. An Edit link should appear. Click on it. Fill out the form and click Submit.The text added in the form should be visible on the - index page.
        API-001Invoke mfp::note::create with a specific word as the title.Proc should return an object id.
        API-002Given an object id from API-001, invoke mfp::note::get.Proc should return the specific word in the title.
        API-003Given the object id from API-001, invoke mfp::note::delete.Proc should return 0 for success.

        Other things to test: try to delete someone else's + index page.

        API-001Invoke mfp::note::create with a specific word as the title.Proc should return an object id.
        API-002Given an object id from API-001, invoke mfp::note::get.Proc should return the specific word in the title.
        API-003Given the object id from API-001, invoke mfp::note::delete.Proc should return 0 for success.

        Other things to test: try to delete someone else's note. Try to delete your own note. Edit your own note. - Search for a note.

        Write automated tests

        by Simon Carstensen and Joel Aufrecht

        + Search for a note.

        Write automated tests

        by Simon Carstensen and Joel Aufrecht

        OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff. -

        - It seems to me that a lot of people have been asking for some guidelines on how to write automated tests. I've done several tests by now and have found the process to be extremely easy and useful. It's a joy to work with automated testing once you get the hang of it.

        Create the directory that will contain the test +

        + It seems to me that a lot of people have been asking for some guidelines on how to write automated tests. I've done several tests by now and have found the process to be extremely easy and useful. It's a joy to work with automated testing once you get the hang of it.

        Create the directory that will contain the test script and edit the script file. The directory location and file name are standards which are recognized by the automated testing package:

        [$OPENACS_SERVICE_NAME www]$ mkdir /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/myfirstpackage/tcl/test
         [$OPENACS_SERVICE_NAME www]$ cd /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/myfirstpackage/tcl/test
         [$OPENACS_SERVICE_NAME test]$ emacs myfirstpackages-procs.tcl

        Write the tests. This is obviously the big step :) The script should first call ad_library like any normal -procs.tcl file:

        ad_library {
             ...
         }
         

        To create a test case you call aa_register_case test_case_name.. -Once you've created the test case you start writing the needed logic. -We'll use the tutorial package, "myfirstpackage," as an example. -Let's say you just wrote an API for adding and deleting notes in the -notes packages and wanted to test that. You'd probably want to write a +Once you've created the test case you start writing the needed logic. +We'll use the tutorial package, "myfirstpackage," as an example. +Let's say you just wrote an API for adding and deleting notes in the +notes packages and wanted to test that. You'd probably want to write a test that first creates a note, then verifies that it was inserted, then perhaps deletes it again, and finally verifies that it is gone.

        -Naturally this means you'll be adding a lot of bogus data to the -database, which you're not really interested in having there. To avoid +Naturally this means you'll be adding a lot of bogus data to the +database, which you're not really interested in having there. To avoid this I usually do two things. I always put all my test code inside a call to aa_run_with_teardown which basically means that all the inserts, deletes, and updates will be rolled back once the test has been executed. A very useful feature. Instead of inserting bogus data -like: set name "Simon", I tend to generate a random script in order avoid inserting a value that's already in the database:

        set name [ad_generate_random_string]
        -

        Here's how the test case looks so far:

        aa_register_case mfp_basic_test {
        +like:        set name "Simon", I tend to generate a random script in order avoid inserting a value that's already in the database:

        set name [ad_generate_random_string]
        +

        Here's how the test case looks so far:

        aa_register_case mfp_basic_test {
             My test
         } {
             aa_run_with_teardown \
        @@ -64,11 +64,11 @@
         
                }
         }
        -

        Now let's look at the actual test code. That's the code that +

        Now let's look at the actual test code. That's the code that goes inside -test_code {}. We want to implement test case API-001, "Given an object id from API-001, invoke mfp::note::get. Proc should return the specific word in the title."

               set name [ad_generate_random_string]
               set new_id [mfp::note::add -title $name]
        -      aa_true "Note add succeeded" ([info exists new_id] && $new_id ne "")

        To test our simple case, we must load the test file into the system (just as with the /tcl file in the basic tutorial, since the file didn't exist when the system started, the system doesn't know about it.) To make this file take effect, go to the APM and choose "Reload changed" for "MyFirstPackage". Since we'll be changing it frequently, select "watch this file" on the next page. This will cause the system to check this file every time any page is requested, which is bad for production systems but convenient for developing. We can also add some aa_register_case flags to make it easier to run the test. The -procs flag, which indicates which procs are tested by this test case, makes it easier to find procs in your package that aren't tested at all. The -cats flag, setting categories, makes it easier to control which tests to run. The smoke test setting means that this is a basic test case that can and should be run any time you are doing any test. (a definition of "smoke test")

        Once the file is loaded, go to ACS Automated Testing and click on myfirstpackage. You should see your test case. Run it and examine the results.

        TCLWebtest tests

        API testing can only test part of our package - it doesn't test the code in our adp/tcl pairs. For this, we can use TCLwebtest. TCLwebtest must be installed for this test to work. This provides a library of functions that make it easy to call a page through HTTP, examine the results, and drive forms. TCLwebtest's functions overlap slightly with acs-automated-testing; see the example provided for one approach on integrating them.

        Example

        Now we can add the rest of the API tests, including a test with deliberately bad data. The complete test looks like:

        ad_library {
        +      aa_true "Note add succeeded" ([info exists new_id] && $new_id ne "")

        To test our simple case, we must load the test file into the system (just as with the /tcl file in the basic tutorial, since the file didn't exist when the system started, the system doesn't know about it.) To make this file take effect, go to the APM and choose "Reload changed" for "MyFirstPackage". Since we'll be changing it frequently, select "watch this file" on the next page. This will cause the system to check this file every time any page is requested, which is bad for production systems but convenient for developing. We can also add some aa_register_case flags to make it easier to run the test. The -procs flag, which indicates which procs are tested by this test case, makes it easier to find procs in your package that aren't tested at all. The -cats flag, setting categories, makes it easier to control which tests to run. The smoke test setting means that this is a basic test case that can and should be run any time you are doing any test. (a definition of "smoke test")

        Once the file is loaded, go to ACS Automated Testing and click on myfirstpackage. You should see your test case. Run it and examine the results.

        TCLWebtest tests

        API testing can only test part of our package - it doesn't test the code in our adp/tcl pairs. For this, we can use TCLwebtest. TCLwebtest must be installed for this test to work. This provides a library of functions that make it easy to call a page through HTTP, examine the results, and drive forms. TCLwebtest's functions overlap slightly with acs-automated-testing; see the example provided for one approach on integrating them.

        Example

        Now we can add the rest of the API tests, including a test with deliberately bad data. The complete test looks like:

        ad_library {
             Test cases for my first package.
         }
         
        @@ -131,15 +131,15 @@
                 
                 @author Peter Marklund
             } {
        -        # we need to get a user_id here so that it's available throughout
        +        # we need to get a user_id here so that it's available throughout
                 # this proc
                 set user_id [db_nextval acs_object_id_seq]
         
                 set note_title [ad_generate_random_string]
         
                 # NOTE: Never use the aa_run_with_teardown with the rollback switch
                 # when running Tclwebtest tests since this will put the test code in
        -        # a transaction and changes won't be visible across HTTP requests.
        +        # a transaction and changes won't be visible across HTTP requests.
                 
                 aa_run_with_teardown -test_code {
                     
        @@ -189,7 +189,7 @@
                     # 1) go directly to the database to get the id
                     # 2) require an API function that takes name and returns ID
                     # 3) screen-scrape for the ID
        -            # all options are problematic.  We'll do #1 in this example:
        +            # all options are problematic.  We'll do #1 in this example:
         
                     set note_id [db_string get_note_id_from_name " 
                         select item_id 
        Index: openacs-4/packages/acs-core-docs/www/tutorial-distribute.adp
        ===================================================================
        RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-distribute.adp,v
        diff -u -N -r1.1.2.12 -r1.1.2.13
        --- openacs-4/packages/acs-core-docs/www/tutorial-distribute.adp	19 Nov 2016 09:21:55 -0000	1.1.2.12
        +++ openacs-4/packages/acs-core-docs/www/tutorial-distribute.adp	6 Jan 2017 09:18:42 -0000	1.1.2.13
        @@ -13,7 +13,7 @@
         distribution.

        Browse to the package manager. Click on tutorialapp.

        Click on Generate a distribution file for this package from the filesystem.

        Click on the file size (37.1KB) after the label Distribution File: and save the -file to /var/tmp.

        Package development guidelines

        +file to /var/tmp.

        Package development guidelines

        37.1KB) after the label Distribution File: and save the file to - /var/tmp.

        + /var/tmp.

        Package development guidelines

        Index: openacs-4/packages/acs-core-docs/www/tutorial-etp-templates.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-etp-templates.adp,v diff -u -N -r1.1.2.14 -r1.1.2.15 --- openacs-4/packages/acs-core-docs/www/tutorial-etp-templates.adp 30 Nov 2016 08:15:11 -0000 1.1.2.14 +++ openacs-4/packages/acs-core-docs/www/tutorial-etp-templates.adp 6 Jan 2017 09:18:42 -0000 1.1.2.15 @@ -86,7 +86,7 @@
      • The template should provide us with the following ETP layout:

        -

        Table 10.1. table +

        Table 10.1. table showing ETP layout

        @@ -133,8 +133,8 @@ Who Wrote This and When

        This problem set was originally written by Nick Carroll in August 2004 for the University of Sydney Course EBUS5002.

        This material is copyright 2004 by Nick Carroll. It may be copied, reused, and modified, provided credit is given to the -original author.

        ($‌Id: tutorial-etp-templates.html,v 1.9.2.12 -2016/11/19 09:21:55 gustafn Exp $)
        +original author.

        ($‌Id: tutorial-advanced.xml,v 1.52.2.3 +2016/10/03 09:17:51 gustafn Exp $)
      • Go to the package manager at http://yoursite/acs-admin/apm. And install the new package: edit-this-page.

      • Or use the "Add Application" form available on the Main site.

      • Change ETP Application

        • Work out how to change the ETP application.

        • Investigate each of the available ETP templates:

          • Default

          • News

          • FAQ

        Exercise 4: Create a New ETP Template

        • Browse the files for each of the above ETP templates at:

          cd ~/openacs/packages/edit-this-page/templates
        • Use the article template as the basis of our new col2 template.

          cp article-content.adp col2-content.adp
                       cp article-content.tcl col2-content.tcl
                       cp article-index.adp col2-index.adp
          -            cp article-index.tcl col2-index.tcl
        • The template should provide us with the following ETP layout:

          Table 10.1. table showing ETP layout

        Header
        SidebarMain Content Pane

      • The "Main Content" pane should contain the editable content that ETP provides.

      • The "Header" should display the title of the page that you set in ETP.

      • The "Sidebar" should display the extlinks that you add as a content item in ETP.

      • Exercise 5: Register the col2 Template with ETP

        • Need to register your template with ETP so that it appears in the drop-down menu that you would have seen in Exercise 3.

          cd ~/openacs/packages/edit-this-page/tcl
          +            cp article-index.tcl col2-index.tcl
        • The template should provide us with the following ETP layout:

          Table 10.1. table showing ETP layout

          Header
          SidebarMain Content Pane

        • The "Main Content" pane should contain the editable content that ETP provides.

        • The "Header" should display the title of the page that you set in ETP.

        • The "Sidebar" should display the extlinks that you add as a content item in ETP.

        Exercise 5: Register the col2 Template with ETP

        • Need to register your template with ETP so that it appears in the drop-down menu that you would have seen in Exercise 3.

          cd ~/openacs/packages/edit-this-page/tcl
                       emacs etp-custom-init.tcl
        • Use the function etp::define_application to register your template with ETP

          • Uncomment the "asc" definition

          • Set allow_extlinks to true, the rest should be false.

        • Restart your server for the changes to take effect.

        Exercise 6: Configure ETP to use the col2 Template

        • Configure your ETP instance at /lab4/index to use the col2 template.

        • Create external links to link to other mounted ETP instances.

        • Check that your external links show up in the sidebar when you view your ETP application using the col2 template.

        Who Wrote This and When

        This problem set was originally written by Nick Carroll in August 2004 for the University of Sydney Course EBUS5002.

        This material is copyright 2004 by Nick Carroll. It may be copied, reused, and modified, provided credit is given to the original author.

        ($Id$)
        Index: openacs-4/packages/acs-core-docs/www/tutorial-future-topics.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-future-topics.html,v diff -u -N -r1.17.2.3 -r1.17.2.4 --- openacs-4/packages/acs-core-docs/www/tutorial-future-topics.html 19 Nov 2016 09:21:55 -0000 1.17.2.3 +++ openacs-4/packages/acs-core-docs/www/tutorial-future-topics.html 6 Jan 2017 09:18:42 -0000 1.17.2.4 @@ -1,7 +1,7 @@ -Future Topics

        Future Topics

        • How to enforce security so that users can't +Future Topics

          Future Topics

          • How to enforce security so that users can't change other users records

          • How to use the content management tables so that ... what?

          • How to change the default stylesheets for Form Builder HTML forms.

          • How to make your package searchable with OpenFTS/Oracle

          • How to prepare pagelets for inclusion in other pages

          • How and when to put procedures in a tcl procedure library

          • More on ad_form - data validation, other stuff. - (plan to draw from Jon Griffin's doc)

          • partialquery in xql

          • How to use the html/text entry widget to get the + (plan to draw from Jon Griffin's doc)

          • partialquery in xql

          • How to use the html/text entry widget to get the "does this look right" confirm page

          • APM package dependencies

          See also the OpenACS Programming FAQ

          Index: openacs-4/packages/acs-core-docs/www/tutorial-hierarchical.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-hierarchical.html,v diff -u -N -r1.11.2.3 -r1.11.2.4 --- openacs-4/packages/acs-core-docs/www/tutorial-hierarchical.html 19 Nov 2016 09:21:55 -0000 1.11.2.3 +++ openacs-4/packages/acs-core-docs/www/tutorial-hierarchical.html 6 Jan 2017 09:18:42 -0000 1.11.2.4 @@ -30,7 +30,7 @@ o.tree_sortkey"

        Note the use of the tree_level() function, which - gives you the level, starting from 1, 2, 3...

        Here's an example, pulling all of the children for a given + gives you the level, starting from 1, 2, 3...

        Here's an example, pulling all of the children for a given parent:

               SELECT 
               children.*,
        @@ -43,14 +43,14 @@
               children.tree_sortkey between parent.tree_sortkey and tree_right(parent.tree_sortkey)
               and parent.tree_sortkey <> children.tree_sortkey
               and parent.key = :the_parent_key;
        -      

        The reason we substract the parent's tree_level from the - child's tree_level is that the tree_levels are global, so if you - want the parent's tree_level to start with 0, you'll want the - subtraction in there. This is a reason you'll commonly see magic +

        The reason we substract the parent's tree_level from the + child's tree_level is that the tree_levels are global, so if you + want the parent's tree_level to start with 0, you'll want the + subtraction in there. This is a reason you'll commonly see magic numbers in tree_sortkey SQL queries, like tree_level(children.tree_sortkey) - 4. That is basically an incorrect way to do it, - and subtracting the parent's tree_level is the preferred method.

        This example does not include the parent. To return the entire subtree including the parent, leave out the non-equals clause:

        +    and subtracting the parent's tree_level is the preferred method.

        This example does not include the parent. To return the entire subtree including the parent, leave out the non-equals clause:

               SELECT
               subtree.*,
               tree_level(subtree.tree_sortkey) -
        Index: openacs-4/packages/acs-core-docs/www/tutorial-newpackage.adp
        ===================================================================
        RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-newpackage.adp,v
        diff -u -N -r1.1.2.12 -r1.1.2.13
        --- openacs-4/packages/acs-core-docs/www/tutorial-newpackage.adp	19 Nov 2016 09:21:55 -0000	1.1.2.12
        +++ openacs-4/packages/acs-core-docs/www/tutorial-newpackage.adp	6 Jan 2017 09:18:42 -0000	1.1.2.13
        @@ -18,7 +18,7 @@
         The intended page map

        -Overview

        To start developing new code in OpenACS, we build a new package. +Overview

        To start developing new code in OpenACS, we build a new package. A package is a a discrete collection of web pages, tcl code, and database tables and procedures. A package with user interface is called an application; @@ -36,14 +36,14 @@ displaying a list of text notes.

        -Before you begin

        You will need:

          +Before you begin

        You will need:

        • A computer with a working installation of OpenACS. If you don't have this, see Chapter 2, Installation Overview .

        • Example files, which are included in the standard OpenACS 5.9.0 distribution.

        -

        Figure 9.1. Assumptions in this +

        Figure 9.1. Assumptions in this section

        @@ -62,7 +62,7 @@

        -Use the APM to initialize a new +Use the APM to initialize a new package

        We use the ACS Package Manager (APM) to add, remove, and upgrade packages. It handles package meta-data, such as lists of files that belong in the package. Each package is uniquely identified by a @@ -102,7 +102,7 @@ packages).

        -Add an Application Instance to the +Add an Application Instance to the Server

        In order to see your work in progress, you must create a map between the URL space of incoming requests and the package application instance. You do this by adding the application in the @@ -121,7 +121,7 @@ to be satisfied from the files at /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/myfirstpackage/www.

        -Quick start

        The remainder of the tutorial walks you through each file one at +Quick start

        The remainder of the tutorial walks you through each file one at a time as you create the package. You can skip all this, and get a working package, by doing the following:

         cd /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/acs-core-docs/www/files/tutorial
        Index: openacs-4/packages/acs-core-docs/www/tutorial-newpackage.html
        ===================================================================
        RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-newpackage.html,v
        diff -u -N -r1.43.2.12 -r1.43.2.13
        --- openacs-4/packages/acs-core-docs/www/tutorial-newpackage.html	19 Nov 2016 09:21:55 -0000	1.43.2.12
        +++ openacs-4/packages/acs-core-docs/www/tutorial-newpackage.html	6 Jan 2017 09:18:42 -0000	1.43.2.13
        @@ -2,7 +2,7 @@
         Creating an Application Package
        Prev Chapter 9. Development Tutorial Next

        Creating an Application Package

        by Joel Aufrecht

        OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff. -

        The intended page map

        Overview

        To start developing new code in OpenACS, we build a new package. A package +

        The intended page map

        Overview

        To start developing new code in OpenACS, we build a new package. A package is a a discrete collection of web pages, tcl code, and database tables and procedures. A package with user interface is called an application; a package which provides functions to other packages and has no direct interface, a @@ -13,16 +13,16 @@

        This tutorial uses the content repository package. This radically simplifies the database work, but forces us to work - around the content repository's limitations, including an - incomplete Tcl API. So the tutorial is messier than we'd like + around the content repository's limitations, including an + incomplete Tcl API. So the tutorial is messier than we'd like right now. Code that is temporary hackage is clearly marked.

        In this tutorial, we will make an application package for displaying a list of text notes. -

        Before you begin

        You will need:

        Before you begin

        You will need:

        • A computer with a working installation of + OpenACS. If you don't have this, see Chapter 2, Installation Overview.

        • Example files, which are included in the standard OpenACS 5.9.0 distribution. -

        Figure 9.1. Assumptions in this section

        Fully qualified domain name of your serveryourserver.test
        URL of your serverhttp://yourserver.test:8000
        Name of development account$OPENACS_SERVICE_NAME
        New Package keymyfirstpackage

        Use the APM to initialize a new package

        We use the ACS Package Manager (APM) to add, remove, and +

        Figure 9.1. Assumptions in this section

        Fully qualified domain name of your serveryourserver.test
        URL of your serverhttp://yourserver.test:8000
        Name of development account$OPENACS_SERVICE_NAME
        New Package keymyfirstpackage

        Use the APM to initialize a new package

        We use the ACS Package Manager (APM) to add, remove, and upgrade packages. It handles package meta-data, such as lists of files that belong in the package. Each package is uniquely identified by a package key. To start developing a new @@ -33,7 +33,7 @@

        1. Browse to http://yourserver:8000/acs-admin/apm.

        2. Click Create a New Package.

          Fill in the fields listed below. Ignore the rest (and leave the check boxes alone). - (Some will change automatically. Don't mess with those.) + (Some will change automatically. Don't mess with those.)

          • Package Key: myfirstpackage

          • @@ -55,18 +55,18 @@ /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/myfirstpackage. This is the "home directory" of our new package, and all files in the package will be within this directory. More on the structure of - packages).

          Add an Application Instance to the Server

          In order to see your work in progress, you must create a + packages).

          Add an Application Instance to the Server

          In order to see your work in progress, you must create a map between the URL space of incoming requests and the package application instance. You do this by adding the application in the main site administration). This creates a link between the incoming URL requests and an instance of the application. (More on applications and nodes)

          You can have instances of a package on one site, each with a different URL and different permissions, all sharing the same code and tables. This requires that a package be developed - package-aware. You'll see how to do that + package-aware. You'll see how to do that in this tutorial.

          1. Browse to -http://yourserver.test:8000/admin/applications/application-add/.

          2. Choose "My First Package" from the list and click OK (the other fields are optional).

          By mounting the package, we've caused all requests to +http://yourserver.test:8000/admin/applications/application-add/.

        3. Choose "My First Package" from the list and click OK (the other fields are optional).

        By mounting the package, we've caused all requests to http://yourserver.test:8000/myfirstpackage - to be satisfied from the files at /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/myfirstpackage/www.

        Quick start

        The remainder of the tutorial walks you through each file one at a time as you create the package. You can skip all this, and get a working package, by doing the following:

        cd /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/acs-core-docs/www/files/tutorial
        +      to be satisfied from the files at /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/myfirstpackage/www.

        Quick start

        The remainder of the tutorial walks you through each file one at a time as you create the package. You can skip all this, and get a working package, by doing the following:

        cd /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/acs-core-docs/www/files/tutorial
         psql $OPENACS_SERVICE_NAME -f myfirstpackage-create.sql
         cp note-edit.* note-delete.tcl index.* ../../../../myfirstpackage/www/
         mkdir ../../../../myfirstpackage/lib
        Index: openacs-4/packages/acs-core-docs/www/tutorial-notifications.html
        ===================================================================
        RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-notifications.html,v
        diff -u -N -r1.17.2.3 -r1.17.2.4
        --- openacs-4/packages/acs-core-docs/www/tutorial-notifications.html	19 Nov 2016 09:21:55 -0000	1.17.2.3
        +++ openacs-4/packages/acs-core-docs/www/tutorial-notifications.html	6 Jan 2017 09:18:42 -0000	1.17.2.4
        @@ -79,7 +79,7 @@
               -- @creation-date 2002-05-16
               --
               -- This code is newly concocted by Ben, but with significant concepts and code
        -      -- lifted from Gilbert's UBB forums. Thanks Orchard Labs.
        +      -- lifted from Gilbert's UBB forums. Thanks Orchard Labs.
               -- Lars and Jade in turn lifted this from gwong and ben.
         
         create function inline_0 ()
        Index: openacs-4/packages/acs-core-docs/www/tutorial-pages.adp
        ===================================================================
        RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-pages.adp,v
        diff -u -N -r1.1.2.15 -r1.1.2.16
        --- openacs-4/packages/acs-core-docs/www/tutorial-pages.adp	30 Nov 2016 08:15:11 -0000	1.1.2.15
        +++ openacs-4/packages/acs-core-docs/www/tutorial-pages.adp	6 Jan 2017 09:18:42 -0000	1.1.2.16
        @@ -15,23 +15,23 @@
         OpenACS docs are written by the named authors, and may be edited by
         OpenACS documentation staff.

        -Install some API

        As a workaround for missing content-repository functionality, +Install some API

        As a workaround for missing content-repository functionality, copy a provided file into the directory for tcl files:

        cp /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/acs-core-docs/www/files/tutorial/note-procs.tcl /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/myfirstpackage/tcl/

        To make this file take effect, go to the APM and choose "Reload changed" for "MyFirstPackage".

        -Page Map

        Our package will have two visible pages. The first shows a list +Page Map

        Our package will have two visible pages. The first shows a list of all objects; the second shows a single object in view or edit mode, and can also be used to add an object. The index page will display the list, but since we might reuse the list later, we'll put it in a seperate file and include it on the index page.

        -

        Figure 9.5. Page +

        Figure 9.5. Page Map

        Page Map

        -Build the "Index" page

        Each user-visible page in your package has, typically, three +Build the "Index" page

        Each user-visible page in your package has, typically, three parts. The tcl file holds the procedural logic for the page, including Tcl and database-independent SQL code, and does things like check @@ -48,7 +48,7 @@ This is the main page for the package. It displays all of the Notes and provides links to edit them and to create new Notes. \@author Your Name (you\@example.com) - \@cvs-id $‌Id: tutorial-pages.html,v 1.44.2.12 2016/11/19 09:21:55 gustafn Exp $ + \@cvs-id $‌Id: index.tcl,v 1.2.22.1 2015/09/10 08:21:20 gustafn Exp $ } set page_title [ad_conn instance_name] @@ -117,7 +117,8 @@ [$OPENACS_SERVICE_NAME lib]$ emacs note-list.adp

         <listtemplate name="notes"></listtemplate>
        -

        You can test your work by viewing the page.

        Create the add/edit page. If note_id is passed in, it display +

        You can test your work by viewing the page /myfirstpackage on +your installation.

        Create the add/edit page. If note_id is passed in, it display that note, and can change to edit mode if appropriate. Otherwise, it presents a form for adding notes.

         [$OPENACS_SERVICE_NAME lib]$ cd /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/myfirstpackage/www
        @@ -127,7 +128,7 @@
             This is the view-edit page for notes.
         
             \@author Your Name (you\@example.com)
        -    \@cvs-id $‌Id: tutorial-pages.html,v 1.44.2.12 2016/11/19 09:21:55 gustafn Exp $
        +    \@cvs-id $‌Id: note-edit.tcl,v 1.3.2.1 2015/09/10 08:21:20 gustafn Exp $
          
             \@param item_id If present, assume we are editing that note.  Otherwise, we are creating a new note.
         } {
        @@ -186,7 +187,7 @@
             This deletes a note
         
             \@author Your Name (you\@example.com)
        -    \@cvs-id $‌Id: tutorial-pages.html,v 1.44.2.12 2016/11/19 09:21:55 gustafn Exp $
        +    \@cvs-id $‌Id: note-delete.tcl,v 1.3.2.1 2015/09/10 08:21:20 gustafn Exp $
          
             \@param item_id The item_id of the note to delete
         } {
        Index: openacs-4/packages/acs-core-docs/www/tutorial-pages.html
        ===================================================================
        RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-pages.html,v
        diff -u -N -r1.44.2.12 -r1.44.2.13
        --- openacs-4/packages/acs-core-docs/www/tutorial-pages.html	19 Nov 2016 09:21:55 -0000	1.44.2.12
        +++ openacs-4/packages/acs-core-docs/www/tutorial-pages.html	6 Jan 2017 09:18:42 -0000	1.44.2.13
        @@ -2,8 +2,8 @@
         Creating Web Pages

        Creating Web Pages

        by Joel Aufrecht

        OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff. -

        Install some API

        As a workaround for missing content-repository functionality, copy a provided file into the directory for tcl files:

        -    cp /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/acs-core-docs/www/files/tutorial/note-procs.tcl /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/myfirstpackage/tcl/

        To make this file take effect, go to the APM and choose "Reload changed" for "MyFirstPackage".

        Page Map

        Our package will have two visible pages. The first shows a list of all objects; the second shows a single object in view or edit mode, and can also be used to add an object. The index page will display the list, but since we might reuse the list later, we'll put it in a seperate file and include it on the index page.

        Figure 9.5. Page Map

        Page Map

        Build the "Index" page

        Each user-visible page in your package has, typically, +

        Install some API

        As a workaround for missing content-repository functionality, copy a provided file into the directory for tcl files:

        +    cp /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/acs-core-docs/www/files/tutorial/note-procs.tcl /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/myfirstpackage/tcl/

        To make this file take effect, go to the APM and choose "Reload changed" for "MyFirstPackage".

        Page Map

        Our package will have two visible pages. The first shows a list of all objects; the second shows a single object in view or edit mode, and can also be used to add an object. The index page will display the list, but since we might reuse the list later, we'll put it in a seperate file and include it on the index page.

        Figure 9.5. Page Map

        Page Map

        Build the "Index" page

        Each user-visible page in your package has, typically, three parts. The tcl file holds the procedural logic for the page, including Tcl and database-independent SQL code, and does things like @@ -12,7 +12,7 @@ holds html. The -postgres.xql and -oracle.xql files contains database-specific SQL. The default page in any directory is - index, so we'll build that + index, so we'll build that first, starting with the tcl file:

        [$OPENACS_SERVICE_NAME postgresql]$ cd /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/myfirstpackages/www
         [$OPENACS_SERVICE_NAME www]$ emacs index.tcl

        Paste this into the file.

        ad_page_contract {
             This is the main page for the package.  It displays all of the Notes and provides links to edit them and to create new Notes.
        @@ -31,7 +31,7 @@
         

        Now index.adp:

        <master>
           <property name="doc(title)">@page_title;literal@</property>
           <property name="context">@context;literal@</property>
        -<include src="/packages/myfirstpackage/lib/note-list">

        The index page includes the list page, which we put in /lib instead of /www to designate that it's available for reuse by other packages.

        [$OPENACS_SERVICE_NAME www]$ mkdir /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/myfirstpackage/lib
        +<include src="/packages/myfirstpackage/lib/note-list">

        The index page includes the list page, which we put in /lib instead of /www to designate that it's available for reuse by other packages.

        [$OPENACS_SERVICE_NAME www]$ mkdir /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/myfirstpackage/lib
         [$OPENACS_SERVICE_NAME www]$ cd /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/myfirstpackage/lib
         [$OPENACS_SERVICE_NAME lib]$ emacs note-list.tcl
        template::list::create \
             -name notes \
        @@ -76,7 +76,7 @@
         #    tcl-indent-level: 4
         #    indent-tabs-mode: nil
         # End:
        -
        [$OPENACS_SERVICE_NAME lib]$ emacs note-list.adp
        <listtemplate name="notes"></listtemplate>

        You can test your work by viewing the page.

        Create the add/edit page. If note_id is passed in, +

        [$OPENACS_SERVICE_NAME lib]$ emacs note-list.adp
        <listtemplate name="notes"></listtemplate>

        You can test your work by viewing the page /myfirstpackage on your installation.

        Create the add/edit page. If note_id is passed in, it display that note, and can change to edit mode if appropriate. Otherwise, it presents a form for adding notes.

        [$OPENACS_SERVICE_NAME lib]$ cd /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/myfirstpackage/www
         [$OPENACS_SERVICE_NAME www]$ emacs note-edit.tcl
        ad_page_contract {
             This is the view-edit page for notes.
        @@ -146,7 +146,7 @@
         mfp::note::delete -item_id $item_id
         
         ad_returnredirect "."
        -# stop running this code, since we're redirecting
        +# stop running this code, since we're redirecting
         abort
         
         # Local variables:
        Index: openacs-4/packages/acs-core-docs/www/tutorial-parameters.html
        ===================================================================
        RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-parameters.html,v
        diff -u -N -r1.9.2.3 -r1.9.2.4
        --- openacs-4/packages/acs-core-docs/www/tutorial-parameters.html	19 Nov 2016 09:21:55 -0000	1.9.2.3
        +++ openacs-4/packages/acs-core-docs/www/tutorial-parameters.html	6 Jan 2017 09:18:42 -0000	1.9.2.4
        @@ -3,6 +3,6 @@
             with it. These are like preferences, and they can be set by the
             administrator for each application to change the behavior of your
             application. 

        To add parameters for your package, go to the Automatic - Package Manager (/acs-admin/apm)

        Click on your package

        Under the Manage section, click on Parameters

        It's fairly self-explanatory at this point. Create the + Package Manager (/acs-admin/apm)

        Click on your package

        Under the Manage section, click on Parameters

        It's fairly self-explanatory at this point. Create the parameters you want, and then access them in your code using the parameter::get procedure.

        Index: openacs-4/packages/acs-core-docs/www/tutorial-specs.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-specs.html,v diff -u -N -r1.14.2.3 -r1.14.2.4 --- openacs-4/packages/acs-core-docs/www/tutorial-specs.html 19 Nov 2016 09:21:55 -0000 1.14.2.3 +++ openacs-4/packages/acs-core-docs/www/tutorial-specs.html 6 Jan 2017 09:18:42 -0000 1.14.2.4 @@ -1,7 +1,7 @@ Write the Requirements and Design Specs

        Write the Requirements and Design Specs

        Before you get started you should make yourself familiar with the tags that are used to write your documentation. For tips on - editing SGML files in emacs, see the section called “OpenACS Documentation Guide”.

        It's time to document. For the tutorial we'll use + editing SGML files in emacs, see the section called “OpenACS Documentation Guide”.

        It's time to document. For the tutorial we'll use pre-written documentation. When creating a package from scratch, start by copying the documentation template from /var/lib/aolserver/openacs-dev/packages/acs-core-docs/xml/docs/xml/package-documentation-template.xml Index: openacs-4/packages/acs-core-docs/www/tutorial-upgrades.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-upgrades.html,v diff -u -N -r1.9.2.4 -r1.9.2.5 --- openacs-4/packages/acs-core-docs/www/tutorial-upgrades.html 19 Nov 2016 09:21:55 -0000 1.9.2.4 +++ openacs-4/packages/acs-core-docs/www/tutorial-upgrades.html 6 Jan 2017 09:18:42 -0000 1.9.2.5 @@ -6,10 +6,10 @@ that can be installed on OpenACS installations, and can be used by administrators to update their packages. If you are a package developer, there are a couple of steps you need to take in order - to release a new version of your package.

        For the sake of this example, let's assume you are the + to release a new version of your package.

        For the sake of this example, let's assume you are the package owner of the notes package. It is currently at version 1.5, and you are planning on - releasing version 1.6. It is also located in OpenACS's CVS.

        To release your package:

        cd /path/to/notes
        +    releasing version 1.6. It is also located in OpenACS's CVS.

        To release your package:

        cd /path/to/notes
         cvs commit -m "Update package to version 1.6."
         cvs tag notes-1-6-final
         cvs tag -F openacs-5-1-compat
        Index: openacs-4/packages/acs-core-docs/www/tutorial-wysiwyg-editor.html
        ===================================================================
        RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-wysiwyg-editor.html,v
        diff -u -N -r1.9.2.5 -r1.9.2.6
        --- openacs-4/packages/acs-core-docs/www/tutorial-wysiwyg-editor.html	19 Nov 2016 09:21:55 -0000	1.9.2.5
        +++ openacs-4/packages/acs-core-docs/www/tutorial-wysiwyg-editor.html	6 Jan 2017 09:18:42 -0000	1.9.2.6
        @@ -20,7 +20,7 @@
         	       	   {after_html
                        {<a name="#">Anchor</a>}}}
         	} ...
        -	

        Warning

        You must not give your your form the same name that your page has. Otherwise HTMLArea won't load.

        Convert your textarea widget to a richtext widget and enable htmlarea.

        The htmlarea_p-flag can be used to prevent +

        Warning

        You must not give your your form the same name that your page has. Otherwise HTMLArea won't load.

        Convert your textarea widget to a richtext widget and enable htmlarea.

        The htmlarea_p-flag can be used to prevent WYSIWYG functionality. Defaults to true if left away.

        From:

         	{my_input_field_2:text
         	

        To:

        @@ -31,7 +31,7 @@
         	take a look at the cr_mime_types table.

        Make sure that both values are passed as a list to your ad_form or you will have problems displaying the content or handling the data manipulation correctly.

        Depending on the data model of your package you either support a content format - or don't. If you don't you can assume "text/html" or + or don't. If you don't you can assume "text/html" or "text/richtext" or "text/enhanced".

        The relevant parts in your ad_form definition are the switches -new_data, -edit_data, -on_request and -on_submit.

        To allow your data to display correctly you need to add an -on_request block. @@ -44,7 +44,7 @@ set format [ template::util::richtext::get_property format $my_input_field_2] #This is optional

        Now the correct values for my_input_field_2 and format are passed to the -new_data and - -edit_data blocks which don't need to get touched.

        To make HTMLArea optional per package instance define a string parameter + -edit_data blocks which don't need to get touched.

        To make HTMLArea optional per package instance define a string parameter UseWysiwygP which defaults 0 for your package using the APM.

        In your edit page make the following changes

         	# Is WYSIWYG enabled?
        Index: openacs-4/packages/acs-core-docs/www/unix-installation.adp
        ===================================================================
        RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/unix-installation.adp,v
        diff -u -N -r1.1.2.6 -r1.1.2.7
        --- openacs-4/packages/acs-core-docs/www/unix-installation.adp	30 Nov 2016 08:15:11 -0000	1.1.2.6
        +++ openacs-4/packages/acs-core-docs/www/unix-installation.adp	6 Jan 2017 09:18:42 -0000	1.1.2.7
        @@ -38,8 +38,8 @@
         must first do Setting a
         global shell variable for cut and paste.

        To install a machine to the specifications of the Reference Platform, do the walkthrough -of the Red Hat 8.0 Install for OpenACS.

        ($‌Id: unix-installation.html,v 1.33.2.12 -2016/11/19 09:21:55 gustafn Exp $)
        +of the Red Hat 8.0 Install for OpenACS.

        ($‌Id: os.xml,v 1.15.14.1 2015/09/28 07:54:30 +gustafn Exp $)
      • - For each channel, it'll do an anonymous checkout of packges and contrib/packages, then build .apm files for each package in the checkout. + For each channel, it'll do an anonymous checkout of packges and contrib/packages, then build .apm files for each package in the checkout.

      • - The files will be stored on the server's hard drive in the directory specified by the 'repository_dir' variable in the page script, by default "$::acs::rootdir/www/repository/". + The files will be stored on the server's hard drive in the directory specified by the 'repository_dir' variable in the page script, by default "$::acs::rootdir/www/repository/".

      • - If you're on openacs.org, everything should now be fine. Otherwise, you need to move the entire directory tree to openacs.org:/web/openacs/www/repository, replacing what was already there. + If you're on openacs.org, everything should now be fine. Otherwise, you need to move the entire directory tree to openacs.org:/web/openacs/www/repository, replacing what was already there.

        This is automated on OpenACS.org by having a dedicated site just for building the repository, invoked with this shell script. Since the page circumvents security checks for ease of use, the entire site is limited to local requests. The script is called daily with a cron job.

        #!/bin/sh
         #set -x
         
        Index: openacs-4/packages/acs-core-docs/www/upgrade-4.5-to-4.6.adp
        ===================================================================
        RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/upgrade-4.5-to-4.6.adp,v
        diff -u -N -r1.1.2.14 -r1.1.2.15
        --- openacs-4/packages/acs-core-docs/www/upgrade-4.5-to-4.6.adp	19 Nov 2016 09:21:55 -0000	1.1.2.14
        +++ openacs-4/packages/acs-core-docs/www/upgrade-4.5-to-4.6.adp	6 Jan 2017 09:18:42 -0000	1.1.2.15
        @@ -9,7 +9,7 @@
         		    rightLink="upgrade-4.6.3-to-5" rightLabel="Next">
         		

        -Upgrading 4.5 or higher to 4.6.3

        The required platform for OpenACS 4.6 is the same as 4.5, with +Upgrading 4.5 or higher to 4.6.3

        The required platform for OpenACS 4.6 is the same as 4.5, with the exception of OpenFTS. OpenACS 4.6 and later require OpenFTS 0.3.2 for full text search on PostGreSQL. If you have OpenFTS 0.2, you'll need to upgrade.

        If upgrading from 4.4, you need to manually run Index: openacs-4/packages/acs-core-docs/www/upgrade-4.5-to-4.6.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/upgrade-4.5-to-4.6.html,v diff -u -N -r1.27.2.12 -r1.27.2.13 --- openacs-4/packages/acs-core-docs/www/upgrade-4.5-to-4.6.html 19 Nov 2016 09:21:55 -0000 1.27.2.12 +++ openacs-4/packages/acs-core-docs/www/upgrade-4.5-to-4.6.html 6 Jan 2017 09:18:42 -0000 1.27.2.13 @@ -1,12 +1,12 @@ -Upgrading 4.5 or higher to 4.6.3

        Upgrading 4.5 or higher to 4.6.3

        The required platform for OpenACS 4.6 is the same as - 4.5, with the exception of OpenFTS. OpenACS 4.6 and later require OpenFTS 0.3.2 for full text search on PostGreSQL. If you have OpenFTS 0.2, you'll need to upgrade.

        If upgrading from 4.4, you need to manually run acs-kernel/sql/postgres/upgrade-4.4-4.5.sql. See Bug #632

        1. Make a Backup. Back up the database and file system (see the section called “Manual backup and recovery”).

        2. OPTIONAL: Upgrade OpenFTS. the section called “Upgrading OpenFTS from 0.2 to 0.3.2”

        3. +Upgrading 4.5 or higher to 4.6.3

          Upgrading 4.5 or higher to 4.6.3

          The required platform for OpenACS 4.6 is the same as + 4.5, with the exception of OpenFTS. OpenACS 4.6 and later require OpenFTS 0.3.2 for full text search on PostGreSQL. If you have OpenFTS 0.2, you'll need to upgrade.

          If upgrading from 4.4, you need to manually run acs-kernel/sql/postgres/upgrade-4.4-4.5.sql. See Bug #632

          1. Make a Backup. Back up the database and file system (see the section called “Manual backup and recovery”).

          2. OPTIONAL: Upgrade OpenFTS. the section called “Upgrading OpenFTS from 0.2 to 0.3.2”

          3. Stop the server

            [root root]# svc -d /service/$OPENACS_SERVICE_NAME
          4. Upgrade the file system. the section called “Upgrading the OpenACS files”

          5. Start the server

            [root root]# svc -u /service/$OPENACS_SERVICE_NAME
          6. Use APM to upgrade the database. 

            1. Browse to the package manager, http://yourserver/acs-admin/apm.

            2. Click Install packages.

            3. Select the packages you want to install. This should be everything that says upgrade, plus any new - packages you want. It's safest to upgrade the kernel by + packages you want. It's safest to upgrade the kernel by itself, and then come back and upgrade the rest of the desired packages in a second pass.

            4. On the next screen, click Install Packages

            5. When prompted, restart the server:

              [root root]# restart-aolserver $OPENACS_SERVICE_NAME
            6. Wait a minute, then browse to the package manager, http://yourserver/acs-admin/apm.

            7. Check that the kernel upgrade worked by clicking All and making sure that acs-kernel version is 5.9.0.

          7. Rollback. If anything goes wrong, roll back to the backup snapshot.

          Index: openacs-4/packages/acs-core-docs/www/upgrade-4.6.3-to-5.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/upgrade-4.6.3-to-5.html,v diff -u -N -r1.17.2.3 -r1.17.2.4 --- openacs-4/packages/acs-core-docs/www/upgrade-4.6.3-to-5.html 19 Nov 2016 09:21:55 -0000 1.17.2.3 +++ openacs-4/packages/acs-core-docs/www/upgrade-4.6.3-to-5.html 6 Jan 2017 09:18:42 -0000 1.17.2.4 @@ -4,7 +4,7 @@ how to upgrade an Oracle installation from OpenACS 4.6.3 to 5 .

        4. PostGreSQL. You must use PostGreSQL 7.3.x or newer to upgrade OpenACS beyond 4.6.3. See Upgrade PostGreSQL to 7.3; Table 2.2, “Version Compatibility Matrix” -

          1. Back up the database and file system.

          2. Upgrade the file system for packages/acs-kernel. the section called “Upgrading the OpenACS files”

          3. Upgrade the kernel manually. (There is a script to do most of the rest: /contrib/misc/upgrade_4.6_to_5.0.sh on HEAD). You'll still have to do a lot of stuff manually, but automated trial and error is much more fun.)

            [root root]# su - $OPENACS_SERVICE_NAME
            +            

            1. Back up the database and file system.

            2. Upgrade the file system for packages/acs-kernel. the section called “Upgrading the OpenACS files”

            3. Upgrade the kernel manually. (There is a script to do most of the rest: /contrib/misc/upgrade_4.6_to_5.0.sh on HEAD). You'll still have to do a lot of stuff manually, but automated trial and error is much more fun.)

              [root root]# su - $OPENACS_SERVICE_NAME
               [$OPENACS_SERVICE_NAME aolserver]$ cd /var/lib/aolserver/ $OPENACS_SERVICE_NAME/packages/acs-kernel/sql/postgresql/upgrade

              Manually execute each of the upgrade scripts in sequence, either from within psql or from the command line with commands such as psql -f upgrade-4.6.3-4.6.4.sql $OPENACS_SERVICE_NAME. Run the scripts in this order (order is tentative, not verified):

              psql -f upgrade-4.6.3-4.6.4.sql $OPENACS_SERVICE_NAME
              @@ -22,7 +22,7 @@
               psql -f upgrade-5.0.0b2-5.0.0b3.sql $OPENACS_SERVICE_NAME
               psql -f upgrade-5.0.0b3-5.0.0b4.sql $OPENACS_SERVICE_NAME
            4. Upgrade ACS Service Contracts manually:

              [$OPENACS_SERVICE_NAME aolserver]$ cd /var/lib/aolserver/ $OPENACS_SERVICE_NAME/packages/acs-service-contracts/sql/postgresql/upgrade
               psql -f upgrade-4.7d2-4.7d3.sql $OPENACS_SERVICE_NAME
              -
            5. Load acs-authentication data model.

              psql -f /var/lib/aolserver/$OPENACS_SERVICE_NAME/openacs-5/packages/acs-authentication/sql/postgresql/acs-authentication-create.sql $OPENACS_SERVICE_NAME
            6. Load acs-lang data model.

              psql -f /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/acs-lang/sql/postgresql/acs-lang-create.sql $OPENACS_SERVICE_NAME
            7. (This step may overlap with the two previous steps, but I think it's harmless?) Create a file which will be executed on startup which takes care of a few issues with authentication and internationalization: create $OPENACS_SERVICE_NAME/tcl/zzz-postload.tcl containing:

              if {![apm_package_installed_p acs-lang]} {
              +
            8. Load acs-authentication data model.

              psql -f /var/lib/aolserver/$OPENACS_SERVICE_NAME/openacs-5/packages/acs-authentication/sql/postgresql/acs-authentication-create.sql $OPENACS_SERVICE_NAME
            9. Load acs-lang data model.

              psql -f /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/acs-lang/sql/postgresql/acs-lang-create.sql $OPENACS_SERVICE_NAME
            10. (This step may overlap with the two previous steps, but I think it's harmless?) Create a file which will be executed on startup which takes care of a few issues with authentication and internationalization: create $OPENACS_SERVICE_NAME/tcl/zzz-postload.tcl containing:

              if {![apm_package_installed_p acs-lang]} {
               apm_package_install -enable -mount_path acs-lang $::acs::rootdir/packages/acs-lang/acs-lang.info
               lang::catalog::import -locales [list "en_US"]
               }
              @@ -40,7 +40,7 @@
               }
            11. If you can login, visit /acs-admin/apm and upgrade acs-kernel and acs-service-contract and uncheck the data model scripts. Restart. If everything is still working, make another backup of the database.

            12. Upgrade other packages via the APM

            See also these forum posts: Forum OpenACS Development: 4.6.3 upgrade to 5-HEAD: final results, OpenACS 5.0 Upgrade Experiences.

            - There are a few things you might want to do once you've + There are a few things you might want to do once you've upgraded. First, the acs-kernel parameters need to be set to allow HREF and IMG tags, if you want users who can edit HTML to be able to insert HREF and IMG tags. Also, you might need Index: openacs-4/packages/acs-core-docs/www/upgrade-openacs-files.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/upgrade-openacs-files.adp,v diff -u -N -r1.1.2.13 -r1.1.2.14 --- openacs-4/packages/acs-core-docs/www/upgrade-openacs-files.adp 19 Nov 2016 09:21:55 -0000 1.1.2.13 +++ openacs-4/packages/acs-core-docs/www/upgrade-openacs-files.adp 6 Jan 2017 09:18:42 -0000 1.1.2.14 @@ -12,7 +12,7 @@ Upgrading the OpenACS files

        -Chosing a Method to Upgrade your +Chosing a Method to Upgrade your Files

        OpenACS is distributed in many different ways:

        • as a collection of files

        • as one big tarball

        • via CVS

        • via automatic download from within the APM (package manager)

        Upgrades work by first changing the file system (via any of the @@ -27,7 +27,7 @@

        -Methods of upgrading OpenACS files

          +Methods of upgrading OpenACS files
        • Upgrading files for a site which is not in a CVS @@ -56,7 +56,7 @@ version, without overriding your own local customizations.

          This diagram explains the basic idea. However, the labels are incorrect. Step 1(a) has been removed, and Step 1(b) should be labelled Step 1.

          -

          Figure 5.2. Upgrading a local CVS +

          Figure 5.2. Upgrading a local CVS repository

          Upgrading a local CVS repository

          • @@ -196,7 +196,7 @@
      • -Upgrading a Production Site Safely

        If you are upgrading a production OpenACS site which is on a +Upgrading a Production Site Safely

        If you are upgrading a production OpenACS site which is on a private CVS tree, this process lets you do the upgrade without risking extended downtime or an unusable site:

        1. Declare a freeze on new cvs updates - ie, you cannot run cvs Index: openacs-4/packages/acs-core-docs/www/upgrade-openacs-files.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/upgrade-openacs-files.html,v diff -u -N -r1.27.2.13 -r1.27.2.14 --- openacs-4/packages/acs-core-docs/www/upgrade-openacs-files.html 19 Nov 2016 09:21:55 -0000 1.27.2.13 +++ openacs-4/packages/acs-core-docs/www/upgrade-openacs-files.html 6 Jan 2017 09:18:42 -0000 1.27.2.14 @@ -1,5 +1,5 @@ -Upgrading the OpenACS files

          Upgrading the OpenACS files

          Chosing a Method to Upgrade your Files

          OpenACS is distributed in many different ways: +Upgrading the OpenACS files

          Upgrading the OpenACS files

          Chosing a Method to Upgrade your Files

          OpenACS is distributed in many different ways:

          • as a collection of files

          • as one big tarball

          • via CVS

          • via automatic download from within the APM (package manager)

          Upgrades work by first changing the file system (via any @@ -11,7 +11,7 @@ describes whether or not you need to be upgrading using this page or not: the section called “Upgrading an OpenACS 5.0.0 or greater installation” -

          Methods of upgrading OpenACS files

          • Upgrading files for a site which is not in a CVS repository. Unpack the tarball into a new directory and copy its +

          Methods of upgrading OpenACS files

          • Upgrading files for a site which is not in a CVS repository. Unpack the tarball into a new directory and copy its contents on top of your working directory. Or just 'install software', select remote repository, and upgrade your files from there.

            [root root]# su - $OPENACS_SERVICE_NAME
            @@ -32,21 +32,21 @@
                     with the latest OpenACS version, without overriding your own
                     local customizations. 

            This diagram explains the basic idea. However, the labels are incorrect. Step 1(a) has been removed, and Step - 1(b) should be labelled Step 1.

            Figure 5.2. Upgrading a local CVS repository

            Upgrading a local CVS repository

            • Step 0: Set up a working CVS checkout. To get your OpenACS code into your local CVS + 1(b) should be labelled Step 1.

              Figure 5.2. Upgrading a local CVS repository

              Upgrading a local CVS repository

              • Step 0: Set up a working CVS checkout. To get your OpenACS code into your local CVS repository, you will set up a working CVS checkout of - OpenACS. When you want to update your site, you'll + OpenACS. When you want to update your site, you'll update the working CVS checkout, import those changes into your local CVS checkout, create a temporary CVS checkout to merge your local changes, fix any conflicts, commit your changes, and then update your - site. It sounds complicated, but it's not too bad, and - it is the best way to work around CVS's limitations.

                This part describes how to set up your working CVS - checkout. Once it is set up, you'll be able to update any + site. It sounds complicated, but it's not too bad, and + it is the best way to work around CVS's limitations.

                This part describes how to set up your working CVS + checkout. Once it is set up, you'll be able to update any packages using the existing working CVS checkout. We use one dedicated directory for each branch of OpenACS - if you are using OpenACS 5.1,x, you will need a 5.1 checkout. That will be good for 5.1, 5.11, 5.12, and so on. But when you want to - upgrade to OpenACS 5.2, you'll need to check out another + upgrade to OpenACS 5.2, you'll need to check out another branch.

                The openacs-5-1-compat tag identifies the latest released version of OpenACS 5.1 (ie, 5.1.3 or 5.1.4) and the latest compatible version of each package. Each minor release of OpenACS since 5.0 has this tagging structure. For example, OpenACS 5.1.x has openacs-5-1-compat.

                You will want to separately check out all the packages you are using.

                [root root]# su - $OPENACS_SERVICE_NAME
                @@ -55,7 +55,7 @@
                 [$OPENACS_SERVICE_NAME aolserver]$ cd openacs-4/packages
                 [$OPENACS_SERVICE_NAME aolserver]$ cvs -d :pserver:anonymous@cvs.openacs.org:/cvsroot checkout -r openacs-5-1-compat packagename packagename2...
                 [$OPENACS_SERVICE_NAME aolserver]$ cd ../..
                -[$OPENACS_SERVICE_NAME aolserver]$ mv openacs-4 openacs-5-1

                Make sure your working CVS checkout doesn't have +[$OPENACS_SERVICE_NAME aolserver]$ mv openacs-4 openacs-5-1

            Make sure your working CVS checkout doesn't have the entire CVS tree from OpenACS. A good way to check this is if it has a contrib directory. If it does, you probably checked out the entire tree. You might want to @@ -74,7 +74,7 @@ [$OPENACS_SERVICE_NAME myfirstpackage]$ cvs -d /var/lib/cvs/ import -m "importing package" $OPENACS_SERVICE_NAME/packages/myfirstpackage OpenACS openacs-5-1

        Create a new directory as temporary working space to reconcile conflicts between the new files and your current work. The example uses the cvs keyword yesterday, making - the assumption that you haven't checked in new code to + the assumption that you haven't checked in new code to your local tree in the last day. This section should be improved to use tags instead of the keyword yesterday!

        [$OPENACS_SERVICE_NAME openacs-5.1]$  cd /var/lib/aolserver
         [$OPENACS_SERVICE_NAME tmp]$ rm -rf $OPENACS_SERVICE_NAME-upgrade
        @@ -83,10 +83,10 @@
         (CVS feedback here)

        The file /var/tmp/openacs-upgrade/cvs.txt contains the results of the upgrade. If you changed files that are part of the OpenACS tarball and those changes conflict, - you'll have to manually reconcile them. Use the emacs + you'll have to manually reconcile them. Use the emacs command M-x sort-lines (you may have to click Ctrl-space at the beginning of the - file, and go to the end, and then try M-x sort-lines) and then, for each line that starts with a C, open that file and manually resolve the conflict by deleting the excess lines. When you're finished, or if there aren't any conflicts, save and exit.

        Once you've fixed any conflicts, commit the new code + file, and go to the end, and then try M-x sort-lines) and then, for each line that starts with a C, open that file and manually resolve the conflict by deleting the excess lines. When you're finished, or if there aren't any conflicts, save and exit.

        Once you've fixed any conflicts, commit the new code to your local tree.

        [$OPENACS_SERVICE_NAME tmp]$ cd $OPENACS_SERVICE_NAME-upgrade
         [$OPENACS_SERVICE_NAME $OPENACS_SERVICE_NAME-upgrade]$ cvs commit -m "Upgraded to 5.1"
      • Step 3: Upgrade your local staging site. Update your working tree with the new files. The CVS flags ensure that new directories are created and pruned directories destroyed.

        [$OPENACS_SERVICE_NAME $OPENACS_SERVICE_NAME-upgrade]$ cd /var/lib/aolserver/$OPENACS_SERVICE_NAME
         [$OPENACS_SERVICE_NAME $OPENACS_SERVICE_NAME]$ cvs up -Pd
        @@ -97,7 +97,7 @@
               

        1. [$OPENACS_SERVICE_NAME ~]$ cd /var/lib/aolserver/$OPENACS_SERVICE_NAME
           [$OPENACS_SERVICE_NAME $OPENACS_SERVICE_NAME]$ cvs up -Pd
           (CVS feedback)
          -[$OPENACS_SERVICE_NAME $OPENACS_SERVICE_NAME]$

        Upgrading a Production Site Safely

        If you are upgrading a production OpenACS site which is on a private CVS tree, this process lets you do the upgrade without risking extended downtime or an unusable site:

        1. Declare a freeze on new cvs updates - ie, you cannot run cvs update +[$OPENACS_SERVICE_NAME $OPENACS_SERVICE_NAME]$

      • Upgrading a Production Site Safely

        If you are upgrading a production OpenACS site which is on a private CVS tree, this process lets you do the upgrade without risking extended downtime or an unusable site:

        1. Declare a freeze on new cvs updates - ie, you cannot run cvs update on the production site

        2. Make a manual backup of the production site in addition to the automated backups

        3. Import the new code (for example, OpenACS 5.0.4, openacs-5-0-compat versions of Index: openacs-4/packages/acs-core-docs/www/upgrade-overview.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/upgrade-overview.adp,v diff -u -N -r1.1.2.13 -r1.1.2.14 --- openacs-4/packages/acs-core-docs/www/upgrade-overview.adp 19 Nov 2016 09:21:55 -0000 1.1.2.13 +++ openacs-4/packages/acs-core-docs/www/upgrade-overview.adp 6 Jan 2017 09:18:42 -0000 1.1.2.14 @@ -26,11 +26,11 @@ upgrade scripts, and prompt you to restart the server. After restarting the server again, the upgrade is complete.

        -

        Figure 5.1. Upgrading with the +

        Figure 5.1. Upgrading with the APM

        Upgrading with the APM

        It's always a good idea to precede an upgrade attempt with a snapshot backup.

        -

        Table 5.1. Assumptions in this +

        Table 5.1. Assumptions in this section

        Index: openacs-4/packages/acs-core-docs/www/upgrade-overview.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/upgrade-overview.html,v diff -u -N -r1.27.2.12 -r1.27.2.13 --- openacs-4/packages/acs-core-docs/www/upgrade-overview.html 19 Nov 2016 09:21:55 -0000 1.27.2.12 +++ openacs-4/packages/acs-core-docs/www/upgrade-overview.html 6 Jan 2017 09:18:42 -0000 1.27.2.13 @@ -2,6 +2,6 @@ Overview
        Prev Chapter 5. Upgrading Next

        Overview

        Starting with Version 4.5, all OpenACS core packages support automatic upgrade. That means that, if you have OpenACS 4.5 or better, you should always be able to upgrade all of your core - packages automatically. If you haven't changed anything, no + packages automatically. If you haven't changed anything, no manual intervention should be required. If you are running - OpenACS prior to 4.5, upgrading will require manual effort.

        If all of these conditions are true:

        • Your OpenACS Core is 5.0.0 or later

        • You do not keep your OpenACS site in a local CVS repository

        • You do not have any custom code

        then you can upgrade automatically using the automated installer in the OpenACS Package Manager (APM), and you can probably skip the rest of this chapter. To upgrade directly from the OpenACS repository using the APM:

        1. Browse to the Installer.

        2. Click install or upgrade under "Install from OpenACS Repository" and select the packages to install or upgrade.

        3. The APM will download the requested packages from OpenACS.org, install the files on your hard drive, run any appropriate database upgrade scripts, and prompt you to restart the server. After restarting the server again, the upgrade is complete.

        Figure 5.1. Upgrading with the APM

        Upgrading with the APM

        It's always a good idea to precede an upgrade attempt with a snapshot backup.

        Table 5.1. Assumptions in this section

        name of OpenACS user$OPENACS_SERVICE_NAME
        OpenACS server name$OPENACS_SERVICE_NAME
        Root of OpenACS file tree/var/lib/aolserver/$OPENACS_SERVICE_NAME
        Database backup directory/var/lib/aolserver/$OPENACS_SERVICE_NAME/database-backup

        + OpenACS prior to 4.5, upgrading will require manual effort.

        If all of these conditions are true:

        • Your OpenACS Core is 5.0.0 or later

        • You do not keep your OpenACS site in a local CVS repository

        • You do not have any custom code

        then you can upgrade automatically using the automated installer in the OpenACS Package Manager (APM), and you can probably skip the rest of this chapter. To upgrade directly from the OpenACS repository using the APM:

        1. Browse to the Installer.

        2. Click install or upgrade under "Install from OpenACS Repository" and select the packages to install or upgrade.

        3. The APM will download the requested packages from OpenACS.org, install the files on your hard drive, run any appropriate database upgrade scripts, and prompt you to restart the server. After restarting the server again, the upgrade is complete.

        Figure 5.1. Upgrading with the APM

        Upgrading with the APM

        It's always a good idea to precede an upgrade attempt with a snapshot backup.

        Table 5.1. Assumptions in this section

        name of OpenACS user$OPENACS_SERVICE_NAME
        OpenACS server name$OPENACS_SERVICE_NAME
        Root of OpenACS file tree/var/lib/aolserver/$OPENACS_SERVICE_NAME
        Database backup directory/var/lib/aolserver/$OPENACS_SERVICE_NAME/database-backup

        Index: openacs-4/packages/acs-core-docs/www/upgrade-supporting.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/upgrade-supporting.html,v diff -u -N -r1.20.2.3 -r1.20.2.4 --- openacs-4/packages/acs-core-docs/www/upgrade-supporting.html 19 Nov 2016 09:21:55 -0000 1.20.2.3 +++ openacs-4/packages/acs-core-docs/www/upgrade-supporting.html 6 Jan 2017 09:18:42 -0000 1.20.2.4 @@ -40,7 +40,7 @@ function creation and at function calling, so they still match. But if you use a database created in 7.2 in 7.3, the function names in the database remain truncated but the function calls - are not, and so they don't match. Also some functions use + are not, and so they don't match. Also some functions use casting commands that no longer work in 7.3 and these functions must be recreated.

        To upgrade an OpenACS site from PostGreSQL 7.2 to 7.3, first upgrade the kernel to 4.6.3. Then, dump the database, run the upgrade script /var/lib/aolserver/$OPENACS_SERVICE_NAME/bin/pg_7.2to7.3_upgrade_helper.pl on the dump file, and reply the dump. See Forum OpenACS Q&A: PG 7.2->7.3 upgrade gotcha?. Example:

        1. Back up the database as per PostgreSQL.

        2. Run the upgrade script on the backup file.

          [root root]# su - $OPENACS_SERVICE_NAME
          @@ -62,18 +62,18 @@
                     installation location is different, and your startup script
                     (/etc/init.d/postgres73 should be named differently. You
                     might even need to edit that file to make the paths
          -          correct). You'll also need to add export
          +          correct). You'll also need to add export
                     PGPORT=5434 to the .bashrc and/or
                     .bash_profile for the postgres73 user.
                     

        3. Install PostgreSQL 7.3.x. Note that you PostgreSQL must listen on a different port in order to work - correctly, so you'll need to edit the configuration file + correctly, so you'll need to edit the configuration file (/usr/local/pgsql73/data/postgresql.conf) and change the port (to 5433, say). create a second postgres user to differentiate between the two postgres - installs. When you do ./configure, you'll need to include + installs. When you do ./configure, you'll need to include --prefix=$HOME to ensure that it is installed in the - postgres73 user's home directory.

        4. Change the path in + postgres73 user's home directory.

        5. Change the path in $OPENACS_SERVICE_NAME's .bashrc or .bash_profile (or both) files to reflect the new postgres73 user directory. Also add in the PGPORT.

        6. Restore the database from dump as per the recovery instructions.

        Index: openacs-4/packages/acs-core-docs/www/upgrade.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/upgrade.html,v diff -u -N -r1.30.2.3 -r1.30.2.4 --- openacs-4/packages/acs-core-docs/www/upgrade.html 19 Nov 2016 09:21:55 -0000 1.30.2.3 +++ openacs-4/packages/acs-core-docs/www/upgrade.html 6 Jan 2017 09:18:42 -0000 1.30.2.4 @@ -1,5 +1,5 @@ -Chapter 5. Upgrading

        Chapter 5. Upgrading

        by Joel Aufrecht

        +Chapter 5. Upgrading

        Chapter 5. Upgrading

        by Joel Aufrecht

        OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.
        Index: openacs-4/packages/acs-core-docs/www/variables.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/variables.adp,v diff -u -N -r1.1.2.14 -r1.1.2.15 --- openacs-4/packages/acs-core-docs/www/variables.adp 30 Nov 2016 08:15:11 -0000 1.1.2.14 +++ openacs-4/packages/acs-core-docs/www/variables.adp 6 Jan 2017 09:18:42 -0000 1.1.2.15 @@ -12,14 +12,14 @@ Variables

        Date and Time Variables

        -
        ($‌Id: variables.html,v 1.30.2.12 2016/11/19 -09:21:55 gustafn Exp $)

        By joel\@aufrecht.org +

        ($‌Id: variables.xml,v 1.3 2006/07/17 05:38:37 +torbenb Exp $)

        By joel\@aufrecht.org

        OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

        Starting with OpenACS 5.0 and the introduction of acs-lang, we recommend retrieving date/time information from the database in ANSI format and then using lc_time_fmt to format it for display.

        -

        Example 12.1. Getting datetime from +

        Example 12.1. Getting datetime from the database ANSI-style

         db_multirow -extend { mydate_pretty } {
             select to_char(mydate, 'YYYY-MM-DD HH24:MI:SS') as mydate_ansi,
        Index: openacs-4/packages/acs-core-docs/www/variables.html
        ===================================================================
        RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/variables.html,v
        diff -u -N -r1.30.2.12 -r1.30.2.13
        --- openacs-4/packages/acs-core-docs/www/variables.html	19 Nov 2016 09:21:55 -0000	1.30.2.12
        +++ openacs-4/packages/acs-core-docs/www/variables.html	6 Jan 2017 09:18:42 -0000	1.30.2.13
        @@ -4,7 +4,7 @@
                   by OpenACS documentation staff.
                 

        Starting with OpenACS 5.0 and the introduction of acs-lang, we recommend retrieving date/time information from the database in - ANSI format and then using lc_time_fmt to format it for display.

        Example 12.1. Getting datetime from the database ANSI-style

        db_multirow -extend { mydate_pretty } {
        +    ANSI format and then using lc_time_fmt to format it for display.

        Example 12.1. Getting datetime from the database ANSI-style

        db_multirow -extend { mydate_pretty } {
             select to_char(mydate, 'YYYY-MM-DD HH24:MI:SS') as mydate_ansi,
                   ...
             ...
        Index: openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-pages.xml
        ===================================================================
        RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-pages.xml,v
        diff -u -N -r1.20.2.1 -r1.20.2.2
        --- openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-pages.xml	23 Jun 2016 08:32:46 -0000	1.20.2.1
        +++ openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-pages.xml	6 Jan 2017 09:18:43 -0000	1.20.2.2
        @@ -56,7 +56,7 @@
               example missing
         [$OPENACS_SERVICE_NAME lib]$ emacs note-list.adp
         example missing
        -You can test your work by viewing the page.
        +You can test your work by viewing the page /myfirstpackage on your installation.
               Create the add/edit page.  If note_id is passed in,
               it display that note, and can change to edit mode if appropriate.  Otherwise, it presents a form for adding notes.
             [$OPENACS_SERVICE_NAME lib]$ cd /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/myfirstpackage/www