Commit 3835b203 authored by Ivan Tyagov's avatar Ivan Tyagov

Add a method that can make it possible to import a Business Template from base64 encoded text

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27006 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4da286d6
......@@ -50,6 +50,7 @@ import posixpath
from base64 import b64encode, b64decode
from Products.ERP5Type.Message import translateString
from zLOG import LOG, INFO
from base64 import decodestring
WIN = os.name == 'nt'
......@@ -381,6 +382,15 @@ class TemplateTool (BaseTool):
bt.build(no_action=1)
return bt
def importBase64EncodedText(self, file_data=None, id=None, REQUEST=None,
batch_mode=0, **kw):
"""
Import Business Template from passed base64 encoded text.
"""
import_file = StringIO(decodestring(file_data))
return self.importFile(import_file = import_file, id = id, REQUEST = REQUEST,
batch_mode = batch_mode, **kw)
def importFile(self, import_file=None, id=None, REQUEST=None,
batch_mode=0, **kw):
"""
......
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