Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Georgios Dagkakis
erp5
Commits
c5027fb7
Commit
c5027fb7
authored
Sep 07, 2018
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web: add Static Web Site for domain redirection
/reviewed-on
nexedi/erp5!737
parent
0d7a728a
Changes
36
Hide whitespace changes
Inline
Side-by-side
Showing
36 changed files
with
1410 additions
and
4 deletions
+1410
-4
bt5/erp5_web/ActionTemplateItem/portal_types/Static%20Web%20Site/view.xml
...ionTemplateItem/portal_types/Static%20Web%20Site/view.xml
+81
-0
bt5/erp5_web/DocumentTemplateItem/portal_components/document.erp5.StaticWebSite.py
...lateItem/portal_components/document.erp5.StaticWebSite.py
+60
-0
bt5/erp5_web/DocumentTemplateItem/portal_components/document.erp5.StaticWebSite.xml
...ateItem/portal_components/document.erp5.StaticWebSite.xml
+123
-0
bt5/erp5_web/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml
...eAllowedContentTypeTemplateItem/allowed_content_types.xml
+1
-0
bt5/erp5_web/PortalTypeBaseCategoryTemplateItem/base_category_list.xml
...PortalTypeBaseCategoryTemplateItem/base_category_list.xml
+4
-0
bt5/erp5_web/PortalTypePropertySheetTemplateItem/property_sheet_list.xml
...rtalTypePropertySheetTemplateItem/property_sheet_list.xml
+3
-0
bt5/erp5_web/PortalTypeTemplateItem/portal_types/Static%20Web%20Site.xml
...rtalTypeTemplateItem/portal_types/Static%20Web%20Site.xml
+139
-0
bt5/erp5_web/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
...rtalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
+4
-0
bt5/erp5_web/RegisteredSkinSelectionTemplateItem/registered_skin_selection.xml
...edSkinSelectionTemplateItem/registered_skin_selection.xml
+10
-0
bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/StaticWebSite_init.py
...nTemplateItem/portal_skins/erp5_web/StaticWebSite_init.py
+12
-0
bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/StaticWebSite_init.xml
...TemplateItem/portal_skins/erp5_web/StaticWebSite_init.xml
+85
-0
bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/StaticWebSite_viewRedirectAssistConfiguration.xml
...rp5_web/StaticWebSite_viewRedirectAssistConfiguration.xml
+153
-0
bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/StaticWebSite_viewRedirectAssistConfiguration/my_redirect_domain.xml
...te_viewRedirectAssistConfiguration/my_redirect_domain.xml
+101
-0
bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/StaticWebSite_viewRedirectAssistConfiguration/my_use_moved_temporarily.xml
...wRedirectAssistConfiguration/my_use_moved_temporarily.xml
+109
-0
bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_redirect_assist.xml
...kinTemplateItem/portal_skins/erp5_web_redirect_assist.xml
+47
-0
bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_redirect_assist/StaticWebSite_getDocumentValue.py
...rp5_web_redirect_assist/StaticWebSite_getDocumentValue.py
+17
-0
bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_redirect_assist/StaticWebSite_getDocumentValue.xml
...p5_web_redirect_assist/StaticWebSite_getDocumentValue.xml
+62
-0
bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_redirect_assist/StaticWebSite_getRedirectSourceUrl.py
...web_redirect_assist/StaticWebSite_getRedirectSourceUrl.py
+32
-0
bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_redirect_assist/StaticWebSite_getRedirectSourceUrl.xml
...eb_redirect_assist/StaticWebSite_getRedirectSourceUrl.xml
+62
-0
bt5/erp5_web/bt/template_action_path_list
bt5/erp5_web/bt/template_action_path_list
+1
-0
bt5/erp5_web/bt/template_document_id_list
bt5/erp5_web/bt/template_document_id_list
+2
-1
bt5/erp5_web/bt/template_portal_type_allowed_content_type_list
...rp5_web/bt/template_portal_type_allowed_content_type_list
+1
-0
bt5/erp5_web/bt/template_portal_type_base_category_list
bt5/erp5_web/bt/template_portal_type_base_category_list
+2
-0
bt5/erp5_web/bt/template_portal_type_id_list
bt5/erp5_web/bt/template_portal_type_id_list
+1
-0
bt5/erp5_web/bt/template_portal_type_property_sheet_list
bt5/erp5_web/bt/template_portal_type_property_sheet_list
+1
-0
bt5/erp5_web/bt/template_portal_type_workflow_chain_list
bt5/erp5_web/bt/template_portal_type_workflow_chain_list
+2
-0
bt5/erp5_web/bt/template_registered_skin_selection_list
bt5/erp5_web/bt/template_registered_skin_selection_list
+2
-0
bt5/erp5_web/bt/template_skin_id_list
bt5/erp5_web/bt/template_skin_id_list
+1
-0
bt5/erp5_web_ui_test/TestTemplateItem/portal_components/test.erp5.testStaticWebSiteRedirection.py
...rtal_components/test.erp5.testStaticWebSiteRedirection.py
+165
-0
bt5/erp5_web_ui_test/TestTemplateItem/portal_components/test.erp5.testStaticWebSiteRedirection.xml
...tal_components/test.erp5.testStaticWebSiteRedirection.xml
+121
-0
bt5/erp5_web_ui_test/bt/dependency_list
bt5/erp5_web_ui_test/bt/dependency_list
+1
-0
bt5/erp5_web_ui_test/bt/template_test_id_list
bt5/erp5_web_ui_test/bt/template_test_id_list
+1
-0
bt5/erp5_web_ui_test/bt/test_dependency_list
bt5/erp5_web_ui_test/bt/test_dependency_list
+1
-0
product/ERP5/Document/WebSection.py
product/ERP5/Document/WebSection.py
+1
-1
product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_redirect.py
...mplateItem/portal_skins/erp5_xhtml_style/Base_redirect.py
+1
-1
product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_redirect.xml
...plateItem/portal_skins/erp5_xhtml_style/Base_redirect.xml
+1
-1
No files found.
bt5/erp5_web/ActionTemplateItem/portal_types/Static%20Web%20Site/view.xml
0 → 100644
View file @
c5027fb7
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ActionInformation"
module=
"Products.CMFCore.ActionInformation"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
action_type/object_view
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
category
</string>
</key>
<value>
<string>
object_view
</string>
</value>
</item>
<item>
<key>
<string>
condition
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
icon
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
view
</string>
</value>
</item>
<item>
<key>
<string>
permissions
</string>
</key>
<value>
<tuple>
<string>
View
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
priority
</string>
</key>
<value>
<float>
1.0
</float>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
View
</string>
</value>
</item>
<item>
<key>
<string>
visible
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Expression"
module=
"Products.CMFCore.Expression"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
text
</string>
</key>
<value>
<string>
string:${object_url}/WebSite_view
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_web/DocumentTemplateItem/portal_components/document.erp5.StaticWebSite.py
0 → 100644
View file @
c5027fb7
##############################################################################
#
# Copyright (c) 2002-2006 Nexedi SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from
AccessControl
import
ClassSecurityInfo
from
erp5.component.document
import
StaticWebSection
from
Products.ERP5Type
import
Permissions
,
PropertySheet
class
StaticWebSite
(
StaticWebSection
.
StaticWebSection
):
"""
The Web Site root class is specialises WebSection
by defining a global webmaster user.
"""
# CMF Type Definition
meta_type
=
'ERP5 Static Web Site'
portal_type
=
'Static Web Site'
# Declarative security
security
=
ClassSecurityInfo
()
security
.
declareObjectProtected
(
Permissions
.
AccessContentsInformation
)
# Default Properties
property_sheets
=
(
PropertySheet
.
Base
,
PropertySheet
.
XMLObject
,
PropertySheet
.
CategoryCore
,
PropertySheet
.
DublinCore
,
PropertySheet
.
WebSection
,
PropertySheet
.
WebSite
,
PropertySheet
.
Predicate
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getWebSiteValue'
)
def
getWebSiteValue
(
self
):
"""
Returns the current web site (ie. self) though containment acquisition
"""
return
self
bt5/erp5_web/DocumentTemplateItem/portal_components/document.erp5.StaticWebSite.xml
0 → 100644
View file @
c5027fb7
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Document Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
StaticWebSite
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
document.erp5.StaticWebSite
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Document Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
bt5/erp5_web/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml
View file @
c5027fb7
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
<item>
Web Section
</item>
<item>
Web Section
</item>
</portal_type>
</portal_type>
<portal_type
id=
"Web Site Module"
>
<portal_type
id=
"Web Site Module"
>
<item>
Static Web Site
</item>
<item>
Web Site
</item>
<item>
Web Site
</item>
</portal_type>
</portal_type>
</allowed_content_type_list>
</allowed_content_type_list>
\ No newline at end of file
bt5/erp5_web/PortalTypeBaseCategoryTemplateItem/base_category_list.xml
View file @
c5027fb7
...
@@ -3,6 +3,10 @@
...
@@ -3,6 +3,10 @@
<item>
aggregate
</item>
<item>
aggregate
</item>
<item>
caching_policy
</item>
<item>
caching_policy
</item>
</portal_type>
</portal_type>
<portal_type
id=
"Static Web Site"
>
<item>
aggregate
</item>
<item>
caching_policy
</item>
</portal_type>
<portal_type
id=
"Web Page"
>
<portal_type
id=
"Web Page"
>
<item>
predecessor
</item>
<item>
predecessor
</item>
<item>
publication_section
</item>
<item>
publication_section
</item>
...
...
bt5/erp5_web/PortalTypePropertySheetTemplateItem/property_sheet_list.xml
View file @
c5027fb7
...
@@ -2,6 +2,9 @@
...
@@ -2,6 +2,9 @@
<portal_type
id=
"Static Web Section"
>
<portal_type
id=
"Static Web Section"
>
<item>
SortIndex
</item>
<item>
SortIndex
</item>
</portal_type>
</portal_type>
<portal_type
id=
"Static Web Site"
>
<item>
WebSitePreference
</item>
</portal_type>
<portal_type
id=
"Web Page"
>
<portal_type
id=
"Web Page"
>
<item>
Reference
</item>
<item>
Reference
</item>
<item>
SortIndex
</item>
<item>
SortIndex
</item>
...
...
bt5/erp5_web/PortalTypeTemplateItem/portal_types/Static%20Web%20Site.xml
0 → 100644
View file @
c5027fb7
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Base Type"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_property_domain_dict
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
short_title
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
acquire_local_roles
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
content_icon
</string>
</key>
<value>
<string>
web_site.png
</string>
</value>
</item>
<item>
<key>
<string>
content_meta_type
</string>
</key>
<value>
<string>
ERP5 Web Site
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
A Static Web Site defines an optional default web page and a predicate to select content listed in that section. Contrary to Web Site it disables acquisition to provide only document from the DMS
</string>
</value>
</item>
<item>
<key>
<string>
factory
</string>
</key>
<value>
<string>
addWebSite
</string>
</value>
</item>
<item>
<key>
<string>
filter_content_types
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
group_list
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Static Web Site
</string>
</value>
</item>
<item>
<key>
<string>
init_script
</string>
</key>
<value>
<string>
StaticWebSite_init
</string>
</value>
</item>
<item>
<key>
<string>
permission
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
type_class
</string>
</key>
<value>
<string>
StaticWebSite
</string>
</value>
</item>
<item>
<key>
<string>
type_interface
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
type_mixin
</string>
</key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<tuple>
<global
name=
"TranslationInformation"
module=
"Products.ERP5Type.TranslationProviderBase"
/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
domain_name
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
property_name
</string>
</key>
<value>
<string>
short_title
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<tuple>
<global
name=
"TranslationInformation"
module=
"Products.ERP5Type.TranslationProviderBase"
/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
domain_name
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
property_name
</string>
</key>
<value>
<string>
title
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_web/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
View file @
c5027fb7
...
@@ -19,6 +19,10 @@
...
@@ -19,6 +19,10 @@
<type>
Static Web Section
</type>
<type>
Static Web Section
</type>
<workflow>
category_publication_workflow, edit_workflow
</workflow>
<workflow>
category_publication_workflow, edit_workflow
</workflow>
</chain>
</chain>
<chain>
<type>
Static Web Site
</type>
<workflow>
category_publication_workflow, edit_workflow
</workflow>
</chain>
<chain>
<chain>
<type>
Web Page
</type>
<type>
Web Page
</type>
<workflow>
document_conversion_interaction_workflow, document_security_interaction_workflow, edit_workflow, processing_status_workflow, publication_workflow
</workflow>
<workflow>
document_conversion_interaction_workflow, document_security_interaction_workflow, edit_workflow, processing_status_workflow, publication_workflow
</workflow>
...
...
bt5/erp5_web/RegisteredSkinSelectionTemplateItem/registered_skin_selection.xml
0 → 100644
View file @
c5027fb7
<registered_skin_selection>
<skin_folder_selection>
<skin_folder>
erp5_web_redirect_assist
</skin_folder>
<skin_selection>
RedirectAssist
</skin_selection>
</skin_folder_selection>
<skin_folder_selection>
<skin_folder>
erp5_xhtml_style
</skin_folder>
<skin_selection>
RedirectAssist
</skin_selection>
</skin_folder_selection>
</registered_skin_selection>
\ No newline at end of file
bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/StaticWebSite_init.py
0 → 100644
View file @
c5027fb7
"""
================================================================================
Set default parameters of static web site for redirection
================================================================================
"""
# parameters
# ------------------------------------------------------------------------------
context
.
edit
(
layout_configuration_form_id
=
"StaticWebSite_viewRedirectAssistConfiguration"
,
skin_selection_name
=
"RedirectAssist"
,
custom_render_method_id
=
"StaticWebSite_getRedirectSourceUrl"
)
bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/StaticWebSite_init.xml
0 → 100644
View file @
c5027fb7
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</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>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
*args, **kw
</string>
</value>
</item>
<item>
<key>
<string>
guard
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
StaticWebSite_init
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Guard"
module=
"Products.DCWorkflow.Guard"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
roles
</string>
</key>
<value>
<tuple>
<string>
Owner
</string>
</tuple>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/StaticWebSite_viewRedirectAssistConfiguration.xml
0 → 100644
View file @
c5027fb7
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ERP5 Form"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<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>
Base_edit
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
This form provides access to frontend configuration properties handled on the backend (eg redirect)
</string>
</value>
</item>
<item>
<key>
<string>
edit_order
</string>
</key>
<value>
<list/>
</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 (Style)
</string>
<string>
right (Widgets)
</string>
<string>
center
</string>
<string>
bottom
</string>
<string>
hidden
</string>
</list>
</value>
</item>
<item>
<key>
<string>
groups
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
bottom
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
center
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
hidden
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
left (Style)
</string>
</key>
<value>
<list>
<string>
my_redirect_domain
</string>
<string>
my_use_moved_temporarily
</string>
</list>
</value>
</item>
<item>
<key>
<string>
right (Widgets)
</string>
</key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
StaticWebSite_viewRedirectAssistConfiguration
</string>
</value>
</item>
<item>
<key>
<string>
method
</string>
</key>
<value>
<string>
POST
</string>
</value>
</item>
<item>
<key>
<string>
name
</string>
</key>
<value>
<string>
StaticWebSite_viewRedirectAssistConfiguration
</string>
</value>
</item>
<item>
<key>
<string>
pt
</string>
</key>
<value>
<string>
form_view
</string>
</value>
</item>
<item>
<key>
<string>
row_length
</string>
</key>
<value>
<int>
4
</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>
Redirect Assist Configuration
</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>
<item>
<key>
<string>
update_action_title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/StaticWebSite_viewRedirectAssistConfiguration/my_redirect_domain.xml
0 → 100644
View file @
c5027fb7
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ProxyField"
module=
"Products.ERP5Form.ProxyField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
delegated_list
</string>
</key>
<value>
<list>
<string>
input_type
</string>
<string>
title
</string>
</list>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
my_redirect_domain
</string>
</value>
</item>
<item>
<key>
<string>
message_values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
external_validator_failed
</string>
</key>
<value>
<string>
The input failed the external validator.
</string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
overrides
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
tales
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_string_field
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
input_type
</string>
</key>
<value>
<string>
url
</string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string>
Click to edit the target
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Redirect Domain
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/StaticWebSite_viewRedirectAssistConfiguration/my_use_moved_temporarily.xml
0 → 100644
View file @
c5027fb7
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ProxyField"
module=
"Products.ERP5Form.ProxyField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
delegated_list
</string>
</key>
<value>
<list>
<string>
description
</string>
<string>
title
</string>
</list>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
my_use_moved_temporarily
</string>
</value>
</item>
<item>
<key>
<string>
message_values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
external_validator_failed
</string>
</key>
<value>
<string>
The input failed the external validator.
</string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
overrides
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
tales
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
target
</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>
description
</string>
</key>
<value>
<string>
By default, redirects will respond 301 Moved Permanently. Ticking the box will respond using 302 Moved Temporarily.
</string>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_checkbox
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewWebFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string>
Click to edit the target
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Override 301 with 302 Status Code
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_redirect_assist.xml
0 → 100644
View file @
c5027fb7
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Folder"
module=
"OFS.Folder"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_local_properties
</string>
</key>
<value>
<tuple>
<dictionary>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
business_template_skin_layer_priority
</string>
</value>
</item>
<item>
<key>
<string>
type
</string>
</key>
<value>
<string>
float
</string>
</value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key>
<string>
_objects
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
business_template_skin_layer_priority
</string>
</key>
<value>
<float>
50.0
</float>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
erp5_web_redirect_assist
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_redirect_assist/StaticWebSite_getDocumentValue.py
0 → 100644
View file @
c5027fb7
"""
================================================================================
Proxy of StaticWebSection_getDocumentValue to allow redirection
================================================================================
"""
# parameters
# ------------------------------------------------------------------------------
# name main_template
context
.
REQUEST
.
other
[
'actual_url'
]
=
context
.
REQUEST
[
'ACTUAL_URL'
]
# catch KeyError on source_path with urls "", "?", "/?", "...&"
try
:
context
.
REQUEST
.
other
[
'source_path'
]
=
name
except
KeyError
:
return
context
return
context
bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_redirect_assist/StaticWebSite_getDocumentValue.xml
0 → 100644
View file @
c5027fb7
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</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>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
name, **kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
StaticWebSite_getDocumentValue
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_redirect_assist/StaticWebSite_getRedirectSourceUrl.py
0 → 100644
View file @
c5027fb7
"""
================================================================================
Redirect to domain specified as layout property on website
================================================================================
"""
# parameters
# ------------------------------------------------------------------------------
INDEX
=
"index.html"
REQUEST
=
context
.
REQUEST
query_string
=
REQUEST
[
"QUERY_STRING"
]
redirect_domain
=
context
.
getLayoutProperty
(
"redirect_domain"
)
redirect_url
=
redirect_domain
status_code
=
301
if
context
.
getLayoutProperty
(
"use_moved_temporarily"
):
status_code
=
302
try
:
source_path
=
REQUEST
.
other
[
"source_path"
]
redirect_url
=
"/"
.
join
([
redirect_url
,
source_path
])
except
(
KeyError
):
redirect_url
=
redirect_url
+
"/"
if
query_string
:
redirect_url
=
'?'
.
join
([
redirect_url
,
query_string
])
if
redirect_url
.
find
(
INDEX
)
>
-
1
and
not
redirect_url
.
endswith
(
INDEX
):
redirect_url
=
redirect_url
.
replace
(
INDEX
,
''
)
if
redirect_url
.
find
(
INDEX
)
>
-
1
and
REQUEST
.
other
[
'actual_url'
].
find
(
INDEX
)
==
-
1
:
redirect_url
=
redirect_url
.
replace
(
INDEX
,
''
)
return
context
.
Base_redirect
(
redirect_url
,
status_code
=
status_code
)
bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_redirect_assist/StaticWebSite_getRedirectSourceUrl.xml
0 → 100644
View file @
c5027fb7
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</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>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
**kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
StaticWebSite_getRedirectSourceUrl
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_web/bt/template_action_path_list
View file @
c5027fb7
...
@@ -9,6 +9,7 @@ Static Web Section | predicate
...
@@ -9,6 +9,7 @@ Static Web Section | predicate
Static Web Section | section_content
Static Web Section | section_content
Static Web Section | view
Static Web Section | view
Static Web Section | web_view
Static Web Section | web_view
Static Web Site | view
Web Page Module | list_ui
Web Page Module | list_ui
Web Page Module | sort_on
Web Page Module | sort_on
Web Page Module | view
Web Page Module | view
...
...
bt5/erp5_web/bt/template_document_id_list
View file @
c5027fb7
document.erp5.StaticWebSection
document.erp5.StaticWebSection
\ No newline at end of file
document.erp5.StaticWebSite
\ No newline at end of file
bt5/erp5_web/bt/template_portal_type_allowed_content_type_list
View file @
c5027fb7
...
@@ -8,6 +8,7 @@ Web Section | Image
...
@@ -8,6 +8,7 @@ Web Section | Image
Web Section | Role Definition
Web Section | Role Definition
Web Section | Static Web Section
Web Section | Static Web Section
Web Section | Web Section
Web Section | Web Section
Web Site Module | Static Web Site
Web Site Module | Web Site
Web Site Module | Web Site
Web Site | File
Web Site | File
Web Site | Image
Web Site | Image
...
...
bt5/erp5_web/bt/template_portal_type_base_category_list
View file @
c5027fb7
Static Web Section | aggregate
Static Web Section | aggregate
Static Web Section | caching_policy
Static Web Section | caching_policy
Static Web Site | aggregate
Static Web Site | caching_policy
Web Page Module | business_application
Web Page Module | business_application
Web Page | predecessor
Web Page | predecessor
Web Page | publication_section
Web Page | publication_section
...
...
bt5/erp5_web/bt/template_portal_type_id_list
View file @
c5027fb7
Static Web Section
Static Web Section
Static Web Site
Web Page
Web Page
Web Page Module
Web Page Module
Web Section
Web Section
...
...
bt5/erp5_web/bt/template_portal_type_property_sheet_list
View file @
c5027fb7
Static Web Section | SortIndex
Static Web Section | SortIndex
Static Web Site | WebSitePreference
Web Page | Reference
Web Page | Reference
Web Page | SortIndex
Web Page | SortIndex
Web Section | SortIndex
Web Section | SortIndex
...
...
bt5/erp5_web/bt/template_portal_type_workflow_chain_list
View file @
c5027fb7
...
@@ -4,6 +4,8 @@ Category | category_publication_workflow
...
@@ -4,6 +4,8 @@ Category | category_publication_workflow
Domain | category_publication_workflow
Domain | category_publication_workflow
Static Web Section | category_publication_workflow
Static Web Section | category_publication_workflow
Static Web Section | edit_workflow
Static Web Section | edit_workflow
Static Web Site | category_publication_workflow
Static Web Site | edit_workflow
Web Page | document_conversion_interaction_workflow
Web Page | document_conversion_interaction_workflow
Web Page | document_security_interaction_workflow
Web Page | document_security_interaction_workflow
Web Page | edit_workflow
Web Page | edit_workflow
...
...
bt5/erp5_web/bt/template_registered_skin_selection_list
0 → 100644
View file @
c5027fb7
erp5_web_redirect_assist | RedirectAssist
erp5_xhtml_style | RedirectAssist
\ No newline at end of file
bt5/erp5_web/bt/template_skin_id_list
View file @
c5027fb7
erp5_web
erp5_web
erp5_web_crm
erp5_web_crm
erp5_web_minimal_theme
erp5_web_minimal_theme
erp5_web_redirect_assist
erp5_web_widget_library
erp5_web_widget_library
\ No newline at end of file
bt5/erp5_web_ui_test/TestTemplateItem/portal_components/test.erp5.testStaticWebSiteRedirection.py
0 → 100644
View file @
c5027fb7
##############################################################################
#
# Copyright (c) 2002-2018 Nexedi SA and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
##############################################################################
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
import
urlparse
import
httplib
import
unittest
LOCATION
=
"Location"
WEB_SITE_ID
=
"bouncer"
class
TestStaticWebSectionRedirection
(
ERP5TypeTestCase
):
def
getTitle
(
self
):
return
"Test Static Web Section Redirection."
def
getBusinessTemplateList
(
self
):
return
(
"erp5_base"
,
"erp5_web"
,
"erp5_ui_test_core"
)
def
afterSetup
(
self
):
"""
This is ran before anything, used to set the environment
"""
self
.
portal
=
self
.
getPortalObject
()
def
setupWebSite
(
self
,
use_moved_temporarily
=
None
,
**
kw
):
"""
Setup Web Site
"""
if
WEB_SITE_ID
in
self
.
portal
.
web_site_module
.
objectIds
():
self
.
portal
.
web_site_module
.
manage_delObjects
(
WEB_SITE_ID
)
website
=
self
.
portal
.
web_site_module
.
newContent
(
portal_type
=
"Static Web Site"
,
id
=
WEB_SITE_ID
,
**
kw
)
website
.
edit
(
redirect_domain
=
"https://www.example.org"
,
use_moved_temporarily
=
use_moved_temporarily
or
0
)
website
.
publish
()
self
.
tic
()
return
website
def
runTestRedirect
(
self
,
source_path
,
expected_failure
=
None
,
use_moved_temporarily
=
None
,
**
kw
):
"""
Redirect to backend configuration redirect_domain
"""
# create website and websection
website
=
self
.
setupWebSite
(
use_moved_temporarily
=
use_moved_temporarily
)
absolute_url
=
website
.
absolute_url
()
# XXX can't handle "?" at path end, swallowed before __bobo_traverse__
if
source_path
.
endswith
(
"/?"
):
source_path
=
source_path
[:
-
2
]
if
source_path
.
endswith
(
"?"
):
source_path
=
source_path
[:
-
1
]
_
,
api_netloc
,
_
,
_
,
_
=
urlparse
.
urlsplit
(
absolute_url
)
redirect_url
=
website
.
getLayoutProperty
(
"redirect_domain"
)
redirect_location
=
"/"
.
join
([
redirect_url
,
source_path
])
connection
=
httplib
.
HTTPConnection
(
api_netloc
)
connection
.
request
(
method
=
"GET"
,
url
=
'%s/%s'
%
(
absolute_url
,
source_path
)
)
response
=
connection
.
getresponse
()
status_to_assert
=
httplib
.
MOVED_PERMANENTLY
if
use_moved_temporarily
:
status_to_assert
=
httplib
.
FOUND
self
.
assertEquals
(
response
.
status
,
status_to_assert
)
self
.
assertEquals
(
response
.
getheader
(
LOCATION
),
redirect_location
)
##############################################################################
def
test_plainRedirect
(
self
):
self
.
runTestRedirect
(
""
)
def
test_plainRedirectIndex
(
self
):
self
.
runTestRedirect
(
"index.html"
)
def
test_plainRedirectQuery
(
self
):
self
.
runTestRedirect
(
"?"
)
def
test_plainRedirectQueryWithParams
(
self
):
self
.
runTestRedirect
(
"?a=b&c=&d=e&"
)
def
test_plainRedirectFolderNoSlash
(
self
):
self
.
runTestRedirect
(
"foo"
)
def
test_plainRedirectFolderSlash
(
self
):
self
.
runTestRedirect
(
"foo/"
)
def
test_plainRedirectFolderNested
(
self
):
self
.
runTestRedirect
(
"foo/bar"
)
def
test_plainRedirectFolderDeepNested
(
self
):
self
.
runTestRedirect
(
"foo/bar/baz"
)
def
test_plainRedirectFolderNestedWithIndex
(
self
):
self
.
runTestRedirect
(
"foo/bar/index.html"
)
def
test_queryStringRedirectFolder
(
self
):
self
.
runTestRedirect
(
"foo?baz=bam"
)
def
test_queryStringRedirectFolderSlash
(
self
):
self
.
runTestRedirect
(
"foo/?baz=bam"
)
def
test_queryStringRedirectFolderNested
(
self
):
self
.
runTestRedirect
(
"foo/bar?baz=bam"
)
def
test_queryStringRedirectFolderDeepNested
(
self
):
self
.
runTestRedirect
(
"foo/bar/baz?baz=bam&cous=cous&the=end"
)
def
test_queryStringRedirectSlashQuestion
(
self
):
self
.
runTestRedirect
(
"foo/bar/?"
)
@
unittest
.
expectedFailure
def
test_queryStringIgnoreLayout
(
self
):
self
.
runTestRedirect
(
"?ignore_layout=1"
)
def
test_plainRedirectGetId
(
self
):
self
.
runTestRedirect
(
"getId"
)
def
test_plainRedirectWebSiteView
(
self
):
self
.
runTestRedirect
(
"WebSite_view"
)
def
test_302queryStringRedirectFolderDeepNested
(
self
):
self
.
runTestRedirect
(
"foo/bar/baz?baz=bam&cous=cous&the=end"
,
use_moved_temporarily
=
1
)
bt5/erp5_web_ui_test/TestTemplateItem/portal_components/test.erp5.testStaticWebSiteRedirection.xml
0 → 100644
View file @
c5027fb7
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Test Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
testStaticWebSiteRedirection
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
Tests testing various redirections handled by static web site.
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test.erp5.testStaticWebSiteRedirection
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Test Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
bt5/erp5_web_ui_test/bt/dependency_list
View file @
c5027fb7
erp5_web
erp5_web
erp5_ui_test_core
erp5_ui_test
erp5_ui_test
\ No newline at end of file
bt5/erp5_web_ui_test/bt/template_test_id_list
0 → 100644
View file @
c5027fb7
test.erp5.testStaticWebSiteRedirection
\ No newline at end of file
bt5/erp5_web_ui_test/bt/test_dependency_list
0 → 100644
View file @
c5027fb7
erp5_full_text_mroonga_catalog
\ No newline at end of file
product/ERP5/Document/WebSection.py
View file @
c5027fb7
...
@@ -180,7 +180,7 @@ class WebSection(Domain, DocumentExtensibleTraversableMixin):
...
@@ -180,7 +180,7 @@ class WebSection(Domain, DocumentExtensibleTraversableMixin):
acquiring it from the current section or its parents.
acquiring it from the current section or its parents.
"""
"""
section
=
aq_inner
(
self
)
section
=
aq_inner
(
self
)
while
section
.
getPortalType
()
in
(
'Web Section'
,
'Web Site'
,
'Static Web Section'
):
while
section
.
getPortalType
()
in
(
'Web Section'
,
'Web Site'
,
'Static Web Section'
,
'Static Web Site'
):
result
=
section
.
getProperty
(
key
,
MARKER
)
result
=
section
.
getProperty
(
key
,
MARKER
)
if
result
not
in
(
MARKER
,
None
):
if
result
not
in
(
MARKER
,
None
):
return
result
return
result
...
...
product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_redirect.py
View file @
c5027fb7
...
@@ -31,4 +31,4 @@ if len(parameters):
...
@@ -31,4 +31,4 @@ if len(parameters):
if
abort_transaction
:
if
abort_transaction
:
from
zExceptions
import
Redirect
from
zExceptions
import
Redirect
raise
Redirect
(
redirect_url
)
raise
Redirect
(
redirect_url
)
return
request
.
RESPONSE
.
redirect
(
redirect_url
)
return
request
.
RESPONSE
.
redirect
(
redirect_url
,
status
=
status_code
)
product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_redirect.xml
View file @
c5027fb7
...
@@ -50,7 +50,7 @@
...
@@ -50,7 +50,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
<value>
<string>
redirect_url=None, keep_items=(), abort_transaction=False, **kw
</string>
</value>
<value>
<string>
redirect_url=None, keep_items=(), abort_transaction=False,
status_code=302,
**kw
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment