View · Index

Creating Application specific Subclasses of the CR

############################################################
# Create new application classes by sub-typing the 
# Content Repository, adding additional attributes
#
# We create a subclass of ::xo::db::CrItem called ::demo::Page
# which has a few more attributes. Actually, this class is very
# similar to ::xowiki::Page. Again, we define an XOTcl class
# ::demo::Page which creates the ACS Object Type, the ACS
# attributes and the table, if necessary.

>> ::xo::db::CrClass create Page  -superclass ::xo::db::CrItem \ 
   -pretty_name "demo Page"  -mime_type text/html  -slots {
      ::xo::db::CrAttribute create creator \ 
        -column_name creator_string
    }

=  ::demo::Page