posted on 3:02 PM, July 12, 2009
The Section class handles configuration, publication, and other management of website sections.
Formally, a section is a group of pages with similar publication and access control attributes. All static pages in a section publish into the same directory, and all member-only pages are accessible by the same group of members.
Many small websites are configured as a single section; therefore the terms ``section'', ``website'', and ``site'' are sometimes used interchangeably.
Note that sections have somewhat different behaviours, depending on their type:
(This method is actually inherited from ExSite::ContentBase.)
Instantiate and/or configure a section object.
my $section = new ExSite::Section(%option);
If the section is not set up with an actual section description, the object
will have limited functionality. The setup methods are normally invoked
automatically by the class constructor method
Returns the publication name of the section. This is only meaningful for native websites.
Returns the full disk path where the section's files will be published. The disk path depends on the section's type and relationship to its parent section.
(DEPRECATED) Returns the path relative to the webroot where the section's files will be found.
Returns the URL to the section. The URL references the section
directory, which normally defaults to the
Returns just the machine name part of the URL, eg. ``www.mydomain.com''.
Sections can be nested to any depth. This method returns an array of section objects representing all sections in this path, from the root section to the current section.
This might represent a native website ``native3'' that is a child of a stand-alone website (section ID 2), which is a child of a native website ``native1''. Note that this in turn may be a child of a native website with a blank publication directory. (The root section in a system is typically a native website with no publication directory, since it publishes to the default directory specified by the webserver.)
Returns an array of page objects for all of the active pages in the section.
Returns an array of library records (not objects) that are accessible to the current section. This includes libraries in the current section, shared libraries in the the sectionpath, and public libraries anywhere in the system.
Returns an array of content objects for all of the content in all of the libraries returned by the previous method.
Returns all templates available to the section, as an array of page records. This may include templates from other sections, depending on their privacy settings and relationship to the current section.
my @templates = $section->get_templates(%option)
Changes the graphic design template for the section to
If not allowed, an error message is returned, which can be issued directly to the browser.
Returns an array of content records, representing model page bodies that can be used by the current section. These can be used to initialize the body of any page in the current section.
Returns an array of services running on this section. A service is a special record connecting a section to a DCD (plug-in). It is used for authorizing access to restricted-access DCDs, and finding special service pages that should be used to handle all requests to a DCD.
Finds pages using a particular DCD (plug-in).
my @pages = $section->find_dcd($module);
Returns an array of page records representing those pages that contain
a tag invoking the DCD
WARNING: you need write access to the section's publication area to
publish files there. The webserver normally does not have this
access. Negotiating this access is normally done by the publish
program (ie. publish.cgi), which has special permissions. If you do
not have these permissions, then you have to ask publish.cgi to do
this task on your behalf, using
Creates the section directories on disk, and publishes all publishable
pages and content to these directories. If
The output of the publish method is printed direct to stdout, so that progress can be monitored in real time. Otherwise for large sections, long delays can be experienced as the lengthy publish output is buffered until completion. This is why publish progress screens are not templated.
Removes a section's files from disk. Recursively unpublishes each
page by callings its
my @errors = $section->validate($sectiondata);
Returns TRUE if the values in the the
Creates a new section using the attributes in the
Removes the current section from the system. Records are moved to the trash bin, and may be recovered from there. (However, large sections' trashballs may exceed the query size limit of the database.) Attempts to unpublish its files, as well.
best practices (5)
content management (12)
data handling (7)
graphic design (21)
html formatting (7)
plug-in modules (28)
visual tutorial (29)
web protocols (9)