• Publicity: Public Only All

subsite-procs.tcl

Procs to manage application groups

Location:
packages/acs-subsite/tcl/subsite-procs.tcl
Created:
2001-02-01
Author:
oumi@arsdigita.com
CVS Identification:
$Id: subsite-procs.tcl,v 1.44.2.10 2015/10/28 09:38:35 gustafn Exp $

Procedures in this file

Detailed information

subsite::add_section_row (public)

 subsite::add_section_row -array array -base_url base_url \
    -multirow multirow [ -section section ]

Helper proc for adding rows of sections to the page flow of the subsite.

Switches:
-array (required)
-base_url (required)
-multirow (required)
-section (optional)

See Also:

subsite::after_mount (public)

 subsite::after_mount -package_id package_id -node_id node_id

This is the Tcl proc that is called automatically by the APM whenever a new instance of the subsites application is mounted.

Switches:
-package_id (required)
-node_id (required)
Author:
Don Baccus <dhogaza@pacifier.com>
Created:
2003-03-05

subsite::auto_mount_application (public)

 subsite::auto_mount_application [ -instance_name instance_name ] \
    [ -pretty_name pretty_name ] [ -node_id node_id ] package_key

Mounts a new instance of the application specified by package_key beneath node_id. This proc makes sure that the instance_name (the name of the new node) is unique before invoking site_node::instantiate_and_mount.

Switches:
-instance_name (optional)
The name to use for the url in the site-map. Defaults to the package_key plus a possible digit to serve as a unique identifier (e.g. news-2)
-pretty_name (optional)
The english name to use for the site-map and for things like context bars. Defaults to the name of the object mounted at this node + the package pretty name (e.g. Intranet News)
-node_id (optional)
Defaults to [ad_conn node_id]
Parameters:
package_key
Returns:
The package id of the newly mounted package
Author:
Michael Bryzek <mbryzek@arsdigita.com>
Created:
2001-02-28

See Also:

subsite::before_uninstantiate (public)

 subsite::before_uninstantiate -package_id package_id

Delete the application group associated with this subsite.

Switches:
-package_id (required)

subsite::before_upgrade (public)

 subsite::before_upgrade -from_version_name from_version_name \
    -to_version_name to_version_name

Handles upgrade

Switches:
-from_version_name (required)
-to_version_name (required)

subsite::default::create_app_group (public)

 subsite::default::create_app_group [ -package_id package_id ] \
    [ -name name ]

Create the default application group for a subsite.

  • Create application group
  • Create segment "Subsite Users"
  • Create relational constraint to make subsite registration require supersite registration.

Switches:
-package_id (optional)
-name (optional)

subsite::default::delete_app_group (public)

 subsite::default::delete_app_group [ -package_id package_id ]

Delete the default application group for a subsite.

Switches:
-package_id (optional)

subsite::define_pageflow (public)

 subsite::define_pageflow [ -sections_multirow sections_multirow ] \
    [ -subsections_multirow subsections_multirow ] \
    [ -section section ] [ -url url ]

Defines the page flow of the subsite TODO: add an image TODO: add link_p/selected_p for subsections

Switches:
-sections_multirow (defaults to "sections") (optional)
-subsections_multirow (defaults to "subsections") (optional)
-section (optional)
-url (optional)

subsite::delete_subsite_theme (public)

 subsite::delete_subsite_theme -key key

Delete a subsite theme, making it unavailable to the theme configuration code.

Switches:
-key (required)

subsite::get (public)

 subsite::get [ -subsite_id subsite_id ] -array array

Get information about a subsite.

Switches:
-subsite_id (optional)
The id of the subsite for which info is requested. If no id is provided, then the id of the closest ancestor subsite will be used.
-array (required)
The name of an array in which information will be returned.
Author:
Frank Nikolajsen <frank@warpspace.com>
Created:
2003-03-08

subsite::get_application_options (public)

 subsite::get_application_options

Gets options list for applications to install

subsite::get_element (public)

 subsite::get_element [ -subsite_id subsite_id ] -element element \
    [ -notrailing ]

Return a single element from the information about a subsite.

Switches:
-subsite_id (optional)
The node id of the subsite for which info is requested. If no id is provided, then the id of the closest ancestor subsite will be used.
-element (required)
The element you want, one of: directory_p object_type package_key package_id name pattern_p instance_name node_id parent_id url object_id
-notrailing (boolean) (optional)
Returns:
The element you asked for
Author:
Frank Nikolajsen <frank@warpspace.com>
Created:
2003-03-08

subsite::get_pageflow_struct (public)

 subsite::get_pageflow_struct [ -url url ]

Defines the page flow structure.

Switches:
-url (optional)

subsite::get_section_info (public)

 subsite::get_section_info [ -array array ] \
    [ -sections_multirow sections_multirow ]

Takes the sections_multirow and sets the passed array name with the elements label and url of the selected section.

Switches:
-array (defaults to "section_info") (optional)
-sections_multirow (defaults to "sections") (optional)

subsite::get_theme (public)

 subsite::get_theme [ -subsite_id subsite_id ]

Get the theme for the given (or current) subsite.

Switches:
-subsite_id (optional)
id of the subsite
Returns:
Name of the theme (theme key)

subsite::get_theme_options (public)

 subsite::get_theme_options

Gets options for subsite themes for use with a form builder select widget.

subsite::get_url (public)

 subsite::get_url [ -node_id node_id ] [ -absolute_p absolute_p ] \
    [ -force_host force_host ] [ -strict_p strict_p ] \
    [ -protocol protocol ] [ -port port ]

Returns the url stub for the specified subsite. If -absolute is supplied then this function will generate absolute urls. If the site is currently being accessed via a host node mapping or -force_host_node_map is also supplied then URLs will ommit the corresponding subsite url stub. The host name will be used for any appropriate subsite when absolute urls are generated.

Switches:
-node_id (optional)
the subsite's node_id (defaults to nearest subsite node).
-absolute_p (defaults to "0") (optional)
whether to include the host in the returned url.
-force_host (optional)
-strict_p (defaults to "0") (optional)
-protocol (optional)
-port (optional)

subsite::main_site_id (public)

 subsite::main_site_id

Get the package_id of the Main Site. The Main Site is the subsite that is always mounted at '/' and that has a number of site-wide parameter settings.

Author:
Peter Marklund

subsite::new_subsite_theme (public)

 subsite::new_subsite_theme -key key -name name -template template \
    [ -css css ] [ -js js ] [ -form_template form_template ] \
    [ -list_template list_template ] \
    [ -list_filter_template list_filter_template ] \
    [ -dimensional_template dimensional_template ] \
    [ -resource_dir resource_dir ] [ -streaming_head streaming_head ]

Add a new subsite theme, making it available to the theme configuration code.

Switches:
-key (required)
-name (required)
-template (required)
-css (optional)
-js (optional)
-form_template (optional)
-list_template (optional)
-list_filter_template (optional)
-dimensional_template (optional)
-resource_dir (optional)
-streaming_head (optional)

subsite::package_keys (public)

 subsite::package_keys

Get the list of packages which can be subsites. This is built during the bootstrap process. If you install a new subsite-implementing package and don't accept the installers invitation to reboot openacs, tough luck.

Returns:
the packages keys of all installed packages acting as subsites.

subsite::pivot_root (public)

 subsite::pivot_root [ -node_id node_id ]

Pivot the package associated with node_id onto the root. Mounting the current root package under node_id.

Switches:
-node_id (optional)

subsite::save_theme_parameters_as_default (public)

 subsite::save_theme_parameters_as_default [ -subsite_id subsite_id ] \
    [ -theme theme ]

Save the actual theming parameter set of the given/current subsite as default for the given/current theme. These default values are used, whenever a subsite switches to the specified theme.

Switches:
-subsite_id (optional)
Id of the subsite
-theme (optional)
Name of the theme (theme key)
Author:
Gustaf Neumann

subsite::set_theme (public)

 subsite::set_theme [ -subsite_id subsite_id ] -theme theme

Set the theme for the given or current subsite. This will change the subsite's ThemeKey, DefaultMaster, and ThemeCSS, DefaultFormStyle, DefaultListStyle, DefaultListFilterStyle, DefaultDimensionalStyle, and ResourceDir parameters.

Switches:
-subsite_id (optional)
Id of the subsite
-theme (required)
Name of the theme (theme key)

subsite::update_subsite_theme (public)

 subsite::update_subsite_theme -key key -name name -template template \
    [ -css css ] [ -js js ] [ -form_template form_template ] \
    [ -list_template list_template ] \
    [ -list_filter_template list_filter_template ] \
    [ -dimensional_template dimensional_template ] \
    [ -resource_dir resource_dir ] [ -streaming_head streaming_head ]

Update the default theming parameters in the database

Switches:
-key (required)
-name (required)
-template (required)
-css (optional)
-js (optional)
-form_template (optional)
-list_template (optional)
-list_filter_template (optional)
-dimensional_template (optional)
-resource_dir (optional)
-streaming_head (optional)
Author:
Gustaf Neumann

subsite::upload_allowed (public)

 subsite::upload_allowed

Verifies SolicitPortraitP parameter to ensure upload portrait security.

Author:
Hector Amado <hr_amado@galileo.edu>
Created:
2004-06-16

subsite::util::get_package_options (public)

 subsite::util::get_package_options

Get a list of pretty name, package key pairs for all packages which identify themselves as implementing subsite semantics.

Returns:
a list of pretty name, package key pairs suitable for use in a template select widget.

subsite::util::object_type_path_list (public)

 subsite::util::object_type_path_list object_type [ ancestor_type ]
Parameters:
object_type
ancestor_type (defaults to "acs_object")
Returns:
the object type heirarchy for the given object type from ancestor_type to object_type

subsite::util::object_type_pretty_name (public)

 subsite::util::object_type_pretty_name object_type

returns pretty name of object. We need this so often that I thought I'd stick it in a proc so it can possibly be cached later.

Parameters:
object_type
Author:
Oumi Mehrotra <oumi@arsdigita.com>
Created:
2000-02-07

subsite::util::packages (public)

 subsite::util::packages [ -node_id node_id ]

Return a list of package_id's for the subsite containing node_id This is a memoized function which caches for 20 minutes.

Switches:
-node_id (optional)
Author:
Jeff Davis davis@xarg.net
Created:
2004-05-07

See Also:

subsite::util::return_url_stack (public)

 subsite::util::return_url_stack return_url_list

Given a list of return_urls, we recursively encode them into one return_url that can be redirected to or passed into a page. As long as each page in the list does the typical redirect to return_url, then the page flow will go through each of the pages in $return_url_list

Parameters:
return_url_list

subsite::util::sub_type_exists_p (public)

 subsite::util::sub_type_exists_p object_type
Parameters:
object_type
Returns:
1 if object_type has sub types, or 0 otherwise
Author:
Oumi Mehrotra <oumi@arsdigita.com>
Created:
2000-02-07
[ show source ]