<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 'http://www.w3.org/TR/html4/loose.dtd"'>
<html><head><metahttp-equiv="Content-Type"content="text/html; charset=UTF-8"><title>Configuring an OpenACS package</title><linkrel="stylesheet"href="openacs.css"type="text/css"><metaname="generator"content="DocBook XSL Stylesheets V1.60.1"><linkrel="home"href="index.html"title="OpenACS Core Documentation"><linkrel="up"href="configuring-new-site.html"title="Chapter 4. Configuring a new OpenACS Site"><linkrel="previous"href="configuring-mounting-packages.html"title="Mounting OpenACS packages"><linkrel="next"href="configuring-configuring-permissions.html"title="Setting Permissions on an OpenACS package"></head><bodybgcolor="white"text="black"link="#0000FF"vlink="#840084"alink="#0000FF"><divclass="navheader"><ahref="http://openacs.org"><imgsrc="/doc/images/alex.jpg"style="border:0"alt="Alex logo"></a><tablewidth="100%"summary="Navigation header"border="0"><tr><tdwidth="20%"align="left"><aaccesskey="p"href="configuring-mounting-packages.html">Prev</a></td><thwidth="60%"align="center">Chapter 4. Configuring a new OpenACS Site</th><tdwidth="20%"align="right"><aaccesskey="n"href="configuring-configuring-permissions.html">Next</a></td></tr></table><hr></div><divclass="sect1"lang="en"><divclass="titlepage"><div><div><h2class="title"style="clear: both"><aname="configuring-configuring-packages"></a>Configuring an OpenACS package</h2></div></div><div></div></div><divclass="authorblurb"><p>by <ahref="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><divclass="sect2"lang="en"><divclass="titlepage"><div><div><h3class="title"><aname="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><divclass="navfooter"><hr><tablewidth="100%"summary="Navigation footer"><tr><tdwidth="40%"align="left"><aaccesskey="p"href="configuring-mounting-packages.html">Prev</a></td><tdwidth="20%"align="center"><aaccesskey="h"href="index.html">Home</a></td><tdwidth="40%"align="right"><aaccesskey="n"href="configuring-configuring-permissions.html">Next</a></td></tr><tr><tdwidth="40%"align="left">Mounting OpenACS packages </td><tdwidth="20%"align="center"><aaccesskey="u"href="configuring-new-site.html">Up</a></td><tdwidth="40%"align="right"> Setting Permissions on an OpenACS package</td></tr></table><hr><address><ahref="mailto:docs@openacs.org">docs@openacs.org</a></address></div><aname="comments"></a><center><ahref="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><metahttp-equiv="Content-Type"content="text/html; charset=UTF-8"><title>Setting Permissions on an OpenACS package</title><linkrel="stylesheet"href="openacs.css"type="text/css"><metaname="generator"content="DocBook XSL Stylesheets V1.60.1"><linkrel="home"href="index.html"title="OpenACS Core Documentation"><linkrel="up"href="configuring-new-site.html"title="Chapter 4. Configuring a new OpenACS Site"><linkrel="previous"href="configuring-configuring-packages.html"title="Configuring an OpenACS package"><linkrel="next"href="how-do-I.html"title="How Do I?"></head><bodybgcolor="white"text="black"link="#0000FF"vlink="#840084"alink="#0000FF"><divclass="navheader"><ahref="http://openacs.org"><imgsrc="/doc/images/alex.jpg"style="border:0"alt="Alex logo"></a><tablewidth="100%"summary="Navigation header"border="0"><tr><tdwidth="20%"align="left"><aaccesskey="p"href="configuring-configuring-packages.html">Prev</a></td><thwidth="60%"align="center">Chapter 4. Configuring a new OpenACS Site</th><tdwidth="20%"align="right"><aaccesskey="n"href="how-do-I.html">Next</a></td></tr></table><hr></div><divclass="sect1"lang="en"><divclass="titlepage"><div><div><h2class="title"style="clear: both"><aname="configuring-configuring-permissions"></a>Setting Permissions on an OpenACS package</h2></div></div><div></div></div><divclass="authorblurb"><p>by <ahref="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><divclass="sect2"lang="en"><divclass="titlepage"><div><div><h3class="title"><aname="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><divclass="navfooter"><hr><tablewidth="100%"summary="Navigation footer"><tr><tdwidth="40%"align="left"><aaccesskey="p"href="configuring-configuring-packages.html">Prev</a></td><tdwidth="20%"align="center"><aaccesskey="h"href="index.html">Home</a></td><tdwidth="40%"align="right"><aaccesskey="n"href="how-do-I.html">Next</a></td></tr><tr><tdwidth="40%"align="left">Configuring an OpenACS package </td><tdwidth="20%"align="center"><aaccesskey="u"href="configuring-new-site.html">Up</a></td><tdwidth="40%"align="right"> How Do I?</td></tr></table><hr><address><ahref="mailto:docs@openacs.org">docs@openacs.org</a></address></div><aname="comments"></a><center><ahref="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><metahttp-equiv="Content-Type"content="text/html; charset=UTF-8"><title>Installing OpenACS packages</title><linkrel="stylesheet"href="openacs.css"type="text/css"><metaname="generator"content="DocBook XSL Stylesheets V1.60.1"><linkrel="home"href="index.html"title="OpenACS Core Documentation"><linkrel="up"href="configuring-new-site.html"title="Chapter 4. Configuring a new OpenACS Site"><linkrel="previous"href="configuring-new-site.html"title="Chapter 4. Configuring a new OpenACS Site"><linkrel="next"href="configuring-mounting-packages.html"title="Mounting OpenACS packages"></head><bodybgcolor="white"text="black"link="#0000FF"vlink="#840084"alink="#0000FF"><divclass="navheader"><ahref="http://openacs.org"><imgsrc="/doc/images/alex.jpg"style="border:0"alt="Alex logo"></a><tablewidth="100%"summary="Navigation header"border="0"><tr><tdwidth="20%"align="left"><aaccesskey="p"href="configuring-new-site.html">Prev</a></td><thwidth="60%"align="center">Chapter 4. Configuring a new OpenACS Site</th><tdwidth="20%"align="right"><aaccesskey="n"href="configuring-mounting-packages.html">Next</a></td></tr></table><hr></div><divclass="sect1"lang="en"><divclass="titlepage"><div><div><h2class="title"style="clear: both"><aname="configuring-install-packages"></a>Installing OpenACS packages</h2></div></div><div></div></div><divclass="authorblurb"><p>by <ahref="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><divclass="sect2"lang="en"><divclass="titlepage"><div><div><h3class="title"><aname="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:
<ahref="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><divclass="navfooter"><hr><tablewidth="100%"summary="Navigation footer"><tr><tdwidth="40%"align="left"><aaccesskey="p"href="configuring-new-site.html">Prev</a></td><tdwidth="20%"align="center"><aaccesskey="h"href="index.html">Home</a></td><tdwidth="40%"align="right"><aaccesskey="n"href="configuring-mounting-packages.html">Next</a></td></tr><tr><tdwidth="40%"align="left">Chapter 4. Configuring a new OpenACS Site </td><tdwidth="20%"align="center"><aaccesskey="u"href="configuring-new-site.html">Up</a></td><tdwidth="40%"align="right"> Mounting OpenACS packages</td></tr></table><hr><address><ahref="mailto:docs@openacs.org">docs@openacs.org</a></address></div><aname="comments"></a><center><ahref="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><metahttp-equiv="Content-Type"content="text/html; charset=UTF-8"><title>Mounting OpenACS packages</title><linkrel="stylesheet"href="openacs.css"type="text/css"><metaname="generator"content="DocBook XSL Stylesheets V1.60.1"><linkrel="home"href="index.html"title="OpenACS Core Documentation"><linkrel="up"href="configuring-new-site.html"title="Chapter 4. Configuring a new OpenACS Site"><linkrel="previous"href="configuring-install-packages.html"title="Installing OpenACS packages"><linkrel="next"href="configuring-configuring-packages.html"title="Configuring an OpenACS package"></head><bodybgcolor="white"text="black"link="#0000FF"vlink="#840084"alink="#0000FF"><divclass="navheader"><ahref="http://openacs.org"><imgsrc="/doc/images/alex.jpg"style="border:0"alt="Alex logo"></a><tablewidth="100%"summary="Navigation header"border="0"><tr><tdwidth="20%"align="left"><aaccesskey="p"href="configuring-install-packages.html">Prev</a></td><thwidth="60%"align="center">Chapter 4. Configuring a new OpenACS Site</th><tdwidth="20%"align="right"><aaccesskey="n"href="configuring-configuring-packages.html">Next</a></td></tr></table><hr></div><divclass="sect1"lang="en"><divclass="titlepage"><div><div><h2class="title"style="clear: both"><aname="configuring-mounting-packages"></a>Mounting OpenACS packages</h2></div></div><div></div></div><divclass="authorblurb"><p>by <ahref="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><divclass="sect2"lang="en"><divclass="titlepage"><div><div><h3class="title"><aname="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><divclass="navfooter"><hr><tablewidth="100%"summary="Navigation footer"><tr><tdwidth="40%"align="left"><aaccesskey="p"href="configuring-install-packages.html">Prev</a></td><tdwidth="20%"align="center"><aaccesskey="h"href="index.html">Home</a></td><tdwidth="40%"align="right"><aaccesskey="n"href="configuring-configuring-packages.html">Next</a></td></tr><tr><tdwidth="40%"align="left">Installing OpenACS packages </td><tdwidth="20%"align="center"><aaccesskey="u"href="configuring-new-site.html">Up</a></td><tdwidth="40%"align="right"> Configuring an OpenACS package</td></tr></table><hr><address><ahref="mailto:docs@openacs.org">docs@openacs.org</a></address></div><aname="comments"></a><center><ahref="http://openacs.org/doc/current/configuring-mounting-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><metahttp-equiv="Content-Type"content="text/html; charset=UTF-8"><title>OpenACS Edit This Page Templates</title><linkrel="stylesheet"href="openacs.css"type="text/css"><metaname="generator"content="DocBook XSL Stylesheets V1.60.1"><linkrel="home"href="index.html"title="OpenACS Core Documentation"><linkrel="up"href="tutorial-advanced.html"title="Chapter 10. Advanced Topics"><linkrel="previous"href="tutorial-cvs.html"title="Add the new package to CVS"><linkrel="next"href="tutorial-comments.html"title="Adding Comments"></head><bodybgcolor="white"text="black"link="#0000FF"vlink="#840084"alink="#0000FF"><divclass="navheader"><ahref="http://openacs.org"><imgsrc="/doc/images/alex.jpg"style="border:0"alt="Alex logo"></a><tablewidth="100%"summary="Navigation header"border="0"><tr><tdwidth="20%"align="left"><aaccesskey="p"href="tutorial-cvs.html">Prev</a></td><thwidth="60%"align="center">Chapter 10. Advanced Topics</th><tdwidth="20%"align="right"><aaccesskey="n"href="tutorial-comments.html">Next</a></td></tr></table><hr></div><divclass="sect1"lang="en"><divclass="titlepage"><div><div><h2class="title"style="clear: both"><aname="tutorial-etp-templates"></a>OpenACS Edit This Page Templates</h2></div></div><div></div></div><divclass="authorblurb"><p>by <ahref="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><divclass="sect2"lang="en"><divclass="titlepage"><div><div><h3class="title"><aname="goals"></a>Goals</h3></div></div><div></div></div><divclass="itemizedlist"><ultype="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><divclass="sect2"lang="en"><divclass="titlepage"><div><div><h3class="title"><aname="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><divclass="sect2"lang="en"><divclass="titlepage"><div><div><h3class="title"><aname="exercise1"></a>Exercise 1: Create a Subsite</h3></div></div><div></div></div><divclass="itemizedlist"><ultype="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><divclass="itemizedlist"><ultype="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><divclass="sect2"lang="en"><divclass="titlepage"><div><div><h3class="title"><aname="exercise2"></a>Exercise 2: Checkout and Install edit-this-page (ETP)</h3></div></div><div></div></div><divclass="itemizedlist"><ultype="disc"><li><p>Checkout ETP from CVS:</p><preclass="screen">cd ~/openacs/packages
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 "Add Application" form available on the Main site.</p></li></ul></div></div><divclass="sect2"lang="en"><divclass="titlepage"><div><div><h3class="title"><aname="exercise3"></a>Change ETP Application</h3></div></div><div></div></div><divclass="itemizedlist"><ultype="disc"><li><p>Work out how to change the ETP application.</p></li><li><p>Investigate each of the available ETP templates:</p><divclass="itemizedlist"><ultype="circle"><li><p>Default</p></li><li><p>News</p></li><li><p>FAQ</p></li></ul></div></li></ul></div></div><divclass="sect2"lang="en"><divclass="titlepage"><div><div><h3class="title"><aname="exercise4"></a>Exercise 4: Create a New ETP Template</h3></div></div><div></div></div><divclass="itemizedlist"><ultype="disc"><li><p>Browse the files for each of the above ETP templates at:</p><preclass="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><preclass="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><divclass="table"><aname="id3013801"></a><pclass="title"><b>Table 10.1. table showing ETP layout</b></p><tablesummary="table showing ETP layout"cellspacing="0"border="1"width="250"><colgroup><colalign="left"><colalign="left"></colgroup><tbody><tr><tdcolspan="2"align="center">Header</td></tr><trheight="200"><tdalign="left">Sidebar</td><tdalign="left">Main Content Pane</td></tr></tbody></table></div></li><li><p>The "Main Content" pane should contain the editable content that ETP provides.</p></li><li><p>The "Header" should display the title of the page that you set in ETP.</p></li><li><p>The "Sidebar" should display the extlinks that you add as a content item in ETP.</p></li></ul></div></div><divclass="sect2"lang="en"><divclass="titlepage"><div><div><h3class="title"><aname="exercise5"></a>Exercise 5: Register the col2 Template with ETP</h3></div></div><div></div></div><divclass="itemizedlist"><ultype="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><preclass="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><divclass="itemizedlist"><ultype="circle"><li><p>Uncomment the "asc" 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><divclass="sect2"lang="en"><divclass="titlepage"><div><div><h3class="title"><aname="exercise6"></a>Exercise 6: Configure ETP to use the col2 Template</h3></div></div><div></div></div><divclass="itemizedlist"><ultype="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><divclass="sect2"lang="en"><divclass="titlepage"><div><div><h3class="title"><aname="end"></a>Who Wrote This and When</h3></div></div><div></div></div><p>This problem set was originally written by <ahref="http://www.weg.ee.usyd.edu.au/people/ncarroll"target="_top">Nick Carroll</a> in August 2004 for the <ahref="http://www.usyd.edu.au"target="_top">University of Sydney</a> Course <ahref="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><divclass="cvstag">($Id$)</div></div></div><divclass="navfooter"><hr><tablewidth="100%"summary="Navigation footer"><tr><tdwidth="40%"align="left"><aaccesskey="p"href="tutorial-cvs.html">Prev</a></td><tdwidth="20%"align="center"><aaccesskey="h"href="index.html">Home</a></td><tdwidth="40%"align="right"><aaccesskey="n"href="tutorial-comments.html">Next</a></td></tr><tr><tdwidth="40%"align="left">Add the new package to CVS </td><tdwidth="20%"align="center"><aaccesskey="u"href="tutorial-advanced.html">Up</a></td><tdwidth="40%"align="right"> Adding Comments</td></tr></table><hr><address><ahref="mailto:docs@openacs.org">docs@openacs.org</a></address></div><aname="comments"></a><center><ahref="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><metahttp-equiv="Content-Type"content="text/html; charset=UTF-8"><title>Adding in parameters for your package</title><linkrel="stylesheet"href="openacs.css"type="text/css"><metaname="generator"content="DocBook XSL Stylesheets V1.60.1"><linkrel="home"href="index.html"title="OpenACS Core Documentation"><linkrel="up"href="tutorial-advanced.html"title="Chapter 10. Advanced Topics"><linkrel="previous"href="tutorial-wysiwyg-editor.html"title="Enabling WYSIWYG"><linkrel="next"href="tutorial-upgrade-scripts.html"title="Writing upgrade scripts"></head><bodybgcolor="white"text="black"link="#0000FF"vlink="#840084"alink="#0000FF"><divclass="navheader"><ahref="http://openacs.org"><imgsrc="/doc/images/alex.jpg"style="border:0"alt="Alex logo"></a><tablewidth="100%"summary="Navigation header"border="0"><tr><tdwidth="20%"align="left"><aaccesskey="p"href="tutorial-wysiwyg-editor.html">Prev</a></td><thwidth="60%"align="center">Chapter 10. Advanced Topics</th><tdwidth="20%"align="right"><aaccesskey="n"href="tutorial-upgrade-scripts.html">Next</a></td></tr></table><hr></div><divclass="sect1"lang="en"><divclass="titlepage"><div><div><h2class="title"style="clear: both"><aname="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><divclass="navfooter"><hr><tablewidth="100%"summary="Navigation footer"><tr><tdwidth="40%"align="left"><aaccesskey="p"href="tutorial-wysiwyg-editor.html">Prev</a></td><tdwidth="20%"align="center"><aaccesskey="h"href="index.html">Home</a></td><tdwidth="40%"align="right"><aaccesskey="n"href="tutorial-upgrade-scripts.html">Next</a></td></tr><tr><tdwidth="40%"align="left">Enabling WYSIWYG </td><tdwidth="20%"align="center"><aaccesskey="u"href="tutorial-advanced.html">Up</a></td><tdwidth="40%"align="right"> Writing upgrade scripts</td></tr></table><hr><address><ahref="mailto:docs@openacs.org">docs@openacs.org</a></address></div><aname="comments"></a><center><ahref="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><metahttp-equiv="Content-Type"content="text/html; charset=UTF-8"><title>Writing upgrade scripts</title><linkrel="stylesheet"href="openacs.css"type="text/css"><metaname="generator"content="DocBook XSL Stylesheets V1.60.1"><linkrel="home"href="index.html"title="OpenACS Core Documentation"><linkrel="up"href="tutorial-advanced.html"title="Chapter 10. Advanced Topics"><linkrel="previous"href="tutorial-parameters.html"title="Adding in parameters for your package"><linkrel="next"href="tutorial-second-database.html"title="Connect to a second database"></head><bodybgcolor="white"text="black"link="#0000FF"vlink="#840084"alink="#0000FF"><divclass="navheader"><ahref="http://openacs.org"><imgsrc="/doc/images/alex.jpg"style="border:0"alt="Alex logo"></a><tablewidth="100%"summary="Navigation header"border="0"><tr><tdwidth="20%"align="left"><aaccesskey="p"href="tutorial-parameters.html">Prev</a></td><thwidth="60%"align="center">Chapter 10. Advanced Topics</th><tdwidth="20%"align="right"><aaccesskey="n"href="tutorial-second-database.html">Next</a></td></tr></table><hr></div><divclass="sect1"lang="en"><divclass="titlepage"><div><div><h2class="title"style="clear: both"><aname="tutorial-upgrade-scripts"></a>Writing upgrade scripts</h2></div></div><div></div></div><divclass="authorblurb"><p>by <ahref="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
(<ahref="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><divclass="navfooter"><hr><tablewidth="100%"summary="Navigation footer"><tr><tdwidth="40%"align="left"><aaccesskey="p"href="tutorial-parameters.html">Prev</a></td><tdwidth="20%"align="center"><aaccesskey="h"href="index.html">Home</a></td><tdwidth="40%"align="right"><aaccesskey="n"href="tutorial-second-database.html">Next</a></td></tr><tr><tdwidth="40%"align="left">Adding in parameters for your package </td><tdwidth="20%"align="center"><aaccesskey="u"href="tutorial-advanced.html">Up</a></td><tdwidth="40%"align="right"> Connect to a second database</td></tr></table><hr><address><ahref="mailto:docs@openacs.org">docs@openacs.org</a></address></div><aname="comments"></a><center><ahref="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><metahttp-equiv="Content-Type"content="text/html; charset=UTF-8"><title>Distributing upgrades of your package</title><linkrel="stylesheet"href="openacs.css"type="text/css"><metaname="generator"content="DocBook XSL Stylesheets V1.60.1"><linkrel="home"href="index.html"title="OpenACS Core Documentation"><linkrel="up"href="tutorial-advanced.html"title="Chapter 10. Advanced Topics"><linkrel="previous"href="tutorial-distribute.html"title="Prepare the package for distribution."><linkrel="next"href="tutorial-notifications.html"title="Notifications"></head><bodybgcolor="white"text="black"link="#0000FF"vlink="#840084"alink="#0000FF"><divclass="navheader"><ahref="http://openacs.org"><imgsrc="/doc/images/alex.jpg"style="border:0"alt="Alex logo"></a><tablewidth="100%"summary="Navigation header"border="0"><tr><tdwidth="20%"align="left"><aaccesskey="p"href="tutorial-distribute.html">Prev</a></td><thwidth="60%"align="center">Chapter 10. Advanced Topics</th><tdwidth="20%"align="right"><aaccesskey="n"href="tutorial-notifications.html">Next</a></td></tr></table><hr></div><divclass="sect1"lang="en"><divclass="titlepage"><div><div><h2class="title"style="clear: both"><aname="tutorial-upgrades"></a>Distributing upgrades of your package</h2></div></div><div></div></div><divclass="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 <ttclass="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><preclass="screen">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
</pre><p>Of course, make sure you write upgrade scripts
(<ahref="tutorial-upgrade-scripts.html"title="Writing upgrade scripts">Section , “Writing upgrade scripts”</a>)</p></div><divclass="navfooter"><hr><tablewidth="100%"summary="Navigation footer"><tr><tdwidth="40%"align="left"><aaccesskey="p"href="tutorial-distribute.html">Prev</a></td><tdwidth="20%"align="center"><aaccesskey="h"href="index.html">Home</a></td><tdwidth="40%"align="right"><aaccesskey="n"href="tutorial-notifications.html">Next</a></td></tr><tr><tdwidth="40%"align="left">Prepare the package for distribution. </td><tdwidth="20%"align="center"><aaccesskey="u"href="tutorial-advanced.html">Up</a></td><tdwidth="40%"align="right"> Notifications</td></tr></table><hr><address><ahref="mailto:docs@openacs.org">docs@openacs.org</a></address></div><aname="comments"></a><center><ahref="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><metahttp-equiv="Content-Type"content="text/html; charset=UTF-8"><title>Enabling WYSIWYG</title><linkrel="stylesheet"href="openacs.css"type="text/css"><metaname="generator"content="DocBook XSL Stylesheets V1.60.1"><linkrel="home"href="index.html"title="OpenACS Core Documentation"><linkrel="up"href="tutorial-advanced.html"title="Chapter 10. Advanced Topics"><linkrel="previous"href="tutorial-schedule-procs.html"title="Scheduled Procedures"><linkrel="next"href="tutorial-parameters.html"title="Adding in parameters for your package"></head><bodybgcolor="white"text="black"link="#0000FF"vlink="#840084"alink="#0000FF"><divclass="navheader"><ahref="http://openacs.org"><imgsrc="/doc/images/alex.jpg"style="border:0"alt="Alex logo"></a><tablewidth="100%"summary="Navigation header"border="0"><tr><tdwidth="20%"align="left"><aaccesskey="p"href="tutorial-schedule-procs.html">Prev</a></td><thwidth="60%"align="center">Chapter 10. Advanced Topics</th><tdwidth="20%"align="right"><aaccesskey="n"href="tutorial-parameters.html">Next</a></td></tr></table><hr></div><divclass="sect1"lang="en"><divclass="titlepage"><div><div><h2class="title"style="clear: both"><aname="tutorial-wysiwyg-editor"></a>Enabling WYSIWYG</h2></div></div><div></div></div><divclass="authorblurb"><p>by <ahref="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 <ahref="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 <ahref="/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 <fontcolor="red"><code>ad_form</code></font> (some changes but worth it)</p><p>Here an examples. From:</p><preclass="programlisting">
</pre><divclass="warning"style="margin-left: 0.5in; margin-right: 0.5in;"><h3class="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 <fontcolor="red"><code>htmlarea_p</code></font>-flag can be used to prevent
WYSIWYG functionality. Defaults to true if left away.</p><p>From:</p><preclass="programlisting">
{my_input_field_2:text
</pre><p>To:</p><preclass="programlisting">
{my_input_field_2:richtext(richtext)
{htmlarea_p "t"}
</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 "MIME-TYPES" or
take a look at the <fontcolor="red"><code>cr_mime_types</code></font> table.</p><p>Make sure that both values are passed as a list to your
<fontcolor="red"><code>ad_form</code></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 <fontcolor="red"><code>"text/html"</code></font> or
<fontcolor="red"><code>"text/richtext"</code></font> or <fontcolor="red"><code>"text/enhanced"</code></font>.</p><p>The relevant parts in your <fontcolor="red"><code>ad_form</code></font> definition are the
<fontcolor="red"><code>-on_request</code></font> and <fontcolor="red"><code>-on_submit</code></font>.</p><p>To allow your data to display correctly you need to add an <fontcolor="red"><code>-on_request</code></font> block.
If you have the format stored in the database pass this as well else use <fontcolor="red"><code>"text/html"</code></font>:</p><preclass="programlisting">
set my_input_field_2 [template::util::richtext::create $my_input_field_2 "text/html"]
</pre><p>Now make sure that your SQL queries that do the data manipulation retrieve the correct value.
If you simply use <fontcolor="red"><code>my_input_field_2</code></font> you will store a list.
Thus you need to add an <fontcolor="red"><code>-on_submit</code></font> block:</p><preclass="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 <fontcolor="red"><code>my_input_field_2</code></font> and
<fontcolor="red"><code>format</code></font> are passed to the <fontcolor="red"><code>-new_data</code></font> and
<fontcolor="red"><code>-edit_data</code></font> blocks which don't need to get touched.</p><p>To make HTMLArea optional per package instance define a string parameter
<fontcolor="red"><code>UseWysiwygP</code></font> which defaults <fontcolor="red"><code>0</code></font> for your
package using the APM.</p><p>In your edit page make the following changes</p><preclass="programlisting">
# Is WYSIWYG enabled?
set use_wysiwyg_p [parameter::get -parameter "UseWysiwygP" -default "f"]
...
{htmlarea_p $use_wysiwyg_p}
</pre><p>The <fontcolor="red"><code>-on_request</code></font> switch should set this value for your form.</p><preclass="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
</pre></div><divclass="navfooter"><hr><tablewidth="100%"summary="Navigation footer"><tr><tdwidth="40%"align="left"><aaccesskey="p"href="tutorial-schedule-procs.html">Prev</a></td><tdwidth="20%"align="center"><aaccesskey="h"href="index.html">Home</a></td><tdwidth="40%"align="right"><aaccesskey="n"href="tutorial-parameters.html">Next</a></td></tr><tr><tdwidth="40%"align="left">Scheduled Procedures </td><tdwidth="20%"align="center"><aaccesskey="u"href="tutorial-advanced.html">Up</a></td><tdwidth="40%"align="right"> Adding in parameters for your package</td></tr></table><hr><address><ahref="mailto:docs@openacs.org">docs@openacs.org</a></address></div><aname="comments"></a><center><ahref="http://openacs.org/doc/current/tutorial-wysiwyg-editor.html#comments">View comments on this page at openacs.org</a></center></body></html>