- Publicity: Public Only All
publish-procs.tcl
Procedures in this file
- publish::get_html_body (public)
- 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::item_include_tag (public)
- publish::mkdirs (public)
- publish::proc_exists (public)
- publish::render_subitem (public)
- publish::write_content (public)
Detailed information
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_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::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::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::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::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.