- 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.68.2.26 2023/02/08 12:35:55 antoniop Exp $
Procedures in this file
- subsite::add_section_row (public)
- subsite::auto_mount_application (public)
- subsite::default::create_app_group (public)
- subsite::default::delete_app_group (public)
- subsite::define_pageflow (public)
- subsite::delete_subsite_theme (public)
- subsite::get (public)
- subsite::get_application_options (public)
- subsite::get_element (public)
- subsite::get_pageflow_struct (public)
- subsite::get_section_info (public)
- subsite::get_theme (public)
- subsite::get_theme_options (public)
- subsite::get_theme_subsites (public)
- subsite::get_url (public)
- subsite::main_site_id (public)
- subsite::new_subsite_theme (public)
- subsite::package_keys (public)
- subsite::pivot_root (public)
- subsite::refresh_theme_subsites (public)
- subsite::set_theme (public)
- subsite::update_subsite_theme (public)
- subsite::upload_allowed (public)
- subsite::util::get_package_options (public)
- subsite::util::object_type_path_list (public)
- subsite::util::object_type_pretty_name (public)
- subsite::util::packages (public)
- subsite::util::sub_type_exists_p (public)
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:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
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 (required)
- Returns:
- The package id of the newly mounted package
- Author:
- Michael Bryzek <mbryzek@arsdigita.com>
- Created:
- 2001-02-28
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- subsite_api
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)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
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)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
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 (optional, defaults to
"sections"
)- -subsections_multirow (optional, defaults to
"subsections"
)- -section (optional)
- -url (optional)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
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)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- subsite_api
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 (optional)
- The name of an array in which information will be returned.
- Returns:
- dict with subsite attributed
- Author:
- Frank Nikolajsen <frank@warpspace.com>
- Created:
- 2003-03-08
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- subsite_api
subsite::get_application_options (public)
subsite::get_application_options
Gets options list for applications to install
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- subsite_api
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 (optional, boolean)
- If true and the element requested is a URL, then strip any trailing slash ('/'). This means the empty string is returned for the root.
- Returns:
- The element you asked for
- Author:
- Frank Nikolajsen <frank@warpspace.com>
- Created:
- 2003-03-08
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- user_links_api
subsite::get_pageflow_struct (public)
subsite::get_pageflow_struct [ -url url ]
Defines the page flow structure.
- Switches:
- -url (optional)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
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 (optional, defaults to
"section_info"
)- -sections_multirow (optional, defaults to
"sections"
)- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
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)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- subsite_api
subsite::get_theme_options (public)
subsite::get_theme_options
Gets options for subsite themes for use with a form builder select widget.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- subsite_api
subsite::get_theme_subsites (public)
subsite::get_theme_subsites -theme theme [ -subsite_id subsite_id ] \ [ -unmodified ]
Returns a list of all packages implementing subsite that are currently using specified theme. Optionally, returns a list of just those that were not locally modified.
- Switches:
- -theme (required)
- theme key to lookup for.
- -subsite_id (optional)
- narrow search to this subsite only. Useful to check whether a single subsite is using a theme with or without local modifications.
- -unmodified (optional, boolean)
- decides whether we include subsites which theme was locally modified.
- Returns:
- list of subsite_id
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- subsite_api
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 then URLs will omit the corresponding subsite url stub. The hostname 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 (optional, defaults to
"0"
)- whether to include the host in the returned url.
- -force_host (optional)
- Use a certain host. In case "any" is specified, and we have a host-node-mapping (e.g. non-connected cases) behave like a virtual server on the first host-node-mapping entry. In connected cases, "any" means: take whatever is provided via vhost.
- -strict_p (optional, defaults to
"0"
)- -protocol (optional)
- -port (optional)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- subsite_api
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
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- acs_subsite_trivial_smoke_test, acs_subsite_test_email_confirmation, password_recovery_page, site_node_closest_ancestor_package
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 ] \ [ -local_p local_p ] [ -create_or_replace ]
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)
- -local_p (optional, defaults to
"true"
)- -create_or_replace (optional, boolean)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- subsite_api
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.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- subsite_api
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 (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
subsite::refresh_theme_subsites (public)
subsite::refresh_theme_subsites [ -theme theme ] [ -include_modified ]
Reload theme subsite parameters from defaults on every subsite currently using specified theme. This might be used, for example, in upgrade callbacks for themes if desired behavior is to upgrade all subsites using it without manual intervention. By default this proc will not refresh locally modified templates.
- Switches:
- -theme (optional)
- theme key to lookup for
- -include_modified (optional, boolean)
- force reload also for locally modified templates
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- subsite_api
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)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- subsite_api
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 ] \ [ -local_p local_p ]
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)
- -local_p (optional, defaults to
"false"
)- Author:
- Gustaf Neumann
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- subsite_api
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
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
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.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- subsite_api
subsite::util::object_type_path_list (public)
subsite::util::object_type_path_list object_type [ ancestor_type ]
- Parameters:
- object_type (required)
- ancestor_type (optional, defaults to
"acs_object"
)- Returns:
- the object type hierarchy for the given object type from ancestor_type to object_type
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
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 (required)
- Author:
- Oumi Mehrotra <oumi@arsdigita.com>
- Created:
- 2000-02-07
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
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::packages_no_mem
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- subsite_api
subsite::util::sub_type_exists_p (public)
subsite::util::sub_type_exists_p object_type
- Parameters:
- object_type (required)
- Returns:
- 1 if object_type has sub types, or 0 otherwise
- Author:
- Oumi Mehrotra <oumi@arsdigita.com>
- Created:
- 2000-02-07
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.