Commit 877f99de authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

we no longer need '/view' in the url.

(more modification should be required.)


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@40351 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e09fda17
......@@ -56,7 +56,7 @@
<value> <string>"""\n
Used in listbox to generate proper root link\n
"""\n
return \'%s/view\' %brain.getParentValue().absolute_url()\n
return brain.getParentValue().absolute_url()\n
</string> </value>
</item>
<item>
......
75
\ No newline at end of file
76
\ No newline at end of file
......@@ -180,7 +180,7 @@ for line in line_list:\n
else:\n
ical_item_dict[\'COMPONENT\'] = \'journal\'\n
elif field_upper == \'URL\' and hasattr(brainObject, \'absolute_url\'):\n
ical_item_dict[\'URL\'] = brainObject.absolute_url() + \'/view\'\n
ical_item_dict[\'URL\'] = brainObject.absolute_url()\n
elif field_upper == \'DTSTAMP\':\n
ical_item_dict[\'DTSTAMP\'] = convertDate(now)\n
elif field_upper == \'DTSTART\':\n
......
20
\ No newline at end of file
21
\ No newline at end of file
......@@ -150,7 +150,7 @@ for line in line_list:\n
elif required_field == \'link\':\n
if hasattr(line.getBrain(), \'absolute_url\'):\n
field_data = unicode(line.getBrain().absolute_url(), \'utf-8\' ) or \'\'\n
rss_item_string += (\'\\t\\t\\t<%s>%s/view</%s>\\n\' % (required_field, field_data, required_field))\n
rss_item_string += (\'\\t\\t\\t<%s>%s</%s>\\n\' % (required_field, field_data, required_field))\n
elif required_field == \'description\':\n
if hasattr(line.getBrain(), \'getDescription\'):\n
field_data = html_quote(unicode(line.getBrain().getDescription(), \'utf-8\' ) or \'\')\n
......
48
\ No newline at end of file
49
\ No newline at end of file
......@@ -289,12 +289,13 @@ class WebSection(Domain, DocumentExtensibleTraversableMixin):
Return a permanent URL of document in the context
of the current section.
If view is True, the url returned point to html content and can be
opened in a browser (ie. + '/view' for ooo documents)
This method must be implemented through a
portal type dependent script:
WebSection_getPermanentURL
XXX The following argument is obsoleted because we no longer need /view.
If view is True, the url returned point to html content and can be
opened in a browser (ie. + '/view' for ooo documents)
"""
cache = getReadOnlyTransactionCache()
if cache is not None:
......
......@@ -137,7 +137,7 @@ class Wiki( Document ):
append(name[1:])
else:
# FIMXE: Create a new wiki instance if not present.
append('<a href="%s/%s/view">%s</a>' % (self._getTopLevelUrl(), name, name))
append('<a href="%s/%s">%s</a>' % (self._getTopLevelUrl(), name, name))
elif min_key == 'url':
url = match.string[match.start(1):match.end(1)]
if url.startswith('!'):
......@@ -159,7 +159,7 @@ class Wiki( Document ):
label = self._render_text(label)
if self.wiki_name_expr.search(link):
# FIXME: Create a new wiki instance if not present
append('<a href="%s/%s/view">%s</a>' % (self._getTopLevelUrl(), link, label))
append('<a href="%s/%s">%s</a>' % (self._getTopLevelUrl(), link, label))
else:
append('<a href="%s">%s</a>' % (link, label))
else:
......
......@@ -173,7 +173,7 @@ class InventoryListBrain(ZSQLBrain):
# with the inventory's uid. Then they are their own explanation.
explanation = o
if explanation is not None:
return '%s/%s/view' % (
return '%s/%s' % (
self.portal_url.getPortalObject().absolute_url(),
explanation.getRelativeUrl())
else:
......@@ -193,7 +193,7 @@ class InventoryListBrain(ZSQLBrain):
query_kw_update = {}
if cname_id in ('transformed_resource_title', ):
return '%s/view' % resource.absolute_url()
return resource.absolute_url()
elif cname_id in ('getCurrentInventory', ):
query_kw_update = {
'simulation_state':
......@@ -242,7 +242,7 @@ class InventoryListBrain(ZSQLBrain):
if document.isMovement():
explanation = document.getExplanationValue()
if explanation is not None:
return '%s/%s/view' % (
return '%s/%s' % (
self.portal_url.getPortalObject().absolute_url(),
explanation.getRelativeUrl())
return ''
......
......@@ -367,7 +367,7 @@ class TemplateTool (BaseTool):
bt = self.download(url, id=id)
if REQUEST is not None:
ret_url = bt.absolute_url() + '/view'
ret_url = bt.absolute_url()
psm = translateString("Business template downloaded successfully.")
REQUEST.RESPONSE.redirect("%s?portal_status_message=%s"
% (ret_url, psm))
......@@ -542,7 +542,7 @@ class TemplateTool (BaseTool):
if not batch_mode and \
(REQUEST is not None):
ret_url = bt.absolute_url() + '/view'
ret_url = bt.absolute_url()
psm = translateString("Business templates imported successfully.")
REQUEST.RESPONSE.redirect("%s?portal_status_message=%s"
% (ret_url, psm))
......
......@@ -282,13 +282,13 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional):
def test_frontpage(self):
"""Test we can view the front page.
"""
response = self.publish('%s/view' % self.portal_id, self.auth)
response = self.publish(self.portal_id, self.auth)
self.assertEquals(HTTP_OK, response.getStatus())
def test_login_form(self):
"""Test anonymous user are redirected to login_form
"""
response = self.publish('%s/view' % self.portal_id)
response = self.publish(self.portal_id)
self.assertEquals(HTTP_REDIRECT, response.getStatus())
self.assertEquals('%s/login_form' % self.portal.absolute_url(),
response.getHeader('Location'))
......@@ -299,7 +299,7 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional):
'portal_templates',
'portal_rules',
'portal_alarms',):
response = self.publish('%s/%s/view' % (self.portal_id, tool), self.auth)
response = self.publish('%s/%s' % (self.portal_id, tool), self.auth)
self.assertEquals(HTTP_OK, response.getStatus(),
"%s: %s" % (tool, response.getStatus()))
......@@ -308,7 +308,7 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional):
translation_service = DummyTranslationService()
setGlobalTranslationService(translation_service)
# assumes that we can add Business Template in template tool
response = self.publish('%s/portal_templates/view' %
response = self.publish('%s/portal_templates' %
self.portal_id, self.auth)
self.assertEquals(HTTP_OK, response.getStatus())
self.failUnless(('Business Template', {})
......@@ -328,7 +328,7 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional):
title='Dummy Jump Action',
action_permission='View',
action_type='object_jump')
response = self.publish('%s/portal_templates/view' %
response = self.publish('%s/portal_templates' %
self.portal_id, self.auth)
self.assertEquals(HTTP_OK, response.getStatus())
self.failUnless(('Dummy Jump Action', {}) in
......@@ -410,7 +410,7 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional):
len(portal.portal_catalog(portal_type='Preference',
title='My Test Preference')),
1)
response = self.publish('%s/view' % self.portal_id, self.auth)
response = self.publish(self.portal_id, self.auth)
self.assertEquals(HTTP_OK, response.getStatus())
def test_Folder_delete(self):
......
......@@ -516,7 +516,7 @@ class TestERP5WebWithDms(ERP5TypeTestCase, ZopeTestCase.Functional):
# is rendered in web_site context
response = self.publish(website.absolute_url_path() + '/' +\
web_page_reference + '/view', credential)
web_page_reference, credential)
self.assertEquals(response.getHeader('content-type'),
'text/html; charset=utf-8')
self.assertTrue('<form' in response.getBody()) # means the web_page
......@@ -545,7 +545,7 @@ class TestERP5WebWithDms(ERP5TypeTestCase, ZopeTestCase.Functional):
# image is rendered in web_site context
response = self.publish(website.absolute_url_path() + '/' +\
image_reference+ '/view', credential)
image_reference, credential)
self.assertEquals(response.getHeader('content-type'),
'text/html; charset=utf-8')
......@@ -562,7 +562,7 @@ class TestERP5WebWithDms(ERP5TypeTestCase, ZopeTestCase.Functional):
'application/vnd.oasis.opendocument.presentation')
# Document is rendered in web_site context
response = self.publish(website.absolute_url_path() + '/' +\
document_reference + '/view', credential)
document_reference, credential)
self.assertEquals(response.getHeader('content-type'),
'text/html; charset=utf-8')
......
......@@ -119,7 +119,7 @@ class TestICal(ERP5TypeTestCase):
self.assertEquals(feed_dict['DTEND'], event.getCreationDate().HTML4().replace('-','').replace(':',''))
self.assertEquals(feed_dict['CREATED'], event.getCreationDate().HTML4().replace('-','').replace(':',''))
self.assertEquals(feed_dict['LAST-MODIFIED'], event.getModificationDate().HTML4().replace('-','').replace(':',''))
self.assertEquals(feed_dict['URL'], event.absolute_url() + '/view')
self.assertEquals(feed_dict['URL'], event.absolute_url())
self.assertEquals(feed_dict['UID'], 'uuid%s' % event.getUid())
# there is no description
self.assertFalse('DESCRIPTION' in feed_dict.keys())
......
......@@ -120,7 +120,7 @@ class TestRSS(ERP5TypeTestCase):
self.assertEquals(getSubnodeContent(item, 'title'), 'Two')
self.assertEquals(getSubnodeContent(item, 'description'), 'Person Two')
self.assertEquals(getSubnodeContent(item, 'author'), 'seb')
expected_link = two.absolute_url() + '/view'
expected_link = two.absolute_url()
self.assertEquals(getSubnodeContent(item, 'link'), expected_link)
self.assertEquals(len(item.getElementsByTagName('pubDate')), 1)
# is date formatted correctly?
......@@ -130,7 +130,7 @@ class TestRSS(ERP5TypeTestCase):
self.assertEquals(getSubnodeContent(item, 'title'), 'One')
self.assertEquals(getSubnodeContent(item, 'description'), 'Person One')
self.assertEquals(getSubnodeContent(item, 'author'), 'seb')
expected_link = one.absolute_url() + '/view'
expected_link = one.absolute_url()
self.assertEquals(getSubnodeContent(item, 'link'), expected_link)
self.assertEquals(len(item.getElementsByTagName('pubDate')), 1)
# is date formatted correctly?
......@@ -173,7 +173,7 @@ class TestRSS(ERP5TypeTestCase):
selection_name='rss_folder_selection'))
listbox_link.manage_tales_xmlrpc(
dict(default="python: cell.absolute_url() + '/view'"))
dict(default="python: cell.absolute_url()"))
one = self.portal.person_module.one
two = self.portal.person_module.two
......@@ -193,7 +193,7 @@ class TestRSS(ERP5TypeTestCase):
self.assertEquals(getSubnodeContent(item, 'title'), 'Two')
self.assertEquals(getSubnodeContent(item, 'description'), 'Person Two')
self.assertEquals(getSubnodeContent(item, 'author'), 'seb')
expected_link = two.absolute_url() + '/view'
expected_link = two.absolute_url()
self.assertEquals(getSubnodeContent(item, 'link'), expected_link)
self.assertEquals(len(item.getElementsByTagName('pubDate')), 1)
# is date formatted correctly?
......@@ -203,7 +203,7 @@ class TestRSS(ERP5TypeTestCase):
self.assertEquals(getSubnodeContent(item, 'title'), 'One')
self.assertEquals(getSubnodeContent(item, 'description'), 'Person One')
self.assertEquals(getSubnodeContent(item, 'author'), 'seb')
expected_link = one.absolute_url() + '/view'
expected_link = one.absolute_url()
self.assertEquals(getSubnodeContent(item, 'link'), expected_link)
self.assertEquals(len(item.getElementsByTagName('pubDate')), 1)
# is date formatted correctly?
......
......@@ -391,11 +391,11 @@ def ERP5Site_createModuleScribus(self,
# manage redirection URL
if not selection_index:
redirect_url = '%s/view?%s' % (portal.absolute_url(),
redirect_url = '%s?%s' % (portal.absolute_url(),
'portal_status_message=Module+Created.'
)
else:
redirect_url = '%s/view?selection_index=%s&selection_name=%s&%s' % (
redirect_url = '%s?selection_index=%s&selection_name=%s&%s' % (
portal.absolute_url(),
selection_index,
selection_name,
......
......@@ -404,11 +404,11 @@ def ERP5Site_updateModuleScribus(self,
# manage redirection URL
if not selection_index:
redirect_url = '%s/view?%s' % (portal.absolute_url(),
redirect_url = '%s?%s' % (portal.absolute_url(),
'portal_status_message=Module+Updated.'
)
else:
redirect_url = '%s/view?selection_index=%s&selection_name=%s&%s' % (
redirect_url = '%s?selection_index=%s&selection_name=%s&%s' % (
portal.absolute_url(),
selection_index,
selection_name,
......
......@@ -41,7 +41,7 @@ def getDocumentGroupByWorkflowStateList(self, form_id='', **kw):
def UrlGetter(doc, state_var):
"""returns an url method."""
def get_url(*args, **kw):
return '%s/view?reset:int=1&%s=%s&portal_type=%s' % (
return '%s?reset:int=1&%s=%s&portal_type=%s' % (
self.absolute_url(), state_var, doc.getProperty(state_var),
doc.getPortalTypeName())
return get_url
......
......@@ -2427,12 +2427,11 @@ class ListBoxHTMLRendererLine(ListBoxRendererLine):
error = sys.exc_info())
else:
try:
url = '%s/view' % (
# brain.absolute_url() is slow because it invokes
# _aq_dynamic() every time to get brain.REQUEST,
# so we call request.physicalPathToURL() directly
# instead of brain.absolute_url().
request.physicalPathToURL(brain.getPath()),)
# brain.absolute_url() is slow because it invokes
# _aq_dynamic() every time to get brain.REQUEST,
# so we call request.physicalPathToURL() directly
# instead of brain.absolute_url().
url = request.physicalPathToURL(brain.getPath())
params = []
if ignore_layout:
params.append('ignore_layout:int=1')
......
......@@ -2418,7 +2418,7 @@ class Activity:
if zone == 1:
# active
block_color = self.color
block_link = '%s/view' % self.object.absolute_url()
block_link = self.object.absolute_url()
else:
# passive
block_color = '#D1E8FF'
......
......@@ -104,7 +104,7 @@ class TestPlanningBox(ERP5TypeTestCase):
for info in bloc.info.values():
self.assertEquals(info.info,'Title 0')
self.assertEquals(info.link ,
'%s/foo_module/0/0/view' % self.getPortal().absolute_url())
'%s/foo_module/0/0' % self.getPortal().absolute_url())
# Check Parent Activities
parent = bloc.parent_activity
for info in parent.info.values():
......
......@@ -89,7 +89,7 @@ class ERP5KeyAuthPlugin(ERP5UserManager, CookieAuthHelper):
"""
Key authentification PAS plugin which support key authentication in URL.
<ERP5_Root>/web_page_module/1/view?__ac_key=207221200213146153166
<ERP5_Root>/web_page_module/1?__ac_key=207221200213146153166
where value of __ac_key contains (encrypted):
- proxied (i.e. granting user) username
......
......@@ -655,7 +655,7 @@ class TestLocalRoleManagement(ERP5TypeTestCase):
self.tic()
person_module_path = self.getPersonModule().absolute_url(relative=1)
response = self.publish('/%s/view' % person_module_path,
response = self.publish(person_module_path,
basic='guest:guest')
self.assertEqual(response.getStatus(), 200)
response = self.publish('/%s/first_last/getFirstName' % person_module_path,
......@@ -709,7 +709,7 @@ class TestLocalRoleManagement(ERP5TypeTestCase):
key = erp5_auth_key_plugin.encrypt(reference)
self.assertNotEquals(reference, key)
self.assertEquals(reference, erp5_auth_key_plugin.decrypt(key))
base_url = '%s/view' %portal.absolute_url(relative=1)
base_url = portal.absolute_url(relative=1)
# without key we are Anonymous User so we should be redirected with proper HTML
# status code to login_form
......@@ -751,7 +751,7 @@ class TestLocalRoleManagement(ERP5TypeTestCase):
assignment.open()
self.stepTic()
base_url = '%s/view' %portal.absolute_url(relative=1)
base_url = portal.absolute_url(relative=1)
# without key we are Anonymous User so we should be redirected with proper HTML
# status code to login_form
......
......@@ -1704,6 +1704,7 @@ class Base( CopyContainer,
"""
Generic edit Method for all ERP5 object
"""
self.log('edit:%r' % kw)
return self._edit(REQUEST=REQUEST, force_update=force_update,
reindex_object=reindex_object, restricted=1, **kw)
......@@ -3057,7 +3058,7 @@ class Base( CopyContainer,
return method(container, **kw)
# XXX this should not happen, unless the Business Template is broken.
return dict(redirect_url=container.absolute_url() + '/view',
return dict(redirect_url=container.absolute_url(),
selection_index=None, selection_name=None)
# Hash method
......
......@@ -136,7 +136,7 @@ class PropertySheetTool(BaseTool):
if REQUEST is not None:
return self.REQUEST.RESPONSE.redirect(
'%s/view?portal_status_message=' \
'%s?portal_status_message=' \
'Property Sheets successfully imported from filesystem to ZODB.' % \
self.absolute_url())
......
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