Commit 7b887cdb authored by Bartek Górny's avatar Bartek Górny

changed ingestion process - a doc should be converted after it was processed...

changed ingestion process - a doc should be converted after it was processed (or ingested) no matter where it came from

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10412 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a4345821
...@@ -81,6 +81,11 @@ if fname is not None:\n ...@@ -81,6 +81,11 @@ if fname is not None:\n
context.guessMimeType(fname)\n context.guessMimeType(fname)\n
if not context.getTitle():\n if not context.getTitle():\n
context.setTitle(fname)\n context.setTitle(fname)\n
# use duck typing to check if it is OOo\n
if hasattr(context,\'convert\') and hasattr(context,\'hasFile\') and hasattr(context,\'hasOOfile\'):\n
context.reset()\n
if context.hasFile() and not context.hasOOfile():\n
context.activate( activity = \'SQLQueue\').OOoDocument_convertAfter()\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -128,6 +133,7 @@ if fname is not None:\n ...@@ -128,6 +133,7 @@ if fname is not None:\n
<string>None</string> <string>None</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>hasattr</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -68,11 +68,8 @@ ...@@ -68,11 +68,8 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>ob=state_change.object\n <value> <string>ob=context\n
ob.log(ob.getRelativeUrl())\n if ob.hasFile() and not ob.hasOOfile(): #doublecheck\n
ob.log(ob.hasFile())\n
ob.log(ob.hasOOfile())\n
if ob.hasFile() and not ob.hasOOfile():\n
try:\n try:\n
res=ob.convert()\n res=ob.convert()\n
ob.log(res)\n ob.log(res)\n
...@@ -95,9 +92,15 @@ if ob.hasFile() and not ob.hasOOfile():\n ...@@ -95,9 +92,15 @@ if ob.hasFile() and not ob.hasOOfile():\n
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>state_change</string> </value> <value> <string>*a,**kw</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -117,15 +120,17 @@ if ob.hasFile() and not ob.hasOOfile():\n ...@@ -117,15 +120,17 @@ if ob.hasFile() and not ob.hasOOfile():\n
<dictionary> <dictionary>
<item> <item>
<key> <string>co_argcount</string> </key> <key> <string>co_argcount</string> </key>
<value> <int>1</int> </value> <value> <int>0</int> </value>
</item> </item>
<item> <item>
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
<value> <value>
<tuple> <tuple>
<string>state_change</string> <string>a</string>
<string>_getattr_</string> <string>kw</string>
<string>context</string>
<string>ob</string> <string>ob</string>
<string>_getattr_</string>
<string>res</string> <string>res</string>
<string>str</string> <string>str</string>
<string>_getitem_</string> <string>_getitem_</string>
...@@ -147,7 +152,7 @@ if ob.hasFile() and not ob.hasOOfile():\n ...@@ -147,7 +152,7 @@ if ob.hasFile() and not ob.hasOOfile():\n
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Convert_after</string> </value> <value> <string>OOoDocument_convertAfter</string> </value>
</item> </item>
<item> <item>
<key> <string>warnings</string> </key> <key> <string>warnings</string> </key>
......
208 212
\ No newline at end of file \ 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