Index: openacs-4/packages/acs-core-docs/www/tutorial-newpackage.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-newpackage.html,v diff -u -r1.39 -r1.40 --- openacs-4/packages/acs-core-docs/www/tutorial-newpackage.html 12 Jul 2009 01:08:29 -0000 1.39 +++ openacs-4/packages/acs-core-docs/www/tutorial-newpackage.html 17 Oct 2010 21:06:08 -0000 1.40 @@ -1,12 +1,12 @@ - -
To start developing new code in OpenACS, we build a new package. A package is a a discrete collection of web pages, tcl code, and database tables and procedures. - A package with user interface is called an application; + A package with user interface is called an application; a package which provides functions to other packages and has no direct interface, a - service. A package can be installed, upgraded, and + service. A package can be installed, upgraded, and removed. It communicates with other packages through an API. This chapter walks you through the minimum steps to create a useful package, including writing documentation, setting up database tables and procedures, writing web pages, debugging, and automatic regression testing. @@ -18,55 +18,55 @@ right now. Code that is temporary hackage is clearly marked.
In this tutorial, we will make an application package for displaying a list of text notes. -
You will need:
A computer with a working installation of - OpenACS. If you don't have this, see Chapter 2, Installation Overview. -
Example files, which are included in the -standard OpenACS 5.5.0 distribution. -
Figure 9.1. Assumptions in this section
Fully qualified domain name of your server | yourserver.test |
URL of your server | http://yourserver.test:8000 |
Name of development account | $OPENACS_SERVICE_NAME |
New Package key | myfirstpackage |
We use the ACS Package Manager (APM) to add, remove, and +
You will need:
A computer with a working installation of + OpenACS. If you don't have this, see Chapter 2, Installation Overview. +
Example files, which are included in the +standard OpenACS 5.6.0 distribution. +
We use the ACS Package Manager (APM) to add, remove, and upgrade packages. It handles package meta-data, such as lists of files that belong in the package. Each package is uniquely identified by a package key. To start developing a new package, use the APM to create an empty package with our new package key, myfirstpackage. This will create the initial directories, meta-information files, and database - entries for a new package. (More info on APM) -
Browse to
- http://yourserver:8000/acs-admin/apm
.
-
Click Create a New Package
.
Fill in the fields listed below. Ignore the rest (and leave the check boxes alone). + entries for a new package. (More info on APM) +
Browse to + http://yourserver:8000/acs-admin/apm. +
Click Create a New Package.
Fill in the fields listed below. Ignore the rest (and leave the check boxes alone). (Some will change automatically. Don't mess with those.) -
- Package Key
:
- myfirstpackage
- Package Name
:
- My First Package
-
- Package Plural
:
- My First Package
- Package Type
:
- Application
-
- Initial Version
:
- 0.1d
-
Summary
:
- This is my first package.
+
+ Package Key: + myfirstpackage
+ Package Name: + My First Package +
+ Package Plural: + My First Package
+ Package Type: + Application +
+ Initial Version: + 0.1d +
Summary: + This is my first package.
At the bottom, click
- Create Package
.
+ Create Package.
This creates a package rooted at
- /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/myfirstpackage
.
- This is the "home directory" of our new package, and all
- files in the package will be within this directory. More on the structure of
- packages).
In order to see your work in progress, you must create a + /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/myfirstpackage. + This is the "home directory" of our new package, and all + files in the package will be within this directory. More on the structure of + packages).
In order to see your work in progress, you must create a map between the URL space of incoming requests and the package application instance. You do this by adding the application in the main site administration). This creates a link between the incoming URL requests and an - instance of the application. (More on applications and nodes)
You can have instances of a package on one site, each with a + instance of the application. (More on applications and nodes)
You can have instances of a package on one site, each with a different URL and different permissions, all sharing the same code and tables. This requires that a package be developed package-aware. You'll see how to do that - in this tutorial.
Browse to
-http://yourserver.test:8000/admin/applications/application-add/
.
Choose "My First Package" from the list and click OK (the other fields are optional).
By mounting the package, we've caused all requests to
- http://yourserver.test:8000/myfirstpackage
- to be satisfied from the files at /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/myfirstpackage/www
.
The remainder of the tutorial walks you through each file one at a time as you create the package. You can skip all this, and get a working package, by doing the following:
cd /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/acs-core-docs/www/files/tutorial + in this tutorial.
Browse to +http://yourserver.test:8000/admin/applications/application-add/.
Choose "My First Package" from the list and click OK (the other fields are optional).
By mounting the package, we've caused all requests to + http://yourserver.test:8000/myfirstpackage + to be satisfied from the files at /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/myfirstpackage/www.
The remainder of the tutorial walks you through each file one at a time as you create the package. You can skip all this, and get a working package, by doing the following:
cd /var/lib/aolserver/$OPENACS_SERVICE_NAME/packages/acs-core-docs/www/files/tutorial psql $OPENACS_SERVICE_NAME -f myfirstpackage-create.sql cp note-edit.* note-delete.tcl index.* ../../../../myfirstpackage/www/ mkdir ../../../../myfirstpackage/lib