Commit 1e18b916 authored by Ivan Tyagov's avatar Ivan Tyagov

It's possible to specify 'reference' directly in preferred re pattern.

This method of determining document's reference has highest priority overall.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14828 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 44d84ef6
......@@ -90,6 +90,7 @@ if property_dict.has_key(\'language\'):\n
language = property_dict.get(\'language\', \'en\')\n
version = property_dict.get(\'version\', \'001\')\n
local_id = property_dict.get(\'local_id\', \'undefined\')\n
reference = property_dict.get(\'reference\', None)\n
group_reference_path = property_dict.get(\'group_reference_path\', None)\n
source_conference_reference = property_dict.get(\'source_conference_reference\', None)\n
source_project_reference = property_dict.get(\'source_project_reference\', None)\n
......@@ -97,7 +98,11 @@ source_project_reference = property_dict.get(\'source_project_reference\', None)
new_dict = dict(language = language, \n
version = version)\n
\n
if source_project_reference:\n
if reference:\n
# we get directly extracted reference in property_dict (from re pattern)\n
# this method has highest priority\n
pass\n
elif source_project_reference:\n
# generate document\'s reference using project reference\n
reference = \'P-%s-%s\' %(source_project_reference, local_id)\n
project = context.portal_catalog.getResultValue(reference = source_project_reference,\n
......@@ -197,12 +202,12 @@ return new_dict\n
<string>version</string>
<string>local_id</string>
<string>None</string>
<string>reference</string>
<string>group_reference_path</string>
<string>source_conference_reference</string>
<string>source_project_reference</string>
<string>dict</string>
<string>new_dict</string>
<string>reference</string>
<string>context</string>
<string>project</string>
<string>conference</string>
......
655
\ No newline at end of file
658
\ No newline at end of file
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