Index: openacs-4/packages/acs-core-docs/www/objects.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/objects.html,v diff -u -r1.48.2.2 -r1.48.2.3 --- openacs-4/packages/acs-core-docs/www/objects.html 12 Dec 2010 00:07:02 -0000 1.48.2.2 +++ openacs-4/packages/acs-core-docs/www/objects.html 12 Dec 2010 01:37:24 -0000 1.48.2.3 @@ -1,19 +1,9 @@ -<<<<<<< objects.html - -
By Pete Su
-======= -By Pete Su
->>>>>>> 1.50 +By Pete Su
OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff. -<<<<<<< objects.html -Developing data models in OpenACS 5.6.0 is much like developing data models ->>>>>>> 1.50 for OpenACS 3, save for the implementation. As usual, you need to examine how to model the information that the application must store and manipulate, and define a suitable set of SQL tables. In our Notes @@ -87,17 +77,10 @@ system.
Fire up your text editor and open the -<<<<<<< objects.html -ROOT/packages/notes/sql/oracle/notes-create.sql (ROOT/packages/notes/sql/postgresql/notes-create.sql for the PG version) file created -when we created the package. Then, do the following: -
-First, add an entry to the acs_object_types table with the following PL/SQL call:
-=======
ROOT/packages/notes/sql/oracle/notes-create.sql
(ROOT/packages/notes/sql/postgresql/notes-create.sql
for the PG version) file created
when we created the package. Then, do the following:
-
+
First, add an entry to the acs_object_types
table with the following PL/SQL call:
->>>>>>> 1.50
begin acs_object_type.create_type ( @@ -156,11 +139,7 @@ because the new typenote
is a subtype ofacs_object
, it will inherit these attributes, so there is no need for us to define them. -<<<<<<< objects.html -
The next thing we do is make a small modification to the data model to
reflect the fact that each row in the notes
table
represents something that is not only an object of type
@@ -184,13 +163,8 @@
we model inheritance; it guarantees that any services that
use the acs_objects
table to find objects will
transparently find any objects that are instances of any subtype of
-<<<<<<< objects.html
-acs_objects.
-
The next step is to define a PL/SQL package for your new type, and write some basic procedures to create and delete objects. Here is a package definition for our new type: @@ -238,11 +212,7 @@ object OBJ was "read only", then any other object that used OBJ as its context would also be "read only" by default. We'll talk about this more later. -<<<<<<< objects.html -
The PL/SQL package body contains the implementations of the procedures
defined above. The only subtle thing going on here is that we must use
acs_object.new
to insert a row into
@@ -399,13 +369,8 @@
when to use inherited attributes is fairly straightforward, but
requires a good amount of thought at design time even for simple
applications.
-<<<<<<< objects.html
-
Hooking into the OpenACS 5.6.0 object system brings the application developer
->>>>>>> 1.50
numerous benefits, and doing it involves only four easy steps:
@@ -429,8 +394,4 @@
especially true for the context_id
field.
-<<<<<<< objects.html