util_text_to_url (public)

 util_text_to_url [ -existing_urls existing_urls ] [ -no_resolve ] \
    [ -replacement replacement ] [ -text text ] [ _text ]

Defined in packages/acs-tcl/tcl/utilities-procs.tcl

Modify a string so that it is suited as a well formatted URL path element. Also, if given a list of existing URLs it can catch duplicate or optionally create an unambiguous url by appending a dash and a digit.

Examples:
util_text_to_url -text "Foo Bar" returns foo-bar
util_text_to_url -existing_urls {foo-bar some-other-item} -text "Foo Bar" returns foo-bar-2

Switches:
-existing_urls (optional)
a list of URLs that already exist on the same level and would cause a conflict
-no_resolve (optional, boolean)
Specify this flag if you do not want util_text_to_url to automatically generate "foo-bar-2" if "foo-bar" is already in existing_urls, and would rather have an error thrown.
-replacement (optional, defaults to "-")
the character that is used to replace illegal characters
-text (optional)
the text to modify, e.g. "Foo Bar"
Parameters:
_text (optional)
the text to modify, e.g. "Foo Bar" (Deprecated, use -text instead. Fails when the value starts with a dash.)
Author:
Tilmann Singer

Partial Call Graph (max 5 caller/called nodes):
%3 test_auth_authenticate auth_authenticate (test acs-authentication) util_text_to_url util_text_to_url test_auth_authenticate->util_text_to_url test_auth_create_user auth_create_user (test acs-authentication) test_auth_create_user->util_text_to_url test_auth_driver_get_parameter_values auth_driver_get_parameter_values (test acs-authentication) test_auth_driver_get_parameter_values->util_text_to_url test_auth_email_on_password_change auth_email_on_password_change (test acs-authentication) test_auth_email_on_password_change->util_text_to_url test_auth_get_registration_elements auth_get_registration_elements (test acs-authentication) test_auth_get_registration_elements->util_text_to_url

Testcases:
auth_authenticate, auth_create_user, auth_get_registration_elements, auth_password_change, auth_password_recover, auth_password_get_forgotten_url, auth_password_retrieve, auth_password_reset, auth_driver_get_parameter_values, auth_use_email_for_login_p, auth_email_on_password_change, sync_batch_ims_example_doc, sync_batch_ims_test, sync_http_get_document
[ show source ]
Show another procedure: