- Publicity: Public Only All
publish-procs.tcl
Procedures in this file
- publish::foreach_publish_path (private)
- publish::get_html_body (public)
- publish::get_main_item_id (private)
- publish::get_main_revision_id (private)
- publish::get_mime_handler (public)
- publish::get_page_root (public)
- publish::get_publish_roots (public)
- publish::handle::image (public)
- publish::handle::text (public)
- publish::handle_binary_file (public)
- publish::handle_item (private)
- publish::html_args (private)
- publish::item_include_tag (public)
- publish::merge_with_template (private)
- publish::mkdirs (public)
- publish::pop_id (private)
- publish::proc_exists (public)
- publish::process_tag (private)
- publish::push_id (private)
- publish::render_subitem (public)
- publish::write_content (public)
- publish::write_multiple_blobs (private)
- publish::write_multiple_files (private)
Detailed information
publish::foreach_publish_path (private)
publish::foreach_publish_path url code [ root_path ]
- Parameters:
- url (required)
- Relative URL to append to the roots
- code (required)
- Execute this code
- root_path (optional)
- {default The empty string} Use this root path instead of the paths specified in the INI file
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
publish::get_html_body (public)
publish::get_html_body html
- Parameters:
- html (required)
- The html to be processed
- Returns:
- Everything between the <body> and the </body> tags if they exist; the unchanged HTML if they do not
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
publish::get_main_item_id (private)
publish::get_main_item_id
- Returns:
- the main item id
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
publish::get_main_revision_id (private)
publish::get_main_revision_id
- Returns:
- the main item id
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
publish::get_mime_handler (public)
publish::get_mime_handler mime_type
- Parameters:
- mime_type (required)
- The full mime type, such as "text/html" or "image/jpg"
- Returns:
- The name of the proc which should be used to handle the mime-type, or an empty string on failure.
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
publish::get_page_root (public)
publish::get_page_root
Get the page root. All items will be published to the filesystem with their URLs relative to this root. The page root is controlled by the PageRoot parameter in CMS. A relative path is relative to $::acs::pageroot The default is $::acs::pageroot
- Returns:
- The page root
- See Also:
- publish::get_template_root
- publish::get_publish_roots
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
publish::get_publish_roots (public)
publish::get_publish_roots
Get a list of all page roots to which files may be published. The publish roots are controlled by the PublishRoots parameter in CMS, which should be a space-separated list of all the roots. Relative paths are relative to publish::get_page_root. The default is [list [publish::get_page_root]]
- Returns:
- A list of all the publish roots
- See Also:
- publish::get_template_root
- publish::get_page_root
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
publish::handle::image (public)
publish::handle::image item_id [ args... ]
The basic image handler. Writes the image blob to the filesystem, then either merges with the template or provides a default <img> tag. Uses the title for alt text if no alt text is specified externally.
- Parameters:
- item_id (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
publish::handle::text (public)
publish::handle::text item_id [ args... ]
Return the text body of the item
- Parameters:
- item_id (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
publish::handle_binary_file (public)
publish::handle_binary_file item_id revision_id_ref url_ref error_ref \ [ args... ]
- Parameters:
- Options:
- item_id (required)
- The id of the item to handle
- revision_id_ref (required)
- {required} The name of the variable in the calling frame that will receive the revision_id whose content blob was written to the filesystem.
- url_ref (required)
- The name of the variable in the calling frame that will receive the relative URL of the file in the filesystem which contains the content blob
- error_ref (required)
- The name of the variable in the calling frame that will receive an error message. If no error has occurred, this variable will be set to the empty string ""
- -embed
- Signifies that the content should be embedded directly in the parent item. -embed is required for this proc, since it makes no sense to handle the binary file in any other way.
- -revision_id
- {default The live revision for the item} The revision whose content is to be used
- -no_merge
- If present, do NOT merge with the template, in order to prevent infinite recursion in the <content> tag. In this case, the proc will return the empty string ""
- Returns:
- The HTML resulting from merging the item with its template, or "" if no template exists or the -no_merge flag was specified
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
publish::handle_item (private)
publish::handle_item item_id [ args... ]
- Parameters:
- Options:
- item_id (required)
- The id of the item to be rendered
- -revision_id
- {default The live revision} The revision which is to be used when rendering the item
- -no_merge
- Indicates that the item should NOT be merged with its template. This option is used to avoid infinite recursion.
- -refresh
- Re-render the item even if it exists in the cache. Use with caution - circular dependencies may cause infinite recursion if this option is specified
- -embed
- Signifies that the content should be statically embedded directly in the HTML. If this option is not specified, the item may be dynamically referenced, f.ex. using the <include> tag
- -html
- Extra HTML parameters to be passed to the item handler, in format {name value name value ...}
- Returns:
- The rendered HTML for the item, or an empty string on failure
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
publish::html_args (private)
publish::html_args argv
- Parameters:
- argv (required)
- The list of name-value pairs
- Returns:
- An HTML string in format "name=value name=value ..."
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
publish::item_include_tag (public)
publish::item_include_tag item_id [ extra_args ]
- Parameters:
- item_id (required)
- The item id
- extra_args (optional)
- {} A list of extra parameters to be passed to the include tag, in form {name value name value ...}
- Returns:
- The HTML for the include tag
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
publish::merge_with_template (private)
publish::merge_with_template item_id [ args... ]
- Parameters:
- Options:
- item_id (required)
- The item id
- -revision_id
- {default The live revision} The revision which is to be used when rendering the item
- -html
- Extra HTML parameters to be passed to the ADP parser, in format {name value name value ...}
- Returns:
- The rendered HTML, or the empty string on failure
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
publish::mkdirs (public)
publish::mkdirs path
Create all the directories necessary to save the specified file
- Parameters:
- path (required)
- The path to the file that is about to be saved
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
publish::pop_id (private)
publish::pop_id
- Returns:
- The popped item id, or the empty string if the string is already empty
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
publish::proc_exists (public)
publish::proc_exists namespace_name proc_name
- Parameters:
- namespace_name (required)
- The fully qualified namespace name, such as "template::util"
- proc_name (required)
- The proc name, such as "is_nil"
- Returns:
- 1 if the proc exists in the given namespace, 0 otherwise
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
publish::process_tag (private)
publish::process_tag relation_type params
- Parameters:
- relation_type (required)
- Either child or relation
- params (required)
- The ns_set id for extra HTML parameters
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
publish::push_id (private)
publish::push_id item_id [ revision_id ]
- Parameters:
- item_id (required)
- The id to be put on stack
- revision_id (optional)
- {default ""} The id of the revision to use. If missing, live revision will most likely be used
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
publish::render_subitem (public)
publish::render_subitem main_item_id relation_type relation_tag index \ is_embed extra_args [ is_merge ]
- Parameters:
- main_item_id (required)
- The id of the parent item
- relation_type (required)
- Either child or relation. Determines which tables are searched for subitems.
- relation_tag (required)
- The relation tag to look for
- index (required)
- The relative index of the subitem. The subitem with lowest order_n has index 1, the second lowest order_n has index 2, and so on.
- is_embed (required)
- If "t", the child item may be embedded directly in the HTML. Otherwise, it may be dynamically included. The proc does not process this parameter directly, but passes it to handle_item
- extra_args (required)
- Any additional HTML arguments to be used when rendering the item, in form {name value name value ...}
- is_merge (optional, defaults to
"t"
)- {default t} If "t", merge_with_template may be used to render the subitem. Otherwise, merge_with_template should not be used, in order to prevent infinite recursion.
- Returns:
- The rendered HTML for the child item
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
publish::write_content (public)
publish::write_content revision_id [ args... ]
- Parameters:
- Options:
- revision_id (required)
- The id of the revision to write
- -item_id
- {default The item_id of the revision} Specifies the item to which this revision belongs (merely for optimization purposes)
- -text
- If specified, indicates that the content of the revision is readable text (clob), not a binary file
- -root_path
- {default All paths in the PublishPaths parameter} Write the content to this path only.
- Returns:
- The relative URL of the file that was written, or an empty string on failure
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
publish::write_multiple_blobs (private)
publish::write_multiple_blobs url revision_id [ root_path ]
- Parameters:
- url (required)
- Relative URL of the file to write
- revision_id (required)
- Write the blob for this revision
- root_path (optional)
- Use this root path (default empty)
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
publish::write_multiple_files (private)
publish::write_multiple_files url text [ root_path ]
- Parameters:
- url (required)
- Relative URL of the file to write
- text (required)
- A string of text to be written to the URL
- root_path (optional)
- Use this root path (default empty)
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.