Commit 5630b413 authored by Frank Bergmann's avatar Frank Bergmann

- Upgrade to OpenACS 5.6

parent aa723964
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 'http://www.w3.org/TR/html4/loose.dtd"'>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Configuring an OpenACS package</title><link rel="stylesheet" href="openacs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="OpenACS Core Documentation"><link rel="up" href="configuring-new-site.html" title="Chapter 4. Configuring a new OpenACS Site"><link rel="previous" href="configuring-mounting-packages.html" title="Mounting OpenACS packages"><link rel="next" href="configuring-configuring-permissions.html" title="Setting Permissions on an OpenACS package"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><a href="http://openacs.org"><img src="/doc/images/alex.jpg" style="border:0" alt="Alex logo"></a><table width="100%" summary="Navigation header" border="0"><tr><td width="20%" align="left"><a accesskey="p" href="configuring-mounting-packages.html">Prev</a> </td><th width="60%" align="center">Chapter 4. Configuring a new OpenACS Site</th><td width="20%" align="right"> <a accesskey="n" href="configuring-configuring-permissions.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="configuring-configuring-packages"></a>Configuring an OpenACS package</h2></div></div><div></div></div><div class="authorblurb"><p>by <a href="mailto:jade@rubick.com" target="_top">Jade Rubick</a></p>
OpenACS docs are written by the named authors, and may be edited
by OpenACS documentation staff.
</div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2944552"></a>Configuring an OpenACS package</h3></div></div><div></div></div><p>After you've installed and mounted your package, you can
configure each instance to act as you would like. </p><p>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'
link, you will see a list of parameters that you can change for
this application.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="configuring-mounting-packages.html">Prev</a> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right"> <a accesskey="n" href="configuring-configuring-permissions.html">Next</a></td></tr><tr><td width="40%" align="left">Mounting OpenACS packages </td><td width="20%" align="center"><a accesskey="u" href="configuring-new-site.html">Up</a></td><td width="40%" align="right"> Setting Permissions on an OpenACS package</td></tr></table><hr><address><a href="mailto:docs@openacs.org">docs@openacs.org</a></address></div><a name="comments"></a><center><a href="http://openacs.org/doc/current/configuring-configuring-packages.html#comments">View comments on this page at openacs.org</a></center></body></html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 'http://www.w3.org/TR/html4/loose.dtd"'>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Setting Permissions on an OpenACS package</title><link rel="stylesheet" href="openacs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="OpenACS Core Documentation"><link rel="up" href="configuring-new-site.html" title="Chapter 4. Configuring a new OpenACS Site"><link rel="previous" href="configuring-configuring-packages.html" title="Configuring an OpenACS package"><link rel="next" href="how-do-I.html" title="How Do I?"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><a href="http://openacs.org"><img src="/doc/images/alex.jpg" style="border:0" alt="Alex logo"></a><table width="100%" summary="Navigation header" border="0"><tr><td width="20%" align="left"><a accesskey="p" href="configuring-configuring-packages.html">Prev</a> </td><th width="60%" align="center">Chapter 4. Configuring a new OpenACS Site</th><td width="20%" align="right"> <a accesskey="n" href="how-do-I.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="configuring-configuring-permissions"></a>Setting Permissions on an OpenACS package</h2></div></div><div></div></div><div class="authorblurb"><p>by <a href="mailto:jade@rubick.com" target="_top">Jade Rubick</a></p>
OpenACS docs are written by the named authors, and may be edited
by OpenACS documentation staff.
</div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2968560"></a>Setting Permission on an OpenACS package</h3></div></div><div></div></div><p>After you've installed and mounted your package, you can
configure each instance to act as you would like. </p><p>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'
link, you will see and be able to set the permissions for that
application. </p><p>Each application may have different behavior for what Read
Create Write and Admin permissions mean, but generally the
permissions are straightforward. If you find the behavior is not
what you expect after setting permissions, you can post a bug in
the OpenACS bugtracker.</p><p>'The Public' refers to users to the website who are not
logged in. 'Registered Users' are people who have registered for
the site. </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="configuring-configuring-packages.html">Prev</a> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right"> <a accesskey="n" href="how-do-I.html">Next</a></td></tr><tr><td width="40%" align="left">Configuring an OpenACS package </td><td width="20%" align="center"><a accesskey="u" href="configuring-new-site.html">Up</a></td><td width="40%" align="right"> How Do I?</td></tr></table><hr><address><a href="mailto:docs@openacs.org">docs@openacs.org</a></address></div><a name="comments"></a><center><a href="http://openacs.org/doc/current/configuring-configuring-permissions.html#comments">View comments on this page at openacs.org</a></center></body></html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 'http://www.w3.org/TR/html4/loose.dtd"'>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Installing OpenACS packages</title><link rel="stylesheet" href="openacs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="OpenACS Core Documentation"><link rel="up" href="configuring-new-site.html" title="Chapter 4. Configuring a new OpenACS Site"><link rel="previous" href="configuring-new-site.html" title="Chapter 4. Configuring a new OpenACS Site"><link rel="next" href="configuring-mounting-packages.html" title="Mounting OpenACS packages"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><a href="http://openacs.org"><img src="/doc/images/alex.jpg" style="border:0" alt="Alex logo"></a><table width="100%" summary="Navigation header" border="0"><tr><td width="20%" align="left"><a accesskey="p" href="configuring-new-site.html">Prev</a> </td><th width="60%" align="center">Chapter 4. Configuring a new OpenACS Site</th><td width="20%" align="right"> <a accesskey="n" href="configuring-mounting-packages.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="configuring-install-packages"></a>Installing OpenACS packages</h2></div></div><div></div></div><div class="authorblurb"><p>by <a href="mailto:jade@rubick.com" target="_top">Jade Rubick</a></p>
OpenACS docs are written by the named authors, and may be edited
by OpenACS documentation staff.
</div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2912365"></a>Installing OpenACS packages</h3></div></div><div></div></div><p>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.</p><p>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.</p><p>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 Control Panel. Click on that, then click on 'Install
software'. Packages are sometimes also referred to as
applications or software.</p><p>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.</p><p>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</p><p>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 are missing any packages, you may have to add the packages
your desired package depends on:
<a href="upgrade-openacs-files.html" title="Upgrading the OpenACS files">Section , “Upgrading the OpenACS files”</a>
</p><p>If you run into any errors at all, check your
/var/lib/aolserver/$OPENACS_SERVICE_NAME/log/error.log file, and
post your error on the OpenACS forums</p><p>Once the package has been installed, then you will need to
'mount' the package. The next section handles that.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="configuring-new-site.html">Prev</a> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right"> <a accesskey="n" href="configuring-mounting-packages.html">Next</a></td></tr><tr><td width="40%" align="left">Chapter 4. Configuring a new OpenACS Site </td><td width="20%" align="center"><a accesskey="u" href="configuring-new-site.html">Up</a></td><td width="40%" align="right"> Mounting OpenACS packages</td></tr></table><hr><address><a href="mailto:docs@openacs.org">docs@openacs.org</a></address></div><a name="comments"></a><center><a href="http://openacs.org/doc/current/configuring-install-packages.html#comments">View comments on this page at openacs.org</a></center></body></html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 'http://www.w3.org/TR/html4/loose.dtd"'>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Mounting OpenACS packages</title><link rel="stylesheet" href="openacs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="OpenACS Core Documentation"><link rel="up" href="configuring-new-site.html" title="Chapter 4. Configuring a new OpenACS Site"><link rel="previous" href="configuring-install-packages.html" title="Installing OpenACS packages"><link rel="next" href="configuring-configuring-packages.html" title="Configuring an OpenACS package"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><a href="http://openacs.org"><img src="/doc/images/alex.jpg" style="border:0" alt="Alex logo"></a><table width="100%" summary="Navigation header" border="0"><tr><td width="20%" align="left"><a accesskey="p" href="configuring-install-packages.html">Prev</a> </td><th width="60%" align="center">Chapter 4. Configuring a new OpenACS Site</th><td width="20%" align="right"> <a accesskey="n" href="configuring-configuring-packages.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="configuring-mounting-packages"></a>Mounting OpenACS packages</h2></div></div><div></div></div><div class="authorblurb"><p>by <a href="mailto:jade@rubick.com" target="_top">Jade Rubick</a></p>
OpenACS docs are written by the named authors, and may be edited
by OpenACS documentation staff.
</div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2931424"></a>Mounting OpenACS packages</h3></div></div><div></div></div><p>After you've installed your packages, you have to 'mount'
them in order to make them appear on your website.</p><p>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
like the application to be available at.</p><p>Subsites are a way of dividing your website into logical
chunks. Often they represent different groups of users, or parts
of an organization. </p><p>Now click on 'Applications' (applications are the same
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
done.</p><p>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
available at http://www.yoursite.com/calendar. If you installed
it at a subsite that has a URL intranet, then it would be
located at http://www.yoursite.com/intranet/calendar.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="configuring-install-packages.html">Prev</a> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right"> <a accesskey="n" href="configuring-configuring-packages.html">Next</a></td></tr><tr><td width="40%" align="left">Installing OpenACS packages </td><td width="20%" align="center"><a accesskey="u" href="configuring-new-site.html">Up</a></td><td width="40%" align="right"> Configuring an OpenACS package</td></tr></table><hr><address><a href="mailto:docs@openacs.org">docs@openacs.org</a></address></div><a name="comments"></a><center><a href="http://openacs.org/doc/current/configuring-mounting-packages.html#comments">View comments on this page at openacs.org</a></center></body></html>
#!/bin/sh
# run this file from ../packages to renumber all .info version numbers
# call as bash update-info.sh <new-version> <release-date>
# this will update all version numbers to new-version
# and release dates to release-date
# it should catch any valid openacs version numbers
# for example 5.2.0
# 5.2.0a1
# 5.2.0b1
# 5.2.0d1
#---------------------------------------------------------------------
# here's what we're looking for
#---------------------------------------------------------------------
# <version name="5.1.0d1" url="http:blahblah/acs-kernel-5.1.0d1.apm">
# <provides url="acs-kernel" version="5.1.0d1"/>
# <requires url="acs-kernel" version="5.0.0b4"/>
# 2006-01-08 daveb
#
# changing requires statements is new
# all the core packages should require only core packages
# and it makes sense to require core packages of the same version
#---------------------------------------------------------------------
for dir in `find -name *.info`
do
perl -p -i -e "s/name=\"\d\.\d\.\d\w?\d?\"/name=\"${1}\"/" $dir
perl -p -i -e "s/-\d\.\d\.\d\w?\d?.apm\"/-${1}.apm\"/" $dir
perl -p -i -e "s/(provides.*version)=\"\d\.\d\.\d\w?\d?\"/\1=\"${1}\"/" $dir
perl -p -i -e "s/(requires.*version)=\"\d\.\d\.\d\w?\d?\"/\1=\"${1}\"/" $dir
perl -p -i -e "s/(<release-date>)\d{4}-\d{2}-\d{2}/<release-date>${2}/" $dir
done
\ No newline at end of file
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 'http://www.w3.org/TR/html4/loose.dtd"'>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>OpenACS Edit This Page Templates</title><link rel="stylesheet" href="openacs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="OpenACS Core Documentation"><link rel="up" href="tutorial-advanced.html" title="Chapter 10. Advanced Topics"><link rel="previous" href="tutorial-cvs.html" title="Add the new package to CVS"><link rel="next" href="tutorial-comments.html" title="Adding Comments"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><a href="http://openacs.org"><img src="/doc/images/alex.jpg" style="border:0" alt="Alex logo"></a><table width="100%" summary="Navigation header" border="0"><tr><td width="20%" align="left"><a accesskey="p" href="tutorial-cvs.html">Prev</a> </td><th width="60%" align="center">Chapter 10. Advanced Topics</th><td width="20%" align="right"> <a accesskey="n" href="tutorial-comments.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="tutorial-etp-templates"></a>OpenACS Edit This Page Templates</h2></div></div><div></div></div><div class="authorblurb"><p>by <a href="mailto:ncarroll@ee.usyd.edu.au" target="_top">Nick Carroll</a></p>
OpenACS docs are written by the named authors, and may be edited
by OpenACS documentation staff.
</div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="goals"></a>Goals</h3></div></div><div></div></div><div class="itemizedlist"><ul type="disc"><li><p>Learn about the OpenACS templating system.</p></li><li><p>Learn about subsites and site-map administration.</p></li></ul></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="introduction"></a>Introduction</h3></div></div><div></div></div><p>
The OpenACS templating system allows you to give your site a consistent look and feel. It also promotes code maintainability in the presentation layer, by allowing presentation components to be reused across multiple pages. If you need to change the layout for some reason, then you only need to make that change in one location, instead of across many files.
</p><p>
In this problem set you will familiarise yourself with the templating system in openacs. This will be achieved through customising an existing edit-this-page application template.
</p><p>
Before proceeding, it is strongly advised to read the templating documentation on your openacs installation (http://localhost:8000/doc/acs-templating). The documentation lists the special tags available for ADP files.
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="exercise1"></a>Exercise 1: Create a Subsite</h3></div></div><div></div></div><div class="itemizedlist"><ul type="disc"><li><p>Create a subsite called pset3.</p></li><li><p>A subsite is simply a directory or subdirectory mounted at the end of your domain name. This can be done in one of two places:</p><div class="itemizedlist"><ul type="circle"><li><p>http://localhost:8000/admin/site-map</p></li><li><p>or the subsite admin form on the main site, which is available when you login to your OpenACS installation.</p></li></ul></div></li></ul></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="exercise2"></a>Exercise 2: Checkout and Install edit-this-page (ETP)</h3></div></div><div></div></div><div class="itemizedlist"><ul type="disc"><li><p>Checkout ETP from CVS:</p><pre class="screen">cd ~/openacs/packages
cvs -d:pserver:anonymous@openacs.org:/cvsroot login
cvs -d:pserver:anonymous@openacs.org:/cvsroot co edit-this-page</pre></li><li><p>Go to the package manager at http://yoursite/acs-admin/apm. And install the new package: edit-this-page.</p></li><li><p>Or use the &quot;Add Application&quot; form available on the Main site.</p></li></ul></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="exercise3"></a>Change ETP Application</h3></div></div><div></div></div><div class="itemizedlist"><ul type="disc"><li><p>Work out how to change the ETP application.</p></li><li><p>Investigate each of the available ETP templates:</p><div class="itemizedlist"><ul type="circle"><li><p>Default</p></li><li><p>News</p></li><li><p>FAQ</p></li></ul></div></li></ul></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="exercise4"></a>Exercise 4: Create a New ETP Template</h3></div></div><div></div></div><div class="itemizedlist"><ul type="disc"><li><p>Browse the files for each of the above ETP templates at:</p><pre class="screen">cd ~/openacs/packages/edit-this-page/templates</pre></li><li><p>Use the article template as the basis of our new col2 template.</p><pre class="screen">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</pre></li><li><p>The template should provide us with the following ETP layout:</p><div class="table"><a name="id3013801"></a><p class="title"><b>Table 10.1. table showing ETP layout</b></p><table summary="table showing ETP layout" cellspacing="0" border="1" width="250"><colgroup><col align="left"><col align="left"></colgroup><tbody><tr><td colspan="2" align="center">Header</td></tr><tr height="200"><td align="left">Sidebar</td><td align="left">Main Content Pane</td></tr></tbody></table></div></li><li><p>The &quot;Main Content&quot; pane should contain the editable content that ETP provides.</p></li><li><p>The &quot;Header&quot; should display the title of the page that you set in ETP.</p></li><li><p>The &quot;Sidebar&quot; should display the extlinks that you add as a content item in ETP.</p></li></ul></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="exercise5"></a>Exercise 5: Register the col2 Template with ETP</h3></div></div><div></div></div><div class="itemizedlist"><ul type="disc"><li><p>Need to register your template with ETP so that it appears in the drop-down menu that you would have seen in Exercise 3.</p><pre class="screen">cd ~/openacs/packages/edit-this-page/tcl
emacs etp-custom-init.tcl</pre></li><li><p>Use the function etp::define_application to register your template with ETP</p><div class="itemizedlist"><ul type="circle"><li><p>Uncomment the &quot;asc&quot; definition</p></li><li><p>Set allow_extlinks to true, the rest should be false.</p></li></ul></div></li><li><p>Restart your server for the changes to take effect.</p></li></ul></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="exercise6"></a>Exercise 6: Configure ETP to use the col2 Template</h3></div></div><div></div></div><div class="itemizedlist"><ul type="disc"><li><p>Configure your ETP instance at /lab4/index to use the col2 template.</p></li><li><p>Create external links to link to other mounted ETP instances.</p></li><li><p>Check that your external links show up in the sidebar when you view your ETP application using the col2 template.</p></li></ul></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="end"></a>Who Wrote This and When</h3></div></div><div></div></div><p>This problem set was originally written by <a href="http://www.weg.ee.usyd.edu.au/people/ncarroll" target="_top">Nick Carroll</a> in August 2004 for the <a href="http://www.usyd.edu.au" target="_top">University of Sydney</a> Course <a href="http://www.weg.ee.usyd.edu.au/courses/ebus5002" target="_top">EBUS5002</a>.</p><p>This material is copyright 2004 by Nick Carroll. It may be copied, reused, and modified, provided credit is given to the original author.</p><div class="cvstag">($Id$)</div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="tutorial-cvs.html">Prev</a> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right"> <a accesskey="n" href="tutorial-comments.html">Next</a></td></tr><tr><td width="40%" align="left">Add the new package to CVS </td><td width="20%" align="center"><a accesskey="u" href="tutorial-advanced.html">Up</a></td><td width="40%" align="right"> Adding Comments</td></tr></table><hr><address><a href="mailto:docs@openacs.org">docs@openacs.org</a></address></div><a name="comments"></a><center><a href="http://openacs.org/doc/current/tutorial-etp-templates.html#comments">View comments on this page at openacs.org</a></center></body></html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 'http://www.w3.org/TR/html4/loose.dtd"'>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Adding in parameters for your package</title><link rel="stylesheet" href="openacs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="OpenACS Core Documentation"><link rel="up" href="tutorial-advanced.html" title="Chapter 10. Advanced Topics"><link rel="previous" href="tutorial-wysiwyg-editor.html" title="Enabling WYSIWYG"><link rel="next" href="tutorial-upgrade-scripts.html" title="Writing upgrade scripts"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><a href="http://openacs.org"><img src="/doc/images/alex.jpg" style="border:0" alt="Alex logo"></a><table width="100%" summary="Navigation header" border="0"><tr><td width="20%" align="left"><a accesskey="p" href="tutorial-wysiwyg-editor.html">Prev</a> </td><th width="60%" align="center">Chapter 10. Advanced Topics</th><td width="20%" align="right"> <a accesskey="n" href="tutorial-upgrade-scripts.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="tutorial-parameters"></a>Adding in parameters for your package</h2></div></div><div></div></div><p>Each instance of a package can have paramaters associated
with it. These are like preferences, and they can be set by the
administrator for each application to change the behavior of your
application. </p><p>To add parameters for your package, go to the Automatic
Package Manager (/acs-admin/apm)</p><p>Click on your package</p><p>Under the Manage section, click on Parameters</p><p>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.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="tutorial-wysiwyg-editor.html">Prev</a> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right"> <a accesskey="n" href="tutorial-upgrade-scripts.html">Next</a></td></tr><tr><td width="40%" align="left">Enabling WYSIWYG </td><td width="20%" align="center"><a accesskey="u" href="tutorial-advanced.html">Up</a></td><td width="40%" align="right"> Writing upgrade scripts</td></tr></table><hr><address><a href="mailto:docs@openacs.org">docs@openacs.org</a></address></div><a name="comments"></a><center><a href="http://openacs.org/doc/current/tutorial-parameters.html#comments">View comments on this page at openacs.org</a></center></body></html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 'http://www.w3.org/TR/html4/loose.dtd"'>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Writing upgrade scripts</title><link rel="stylesheet" href="openacs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="OpenACS Core Documentation"><link rel="up" href="tutorial-advanced.html" title="Chapter 10. Advanced Topics"><link rel="previous" href="tutorial-parameters.html" title="Adding in parameters for your package"><link rel="next" href="tutorial-second-database.html" title="Connect to a second database"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><a href="http://openacs.org"><img src="/doc/images/alex.jpg" style="border:0" alt="Alex logo"></a><table width="100%" summary="Navigation header" border="0"><tr><td width="20%" align="left"><a accesskey="p" href="tutorial-parameters.html">Prev</a> </td><th width="60%" align="center">Chapter 10. Advanced Topics</th><td width="20%" align="right"> <a accesskey="n" href="tutorial-second-database.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="tutorial-upgrade-scripts"></a>Writing upgrade scripts</h2></div></div><div></div></div><div class="authorblurb"><p>by <a href="mailto:jade@rubick.com" target="_top">Jade Rubick</a></p>
OpenACS docs are written by the named authors, and may be edited
by OpenACS documentation staff.
</div><p>If your package changes its data model, you have to write an
upgrade script. This is very easy in OpenACS. </p><p>First, you want to make sure you change the original .sql
file so that new installation will have the new data model.</p><p>Next, check what version your package is currently at. For
example, it may be at version 1.0b1. Create a file in
sql/postgres/upgrade called packagename-1.0b1-1.0b2.sql and put
the SQL code that will update the data model. For example, if you
add in a column, you would have an alter table add column
statement in this file. Test this out very well, because data
model changes are more serious and fundamental changes than the
program .tcl files. </p><p>Now use the APM to create a new package version
1.0b2. Commit all your changes, tag the release
(<a href="tutorial-upgrades.html" title="Distributing upgrades of your package">Section , “Distributing upgrades of your package”</a>),
and both new installations and upgrades
will be taken care of.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="tutorial-parameters.html">Prev</a> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right"> <a accesskey="n" href="tutorial-second-database.html">Next</a></td></tr><tr><td width="40%" align="left">Adding in parameters for your package </td><td width="20%" align="center"><a accesskey="u" href="tutorial-advanced.html">Up</a></td><td width="40%" align="right"> Connect to a second database</td></tr></table><hr><address><a href="mailto:docs@openacs.org">docs@openacs.org</a></address></div><a name="comments"></a><center><a href="http://openacs.org/doc/current/tutorial-upgrade-scripts.html#comments">View comments on this page at openacs.org</a></center></body></html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 'http://www.w3.org/TR/html4/loose.dtd"'>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Distributing upgrades of your package</title><link rel="stylesheet" href="openacs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="OpenACS Core Documentation"><link rel="up" href="tutorial-advanced.html" title="Chapter 10. Advanced Topics"><link rel="previous" href="tutorial-distribute.html" title="Prepare the package for distribution."><link rel="next" href="tutorial-notifications.html" title="Notifications"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><a href="http://openacs.org"><img src="/doc/images/alex.jpg" style="border:0" alt="Alex logo"></a><table width="100%" summary="Navigation header" border="0"><tr><td width="20%" align="left"><a accesskey="p" href="tutorial-distribute.html">Prev</a> </td><th width="60%" align="center">Chapter 10. Advanced Topics</th><td width="20%" align="right"> <a accesskey="n" href="tutorial-notifications.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="tutorial-upgrades"></a>Distributing upgrades of your package</h2></div></div><div></div></div><div class="authorblurb"><p>by Jade Rubick</p>
OpenACS docs are written by the named authors, and may be edited
by OpenACS documentation staff.
</div><p>The OpenACS Package Repository builds a list of packages
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. </p><p>For the sake of this example, let's assume you are the
package owner of the <tt class="computeroutput">notes</tt>
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.</p><p>To release your package:</p><pre class="screen">cd /path/to/notes
cvs commit -m &quot;Update package to version 1.6.&quot;
cvs tag notes-1-6-final
cvs tag -F openacs-5-1-compat
</pre><p>Of course, make sure you write upgrade scripts
(<a href="tutorial-upgrade-scripts.html" title="Writing upgrade scripts">Section , “Writing upgrade scripts”</a>)</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="tutorial-distribute.html">Prev</a> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right"> <a accesskey="n" href="tutorial-notifications.html">Next</a></td></tr><tr><td width="40%" align="left">Prepare the package for distribution. </td><td width="20%" align="center"><a accesskey="u" href="tutorial-advanced.html">Up</a></td><td width="40%" align="right"> Notifications</td></tr></table><hr><address><a href="mailto:docs@openacs.org">docs@openacs.org</a></address></div><a name="comments"></a><center><a href="http://openacs.org/doc/current/tutorial-upgrades.html#comments">View comments on this page at openacs.org</a></center></body></html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 'http://www.w3.org/TR/html4/loose.dtd"'>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Enabling WYSIWYG</title><link rel="stylesheet" href="openacs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="OpenACS Core Documentation"><link rel="up" href="tutorial-advanced.html" title="Chapter 10. Advanced Topics"><link rel="previous" href="tutorial-schedule-procs.html" title="Scheduled Procedures"><link rel="next" href="tutorial-parameters.html" title="Adding in parameters for your package"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><a href="http://openacs.org"><img src="/doc/images/alex.jpg" style="border:0" alt="Alex logo"></a><table width="100%" summary="Navigation header" border="0"><tr><td width="20%" align="left"><a accesskey="p" href="tutorial-schedule-procs.html">Prev</a> </td><th width="60%" align="center">Chapter 10. Advanced Topics</th><td width="20%" align="right"> <a accesskey="n" href="tutorial-parameters.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="tutorial-wysiwyg-editor"></a>Enabling WYSIWYG</h2></div></div><div></div></div><div class="authorblurb"><p>by <a href="mailto:nima.mazloumi@gmx.de" target="_top">Nima Mazloumi</a></p>
OpenACS docs are written by the named authors, and may be edited
by OpenACS documentation staff.
</div><p>Most of the forms in OpenACS are created using the form builder, see <a href="form-builder.html" title="Using Form Builder: building html forms dynamically">Section , “Using Form Builder: building html forms dynamically”</a>. For detailed information on the
API take a look <a href="/api-doc/proc-view?proc=ad_form" target="_top">here</a>.</p><p>The following section shows how you can modify your form to allow WYSIWYG functionalities.</p><p>Convert your page to use <font color="red">&lt;code&gt;ad_form&lt;/code&gt;</font> (some changes but worth it)</p><p>Here an examples. From:</p><pre class="programlisting">
template::form create my_form
template::element create my_form my_form_id -label &quot;The ID&quot; -datatype integer -widget hidden
template::element create my_form my_input_field_1 -html { size 30 } -label &quot;Label 1&quot; -datatype text -optional
template::element create my_form my_input_field_2 -label &quot;Label 2&quot; -datatype text -help_text &quot;Some Help&quot; -after_html {&lt;a name=&quot;#&quot;&gt;Anchor&lt;/a&gt;}
</pre><p>To:</p><pre class="programlisting">
ad_form -name my_form -form {
my_form_id:key(acs_object_id_seq)
{my_input_field_1:text,optional
{label &quot;Label 1&quot;}
{html {size 30}}}
{my_input_field_2:text
{label &quot;Label 2&quot;}
{help_text &quot;Some Help&quot;}
{after_html
{&lt;a name=&quot;#&quot;&gt;Anchor&lt;/a&gt;}}}
} ...
</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>You must not give your your form the same name that your page has. Otherwise HTMLArea won't load.</p></div><p>Convert your textarea widget to a richtext widget and enable htmlarea.</p><p>The <font color="red">&lt;code&gt;htmlarea_p&lt;/code&gt;</font>-flag can be used to prevent
WYSIWYG functionality. Defaults to true if left away.</p><p>From:</p><pre class="programlisting">
{my_input_field_2:text
</pre><p>To:</p><pre class="programlisting">
{my_input_field_2:richtext(richtext)
{htmlarea_p &quot;t&quot;}
</pre><p>The richtext widget presents a list with two elements: text and content type.
To learn more on existing content types search in Google for &quot;MIME-TYPES&quot; or
take a look at the <font color="red">&lt;code&gt;cr_mime_types&lt;/code&gt;</font> table.</p><p>Make sure that both values are passed as a list to your
<font color="red">&lt;code&gt;ad_form&lt;/code&gt;</font> or you will have problems
displaying the content or handling the data manipulation correctly.</p><p>Depending on the data model of your package you either support a content format
or don't. If you don't you can assume <font color="red">&lt;code&gt;&quot;text/html&quot;&lt;/code&gt;</font> or
<font color="red">&lt;code&gt;&quot;text/richtext&quot;&lt;/code&gt;</font> or <font color="red">&lt;code&gt;&quot;text/enhanced&quot;&lt;/code&gt;</font>.</p><p>The relevant parts in your <font color="red">&lt;code&gt;ad_form&lt;/code&gt;</font> definition are the
switches <font color="red">&lt;code&gt;-new_data&lt;/code&gt;</font>, <font color="red">&lt;code&gt;-edit_data&lt;/code&gt;</font>,
<font color="red">&lt;code&gt;-on_request&lt;/code&gt;</font> and <font color="red">&lt;code&gt;-on_submit&lt;/code&gt;</font>.</p><p>To allow your data to display correctly you need to add an <font color="red">&lt;code&gt;-on_request&lt;/code&gt;</font> block.
If you have the format stored in the database pass this as well else use <font color="red">&lt;code&gt;&quot;text/html&quot;&lt;/code&gt;</font>:</p><pre class="programlisting">
set my_input_field_2 [template::util::richtext::create $my_input_field_2 &quot;text/html&quot;]
</pre><p>Now make sure that your SQL queries that do the data manipulation retrieve the correct value.
If you simply use <font color="red">&lt;code&gt;my_input_field_2&lt;/code&gt;</font> you will store a list.
Thus you need to add an <font color="red">&lt;code&gt;-on_submit&lt;/code&gt;</font> block:</p><pre class="programlisting">
set my_input_field_2 [ template::util::richtext::get_property contents $my_input_field_2]
set format [ template::util::richtext::get_property format $my_input_field_2] #This is optional
</pre><p>Now the correct values for <font color="red">&lt;code&gt;my_input_field_2&lt;/code&gt;</font> and
<font color="red">&lt;code&gt;format&lt;/code&gt;</font> are passed to the <font color="red">&lt;code&gt;-new_data&lt;/code&gt;</font> and
<font color="red">&lt;code&gt;-edit_data&lt;/code&gt;</font> blocks which don't need to get touched.</p><p>To make HTMLArea optional per package instance define a string parameter
<font color="red">&lt;code&gt;UseWysiwygP&lt;/code&gt;</font> which defaults <font color="red">&lt;code&gt;0&lt;/code&gt;</font> for your
package using the APM.</p><p>In your edit page make the following changes</p><pre class="programlisting">
# Is WYSIWYG enabled?
set use_wysiwyg_p [parameter::get -parameter &quot;UseWysiwygP&quot; -default &quot;f&quot;]
...
{htmlarea_p $use_wysiwyg_p}
</pre><p>The <font color="red">&lt;code&gt;-on_request&lt;/code&gt;</font> switch should set this value for your form.</p><pre class="programlisting">
set htmlarea_p $use_wysiwyg_p
</pre><p>All you need now is a configuration page where the user can change this setting. Create a
<font color="red">&lt;code&gt;configure.tcl&lt;/code&gt;</font> file:</p><pre class="programlisting">
ad_page_contract {
This page allows a faq admin to change the UseWysiwygP setting
} {
{return_url &quot;&quot;}
}
set title &quot;Should we support WYSIWYG?&quot;
set context [list $title]
set use_wysiwyg_p
ad_form -name categories_mode -form {
{enabled_p:text(radio)
{label &quot;Enable WYSIWYG&quot;}
{options {{Yes t} {No f}}}
{value $use_wysiwyg_p}
}
{return_url:text(hidden) {value $return_url}}
{submit:text(submit) {label &quot;Change&quot;}}
} -on_submit {
parameter::set_value -parameter &quot;UseWysiwygP&quot; -value $enabled_p
if {![empty_string_p $return_url]} {
ns_returnredirect $return_url
}
}
</pre><p>In the corresponding ADP file write</p><pre class="programlisting">
&lt;master&gt;
&lt;property name=&quot;title&quot;&gt;@title@&lt;/property&gt;
&lt;property name=&quot;context&quot;&gt;@context@&lt;/property&gt;
&lt;formtemplate id=&quot;categories_mode&quot;&gt;&lt;/formtemplate&gt;
</pre><p>And finally reference this page from your admin page</p><pre class="programlisting">
#TCL:
set return_url [ad_conn url]
#ADP:
&lt;a href=configure?&lt;%=[export_url_vars return_url]%&gt;&gt;Configure&lt;/a&gt;
</pre></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="tutorial-schedule-procs.html">Prev</a> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right"> <a accesskey="n" href="tutorial-parameters.html">Next</a></td></tr><tr><td width="40%" align="left">Scheduled Procedures </td><td width="20%" align="center"><a accesskey="u" href="tutorial-advanced.html">Up</a></td><td width="40%" align="right"> Adding in parameters for your package</td></tr></table><hr><address><a href="mailto:docs@openacs.org">docs@openacs.org</a></address></div><a name="comments"></a><center><a href="http://openacs.org/doc/current/tutorial-wysiwyg-editor.html#comments">View comments on this page at openacs.org</a></center></body></html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment