From 1e18b91617934c91c6530be9672d005b0f3650d2 Mon Sep 17 00:00:00 2001
From: Ivan Tyagov <ivan@nexedi.com>
Date: Thu, 14 Jun 2007 13:55:54 +0000
Subject: [PATCH] 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
---
 .../ContributionTool_getPropertyDictFromFileName.xml     | 9 +++++++--
 bt5/erp5_dms/bt/revision                                 | 2 +-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ContributionTool_getPropertyDictFromFileName.xml b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ContributionTool_getPropertyDictFromFileName.xml
index b9eccf6edb..ba87186749 100644
--- a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ContributionTool_getPropertyDictFromFileName.xml
+++ b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ContributionTool_getPropertyDictFromFileName.xml
@@ -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>
diff --git a/bt5/erp5_dms/bt/revision b/bt5/erp5_dms/bt/revision
index d02412a497..e59f0632ab 100644
--- a/bt5/erp5_dms/bt/revision
+++ b/bt5/erp5_dms/bt/revision
@@ -1 +1 @@
-655
\ No newline at end of file
+658
\ No newline at end of file
-- 
2.30.9