Index: openacs-4/packages/acs-core-docs/www/subsites.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/subsites.adp,v diff -u -r1.1.2.4 -r1.1.2.5 --- openacs-4/packages/acs-core-docs/www/subsites.adp 9 Jun 2016 13:03:11 -0000 1.1.2.4 +++ openacs-4/packages/acs-core-docs/www/subsites.adp 23 Jun 2016 08:32:46 -0000 1.1.2.5 @@ -14,15 +14,15 @@ OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.
In this document, we'll examine the user interface pages of the -Notes application in more detail, covering two separate aspects of -page development in OpenACS. First, we'll talk about the code -needed to make your pages aware of which application instance they -are running in. Second, we'll talk about using the form builder to -develop form-based user interfaces in OpenACS. While these seem -like unrelated topics, they both come up in the example page that -we are going to look at, so it makes sense to address them at the -same time.
+OverviewIn this document, we'll examine the user interface pages of +the Notes application in more detail, covering two separate aspects +of page development in OpenACS. First, we'll talk about the +code needed to make your pages aware of which application instance +they are running in. Second, we'll talk about using the form +builder to develop form-based user interfaces in OpenACS. While +these seem like unrelated topics, they both come up in the example +page that we are going to look at, so it makes sense to address +them at the same time.
As you will recall from the packages tutorial, the Request
@@ -34,8 +34,8 @@
mapping mounting the
application instance at a particular URL. The tutorial also showed
how a given URL is translated into a physical file to serve using
-the site map. We'll repeat this description here, assuming that you
-have mounted an instance of Notes at the URL /notes
as we did in the packages-example:
/notes
as we did in the packages-example:AOLserver receives your request for the URL /notes/somepage
.
This URL is passed to the request processor.
The RP looks up the URL in the site map, and sees that the
object mounted at that location is an instance of the notes
application.
The RP asks the package manager where in the file system the Notes package lives. In the standard case, this would be @@ -60,8 +60,8 @@ following the part that matched a site map entry.
In the Notes example, we are particularly interested in the
package_id
field. If you study
-the data model and code, you'll see why. As we said before in the
-data modeling
+the data model and code, you'll see why. As we said before in
+the data modeling
tutorial, the Notes application points the context_id
of each Note object that it
creates to the package instance that created it. That is, the
context_id
corresponds exactly
@@ -110,7 +110,7 @@
the template system. This API allows you to write forms-based pages
without generating a lot of duplicated HTML in your pages. It also
encapsulates most of the common logic that we use in dealing with
-forms, which we'll discuss next.
The forms API is pretty simple: You use calls in the @@ -208,9 +208,9 @@ ad_returnredirect "." } -
In this simple example, we don't do any custom validation. The -nice thing about using this API is that the forms library handles -all of the HTML rendering, input validation and database +
In this simple example, we don't do any custom validation. +The nice thing about using this API is that the forms library +handles all of the HTML rendering, input validation and database transaction logic on your behalf. This means that you can write pages without duplicating all of that code in every set of pages that uses forms.
@@ -222,7 +222,7 @@ server and then try out the user interface pages. It should become clear that in a real site, you would be able to, say, create a custom instance of Notes for every registered user, mount that -instance at the user's home page, and set up the permissions so +instance at the user's home page, and set up the permissions so that the instance is only visible to that user. The end result is a site where users can come and write notes to themselves.This is a good example of the leverage available in the OpenACS 5.9.0 system. The code that we have written for Notes is not at all @@ -240,10 +240,10 @@ structure web services in very flexible ways.
We saw how to use this mechanism in the Notes application and how it makes it possible to easily turn Notes into an application that appears to provide each user in a system with their own -private notes database.
We also saw how to use the templating system's forms API in a -simple way, to create forms based pages with minimal duplication of -code.
We also saw how to use the templating system's forms API in +a simple way, to create forms based pages with minimal duplication +of code.