Converted SocParams.md
diff --git a/SocParams.md b/SocParams.md new file mode 100644 index 0000000..31c04ee --- /dev/null +++ b/SocParams.md
@@ -0,0 +1,118 @@ +# Parameters + +Parameters are usually system-wide and they contain information for handling redirects, templates, sidebar entries, url patterns, dynamic fields & forms, and more in views. Parameters related methods are defined in **soc.views.helper.params**: + + * **constructParams(params)** receives a dictionary type argument with predefined parameters. _constructParams_ defines the default values (_newParams_) for all or most of the parameters and then it merges them with _params_. If defined, values in _params_ are going to override any values in _newParameters_. Some default values are shown below, for a complete list see this method. + * **getDynaFields(fields)** Retrieves the fields for the Dynaform class + * **getEditForm(params, base\_form)** Retrieves the form used on the edit page + * **getAdminForm(base\_form)** + * **getKeyFieldsPattern(params)** Retrieves the pattern for the keyfields + * **getPattern(params)** + * **getScopePattern(params)** + + +## Redirects + + * **edit\_redirect** defines the url pattern for redirection to the edit page. It is used on public pages, for example document's public page for generating the "Edit this document" link. + * **missing\_redirect** defines the url pattern for redirection to the page that should be displayed if the entity is missing. + * **delete\_redirect** defines the url pattern for redirection after deleting an entity. + * **cancel\_redirect** defines the URL when the cancel button is pressed on the edit page + * **public\_redirect** defines the URL for redirecting to the entities Public page + +## Url patterns + + * **link\_id\_arg\_pattern** + * **link\_id\_pattern\_core** + * **scope\_path\_pattern** + * **sans\_link\_id\_pattern** + * **no\_edit** if defined the default edit url pattern will not be included in _django\_patterns\_defaults_ + * **no\_delete** if defined the default delete url pattern will not be included in _django\_patterns\_defaults_ + * **no\_create\_raw** if defined the URL pattern for creation without any keyfields is not included + * **no\_list\_raw** if defined the URL pattern for the list page without keyfields is not included + * **no\_show** if defined the default public page url pattern will not be included in _django\_patterns\_defaults_ + * **no\_admin** if defined the default admin url pattern will not be included in _django\_patterns\_defaults_ + * **sans\_link\_id\_create** + * **sans\_link\_id\_list** + * **sans\_link\_id\_public\_list** + * **django\_patterns** if defined they are going to be the only url patterns used for a specific view. + * **extra\_django\_patterns** this is where you should define any additional django patterns to be used with _django\_patterns\_default_. They are omited if _django\_patterns_ is defined. + * **django\_patterns\_default** are the default django url patterns and they will be used if _django\_patterns_ isn't defined. They are dynamicaly constructed in _constructParams_. + * **no\_create\_with\_scope** The URL pattern for the create page with a given scope is not included + * **no\_create\_with\_key\_fields** The URL pattern for the create page with all the key fields is no included + * **key\_fields\_pattern** pattern for the keyfields of an entity + + +## Sidebar + +Sidebar entries are defined as a three-element tuple (url, text, access\_type ?). Sidebar related methods are in **soc.views.helper.sidebar**. + + * **sidebar** is used instead of _sidebar\_default_ if defined. + * **sidebar\_grouping** is used to indicate to which sidebar group _sidebar_ or _sidebar\_defaults_ entries belong to. + * **sidebar\_defaults** are the default sidebar entries. + * **sidebar\_additional** are additional sidebar entries. + +## Templates and messages + +Templates parameters are paths to django template files with soc/app/soc/temlates being the root. + + * **public\_template** is used in the entity's public page (show) + * **export\_template** is used in the entity's export page + * **edit\_template** is used in the entity's edit page + * **admin\_template** is used in the entity's admin page + * **list\_template** is used in the entity's list page + * **list\_main** is the list layout django template for the list page ? + * **error\_public** is used for showing errors in the public page ? + * **error\_export** is used for showing errors in the export page.? It defaults to _error\_public_. + * **error\_edit** is used for showing errors in the edit page. ? It defaults to _error\_public_. + +## Strings + +Some strings are used system-wide so they are defined in the parameters. + + * **save\_msg** is used on the create page when saving or deleting an entity. It holds two values where the first one is used to indicate a succesfull entity creation, for example 'Document saved' and the other one is used to indicate that an entity couldn't be deleted for example 'Cannot delete document'. + * **no\_lists\_msg** + * **list\_description** is the message used when showing the list page, for example 'List of documents'. + * **name** is the name of the entity. + * **name\_short** is the short name of the entity, which defaults to _name_. + * **name\_plural** is the plural name of the entity, which defaults to _name_+'s'. + * **module\_package** is the module package name, which defaults to 'soc.views.models' + * **module\_name** is the module name. + * **url\_name** is the module name used in the url. Defaults to _module\_name_. + * **document\_prefix** + * **list\_msg** Default message used on the lists page + +## Exporting + +Data of some entities can be exported and these parameters are used to define that process. + + * **export\_template** see Templates + * **error\_export** see Templates + * **export\_content\_type** holds the mime content type of the exported data. If defined default url pattern for export will be added to _django\_patterns\_default_ (see Url patterns). + * **export\_extension** defines the export file extension. If not predefined it defaults to '.txt'. + * **csv\_fieldnames** if the export content type is text/csv this parameter is used to indicate the field names. + +## Javascript modules + + * **js\_uses\_all** + * **js\_uses\_edit** + * **js\_uses\_list** + * **js\_uses\_show** + +## Needs to be sorted and defined + + * **rights** The rights instance this View uses for checking access + * **logic** The Logic instance this View uses + * **pickable** + * **list\_params** Defines the mapping of params entry to an entry that is used in generating lists + * **submit\_msg\_param\_name** Name of the parameter appended to URL when a form is submitted to show the saved message. + * **edit\_params** + * **cannot\_delete\_params** + * **dynabase** + * **references** + * **create\_dynainclude** + * **create\_dynaexclude** Form fields to exclude from the create/edit form per default + * **create\_dynaproperties** Properties for the Create form + * **edit\_dynaproperties** Properties for the Edit form + * **create\_form** Form used on the default Create page for this View + * **edit\_form** Form used on the default Edit page for this View + * **admin\_form** Admin Form \ No newline at end of file
diff --git a/SocParams.wiki b/SocParams.wiki deleted file mode 100644 index d05dd5f..0000000 --- a/SocParams.wiki +++ /dev/null
@@ -1,121 +0,0 @@ -#summary List of views helper parameters and their role in the system. -#labels Importance-Useful,Contents-Draft - -= Parameters = - -Parameters are usually system-wide and they contain information for handling redirects, templates, sidebar entries, url patterns, dynamic fields & forms, and more in views. Parameters related methods are defined in *soc.views.helper.params*: - - * *constructParams(params)* receives a dictionary type argument with predefined parameters. _constructParams_ defines the default values (_newParams_) for all or most of the parameters and then it merges them with _params_. If defined, values in _params_ are going to override any values in _newParameters_. Some default values are shown below, for a complete list see this method. - * *getDynaFields(fields)* Retrieves the fields for the Dynaform class - * *getEditForm(params, base_form)* Retrieves the form used on the edit page - * *getAdminForm(base_form)* - * *getKeyFieldsPattern(params)* Retrieves the pattern for the keyfields - * *getPattern(params)* - * *getScopePattern(params)* - - -== Redirects == - - * *edit_redirect* defines the url pattern for redirection to the edit page. It is used on public pages, for example document's public page for generating the "Edit this document" link. - * *missing_redirect* defines the url pattern for redirection to the page that should be displayed if the entity is missing. - * *delete_redirect* defines the url pattern for redirection after deleting an entity. - * *cancel_redirect* defines the URL when the cancel button is pressed on the edit page - * *public_redirect* defines the URL for redirecting to the entities Public page - -== Url patterns == - - * *link_id_arg_pattern* - * *link_id_pattern_core* - * *scope_path_pattern* - * *sans_link_id_pattern* - * *no_edit* if defined the default edit url pattern will not be included in _django_patterns_defaults_ - * *no_delete* if defined the default delete url pattern will not be included in _django_patterns_defaults_ - * *no_create_raw* if defined the URL pattern for creation without any keyfields is not included - * *no_list_raw* if defined the URL pattern for the list page without keyfields is not included - * *no_show* if defined the default public page url pattern will not be included in _django_patterns_defaults_ - * *no_admin* if defined the default admin url pattern will not be included in _django_patterns_defaults_ - * *sans_link_id_create* - * *sans_link_id_list* - * *sans_link_id_public_list* - * *django_patterns* if defined they are going to be the only url patterns used for a specific view. - * *extra_django_patterns* this is where you should define any additional django patterns to be used with _django_patterns_default_. They are omited if _django_patterns_ is defined. - * *django_patterns_default* are the default django url patterns and they will be used if _django_patterns_ isn't defined. They are dynamicaly constructed in _constructParams_. - * *no_create_with_scope* The URL pattern for the create page with a given scope is not included - * *no_create_with_key_fields* The URL pattern for the create page with all the key fields is no included - * *key_fields_pattern* pattern for the keyfields of an entity - - -== Sidebar == - -Sidebar entries are defined as a three-element tuple (url, text, access_type ?). Sidebar related methods are in *soc.views.helper.sidebar*. - - * *sidebar* is used instead of _sidebar_default_ if defined. - * *sidebar_grouping* is used to indicate to which sidebar group _sidebar_ or _sidebar_defaults_ entries belong to. - * *sidebar_defaults* are the default sidebar entries. - * *sidebar_additional* are additional sidebar entries. - -== Templates and messages == - -Templates parameters are paths to django template files with soc/app/soc/temlates being the root. - - * *public_template* is used in the entity's public page (show) - * *export_template* is used in the entity's export page - * *edit_template* is used in the entity's edit page - * *admin_template* is used in the entity's admin page - * *list_template* is used in the entity's list page - * *list_main* is the list layout django template for the list page ? - * *error_public* is used for showing errors in the public page ? - * *error_export* is used for showing errors in the export page.? It defaults to _error_public_. - * *error_edit* is used for showing errors in the edit page. ? It defaults to _error_public_. - -== Strings == - -Some strings are used system-wide so they are defined in the parameters. - - * *save_msg* is used on the create page when saving or deleting an entity. It holds two values where the first one is used to indicate a succesfull entity creation, for example 'Document saved' and the other one is used to indicate that an entity couldn't be deleted for example 'Cannot delete document'. - * *no_lists_msg* - * *list_description* is the message used when showing the list page, for example 'List of documents'. - * *name* is the name of the entity. - * *name_short* is the short name of the entity, which defaults to _name_. - * *name_plural* is the plural name of the entity, which defaults to _name_+'s'. - * *module_package* is the module package name, which defaults to 'soc.views.models' - * *module_name* is the module name. - * *url_name* is the module name used in the url. Defaults to _module_name_. - * *document_prefix* - * *list_msg* Default message used on the lists page - -== Exporting == - -Data of some entities can be exported and these parameters are used to define that process. - - * *export_template* see Templates - * *error_export* see Templates - * *export_content_type* holds the mime content type of the exported data. If defined default url pattern for export will be added to _django_patterns_default_ (see Url patterns). - * *export_extension* defines the export file extension. If not predefined it defaults to '.txt'. - * *csv_fieldnames* if the export content type is text/csv this parameter is used to indicate the field names. - -== Javascript modules == - - * *js_uses_all* - * *js_uses_edit* - * *js_uses_list* - * *js_uses_show* - -== Needs to be sorted and defined == - - * *rights* The rights instance this View uses for checking access - * *logic* The Logic instance this View uses - * *pickable* - * *list_params* Defines the mapping of params entry to an entry that is used in generating lists - * *submit_msg_param_name* Name of the parameter appended to URL when a form is submitted to show the saved message. - * *edit_params* - * *cannot_delete_params* - * *dynabase* - * *references* - * *create_dynainclude* - * *create_dynaexclude* Form fields to exclude from the create/edit form per default - * *create_dynaproperties* Properties for the Create form - * *edit_dynaproperties* Properties for the Edit form - * *create_form* Form used on the default Create page for this View - * *edit_form* Form used on the default Edit page for this View - * *admin_form* Admin Form \ No newline at end of file