Commit 6b66946b authored by Jean-Paul Smets's avatar Jean-Paul Smets

2007-01-08 JPS - refactored API and implemented minimal site.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11918 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c4b05340
...@@ -321,7 +321,7 @@ return aggregate_list\n ...@@ -321,7 +321,7 @@ return aggregate_list\n
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>WebSite_getGroupList</string> </value> <value> <string>Form_getGroupList</string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
...@@ -76,21 +76,37 @@ ...@@ -76,21 +76,37 @@
ERP5 contents through multiple custom web layouts.\n ERP5 contents through multiple custom web layouts.\n
\n \n
This script returns a list of tuples in the form\n This script returns a list of tuples in the form\n
(title, value) where title is the title of the\n (title, value) where title is the *translated* title of the\n
document provided as value. The document value\n document provided as value. The document value\n
must be wrapped in the acquisition context\n must be wrapped in the acquisition context\n
(ex. Web Site / Section / Module / Document).\n (ex. Web Site / Section / Module / Document).\n
\n \n
Scripts of page templates which use this script\n The reason why the title is generated by this script\n
is because the layout of a breadcrumb (ex. horizontal,\n
vertical, tree, etc.) is independent of the kind of\n
titles we want to use to represent each the breadcrumb\n
items. It is therefore the responsability of this\n
script to decide how to identify a document which will\n
be displayed in a breadcrumb (ex. by title,\n
by short title, by reference, by version) and to translate\n
whatever is relevant to be translated.\n
\n
Page templates which use this script\n
and need to generate the URLs of document values\n and need to generate the URLs of document values\n
should must use the Base_getPermanentURL API\n should use the getPermanentURL API (called on the\n
or the absolute_url API in order\n current section) in order to benefit from\n
to benefit from virtual hosting features.\n virtual hosting features and in order to make sure\n
(ie. do not use getUrl or getPath)\n that generated URLs are as much as possible permanent\n
URLs. Never use getUrl or getPath to generate URLs.\n
You may also use absolute_url but in this case you\n
will lose all the benefits from permanent URLs.\n
\n
As a rule of thumb: for viewable content, use\n
getPermanentURL; for editable content, use absolute_url\n
\n \n
This script can be used to produce breadcrumbs\n This script should be customised if necessary to\n
in page templates or in widgets. It can be customised\n implement Web Section specific breadcrumb behaviour.\n
to implement different behaviours such as\n Typical behaviours include:\n
\n \n
- CMS like breadcrumb (hierarchy of contents)\n - CMS like breadcrumb (hierarchy of contents)\n
\n \n
...@@ -100,10 +116,13 @@ ...@@ -100,10 +116,13 @@
\n \n
The default implementation is hierarchical.\n The default implementation is hierarchical.\n
\n \n
TODO: Clarify absolute_url or Base_getPermanentURL\n Customisation can be portal_type based, class based\n
TODO: is it so useful to include title ?\n or can simply result from putting a WebSection_getBreadcrumbItemList\n
directly inside a given section rather than in a skin\n
folder. The later is recommended for hosting\n
multiple sites on a single ERP5Site instance.\n
"""\n """\n
crumb = context\n crumb = document\n
crumb_list = []\n crumb_list = []\n
\n \n
# Implementation consists in browsing the aq_parent sequence\n # Implementation consists in browsing the aq_parent sequence\n
...@@ -140,7 +159,7 @@ return crumb_list\n ...@@ -140,7 +159,7 @@ return crumb_list\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string></string> </value> <value> <string>document</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -160,13 +179,13 @@ return crumb_list\n ...@@ -160,13 +179,13 @@ return crumb_list\n
<dictionary> <dictionary>
<item> <item>
<key> <string>co_argcount</string> </key> <key> <string>co_argcount</string> </key>
<value> <int>0</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
<value> <value>
<tuple> <tuple>
<string>context</string> <string>document</string>
<string>crumb</string> <string>crumb</string>
<string>crumb_list</string> <string>crumb_list</string>
<string>None</string> <string>None</string>
...@@ -187,7 +206,7 @@ return crumb_list\n ...@@ -187,7 +206,7 @@ return crumb_list\n
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>WebSite_getBreadcrumbItemList</string> </value> <value> <string>WebSection_getBreadcrumbItemList</string> </value>
</item> </item>
<item> <item>
<key> <string>warnings</string> </key> <key> <string>warnings</string> </key>
......
...@@ -81,17 +81,18 @@ ...@@ -81,17 +81,18 @@
\n \n
The default implementation should look at published\n The default implementation should look at published\n
documents which are associated to the section\n documents which are associated to the section\n
through aggregate relation and try to display those\n through the aggregate relation and try to display those\n
which are in the user language if any.\n which are available in the user language if any.\n
\n \n
Other implementations are possible: ex. display the last\n Other implementations are possible: ex. display the last\n
version in the closest language rather than\n version in the closest language rather than\n
the latest version in the user language.\n the latest version in the user language.\n
\n \n
This script is intended to be overriden by creating a new script\n This script is intended to be overriden by creating a new script\n
within the Web Site instance if necessary (not inside a\n within a Web Section or a Web Site instance. Customisation\n
portal_skin since multiple sites might have different behaviour).\n is also possible per portal type or per meta type through\n
\n portal skins. It is recommended to use the first approach\n
to host multiple sites on a single ERP5Site instance.\n
"""\n """\n
portal_object = context.getPortalObject()\n portal_object = context.getPortalObject()\n
\n \n
...@@ -104,7 +105,7 @@ current_section = context.getWebSectionValue()\n ...@@ -104,7 +105,7 @@ current_section = context.getWebSectionValue()\n
reference_list = context.getAggregateReferenceList()\n reference_list = context.getAggregateReferenceList()\n
if not reference_list: return None # Quick return\n if not reference_list: return None # Quick return\n
\n \n
return context.WebSite_getDocumentValue(name=reference_list)\n return context.getDocumentValue(name=reference_list)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -175,7 +176,7 @@ return context.WebSite_getDocumentValue(name=reference_list)\n ...@@ -175,7 +176,7 @@ return context.WebSite_getDocumentValue(name=reference_list)\n
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>WebSite_getDefaultWebPageValue</string> </value> <value> <string>WebSection_getDefaultDocumentValue</string> </value>
</item> </item>
<item> <item>
<key> <string>warnings</string> </key> <key> <string>warnings</string> </key>
......
...@@ -74,11 +74,6 @@ ...@@ -74,11 +74,6 @@
ERP5 Web is a business template of ERP5 which provides a way\n ERP5 Web is a business template of ERP5 which provides a way\n
to create web sites which can display selected\n to create web sites which can display selected\n
ERP5 contents through multiple custom web layouts.\n ERP5 contents through multiple custom web layouts.\n
\n
If no name parameter is provided, this script\n
returns the document which is being displayed\n
currently in a Web Section or a Web Page\n
by invoking WebSite_getDefaultWebPageValue. \n
\n \n
The default implementation searches for\n The default implementation searches for\n
documents which are in the user language if any\n documents which are in the user language if any\n
...@@ -87,13 +82,11 @@ ...@@ -87,13 +82,11 @@
Other implementations are possible: ex. display the last\n Other implementations are possible: ex. display the last\n
version in the closest language rather than\n version in the closest language rather than\n
the latest version in the user language.\n the latest version in the user language.\n
\n
If a name parameter is provided, it will lookup\n
the catalog to find the most appropriate\n
document.\n
\n \n
NOTE:\n NOTE:\n
- portal param probably useless \n - the portal parameter was introduced to\n
fix acquisition issues within the _aq_dynamic\n
lookup from WebSection class.\n
"""\n """\n
if portal is None: portal = context.getPortalObject()\n if portal is None: portal = context.getPortalObject()\n
portal_catalog = portal.portal_catalog\n portal_catalog = portal.portal_catalog\n
...@@ -102,33 +95,26 @@ portal_catalog = portal.portal_catalog\n ...@@ -102,33 +95,26 @@ portal_catalog = portal.portal_catalog\n
# href tags which point to a document by reference can still work.\n # href tags which point to a document by reference can still work.\n
valid_portal_type_list = [\'Web Page\', ]\n valid_portal_type_list = [\'Web Page\', ]\n
\n \n
# This should probably be moved to a specific page\n
if name is None:\n
if context.getPortalType() in valid_portal_type_list:\n
return context\n
elif context.getPortalType() in (\'Web Site\', \'Web Section\'):\n
return context.WebSite_getDefaultWebPageValue()\n
else:\n
return None\n
\n
# Find the applicable language\n # Find the applicable language\n
language = context.Localizer.get_selected_language()\n language = portal.Localizer.get_selected_language()\n
\n \n
# Search the catalog for all documents matching the reference\n # Search the catalog for all documents matching the reference\n
# this will only return documents which are accessible by the user\n # this will only return documents which are accessible by the user\n
web_page_list = portal_catalog(reference=name, portal_type=valid_portal_type_list,\n web_page_list = portal_catalog(reference=name, portal_type=valid_portal_type_list, \n
order_by=[(\'index\', \'descending\'), (\'version\', \'descending\')],\n order_by=[(\'index\', \'descending\'), (\'version\', \'descending\')],\n
language=language)\n language=language)\n
# XXX - group_by is missing here\n # XXX - group_by is missing here\n
# portal_catalog extension required\n
try:\n try:\n
# Try to get the first page on the list\n # Try to get the first page on the list\n
web_page = web_page_list[0]\n web_page = web_page_list[0]\n
web_page = web_page.getObject()\n web_page = web_page.getObject()\n
except IndexError:\n except IndexError:\n
# Search again without the language\n # Search again without the language\n
web_page_list = portal_catalog(reference=name, portal_type=\'Web Page\',\n web_page_list = portal_catalog(reference=name, portal_type=\'Web Page\', \n
order_by=[(\'index\', \'descending\'), (\'version\', \'descending\')])\n order_by=[(\'index\', \'descending\'), (\'version\', \'descending\')])\n
# XXX - group_by is missing here\n # XXX - group_by is missing here\n
# portal_catalog extension required\n
try:\n try:\n
# Try to get the first page on the list\n # Try to get the first page on the list\n
web_page = web_page_list[0]\n web_page = web_page_list[0]\n
...@@ -161,7 +147,7 @@ return web_page\n ...@@ -161,7 +147,7 @@ return web_page\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>name=None,portal=None</string> </value> <value> <string>name,portal=None</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -212,13 +198,12 @@ return web_page\n ...@@ -212,13 +198,12 @@ return web_page\n
<value> <value>
<tuple> <tuple>
<none/> <none/>
<none/>
</tuple> </tuple>
</value> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>WebSite_getDocumentValue</string> </value> <value> <string>WebSection_getDocumentValue</string> </value>
</item> </item>
<item> <item>
<key> <string>warnings</string> </key> <key> <string>warnings</string> </key>
......
...@@ -94,14 +94,21 @@ ...@@ -94,14 +94,21 @@
with a "validated" state and in the appropriate product family.\n with a "validated" state and in the appropriate product family.\n
\n \n
This script is intended to be overriden by creating a new script\n This script is intended to be overriden by creating a new script\n
within the Web Site instance if necessary (not inside a\n within the Web Section or Web Site instance. It can be also\n
portal_skin since multiple sites might have different behaviour).\n customised per portal type within portal_skins. Customisation\n
thourgh local scripts is recommended to host multiple sites\n
on the same ERP5Site instance.\n
\n
The API uses **kw so that it is possible to extend the behaviour of\n
the default script with advanced features (ex. group by reference,\n
by version, only select a specific publication state, etc.).\n
\n \n
Here are some suggestions which can either be implemented using\n Here are some suggestions which can either be implemented using\n
SQL (group_by, order_by) or using additional python scripting\n SQL (group_by, order_by) or using additional python scripting\n
if this is compatible with data size.\n if this is compatible with data size.\n
\n \n
SUGGESTIONS:\n SUGGESTIONS:\n
\n
- Prevent showing duplicate references\n - Prevent showing duplicate references\n
\n \n
- Add documents associated to this section through \'aggregate\'.\n - Add documents associated to this section through \'aggregate\'.\n
...@@ -115,7 +122,7 @@ current_section = context.getWebSectionValue()\n ...@@ -115,7 +122,7 @@ current_section = context.getWebSectionValue()\n
\n \n
# Return the list of matching documents for the given states\n # Return the list of matching documents for the given states\n
return current_section.searchResults(validation_state=[\'draft\', \'submitted\', \'shared\',\n return current_section.searchResults(validation_state=[\'draft\', \'submitted\', \'shared\',\n
\'released\', \'public\', \'restricted\'],\n \'released\', \'published\', \'restricted\'],\n
order_by=[(\'int_index\', \'descending\')])\n order_by=[(\'int_index\', \'descending\')])\n
</string> </value> </string> </value>
</item> </item>
......
...@@ -85,56 +85,40 @@ ...@@ -85,56 +85,40 @@
even if the physical path of the document is\n even if the physical path of the document is\n
\n \n
/erp5/web_page_module/33\n /erp5/web_page_module/33\n
\n
This script can be considered as the reverse of\n
WebSection_getDocumentValue.\n
\n \n
The default script looks in the acquisition context\n The default script looks in the acquisition context\n
for the first relevant section and build a URL\n for the first relevant section and builds a URL\n
based on the section absolute_url and on the\n based on the section absolute_url and on the\n
document reference.\n document reference.\n
\n \n
The section parameter can be used to provide\n The document parameter is required.\n
explicitely a section. This can be useful to\n
build URL generators for listbox entries.\n
\n \n
More sophisticated behaviours are possible.\n More sophisticated behaviours are possible.\n
\n \n
SUGGESTIONS:\n SUGGESTIONS:\n
\n \n
- change the behaviour of WebSite_getDocumentUrl\n - change the behaviour of WebSection_getPermanentURL\n
for non anonymous\n for non anonymous\n
\n
- change the behaviour of WebSite_getDocumentUrl\n
for documents which are not published.\n
\n \n
NOTE: absolute_url is the appropriate API to get\n - change the behaviour of WebSection_getPermanentURL\n
the absolute_url of the current document. It has\n for documents which are not published.\n
been tweaked enough in ERP5 Web to support virtual\n
hosting and permanent URLs.\n
\n
Base_getPermanentURL is useful to create a permanent\n
URL out of a document which has been accessed either\n
directly or through a Web Section / Web Site. It is\n
the reverse method of WebSite_getDocumentValue.\n
"""\n """\n
# Return absolute URL if our parent is not a Web Section or Web Site\n
if section is None and context.aq_parent.getPortalType() not in (\'Web Section\', \'Web Site\'):\n
return context.absolute_url()\n
\n
# Return absolute URL if this is not an appropriate portal_type\n # Return absolute URL if this is not an appropriate portal_type\n
valid_portal_type_list = [\'Web Page\', ] # WARNING - this is a copy from WebSite_getDocumentValue\n valid_portal_type_list = [\'Web Page\', ] # WARNING - this is a copy from WebSection_getDocumentValue\n
if context.getPortalType() not in valid_portal_type_list:\n if document.getPortalType() not in valid_portal_type_list:\n
return context.absolute_url()\n return document.absolute_url()\n
\n \n
# Return absolute URL if this is not a \'live\' document\n # Return absolute URL if this is not a \'live\' document\n
validation_state=[\'draft\', \'submitted\', \'shared\', # WARNING - this is a copy from WebSite_getDocumentValueList\n validation_state=[\'draft\', \'submitted\', \'shared\', # WARNING - this is a copy from WebSection_getDocumentValueList\n
\'released\', \'published\', \'restricted\']\n \'released\', \'published\', \'restricted\']\n
if context.getValidationState() not in validation_state:\n if document.getValidationState() not in validation_state:\n
return context.absolute_url()\n return document.absolute_url()\n
\n
# Find the Web Section or Web Site we belong to\n
if section is None: section = context.getWebSectionValue()\n
\n \n
# Return the URL\n # Return the URL\n
return "%s/%s" % (section.absolute_url(), context.getReference())\n return "%s/%s" % (context.absolute_url(), document.getReference())\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -157,7 +141,7 @@ return "%s/%s" % (section.absolute_url(), context.getReference())\n ...@@ -157,7 +141,7 @@ return "%s/%s" % (section.absolute_url(), context.getReference())\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>section=None</string> </value> <value> <string>document</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -183,12 +167,11 @@ return "%s/%s" % (section.absolute_url(), context.getReference())\n ...@@ -183,12 +167,11 @@ return "%s/%s" % (section.absolute_url(), context.getReference())\n
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
<value> <value>
<tuple> <tuple>
<string>section</string> <string>document</string>
<string>None</string>
<string>_getattr_</string>
<string>context</string>
<string>valid_portal_type_list</string> <string>valid_portal_type_list</string>
<string>_getattr_</string>
<string>validation_state</string> <string>validation_state</string>
<string>context</string>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -200,14 +183,12 @@ return "%s/%s" % (section.absolute_url(), context.getReference())\n ...@@ -200,14 +183,12 @@ return "%s/%s" % (section.absolute_url(), context.getReference())\n
<item> <item>
<key> <string>func_defaults</string> </key> <key> <string>func_defaults</string> </key>
<value> <value>
<tuple> <none/>
<none/>
</tuple>
</value> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Base_getPermanentURL</string> </value> <value> <string>WebSection_getPermanentURL</string> </value>
</item> </item>
<item> <item>
<key> <string>warnings</string> </key> <key> <string>warnings</string> </key>
......
...@@ -73,9 +73,8 @@ ...@@ -73,9 +73,8 @@
for a newly created Web Site\n for a newly created Web Site\n
"""\n """\n
# Set Web Site layout to default one\n # Set Web Site layout to default one\n
default_layout = \'template_erp5_web\'\n context.setContainerLayout(\'erp5_web_layout\')\n
context.setContainerLayout(default_layout)\n context.setContentLayout(\'erp5_web_content_layout\')\n
context.setContentLayout(default_layout)\n
\n \n
# Set default webmaster to current user\n # Set default webmaster to current user\n
user_id = context.portal_membership.getAuthenticatedMember().getUserName()\n user_id = context.portal_membership.getAuthenticatedMember().getUserName()\n
...@@ -124,7 +123,6 @@ context.setWebmaster(user_id)\n ...@@ -124,7 +123,6 @@ context.setWebmaster(user_id)\n
<tuple> <tuple>
<string>args</string> <string>args</string>
<string>kw</string> <string>kw</string>
<string>default_layout</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>user_id</string> <string>user_id</string>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.ERP5Form.Form</string>
<string>ERP5Form</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left column transparent (Logo)</string>
<string>left column (Navigation)</string>
<string>left column (Contents)</string>
<string>left column (Search)</string>
<string>left column (Debug)</string>
<string>right column (Demo)</string>
<string>right column (Toolbox)</string>
<string>footer</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>footer</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left column (Contents)</string> </key>
<value>
<list>
<string>subsection_list</string>
<string>section_content_list</string>
</list>
</value>
</item>
<item>
<key> <string>left column (Debug)</string> </key>
<value>
<list>
<string>applicable_layout</string>
</list>
</value>
</item>
<item>
<key> <string>left column (Navigation)</string> </key>
<value>
<list>
<string>language_selector</string>
<string>breadcrumb</string>
</list>
</value>
</item>
<item>
<key> <string>left column (Search)</string> </key>
<value>
<list>
<string>your_search_text</string>
<string>search_action</string>
</list>
</value>
</item>
<item>
<key> <string>left column transparent (Logo)</string> </key>
<value>
<list>
<string>website_logo</string>
</list>
</value>
</item>
<item>
<key> <string>right column (Demo)</string> </key>
<value>
<list>
<string>about_box</string>
</list>
</value>
</item>
<item>
<key> <string>right column (Toolbox)</string> </key>
<value>
<list>
<string>admin_toolbox</string>
</list>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>erp5_web_content_layout</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>erp5_web_default_layout</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>template_erp5_web</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>6</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Default Section Layout</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.ERP5Form.InputButtonField</string>
<string>InputButtonField</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>search_action</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string>hiddenLabel searchButton</string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string>Go</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>Base_searchResultList:method</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Search</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -150,9 +150,7 @@ ...@@ -150,9 +150,7 @@
</item> </item>
<item> <item>
<key> <string>enabled</string> </key> <key> <string>enabled</string> </key>
<value> <value> <string></string> </value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>external_validator</string> </key> <key> <string>external_validator</string> </key>
...@@ -301,26 +299,7 @@ ...@@ -301,26 +299,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>here/section_content_render</string> </value> <value> <string>here/current_web_section/section_content_render</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.TALESField</string>
<string>TALESMethod</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:here.getPortalType() in (\'Web Site\', \'Web Section\')</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -150,9 +150,7 @@ ...@@ -150,9 +150,7 @@
</item> </item>
<item> <item>
<key> <string>enabled</string> </key> <key> <string>enabled</string> </key>
<value> <value> <string></string> </value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>external_validator</string> </key> <key> <string>external_validator</string> </key>
...@@ -301,26 +299,7 @@ ...@@ -301,26 +299,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>here/subsection_render</string> </value> <value> <string>request/current_web_section/subsection_render</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.TALESField</string>
<string>TALESMethod</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:here.getPortalType() in (\'Web Site\', \'Web Section\')</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -150,9 +150,7 @@ ...@@ -150,9 +150,7 @@
</item> </item>
<item> <item>
<key> <string>enabled</string> </key> <key> <string>enabled</string> </key>
<value> <value> <string></string> </value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>external_validator</string> </key> <key> <string>external_validator</string> </key>
...@@ -301,26 +299,7 @@ ...@@ -301,26 +299,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>here/section_content_render</string> </value> <value> <string>request/current_web_section/section_content_render</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.TALESField</string>
<string>TALESMethod</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:here.getPortalType() in (\'Web Site\', \'Web Section\')</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -150,9 +150,7 @@ ...@@ -150,9 +150,7 @@
</item> </item>
<item> <item>
<key> <string>enabled</string> </key> <key> <string>enabled</string> </key>
<value> <value> <string></string> </value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>external_validator</string> </key> <key> <string>external_validator</string> </key>
...@@ -301,26 +299,7 @@ ...@@ -301,26 +299,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>here/subsection_render</string> </value> <value> <string>request/current_web_section/subsection_render</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.TALESField</string>
<string>TALESMethod</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:here.getPortalType() in (\'Web Site\', \'Web Section\')</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -105,18 +105,26 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n ...@@ -105,18 +105,26 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n
<!-- Here we force the editable_mode variable to True to let the layout and widgets\n <!-- Here we force the editable_mode variable to True to let the layout and widgets\n
based on forms be rendered as editable or non-editable according the "editable"\n based on forms be rendered as editable or non-editable according the "editable"\n
property on fields.\n property on fields.\n
However this hasa bad side effect: the editable_mode variable in request is\n \n
However this has bad side effect: the editable_mode variable in request is\n
forced to True and is no longer representative of the web site mode.\n forced to True and is no longer representative of the web site mode.\n
\n
We also set some REQUEST variables which will be needed by Widgets.\n
-->\n -->\n
</tal:block>\n </tal:block>\n
\n \n
<tal:block tal:repeat="aggregate python: layout_form.WebSite_getGroupList([\'header\', \'left\', \'right\', \'footer\'])"\n <tal:block tal:repeat="aggregate python: layout_form.Form_getGroupList([\'header\', \'left\', \'right\', \'footer\'])"\n
tal:define="dummy python: request.set(\'editable_mode\', True);\n tal:define="dummy python: request.set(\'editable_mode\', True);\n
dummy python: request.set(\'http_parameters\', http_parameters);\n dummy python: request.set(\'http_parameters\', http_parameters);\n
dummy python: request.set(\'actions\', actions);">\n dummy python: request.set(\'actions\', actions);\n
dummy python: request.set(\'current_web_section\',\n
request.get(\'current_web_section\', here.getWebSectionValue()));\n
dummy python: request.set(\'current_web_document\',\n
request.get(\'current_web_document\', here));\n
dummy python: request.set(\'is_web_section_default_document\',\n
request.get(\'is_web_section_default_document\', 0));">\n
<tal:block metal:use-macro="here/aggregate_render/macros/aggregate_render"/>\n <tal:block metal:use-macro="here/aggregate_render/macros/aggregate_render"/>\n
</tal:block>\n </tal:block>\n
\n
</tal:block>\n </tal:block>\n
</tal:block>\t\n </tal:block>\t\n
</tal:block>\n </tal:block>\n
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
tal:condition="remaining_items">\n tal:condition="remaining_items">\n
<li tal:define="current_item python: remaining_items[0];\n <li tal:define="current_item python: remaining_items[0];\n
remaining_items python: remaining_items[1:]">\n remaining_items python: remaining_items[1:]">\n
<a tal:attributes="href python: \'%s/view\' % current_item[1].Base_getPermanentURL();\n <a tal:attributes="href python: \'%s/view\' % current_item[1].getPermanentURL(current_item[1]);\n
class python: len(remaining_items) == 0 and \'selected\' or \'\'"\n class python: len(remaining_items) == 0 and \'selected\' or \'\'"\n
tal:content="python: current_item[0]"/>\n tal:content="python: current_item[0]"/>\n
<tal:block metal:use-macro="here/breadcrumb/macros/renderBreadcrumbItem"/>\n <tal:block metal:use-macro="here/breadcrumb/macros/renderBreadcrumbItem"/>\n
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
</tal:block>\n </tal:block>\n
\n \n
<!-- Initialize the recursive loop -->\n <!-- Initialize the recursive loop -->\n
<div class="breadcrumb" tal:define="remaining_items python: context.WebSite_getBreadcrumbItemList()">\n <div class="breadcrumb" tal:define="remaining_items python: context.getBreadcrumbItemList(here)">\n
<tal:block metal:use-macro="here/breadcrumb/macros/renderBreadcrumbItem"/>\n <tal:block metal:use-macro="here/breadcrumb/macros/renderBreadcrumbItem"/>\n
</div>\n </div>\n
\n \n
......
...@@ -53,8 +53,8 @@ ...@@ -53,8 +53,8 @@
are published and linked with the current section through Predicate.\n are published and linked with the current section through Predicate.\n
--></tal:block>\n --></tal:block>\n
\n \n
<ul tal:repeat="document python: context.WebSection_getDocumentValueList()">\n <ul tal:repeat="document python: request.current_web_section.getDocumentValueList()">\n
<li><a tal:attributes="href python: document.WebSite_getDocumentUrl()"\n <li><a tal:attributes="href python: context.getPermanentURL(document)"\n
tal:content="python: document.getProperty(\'translated_short_title\', None)\n tal:content="python: document.getProperty(\'translated_short_title\', None)\n
or document.getTranslatedTitleOrId()"/></li>\n or document.getTranslatedTitleOrId()"/></li>\n
</ul> </ul>
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
This widget displays the list of Sections contained in the current context.\n This widget displays the list of Sections contained in the current context.\n
--></tal:block>\n --></tal:block>\n
\n \n
<ul><tal:block tal:repeat="section python:context.contentValues(portal_type=\'Web Section\')">\n <ul><tal:block tal:repeat="section python:here.contentValues(portal_type=\'Web Section\')">\n
<li>\n <li>\n
<a tal:attributes="href python: section.absolute_url_path()"\n <a tal:attributes="href python: section.absolute_url_path()"\n
tal:content="python: section.getProperty(\'translated_short_title\', None)\n tal:content="python: section.getProperty(\'translated_short_title\', None)\n
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment