%myvars; ]> Configuring a new OpenACS Site by Joel Aufrecht 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 filesystem, and require some planning if easy upgradability is to be maintained. Installing OpenACS packages by Jade Rubick Installing OpenACS packages An OpenACS package extends your website and lets it do things it was not 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 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 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 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 selected 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: 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 Once the package has been installed, then you will need to 'mount' the package. The next section handles that. Mounting OpenACS packages by Jade Rubick 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 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 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. 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. Configuring an OpenACS package by Jade Rubick 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' link, you will see a list of parameters that you can change for this application. Setting Permissions on an OpenACS package by Jade Rubick 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' link, you will see and be able to set the permissions for that application. 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. 'The Public' refers to users to the website who are not logged in. 'Registered Users' are people who have registered for the site. 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. Log in to the web site as an administrator. Click on Admin > Install Software > Install from OpenACS Repository / Install new application Choose Edit This Page and install 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. On the front page, click the Admin button. On the administration page, click Parameters link. 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: cp /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/acs-subsite/www/index* /var/lib/aolserver/$OPENACS_SERVICE_NAME/www 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 processor 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.
Site Templates
How do I diagnose a permissions problem? Steps to Reproduce The events package does not allow users to register for new events. 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. Select an available event 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" 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 privilege on the event in order to register. Let's assume that the privileges inherit, so that if a user has the write privilege on the whole package, they will have the write privilege on the event. Setting Permissions A permission has three parts: the privilege, the object of the privilege, and the subject being granted the privilege. In this case the privilege is "write," the object is the Events package, and the subject is all Registered Users. 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.
Granting Permissions
OpenACS 5.0 offers a prettier version at /admin/applications.
Granting Permissions in 5.0