Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
7c72a354
Commit
7c72a354
authored
Jul 16, 2020
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ZODB Components: Migrate Products.ERP5.Document.Document.
parent
5a3a1624
Changes
91
Show whitespace changes
Inline
Side-by-side
Showing
91 changed files
with
2454 additions
and
318 deletions
+2454
-318
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.Image.py
...mentTemplateItem/portal_components/document.erp5.Image.py
+3
-3
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.OOoDocument.py
...mplateItem/portal_components/document.erp5.OOoDocument.py
+8
-8
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.Url.py
...cumentTemplateItem/portal_components/document.erp5.Url.py
+1
-1
bt5/erp5_base/MixinTemplateItem/portal_components/mixin.erp5.OOoDocumentExtensibleTraversableMixin.py
...nents/mixin.erp5.OOoDocumentExtensibleTraversableMixin.py
+1
-1
bt5/erp5_base/ModuleComponentTemplateItem/portal_components/module.erp5.ImageUtil.py
...ntTemplateItem/portal_components/module.erp5.ImageUtil.py
+1
-1
bt5/erp5_base/ModuleComponentTemplateItem/portal_components/module.erp5.TransformLib.py
...emplateItem/portal_components/module.erp5.TransformLib.py
+1
-1
bt5/erp5_big_file/DocumentTemplateItem/portal_components/document.erp5.BigFile.py
...ntTemplateItem/portal_components/document.erp5.BigFile.py
+1
-1
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testBusinessTemplate.py
...eItem/portal_components/test.erp5.testBusinessTemplate.py
+0
-53
bt5/erp5_corporate_identity/ExtensionTemplateItem/portal_components/extension.erp5.TemplateDocumentConversion.py
...l_components/extension.erp5.TemplateDocumentConversion.py
+1
-1
bt5/erp5_dms/DocumentTemplateItem/portal_components/document.erp5.ExternalSource.py
...ateItem/portal_components/document.erp5.ExternalSource.py
+2
-2
bt5/erp5_dms/DocumentTemplateItem/portal_components/document.erp5.PDFDocument.py
...mplateItem/portal_components/document.erp5.PDFDocument.py
+1
-1
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_tryToConvertToBaseFormat.py
...ortal_skins/erp5_dms/Document_tryToConvertToBaseFormat.py
+1
-1
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_tryToUpdateBaseMetadata.py
...portal_skins/erp5_dms/Document_tryToUpdateBaseMetadata.py
+1
-1
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/PDF_checkConversionFormatPermission.py
...tal_skins/erp5_dms/PDF_checkConversionFormatPermission.py
+1
-1
bt5/erp5_dms/TestTemplateItem/portal_components/test.erp5.testDms.py
...s/TestTemplateItem/portal_components/test.erp5.testDms.py
+1
-1
bt5/erp5_dms/TestTemplateItem/portal_components/test.erp5.testERP5WebWithDms.py
...ateItem/portal_components/test.erp5.testERP5WebWithDms.py
+1
-1
bt5/erp5_multimedia/DocumentTemplateItem/portal_components/document.erp5.Sound.py
...mentTemplateItem/portal_components/document.erp5.Sound.py
+1
-1
bt5/erp5_oauth/ToolComponentTemplateItem/portal_components/tool.erp5.OAuthTool.py
...nentTemplateItem/portal_components/tool.erp5.OAuthTool.py
+1
-1
product/ERP5/Document/BusinessTemplate.py
product/ERP5/Document/BusinessTemplate.py
+1
-3
product/ERP5/Tool/ContributionTool.py
product/ERP5/Tool/ContributionTool.py
+1
-1
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.Document.py
...tTemplateItem/portal_components/document.erp5.Document.py
+41
-30
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.Document.xml
...TemplateItem/portal_components/document.erp5.Document.xml
+131
-0
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.EmailDocument.py
...lateItem/portal_components/document.erp5.EmailDocument.py
+1
-1
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.File.py
...umentTemplateItem/portal_components/document.erp5.File.py
+5
-21
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.File.xml
...mentTemplateItem/portal_components/document.erp5.File.xml
+110
-0
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.TextDocument.py
...plateItem/portal_components/document.erp5.TextDocument.py
+4
-4
product/ERP5/bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.ICachedConvertable.py
...em/portal_components/interface.erp5.ICachedConvertable.py
+0
-0
product/ERP5/bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.ICachedConvertable.xml
...m/portal_components/interface.erp5.ICachedConvertable.xml
+104
-0
product/ERP5/bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.IConvertable.py
...lateItem/portal_components/interface.erp5.IConvertable.py
+2
-2
product/ERP5/bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.IConvertable.xml
...ateItem/portal_components/interface.erp5.IConvertable.xml
+110
-0
product/ERP5/bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.ICrawlable.py
...mplateItem/portal_components/interface.erp5.ICrawlable.py
+0
-0
product/ERP5/bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.ICrawlable.xml
...plateItem/portal_components/interface.erp5.ICrawlable.xml
+104
-0
product/ERP5/bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.IDiscoverable.py
...ateItem/portal_components/interface.erp5.IDiscoverable.py
+0
-0
product/ERP5/bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.IDiscoverable.xml
...teItem/portal_components/interface.erp5.IDiscoverable.xml
+104
-0
product/ERP5/bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.IDocument.py
...emplateItem/portal_components/interface.erp5.IDocument.py
+2
-2
product/ERP5/bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.IDocument.xml
...mplateItem/portal_components/interface.erp5.IDocument.xml
+110
-0
product/ERP5/bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.IDownloadable.py
...ateItem/portal_components/interface.erp5.IDownloadable.py
+2
-2
product/ERP5/bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.IDownloadable.xml
...teItem/portal_components/interface.erp5.IDownloadable.xml
+110
-0
product/ERP5/bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.IFormatConvertable.py
...em/portal_components/interface.erp5.IFormatConvertable.py
+2
-2
product/ERP5/bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.IFormatConvertable.xml
...m/portal_components/interface.erp5.IFormatConvertable.xml
+110
-0
product/ERP5/bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.IHtmlConvertable.py
...Item/portal_components/interface.erp5.IHtmlConvertable.py
+0
-0
product/ERP5/bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.IHtmlConvertable.xml
...tem/portal_components/interface.erp5.IHtmlConvertable.xml
+104
-0
product/ERP5/bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.ITextConvertable.py
...Item/portal_components/interface.erp5.ITextConvertable.py
+1
-1
product/ERP5/bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.ITextConvertable.xml
...tem/portal_components/interface.erp5.ITextConvertable.xml
+110
-0
product/ERP5/bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.ITextConvertableLegacy.py
...ortal_components/interface.erp5.ITextConvertableLegacy.py
+0
-0
product/ERP5/bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.ITextConvertableLegacy.xml
...rtal_components/interface.erp5.ITextConvertableLegacy.xml
+104
-0
product/ERP5/bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.IUrl.py
...faceTemplateItem/portal_components/interface.erp5.IUrl.py
+0
-0
product/ERP5/bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.IUrl.xml
...aceTemplateItem/portal_components/interface.erp5.IUrl.xml
+104
-0
product/ERP5/bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.IVersionable.py
...lateItem/portal_components/interface.erp5.IVersionable.py
+0
-0
product/ERP5/bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.IVersionable.xml
...ateItem/portal_components/interface.erp5.IVersionable.xml
+104
-0
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.CachedConvertableMixin.py
...em/portal_components/mixin.erp5.CachedConvertableMixin.py
+3
-3
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.CachedConvertableMixin.xml
...m/portal_components/mixin.erp5.CachedConvertableMixin.xml
+110
-0
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.CrawlableMixin.py
...mplateItem/portal_components/mixin.erp5.CrawlableMixin.py
+1
-1
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.CrawlableMixin.xml
...plateItem/portal_components/mixin.erp5.CrawlableMixin.xml
+110
-0
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.DiscoverableMixin.py
...ateItem/portal_components/mixin.erp5.DiscoverableMixin.py
+7
-7
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.DiscoverableMixin.xml
...teItem/portal_components/mixin.erp5.DiscoverableMixin.xml
+110
-0
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.DocumentMixin.py
...emplateItem/portal_components/mixin.erp5.DocumentMixin.py
+4
-7
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.DocumentMixin.xml
...mplateItem/portal_components/mixin.erp5.DocumentMixin.xml
+110
-0
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.DownloadableMixin.py
...ateItem/portal_components/mixin.erp5.DownloadableMixin.py
+6
-6
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.DownloadableMixin.xml
...teItem/portal_components/mixin.erp5.DownloadableMixin.xml
+110
-0
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.TextConvertableMixin.py
...Item/portal_components/mixin.erp5.TextConvertableMixin.py
+2
-2
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.TextConvertableMixin.xml
...tem/portal_components/mixin.erp5.TextConvertableMixin.xml
+110
-0
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.UrlMixin.py
...ixinTemplateItem/portal_components/mixin.erp5.UrlMixin.py
+0
-0
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.UrlMixin.xml
...xinTemplateItem/portal_components/mixin.erp5.UrlMixin.xml
+104
-0
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_showFoundText.py
...TemplateItem/portal_skins/erp5_core/Base_showFoundText.py
+1
-1
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Preference_getReportFormatItemList.py
...tal_skins/erp5_core/Preference_getReportFormatItemList.py
+1
-1
product/ERP5/bootstrap/erp5_core/bt/template_document_id_list
...uct/ERP5/bootstrap/erp5_core/bt/template_document_id_list
+2
-0
product/ERP5/bootstrap/erp5_core/bt/template_interface_id_list
...ct/ERP5/bootstrap/erp5_core/bt/template_interface_id_list
+13
-1
product/ERP5/bootstrap/erp5_core/bt/template_mixin_id_list
product/ERP5/bootstrap/erp5_core/bt/template_mixin_id_list
+7
-0
product/ERP5/tests/testERP5Interfaces.py
product/ERP5/tests/testERP5Interfaces.py
+2
-2
product/ERP5/tests/testERP5Web.py
product/ERP5/tests/testERP5Web.py
+2
-2
product/ERP5/tests/test_data/test_167_InstanceAndRelatedClassDefinedInSameBT/DocumentTemplateItem/File.py
...dRelatedClassDefinedInSameBT/DocumentTemplateItem/File.py
+0
-32
product/ERP5/tests/test_data/test_167_InstanceAndRelatedClassDefinedInSameBT/PathTemplateItem/old_file.xml
...RelatedClassDefinedInSameBT/PathTemplateItem/old_file.xml
+0
-19
product/ERP5/tests/test_data/test_167_InstanceAndRelatedClassDefinedInSameBT/PathTemplateItem/some_file.xml
...elatedClassDefinedInSameBT/PathTemplateItem/some_file.xml
+0
-16
product/ERP5/tests/test_data/test_167_InstanceAndRelatedClassDefinedInSameBT/PortalTypeTemplateItem/portal_types/Foo%20Type.xml
...SameBT/PortalTypeTemplateItem/portal_types/Foo%20Type.xml
+0
-24
product/ERP5/tests/test_data/test_167_InstanceAndRelatedClassDefinedInSameBT/PortalTypeTemplateItem/portal_types/Foo.xml
...finedInSameBT/PortalTypeTemplateItem/portal_types/Foo.xml
+0
-24
product/ERP5/tests/test_data/test_167_InstanceAndRelatedClassDefinedInSameBT/bt/template_document_id_list
...dRelatedClassDefinedInSameBT/bt/template_document_id_list
+0
-1
product/ERP5/tests/test_data/test_167_InstanceAndRelatedClassDefinedInSameBT/bt/template_format_version
...AndRelatedClassDefinedInSameBT/bt/template_format_version
+0
-1
product/ERP5/tests/test_data/test_167_InstanceAndRelatedClassDefinedInSameBT/bt/template_path_list
...tanceAndRelatedClassDefinedInSameBT/bt/template_path_list
+0
-2
product/ERP5/tests/test_data/test_167_InstanceAndRelatedClassDefinedInSameBT/bt/template_portal_type_id_list
...latedClassDefinedInSameBT/bt/template_portal_type_id_list
+0
-2
product/ERP5/tests/test_data/test_167_InstanceAndRelatedClassDefinedInSameBT/bt/title
.../test_167_InstanceAndRelatedClassDefinedInSameBT/bt/title
+0
-1
product/ERP5Form/OOoChart.py
product/ERP5Form/OOoChart.py
+1
-1
product/ERP5Form/tests/testOOoChart.py
product/ERP5Form/tests/testOOoChart.py
+2
-1
product/ERP5OOo/FormPrintout.py
product/ERP5OOo/FormPrintout.py
+1
-1
product/ERP5OOo/OOoTemplate.py
product/ERP5OOo/OOoTemplate.py
+0
-1
product/ERP5OOo/__init__.py
product/ERP5OOo/__init__.py
+0
-1
product/ERP5OOo/tests/testOOoBatchMode.py
product/ERP5OOo/tests/testOOoBatchMode.py
+2
-1
product/ERP5OOo/transforms/oood_commandtransform.py
product/ERP5OOo/transforms/oood_commandtransform.py
+7
-6
product/ERP5Type/Base.py
product/ERP5Type/Base.py
+1
-1
product/ERP5Type/Utils.py
product/ERP5Type/Utils.py
+1
-1
product/ERP5Type/patches/OFSFile.py
product/ERP5Type/patches/OFSFile.py
+16
-0
No files found.
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.Image.py
View file @
7c72a354
...
...
@@ -40,8 +40,8 @@ from Acquisition import aq_base
from
Products.ERP5Type
import
Permissions
,
PropertySheet
from
Products.ERP5Type.Utils
import
fill_args_from_request
from
Products.ERP5.D
ocument.File
import
File
from
Products.ERP5.D
ocument.Document
import
Document
,
ConversionError
,
\
from
erp5.component.d
ocument.File
import
File
from
erp5.component.d
ocument.Document
import
Document
,
ConversionError
,
\
VALID_TEXT_FORMAT_LIST
,
VALID_TRANSPARENT_IMAGE_FORMAT_LIST
,
\
DEFAULT_DISPLAY_ID_LIST
,
_MARKER
from
os.path
import
splitext
...
...
@@ -52,7 +52,7 @@ from zLOG import LOG, WARNING
from
erp5.component.module.ImageUtil
import
transformUrlToDataURI
# import mixin
from
Products.ERP5.mixin.text_convertable
import
TextConvertableMixin
from
erp5.component.mixin.TextConvertableMixin
import
TextConvertableMixin
def
getDefaultImageQuality
(
portal
,
format
=
None
):
# pylint: disable=redefined-builtin
preference_tool
=
portal
.
portal_preferences
...
...
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.OOoDocument.py
View file @
7c72a354
...
...
@@ -35,24 +35,24 @@ from zope.contenttype import guess_content_type
from
Products.CMFCore.utils
import
getToolByName
from
Products.ERP5Type
import
Permissions
,
PropertySheet
from
Products.ERP5Type.Cache
import
CachingMethod
from
Products.ERP5.D
ocument.File
import
File
from
Products.ERP5.D
ocument.Document
import
Document
,
\
from
erp5.component.d
ocument.File
import
File
from
erp5.component.d
ocument.Document
import
Document
,
\
VALID_IMAGE_FORMAT_LIST
,
ConversionError
,
NotConvertedError
from
Products.ERP5Type.Utils
import
fill_args_from_request
# Mixin Import
from
erp5.component.mixin.BaseConvertableFileMixin
import
BaseConvertableFileMixin
from
Products.ERP5.mixin.text_convertable
import
TextConvertableMixin
from
erp5.component.mixin.TextConvertableMixin
import
TextConvertableMixin
from
erp5.component.mixin.OOoDocumentExtensibleTraversableMixin
import
OOoDocumentExtensibleTraversableMixin
EMBEDDED_FORMAT
=
'_embedded'
from
Products.ERP5.D
ocument.Document
import
DocumentConversionServerProxy
from
erp5.component.d
ocument.Document
import
DocumentConversionServerProxy
# Backward compatibility only
from
Products.ERP5.D
ocument.Document
import
DOCUMENT_CONVERSION_SERVER_PROXY_TIMEOUT
as
OOO_SERVER_PROXY_TIMEOUT
# pylint: disable=unused-import
from
Products.ERP5.D
ocument.Document
import
DOCUMENT_CONVERSION_SERVER_RETRY
as
OOO_SERVER_RETRY
# pylint: disable=unused-import
from
Products.ERP5.D
ocument.Document
import
global_server_proxy_uri_failure_time
# pylint: disable=unused-import
from
Products.ERP5.D
ocument.Document
import
enc
,
dec
from
erp5.component.d
ocument.Document
import
DOCUMENT_CONVERSION_SERVER_PROXY_TIMEOUT
as
OOO_SERVER_PROXY_TIMEOUT
# pylint: disable=unused-import
from
erp5.component.d
ocument.Document
import
DOCUMENT_CONVERSION_SERVER_RETRY
as
OOO_SERVER_RETRY
# pylint: disable=unused-import
from
erp5.component.d
ocument.Document
import
global_server_proxy_uri_failure_time
# pylint: disable=unused-import
from
erp5.component.d
ocument.Document
import
enc
,
dec
OOoServerProxy
=
DocumentConversionServerProxy
class
OOoDocument
(
OOoDocumentExtensibleTraversableMixin
,
BaseConvertableFileMixin
,
File
,
...
...
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.Url.py
View file @
7c72a354
...
...
@@ -33,7 +33,7 @@ from Products.CMFCore.utils import getToolByName
from
Products.ERP5Type
import
Permissions
,
PropertySheet
from
Products.ERP5Type.Utils
import
deprecated
from
erp5.component.document.Coordinate
import
Coordinate
from
Products.ERP5.mixin.url
import
UrlMixin
from
erp5.component.mixin.UrlMixin
import
UrlMixin
from
zLOG
import
LOG
...
...
bt5/erp5_base/MixinTemplateItem/portal_components/mixin.erp5.OOoDocumentExtensibleTraversableMixin.py
View file @
7c72a354
...
...
@@ -30,7 +30,7 @@
from
AccessControl.SecurityManagement
import
setSecurityManager
from
Products.CMFCore.utils
import
_checkConditionalGET
,
_setCacheHeaders
,
_ViewEmulator
from
OFS.Image
import
File
as
OFSFile
from
Products.ERP5.D
ocument.Document
import
ConversionError
,
NotConvertedError
from
erp5.component.d
ocument.Document
import
ConversionError
,
NotConvertedError
from
Products.ERP5.mixin.base_extensible_traversable
import
BaseExtensibleTraversableMixin
from
Products.ERP5.mixin.document_extensible_traversable
import
DocumentExtensibleTraversableMixin
...
...
bt5/erp5_base/ModuleComponentTemplateItem/portal_components/module.erp5.ImageUtil.py
View file @
7c72a354
...
...
@@ -28,7 +28,7 @@
import
urllib2
from
lxml
import
etree
from
Products.ERP5.D
ocument.Document
import
ConversionError
from
erp5.component.d
ocument.Document
import
ConversionError
SVG_DEFAULT_NAMESPACE
=
"http://www.w3.org/2000/svg"
...
...
bt5/erp5_base/ModuleComponentTemplateItem/portal_components/module.erp5.TransformLib.py
View file @
7c72a354
...
...
@@ -2,7 +2,7 @@
from
Products.PortalTransforms.interfaces
import
ITransform
from
zope.interface
import
implements
from
Products.ERP5.D
ocument.Document
import
DocumentConversionServerProxy
,
ConversionError
,
enc
,
dec
from
erp5.component.d
ocument.Document
import
DocumentConversionServerProxy
,
ConversionError
,
enc
,
dec
class
DocumentConversionServerTransform
:
"""
Transformer using Conversion Server
...
...
bt5/erp5_big_file/DocumentTemplateItem/portal_components/document.erp5.BigFile.py
View file @
7c72a354
...
...
@@ -18,7 +18,7 @@ from cStringIO import StringIO
from
AccessControl
import
ClassSecurityInfo
from
Products.ERP5Type
import
Permissions
,
PropertySheet
from
Products.ERP5Type.Base
import
removeIContentishInterface
from
Products.ERP5.D
ocument.File
import
File
,
_MARKER
from
erp5.component.d
ocument.File
import
File
,
_MARKER
from
Products.ERP5Type.BTreeData
import
BTreeData
from
ZPublisher.HTTPRequest
import
FileUpload
from
ZPublisher
import
HTTPRangeSupport
...
...
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testBusinessTemplate.py
View file @
7c72a354
...
...
@@ -6291,59 +6291,6 @@ class TestBusinessTemplate(BusinessTemplateMixin):
"""
)
sequence_list
.
play
(
self
)
def
test_167_InstanceAndRelatedClassDefinedInSameBT
(
self
):
# This test does too much since we don't modify objects anymore during
# download. Objects are cleaned up during installation, which does not
# require any specific action about garbage collection or pickle cache.
from
Products.ERP5.Document.BusinessTemplate
import
BaseTemplateItem
portal
=
self
.
portal
BaseTemplateItem_removeProperties
=
BaseTemplateItem
.
removeProperties
object_id_list
=
'old_file'
,
'some_file'
marker_list
=
[]
def
removeProperties
(
self
,
obj
,
export
):
# Check it works if the object is modified during install.
if
obj
.
id
in
object_id_list
:
obj
.
int_index
=
marker_list
.
pop
()
return
obj
import
Products.ERP5.tests
try
:
BaseTemplateItem
.
removeProperties
=
removeProperties
template_tool
=
portal
.
portal_templates
bt_path
=
os
.
path
.
join
(
os
.
path
.
dirname
(
Products
.
ERP5
.
tests
.
__file__
),
'test_data'
,
'test_167_InstanceAndRelatedClassDefinedInSameBT'
)
# create a previously existing instance of the overriden document type
File
=
portal
.
portal_types
.
getPortalTypeClass
(
'File'
)
portal
.
_setObject
(
'another_file'
,
File
(
'another_file'
))
self
.
tic
()
# logged errors could keep a reference to a traceback having a reference
# to 'another_file' object
self
.
logged
=
[]
# check its class has not yet been overriden
self
.
assertFalse
(
getattr
(
portal
.
another_file
,
'isClassOverriden'
,
False
))
for
i
in
(
0
,
1
):
marker_list
+=
[
i
]
*
len
(
object_id_list
)
gc
.
disable
()
bt
=
template_tool
.
download
(
bt_path
)
assert
marker_list
if
i
:
self
.
tic
()
bt
.
install
(
force
=
1
)
assert
not
marker_list
gc
.
enable
()
for
id
in
object_id_list
:
self
.
assertEqual
(
getattr
(
portal
,
id
).
int_index
,
i
)
self
.
tic
()
finally
:
BaseTemplateItem
.
removeProperties
=
BaseTemplateItem_removeProperties
gc
.
enable
()
# check the previously existing instance now behaves as the overriden class
self
.
assertTrue
(
getattr
(
portal
.
another_file
,
'isClassOverriden'
,
False
))
# test uninstall is effective
self
.
uninstallBusinessTemplate
(
'test_167_InstanceAndRelatedClassDefinedInSameBT'
)
# check both File instances no longer behave like being overriden
self
.
assertFalse
(
getattr
(
portal
.
another_file
,
'isClassOverriden'
,
False
))
def
test_168_CheckPortalTypeAndPathInSameBusinessTemplate
(
self
,
change_broken_object
=
False
):
"""
Make sure we can define a portal type and instance of that portal type
...
...
bt5/erp5_corporate_identity/ExtensionTemplateItem/portal_components/extension.erp5.TemplateDocumentConversion.py
View file @
7c72a354
...
...
@@ -28,7 +28,7 @@
# Cloudooo uses zip= argument, which is also a python builtin
# pylint: disable=redefined-builtin
from
Products.ERP5.D
ocument.Document
import
DocumentConversionServerProxy
from
erp5.component.d
ocument.Document
import
DocumentConversionServerProxy
from
base64
import
b64encode
,
b64decode
from
zExceptions
import
Unauthorized
...
...
bt5/erp5_dms/DocumentTemplateItem/portal_components/document.erp5.ExternalSource.py
View file @
7c72a354
...
...
@@ -29,8 +29,8 @@
from
AccessControl
import
ClassSecurityInfo
from
Products.ERP5Type
import
Permissions
,
PropertySheet
from
Products.ERP5Type.XMLObject
import
XMLObject
from
Products.ERP5.mixin.url
import
UrlMixin
from
Products.ERP5.mixin.crawlable
import
CrawlableMixin
from
erp5.component.mixin.UrlMixin
import
UrlMixin
from
erp5.component.mixin.CrawlableMixin
import
CrawlableMixin
class
ExternalSource
(
XMLObject
,
UrlMixin
,
CrawlableMixin
):
"""
...
...
bt5/erp5_dms/DocumentTemplateItem/portal_components/document.erp5.PDFDocument.py
View file @
7c72a354
...
...
@@ -34,7 +34,7 @@ from AccessControl import ClassSecurityInfo
from
Products.ERP5Type
import
Permissions
,
PropertySheet
from
erp5.component.interface.IWatermarkable
import
IWatermarkable
from
erp5.component.document.Image
import
Image
from
Products.ERP5.D
ocument.Document
import
ConversionError
from
erp5.component.d
ocument.Document
import
ConversionError
from
subprocess
import
Popen
,
PIPE
from
zLOG
import
LOG
,
INFO
,
PROBLEM
import
errno
...
...
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_tryToConvertToBaseFormat.py
View file @
7c72a354
from
Products.ERP5.D
ocument.Document
import
ConversionError
from
erp5.component.d
ocument.Document
import
ConversionError
from
erp5.component.module.Log
import
log
from
ZODB.POSException
import
ConflictError
from
xmlrpclib
import
Fault
...
...
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_tryToUpdateBaseMetadata.py
View file @
7c72a354
from
ZODB.POSException
import
ConflictError
from
Products.ERP5.D
ocument.Document
import
ConversionError
from
erp5.component.d
ocument.Document
import
ConversionError
from
erp5.component.module.Log
import
log
message
=
None
...
...
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/PDF_checkConversionFormatPermission.py
View file @
7c72a354
# this script has an `format` argument
# pylint: disable=redefined-builtin
from
Products.ERP5.D
ocument.Document
import
VALID_IMAGE_FORMAT_LIST
from
erp5.component.d
ocument.Document
import
VALID_IMAGE_FORMAT_LIST
if
format
in
VALID_IMAGE_FORMAT_LIST
:
# we do not have any data so we can allow conversion to proceed and lead to a
...
...
bt5/erp5_dms/TestTemplateItem/portal_components/test.erp5.testDms.py
View file @
7c72a354
...
...
@@ -59,7 +59,7 @@ from Products.ERP5Type.tests.utils import DummyLocalizer
from
Products.ERP5OOo.OOoUtils
import
OOoBuilder
from
AccessControl.SecurityManagement
import
newSecurityManager
from
AccessControl
import
getSecurityManager
from
Products.ERP5.D
ocument.Document
import
NotConvertedError
from
erp5.component.d
ocument.Document
import
NotConvertedError
from
Products.ERP5Form.PreferenceTool
import
Priority
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
from
Products.ERP5Type.Globals
import
get_request
...
...
bt5/erp5_dms/TestTemplateItem/portal_components/test.erp5.testERP5WebWithDms.py
View file @
7c72a354
...
...
@@ -42,7 +42,7 @@ from AccessControl.SecurityManagement import newSecurityManager
from
Testing
import
ZopeTestCase
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.utils
import
FileUpload
,
createZODBPythonScript
from
Products.ERP5.D
ocument.Document
import
ConversionError
from
erp5.component.d
ocument.Document
import
ConversionError
from
PIL
import
Image
...
...
bt5/erp5_multimedia/DocumentTemplateItem/portal_components/document.erp5.Sound.py
View file @
7c72a354
# -*- coding: utf-8 -*-
from
AccessControl
import
ClassSecurityInfo
from
Products.ERP5Type
import
Permissions
,
PropertySheet
from
Products.ERP5.D
ocument.File
import
File
,
_MARKER
from
erp5.component.d
ocument.File
import
File
,
_MARKER
from
ZPublisher
import
HTTPRangeSupport
from
Products.CMFCore.utils
import
_setCacheHeaders
,
_ViewEmulator
from
Products.CMFCore.utils
import
_checkConditionalGET
...
...
bt5/erp5_oauth/ToolComponentTemplateItem/portal_components/tool.erp5.OAuthTool.py
View file @
7c72a354
...
...
@@ -64,7 +64,7 @@ class OAuthTool(BaseTool):
InitializeClass
(
OAuthTool
)
import
sys
sys
.
modules
[
'
Products.ERP5TioSafe.T
ool.OAuthTool'
]
=
sys
.
modules
[
__name__
]
sys
.
modules
[
'
erp5.component.t
ool.OAuthTool'
]
=
sys
.
modules
[
__name__
]
class
DummyClassForUnpickle
(
object
):
def
__init__
(
self
,
*
_
,
**
__
):
pass
...
...
product/ERP5/Document/BusinessTemplate.py
View file @
7c72a354
...
...
@@ -66,7 +66,6 @@ from Products.ERP5Type.dynamic.lazy_class import ERP5BaseBroken
from
Products.ERP5Type.dynamic.portal_type_class
import
synchronizeDynamicModules
from
Products.ERP5Type.Core.PropertySheet
import
PropertySheet
as
PropertySheetDocument
from
Products.ERP5Type.TransactionalVariable
import
getTransactionalVariable
from
Products.ERP5.Document.File
import
File
from
OFS.Traversable
import
NotFound
from
OFS
import
SimpleItem
,
XMLExportImport
from
OFS.Image
import
Pdata
...
...
@@ -1520,7 +1519,7 @@ class ObjectTemplateItem(BaseTemplateItem):
container
.
getParentValue
().
updateCache
()
elif
obj
.
__class__
.
__name__
in
(
'File'
,
'Image'
):
if
"data"
in
obj
.
__dict__
:
File
.
_setData
.
__func__
(
obj
,
obj
.
data
)
obj
.
_setData
(
obj
.
data
)
elif
(
container
.
meta_type
==
'CMF Skins Tool'
)
and
\
(
old_obj
is
not
None
):
# Keep compatibility with previous export format of
...
...
@@ -6548,7 +6547,6 @@ Business Template is a set of definitions, such as skins, portal types and categ
# Business Template
'Products.ERP5.Document.TrashBin'
,
'Products.ERP5.Tool.TrashTool'
,
'Products.ERP5.Document.File'
,
'Products.ERP5.Document.PythonScript'
,
'Products.ERP5.Document.BusinessTemplate'
,
'Products.ERP5.Tool.TemplateTool'
,
...
...
product/ERP5/Tool/ContributionTool.py
View file @
7c72a354
...
...
@@ -42,7 +42,6 @@ from Products.ERP5Type.Tool.BaseTool import BaseTool
from
Products.ERP5Type
import
Permissions
from
Products.ERP5Type.Utils
import
reencodeUrlEscapes
from
Products.ERP5
import
_dtmldir
from
Products.ERP5.mixin.url
import
no_crawl_protocol_list
from
Products.ERP5Type.Utils
import
fill_args_from_request
from
AccessControl
import
Unauthorized
...
...
@@ -563,6 +562,7 @@ class ContributionTool(BaseTool):
if
depth
<
0
:
# Do nothing if crawling depth is reached
return
from
erp5.component.mixin.UrlMixin
import
no_crawl_protocol_list
for
url
in
set
(
content
.
getContentNormalisedURLList
()):
# LOG('trying to crawl', 0, url)
# Some url protocols should not be crawled
...
...
product/ERP5/
Document/
Document.py
→
product/ERP5/
bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.
Document.py
View file @
7c72a354
...
...
@@ -33,7 +33,7 @@ from AccessControl import ClassSecurityInfo
from
Acquisition
import
aq_base
from
Products.ERP5Type.Accessor.Constant
import
PropertyGetter
as
ConstantGetter
from
Products.CMFCore.utils
import
_checkPermission
from
Products.ERP5Type
import
Permissions
,
PropertySheet
,
interfaces
from
Products.ERP5Type
import
Permissions
,
PropertySheet
from
Products.ERP5Type.XMLObject
import
XMLObject
from
Products.ERP5Type.Utils
import
deprecated
,
guessEncodingFromText
from
Products.ERP5Type.TransactionalVariable
import
getTransactionalVariable
...
...
@@ -41,16 +41,18 @@ from Products.ERP5.Tool.ContributionTool import MAX_REPEAT
from
Products.ZSQLCatalog.SQLCatalog
import
Query
,
NegatedQuery
from
AccessControl
import
Unauthorized
import
zope.interface
from
Products.PythonScripts.Utility
import
allow_class
from
AccessControl
import
allow_module
,
allow_class
# Mixin Import
from
Products.ERP5.mixin.cached_convertable
import
CachedConvertableMixin
from
Products.ERP5.mixin.text_convertable
import
TextConvertableMixin
from
Products.ERP5.mixin.downloadable
import
DownloadableMixin
from
Products.ERP5.mixin.document
import
DocumentMixin
from
Products.ERP5.mixin.crawlable
import
CrawlableMixin
from
Products.ERP5.mixin.discoverable
import
DiscoverableMixin
from
Products.ERP5.mixin.url
import
UrlMixin
from
erp5.component.mixin.CachedConvertableMixin
import
CachedConvertableMixin
from
erp5.component.mixin.TextConvertableMixin
import
TextConvertableMixin
from
erp5.component.mixin.DownloadableMixin
import
DownloadableMixin
from
erp5.component.mixin.DocumentMixin
import
DocumentMixin
from
erp5.component.mixin.CrawlableMixin
import
CrawlableMixin
from
erp5.component.mixin.DiscoverableMixin
import
DiscoverableMixin
from
erp5.component.mixin.UrlMixin
import
UrlMixin
allow_module
(
__name__
)
_MARKER
=
object
()
...
...
@@ -73,6 +75,7 @@ DEFAULT_IMAGE_QUALITY = 75.0
DEFAULT_CONTENT_TYPE
=
'text/html'
class
ConversionError
(
Exception
):
pass
allow_class
(
ConversionError
)
class
DocumentProxyError
(
Exception
):
pass
...
...
@@ -90,7 +93,6 @@ global_server_proxy_uri_failure_time = {}
from
Products.CMFCore.utils
import
getToolByName
from
functools
import
partial
from
xmlrpclib
import
Fault
,
ServerProxy
,
ProtocolError
from
AccessControl
import
Unauthorized
from
socket
import
error
as
SocketError
from
DateTime
import
DateTime
class
DocumentConversionServerProxy
():
...
...
@@ -169,7 +171,7 @@ class DocumentConversionServerProxy():
if
not
(
failure
):
try
:
response_code
,
response_dict
,
response_message
=
result_set
response_code
,
_
,
_
=
result_set
except
ValueError
:
# Compatibility for old oood, result is based type, like string
response_code
=
200
...
...
@@ -207,7 +209,16 @@ class DocumentConversionServerProxy():
return
partial
(
self
.
_proxy_function
,
attr
)
from
Products.ERP5.mixin.document_extensible_traversable
import
DocumentExtensibleTraversableMixin
from
erp5.component.interface.IConvertable
import
IConvertable
from
erp5.component.interface.ITextConvertable
import
ITextConvertable
from
erp5.component.interface.IHtmlConvertable
import
IHtmlConvertable
from
erp5.component.interface.ICachedConvertable
import
ICachedConvertable
from
erp5.component.interface.IVersionable
import
IVersionable
from
erp5.component.interface.IDownloadable
import
IDownloadable
from
erp5.component.interface.ICrawlable
import
ICrawlable
from
erp5.component.interface.IDocument
import
IDocument
from
erp5.component.interface.IDiscoverable
import
IDiscoverable
from
erp5.component.interface.IUrl
import
IUrl
class
Document
(
DocumentExtensibleTraversableMixin
,
XMLObject
,
UrlMixin
,
CachedConvertableMixin
,
CrawlableMixin
,
TextConvertableMixin
,
DownloadableMixin
,
DocumentMixin
,
DiscoverableMixin
):
...
...
@@ -380,27 +391,27 @@ class Document(DocumentExtensibleTraversableMixin, XMLObject, UrlMixin,
isDocument
=
ConstantGetter
(
'isDocument'
,
value
=
True
)
__dav_collection__
=
0
zope
.
interface
.
implements
(
interfaces
.
IConvertable
,
interfaces
.
ITextConvertable
,
interfaces
.
IHtmlConvertable
,
interfaces
.
ICachedConvertable
,
interfaces
.
IVersionable
,
interfaces
.
IDownloadable
,
interfaces
.
ICrawlable
,
interfaces
.
IDocument
,
interfaces
.
IDiscoverable
,
interfaces
.
IUrl
,
zope
.
interface
.
implements
(
IConvertable
,
ITextConvertable
,
IHtmlConvertable
,
ICachedConvertable
,
IVersionable
,
IDownloadable
,
ICrawlable
,
IDocument
,
IDiscoverable
,
IUrl
,
)
# Regular expressions
# XXX those regex are weak, fast but not reliable.
# this is a valid url than regex are not able to parse
# http://www.example.com//I don't care i put what/ i want/
href_parser
=
re
.
compile
(
'<a[^>]*href=[
\
'
"](.*?)[
\
'
"]'
,
re
.
IGNORECASE
)
body_parser
=
re
.
compile
(
'<body[^>]*>(.*?)</body>'
,
re
.
IGNORECASE
+
re
.
DOTALL
)
title_parser
=
re
.
compile
(
'<title[^>]*>(.*?)</title>'
,
re
.
IGNORECASE
+
re
.
DOTALL
)
base_parser
=
re
.
compile
(
'<base[^>]*href=[
\
'
"](.*?)[
\
'
"][^>]*>'
,
re
.
IGNORECASE
+
re
.
DOTALL
)
charset_parser
=
re
.
compile
(
'(?P<keyword>charset="?)(?P<charset>[a-z0-9
\
-]+)
'
, re.IGNORECASE)
href_parser
=
re
.
compile
(
r
'<a[^>]*href=[\'"](.*?)[\'"]'
,
re
.
IGNORECASE
)
body_parser
=
re
.
compile
(
r
'<body[^>]*>(.*?)</body>'
,
re
.
IGNORECASE
+
re
.
DOTALL
)
title_parser
=
re
.
compile
(
r
'<title[^>]*>(.*?)</title>'
,
re
.
IGNORECASE
+
re
.
DOTALL
)
base_parser
=
re
.
compile
(
r
'<base[^>]*href=[\'"](.*?)[\'"][^>]*>'
,
re
.
IGNORECASE
+
re
.
DOTALL
)
charset_parser
=
re
.
compile
(
r
'(?P<keyword>charset="?)(?P<charset>[a-z0-9\
-]+)
', re.IGNORECASE)
# Declarative security
security = ClassSecurityInfo()
...
...
@@ -772,7 +783,7 @@ class Document(DocumentExtensibleTraversableMixin, XMLObject, UrlMixin,
group_by=('language',))
if version is not None:
kw['version'] = version
return
map(lambda o:o.getLanguage(), catalog(**kw))
return
[o.getLanguage() for o in catalog(**kw)]
security.declareProtected(Permissions.AccessContentsInformation, 'getOriginalLanguage')
def getOriginalLanguage(self):
...
...
@@ -836,7 +847,7 @@ class Document(DocumentExtensibleTraversableMixin, XMLObject, UrlMixin,
is
the
one
to
override
in
subclasses
.
"""
kw['format'] = 'html'
mime
, html = self.convert(**kw)
_
, html = self.convert(**kw)
return html
security.declareProtected(Permissions.View, 'asStrippedHTML')
...
...
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.Document.xml
0 → 100644
View file @
7c72a354
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Document Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
Document
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.Document.Document
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
document.erp5.Document
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Document Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.EmailDocument.py
View file @
7c72a354
...
...
@@ -33,7 +33,7 @@ from AccessControl import ClassSecurityInfo
from
Products.ERP5Type.Accessor.Constant
import
PropertyGetter
as
ConstantGetter
from
Products.ERP5Type
import
Permissions
,
PropertySheet
from
erp5.component.document.TextDocument
import
TextDocument
from
Products.ERP5.D
ocument.File
import
File
from
erp5.component.d
ocument.File
import
File
from
erp5.component.mixin.MailMessageMixin
import
MailMessageMixin
,
testCharsetAndConvert
from
erp5.component.mixin.DocumentProxyMixin
import
DocumentProxyMixin
,
DocumentProxyError
from
MethodObject
import
Method
...
...
product/ERP5/
Document/
File.py
→
product/ERP5/
bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.
File.py
View file @
7c72a354
...
...
@@ -30,13 +30,11 @@
from
AccessControl
import
ClassSecurityInfo
from
Products.ERP5Type.Base
import
WorkflowMethod
from
Products.ERP5Type
import
Permissions
,
PropertySheet
from
Products.ERP5.D
ocument.Document
import
Document
,
VALID_TEXT_FORMAT_LIST
from
Products.ERP5.D
ocument.Document
import
VALID_IMAGE_FORMAT_LIST
from
Products.ERP5.D
ocument.Document
import
ConversionError
from
erp5.component.d
ocument.Document
import
Document
,
VALID_TEXT_FORMAT_LIST
from
erp5.component.d
ocument.Document
import
VALID_IMAGE_FORMAT_LIST
from
erp5.component.d
ocument.Document
import
ConversionError
from
Products.ERP5Type.Base
import
Base
,
removeIContentishInterface
from
Products.CMFDefault.File
import
File
as
CMFFile
from
OFS.Image
import
Pdata
from
cStringIO
import
StringIO
from
Products.ERP5Type.Utils
import
deprecated
def
_unpackData
(
data
):
...
...
@@ -129,7 +127,7 @@ class File(Document, CMFFile):
security
.
declareProtected
(
Permissions
.
View
,
'getcontentlength'
)
getcontentlength
=
get_size
def
_get_content_type
(
*
args
,
**
kw
):
def
_get_content_type
(
self
,
*
_
,
**
__
):
"""Override original implementation from OFS/Image.py
to disable content_type discovery because
id of object its used to read the filename value.
...
...
@@ -167,20 +165,6 @@ class File(Document, CMFFile):
return
self
.
getPortalObject
().
portal_contributions
.
\
guessMimeTypeFromFilename
(
fname
)
security
.
declareProtected
(
Permissions
.
ModifyPortalContent
,
'_setData'
)
def
_setData
(
self
,
data
):
"""
"""
# update_data use len(data) when size is None, which breaks this method.
# define size = 0 will prevent len be use and keep the consistency of
# getData() and setData()
if
data
is
None
:
size
=
0
else
:
data
,
size
=
self
.
_read_data
(
data
)
# We call this method to make sure size is set and caches reset
self
.
update_data
(
data
,
size
=
size
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getData'
)
def
getData
(
self
,
default
=
None
):
"""return Data as str."""
...
...
@@ -229,7 +213,7 @@ class File(Document, CMFFile):
return
(
mime_type
,
content
)
def
_convert
(
self
,
format
,
**
kw
):
def
_convert
(
self
,
format
,
**
kw
):
# pylint: disable=redefined-builtin
"""File is only convertable if it is an image.
Only Image conversion, original format and text formats are allowed.
However this document can migrate to another portal_type which support
...
...
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.File.xml
0 → 100644
View file @
7c72a354
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Document Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
File
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.Document.File
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
document.erp5.File
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Document Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.TextDocument.py
View file @
7c72a354
...
...
@@ -31,15 +31,15 @@ from AccessControl.ZopeGuards import guarded_getattr
from
AccessControl
import
ClassSecurityInfo
from
zLOG
import
LOG
,
WARNING
from
Products.ERP5Type
import
Permissions
,
PropertySheet
from
Products.ERP5.D
ocument.Document
import
Document
,
ConversionError
,
_MARKER
,
DEFAULT_CONTENT_TYPE
from
Products.ERP5.D
ocument.File
import
File
from
erp5.component.d
ocument.Document
import
Document
,
ConversionError
,
_MARKER
,
DEFAULT_CONTENT_TYPE
from
erp5.component.d
ocument.File
import
File
from
erp5.component.module.WebDAVSupport
import
TextContent
from
Products.ERP5.D
ocument.Document
import
VALID_IMAGE_FORMAT_LIST
,
VALID_TEXT_FORMAT_LIST
from
erp5.component.d
ocument.Document
import
VALID_IMAGE_FORMAT_LIST
,
VALID_TEXT_FORMAT_LIST
import
cStringIO
from
string
import
Template
# Mixin Import
from
Products.ERP5.mixin.cached_convertable
import
CachedConvertableMixin
from
erp5.component.mixin.CachedConvertableMixin
import
CachedConvertableMixin
from
erp5.component.mixin.BaseConvertableFileMixin
import
BaseConvertableFileMixin
from
Products.ERP5Type.mixin.text_content_history
import
TextContentHistoryMixin
from
Products.ERP5Type.Utils
import
guessEncodingFromText
...
...
product/ERP5/
interfaces/cached_c
onvertable.py
→
product/ERP5/
bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.ICachedC
onvertable.py
View file @
7c72a354
File moved
product/ERP5/bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.ICachedConvertable.xml
0 → 100644
View file @
7c72a354
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Interface Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
ICachedConvertable
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.interfaces.cached_convertable
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
interface.erp5.ICachedConvertable
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Interface Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/
interfaces/c
onvertable.py
→
product/ERP5/
bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.IC
onvertable.py
View file @
7c72a354
...
...
@@ -27,7 +27,7 @@
#
##############################################################################
from
Products.ERP5.interfaces.format_c
onvertable
import
IFormatConvertable
from
erp5.component.interface.IFormatC
onvertable
import
IFormatConvertable
class
IConvertable
(
IFormatConvertable
):
"""
...
...
@@ -37,7 +37,7 @@ class IConvertable(IFormatConvertable):
to multiple formats.
"""
def
convert
(
format
,
**
kw
):
def
convert
(
format
,
**
kw
):
# pylint: disable=redefined-builtin
"""
Converts the current document to the specified format
taking into account optional parameters. This method
...
...
product/ERP5/bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.IConvertable.xml
0 → 100644
View file @
7c72a354
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Interface Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
IConvertable
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.interfaces.convertable
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
interface.erp5.IConvertable
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Interface Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/
interfaces/c
rawlable.py
→
product/ERP5/
bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.IC
rawlable.py
View file @
7c72a354
File moved
product/ERP5/bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.ICrawlable.xml
0 → 100644
View file @
7c72a354
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Interface Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
ICrawlable
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.interfaces.crawlable
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
interface.erp5.ICrawlable
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Interface Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/
interfaces/d
iscoverable.py
→
product/ERP5/
bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.ID
iscoverable.py
View file @
7c72a354
File moved
product/ERP5/bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.IDiscoverable.xml
0 → 100644
View file @
7c72a354
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Interface Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
IDiscoverable
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.interfaces.discoverable
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
interface.erp5.IDiscoverable
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Interface Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/
interfaces/d
ocument.py
→
product/ERP5/
bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.ID
ocument.py
View file @
7c72a354
...
...
@@ -27,7 +27,7 @@
#
##############################################################################
"""
Products.ERP5.interfaces.d
ocument
erp5.component.interface.ID
ocument
"""
from
zope.interface
import
Interface
...
...
@@ -185,7 +185,7 @@ class IDocument(Interface):
(title). Each change generates a new revision.
"""
def
convert
(
format
,
**
kw
):
def
convert
(
format
,
**
kw
):
# pylint: disable=redefined-builtin
"""Call a wrapped function with CachingMethod and
return always converted result: ie. tuple(content_type, data)
...
...
product/ERP5/bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.IDocument.xml
0 → 100644
View file @
7c72a354
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Interface Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
IDocument
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.interfaces.document
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
interface.erp5.IDocument
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Interface Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/
interfaces/d
ownloadable.py
→
product/ERP5/
bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.ID
ownloadable.py
View file @
7c72a354
...
...
@@ -37,7 +37,7 @@ class IDownloadable(Interface):
directly from their URL using any format specified as a parameter.
"""
def
index_html
(
REQUEST
,
RESPONSE
,
format
=
None
,
**
kw
):
def
index_html
(
REQUEST
,
RESPONSE
,
format
=
None
,
**
kw
):
# pylint: disable=redefined-builtin
"""
Download the document in the specified format with
optional conversion parameters.
...
...
@@ -52,7 +52,7 @@ class IDownloadable(Interface):
kw -- optional conversion parameters
"""
def
getStandardFilename
(
format
=
None
):
def
getStandardFilename
(
format
=
None
):
# pylint: disable=redefined-builtin
"""
Returns a standard file name for the document to download.
This method is the reverse of
...
...
product/ERP5/bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.IDownloadable.xml
0 → 100644
View file @
7c72a354
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Interface Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
IDownloadable
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.interfaces.downloadable
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
interface.erp5.IDownloadable
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Interface Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/
interfaces/format_c
onvertable.py
→
product/ERP5/
bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.IFormatC
onvertable.py
View file @
7c72a354
...
...
@@ -37,7 +37,7 @@ class IFormatConvertable(Interface):
be converted to.
"""
def
isTargetFormatAllowed
(
format
):
def
isTargetFormatAllowed
(
format
):
# pylint: disable=redefined-builtin
"""
Checks if the current document can be converted
to the specified target format.
...
...
@@ -47,7 +47,7 @@ class IFormatConvertable(Interface):
string (ex. 'text/plain')
"""
def
isTargetFormatPermitted
(
format
):
def
isTargetFormatPermitted
(
format
):
# pylint: disable=redefined-builtin
"""
Checks if the current user can convert the current
document to the specified target format.
...
...
product/ERP5/bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.IFormatConvertable.xml
0 → 100644
View file @
7c72a354
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Interface Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
IFormatConvertable
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.interfaces.format_convertable
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
interface.erp5.IFormatConvertable
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Interface Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/
interfaces/html_c
onvertable.py
→
product/ERP5/
bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.IHtmlC
onvertable.py
View file @
7c72a354
File moved
product/ERP5/bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.IHtmlConvertable.xml
0 → 100644
View file @
7c72a354
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Interface Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
IHtmlConvertable
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.interfaces.html_convertable
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
interface.erp5.IHtmlConvertable
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Interface Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/
interfaces/text_c
onvertable.py
→
product/ERP5/
bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.ITextC
onvertable.py
View file @
7c72a354
...
...
@@ -27,7 +27,7 @@
#
##############################################################################
from
Products.ERP5.interfaces.text_convertable_l
egacy
import
ITextConvertableLegacy
from
erp5.component.interface.ITextConvertableL
egacy
import
ITextConvertableLegacy
class
ITextConvertable
(
ITextConvertableLegacy
):
"""
...
...
product/ERP5/bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.ITextConvertable.xml
0 → 100644
View file @
7c72a354
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Interface Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
ITextConvertable
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.interfaces.text_convertable
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
interface.erp5.ITextConvertable
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Interface Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/
interfaces/text_convertable_l
egacy.py
→
product/ERP5/
bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.ITextConvertableL
egacy.py
View file @
7c72a354
File moved
product/ERP5/bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.ITextConvertableLegacy.xml
0 → 100644
View file @
7c72a354
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Interface Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
ITextConvertableLegacy
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.interfaces.text_convertable_legacy
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
interface.erp5.ITextConvertableLegacy
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Interface Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/
interfaces/u
rl.py
→
product/ERP5/
bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.IU
rl.py
View file @
7c72a354
File moved
product/ERP5/bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.IUrl.xml
0 → 100644
View file @
7c72a354
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Interface Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
IUrl
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.interfaces.url
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
interface.erp5.IUrl
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Interface Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/
interfaces/v
ersionable.py
→
product/ERP5/
bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.IV
ersionable.py
View file @
7c72a354
File moved
product/ERP5/bootstrap/erp5_core/InterfaceTemplateItem/portal_components/interface.erp5.IVersionable.xml
0 → 100644
View file @
7c72a354
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Interface Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
IVersionable
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.interfaces.versionable
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
interface.erp5.IVersionable
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Interface Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/
mixin/cached_convertable
.py
→
product/ERP5/
bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.CachedConvertableMixin
.py
View file @
7c72a354
...
...
@@ -275,7 +275,7 @@ class CachedConvertableMixin:
"""
Returns a list of acceptable formats for conversion
"""
return
map
(
lambda
x
:
x
[
0
],
self
.
getTargetFormatItemList
())
return
[
x
[
0
]
for
x
in
self
.
getTargetFormatItemList
()]
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getTargetFormatList'
)
...
...
@@ -283,11 +283,11 @@ class CachedConvertableMixin:
"""
Returns a list of acceptable formats for conversion
"""
return
map
(
lambda
x
:
x
[
1
],
self
.
getTargetFormatItemList
())
return
[
x
[
1
]
for
x
in
self
.
getTargetFormatItemList
()]
security
.
declareProtected
(
Permissions
.
ModifyPortalContent
,
'isTargetFormatAllowed'
)
def
isTargetFormatAllowed
(
self
,
format
):
def
isTargetFormatAllowed
(
self
,
format
):
# pylint: disable=redefined-builtin
"""
Checks if the current document can be converted
into the specified target format.
...
...
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.CachedConvertableMixin.xml
0 → 100644
View file @
7c72a354
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Mixin Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
CachedConvertableMixin
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.mixin.cached_convertable
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
mixin.erp5.CachedConvertableMixin
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Mixin Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/
mixin/crawlable
.py
→
product/ERP5/
bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.CrawlableMixin
.py
View file @
7c72a354
...
...
@@ -106,7 +106,7 @@ class CrawlableMixin:
if
base_href
:
html_tree
.
make_links_absolute
(
base_href
)
href_list
=
[]
for
elemnt
,
attribute_name
,
link
,
position
in
html_tree
.
iterlinks
():
for
_
,
attribute_name
,
link
,
_
in
html_tree
.
iterlinks
():
# For now take into acount only a and img tags
if
attribute_name
not
in
(
'href'
,):
continue
...
...
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.CrawlableMixin.xml
0 → 100644
View file @
7c72a354
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Mixin Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
CrawlableMixin
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.mixin.crawlable
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
mixin.erp5.CrawlableMixin
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Mixin Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/
mixin/discoverable
.py
→
product/ERP5/
bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.DiscoverableMixin
.py
View file @
7c72a354
...
...
@@ -33,7 +33,7 @@ from ZODB.POSException import ConflictError
from
Products.ERP5Type
import
Permissions
from
Products.ERP5Type.UnrestrictedMethod
import
UnrestrictedMethod
from
Products.ERP5Type.Utils
import
convertToUpperCase
from
Products.ERP5.mixin.cached_convertable
import
CachedConvertableMixin
from
erp5.component.mixin.CachedConvertableMixin
import
CachedConvertableMixin
import
os
import
re
...
...
@@ -82,7 +82,7 @@ class DiscoverableMixin(CachedConvertableMixin):
returns properties which should be set on the document
"""
# accesss data through convert
mime
,
content
=
self
.
convert
(
None
)
_
,
content
=
self
.
convert
(
None
)
if
not
content
:
# if document is empty, we will not find anything in its content
return
{}
...
...
@@ -235,7 +235,7 @@ class DiscoverableMixin(CachedConvertableMixin):
"""
if
not
filename
:
filename
=
self
.
getStandardFilename
()
basename
,
extension
=
os
.
path
.
splitext
(
filename
)
_
,
extension
=
os
.
path
.
splitext
(
filename
)
if
extension
:
extension
=
extension
[
1
:].
lower
()
# remove first dot
return
extension
...
...
@@ -247,14 +247,14 @@ class DiscoverableMixin(CachedConvertableMixin):
Call private implementation, then store the result in conversion
cache storage.
"""
format
=
CONTENT_INFORMATION_FORMAT
format
_
=
CONTENT_INFORMATION_FORMAT
# How to knows if a instance implement an interface
try
:
mime
,
cached_value
=
self
.
getConversion
(
format
=
format
)
_
,
cached_value
=
self
.
getConversion
(
format
=
format_
)
return
cached_value
except
KeyError
:
value
=
self
.
_getContentInformation
()
self
.
setConversion
(
value
,
format
=
format
)
self
.
setConversion
(
value
,
format
=
format
_
)
return
value
def
_getContentInformation
(
self
):
...
...
@@ -269,7 +269,7 @@ class DiscoverableMixin(CachedConvertableMixin):
html
=
self
.
asEntireHTML
()
except
ConflictError
:
raise
except
:
except
Exception
:
return
result
if
not
html
:
return
result
...
...
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.DiscoverableMixin.xml
0 → 100644
View file @
7c72a354
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Mixin Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
DiscoverableMixin
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.mixin.discoverable
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
mixin.erp5.DiscoverableMixin
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Mixin Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/
mixin/document
.py
→
product/ERP5/
bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.DocumentMixin
.py
View file @
7c72a354
...
...
@@ -29,11 +29,8 @@
from
AccessControl
import
ClassSecurityInfo
,
Unauthorized
from
Products.ERP5Type.Globals
import
InitializeClass
from
Products.ERP5Type
import
Permissions
from
OFS.Image
import
Pdata
from
cStringIO
import
StringIO
from
Products.ERP5Type.TransactionalVariable
import
getTransactionalVariable
_MARKER
=
[]
LOCK_PERMISSION_KEY
=
'TRANSACTIONAL_VARIABLE_FORMAT_PERMISSION_LOCK_FLAG'
class
DocumentMixin
:
...
...
@@ -50,7 +47,7 @@ class DocumentMixin:
security
=
ClassSecurityInfo
()
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'convert'
)
def
convert
(
self
,
format
,
**
kw
):
def
convert
(
self
,
format
,
**
kw
):
# pylint: disable=redefined-builtin
"""
Main content conversion function, returns result which should
be returned and stored in cache.
...
...
@@ -94,7 +91,7 @@ class DocumentMixin:
fallback_script_id
=
'Document_getFailsafeConversion'
)
return
method
(
**
kw
)
def
_convert
(
self
,
format
,
**
kw
):
def
_convert
(
self
,
format
,
**
kw
):
# pylint: disable=redefined-builtin
"""Private method which make the transformation.
Must be overriden !!!
"""
...
...
@@ -102,7 +99,7 @@ class DocumentMixin:
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'checkConversionFormatPermission'
)
def
checkConversionFormatPermission
(
self
,
format
,
**
kw
):
def
checkConversionFormatPermission
(
self
,
format
,
**
kw
):
# pylint: disable=redefined-builtin
"""Public version of _checkConversionFormatPermission
Without raising return just True or False.
"""
...
...
@@ -113,7 +110,7 @@ class DocumentMixin:
else
:
return
True
def
_checkConversionFormatPermission
(
self
,
format
,
lock_checking
=
False
,
**
kw
):
def
_checkConversionFormatPermission
(
self
,
format
,
lock_checking
=
False
,
**
kw
):
# pylint: disable=redefined-builtin
"""Private method to check permission when access specified format.
This method raises
"""
...
...
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.DocumentMixin.xml
0 → 100644
View file @
7c72a354
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Mixin Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
DocumentMixin
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.mixin.document
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
mixin.erp5.DocumentMixin
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Mixin Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/
mixin/downloadable
.py
→
product/ERP5/
bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.DownloadableMixin
.py
View file @
7c72a354
...
...
@@ -26,7 +26,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from
AccessControl
import
ClassSecurityInfo
,
Unauthorized
from
AccessControl
import
ClassSecurityInfo
from
Products.ERP5Type.Globals
import
InitializeClass
from
Products.ERP5Type
import
Permissions
from
Products.ERP5Type.Utils
import
fill_args_from_request
...
...
@@ -35,7 +35,7 @@ from Products.CMFCore.utils import getToolByName, _checkConditionalGET, _setCach
import
warnings
from
zExceptions
import
Forbidden
_MARKER
=
[]
_MARKER
=
object
()
class
DownloadableMixin
:
security
=
ClassSecurityInfo
()
...
...
@@ -43,7 +43,7 @@ class DownloadableMixin:
### Content processing methods
security
.
declareProtected
(
Permissions
.
View
,
'index_html'
)
@
fill_args_from_request
(
'display'
,
'quality'
,
'resolution'
,
'frame'
,
'pre_converted_only'
)
def
index_html
(
self
,
REQUEST
,
RESPONSE
,
format
=
_MARKER
,
inline
=
_MARKER
,
**
kw
):
def
index_html
(
self
,
REQUEST
,
RESPONSE
,
format
=
_MARKER
,
inline
=
_MARKER
,
**
kw
):
# pylint: disable=redefined-builtin
"""
We follow here the standard Zope API for files and images
and extend it to support format conversion. The idea
...
...
@@ -66,7 +66,7 @@ class DownloadableMixin:
**kw -- can be various things - e.g. resolution
"""
from
Products.ERP5.D
ocument.Document
import
VALID_TEXT_FORMAT_LIST
,
\
from
erp5.component.d
ocument.Document
import
VALID_TEXT_FORMAT_LIST
,
\
VALID_IMAGE_FORMAT_LIST
if
format
is
_MARKER
and
not
kw
:
# conversion parameters is mandatory to download the converted content.
...
...
@@ -133,7 +133,7 @@ class DownloadableMixin:
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getStandardFilename'
)
def
getStandardFilename
(
self
,
format
=
None
):
def
getStandardFilename
(
self
,
format
=
None
):
# pylint: disable=redefined-builtin
"""Returns the document coordinates as a standard file name. This
method is the reverse of getPropertyDictFromFileName.
"""
...
...
@@ -153,7 +153,7 @@ class DownloadableMixin:
# backward compatibility
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getStandardFileName'
)
def
getStandardFileName
(
self
,
format
=
None
):
def
getStandardFileName
(
self
,
format
=
None
):
# pylint: disable=redefined-builtin
"""(deprecated) use getStandardFilename() instead."""
warnings
.
warn
(
'getStandardFileName() is deprecated. '
'use getStandardFilename() instead.'
)
...
...
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.DownloadableMixin.xml
0 → 100644
View file @
7c72a354
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Mixin Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
DownloadableMixin
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.mixin.downloadable
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
mixin.erp5.DownloadableMixin
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Mixin Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/
mixin/text_convertable
.py
→
product/ERP5/
bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.TextConvertableMixin
.py
View file @
7c72a354
...
...
@@ -47,7 +47,7 @@ class TextConvertableMixin:
Converts the current document to plain text
"""
kw
.
pop
(
'format'
,
None
)
mime
,
data
=
self
.
convert
(
format
=
'txt'
,
**
kw
)
_
,
data
=
self
.
convert
(
format
=
'txt'
,
**
kw
)
return
str
(
data
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
...
...
@@ -57,7 +57,7 @@ class TextConvertableMixin:
Converts the current document to plain text without substitution
"""
kw
.
pop
(
'format'
,
None
)
mime
,
data
=
self
.
convert
(
format
=
'txt'
,
substitute
=
False
,
**
kw
)
_
,
data
=
self
.
convert
(
format
=
'txt'
,
substitute
=
False
,
**
kw
)
return
str
(
data
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
...
...
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.TextConvertableMixin.xml
0 → 100644
View file @
7c72a354
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Mixin Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
TextConvertableMixin
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.mixin.text_convertable
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
mixin.erp5.TextConvertableMixin
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Mixin Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/
mixin/url
.py
→
product/ERP5/
bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.UrlMixin
.py
View file @
7c72a354
File moved
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.UrlMixin.xml
0 → 100644
View file @
7c72a354
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Mixin Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
UrlMixin
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.mixin.url
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
mixin.erp5.UrlMixin
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Mixin Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_showFoundText.py
View file @
7c72a354
...
...
@@ -4,7 +4,7 @@
containing searched words as well highlighting the searched
words in the text itself.
"""
from
Products.ERP5.D
ocument.Document
import
NotConvertedError
from
erp5.component.d
ocument.Document
import
NotConvertedError
encoding
=
'utf-8'
is_gadget_mode
=
context
.
REQUEST
.
get
(
'is_gadget_mode'
,
0
)
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Preference_getReportFormatItemList.py
View file @
7c72a354
...
...
@@ -6,7 +6,7 @@ style = request.get('your_portal_skin',
item_list
=
[(
''
,
''
)]
from
Products.ERP5.D
ocument.Document
import
ConversionError
from
erp5.component.d
ocument.Document
import
ConversionError
try
:
if
style
==
'ODS'
:
...
...
product/ERP5/bootstrap/erp5_core/bt/template_document_id_list
View file @
7c72a354
...
...
@@ -7,9 +7,11 @@ document.erp5.ContributionPredicate
document.erp5.Delivery
document.erp5.DeliveryCell
document.erp5.DeliveryLine
document.erp5.Document
document.erp5.DomainGenerator
document.erp5.EmailDocument
document.erp5.Event
document.erp5.File
document.erp5.ImmobilisableItem
document.erp5.ImmobilisationDelivery
document.erp5.ImmobilisationMovement
...
...
product/ERP5/bootstrap/erp5_core/bt/template_interface_id_list
View file @
7c72a354
...
...
@@ -11,16 +11,24 @@ interface.erp5.IArrowBase
interface.erp5.IAssetMovement
interface.erp5.IBaseConvertable
interface.erp5.IBusinessProcess
interface.erp5.ICachedConvertable
interface.erp5.IConvertable
interface.erp5.ICrawlable
interface.erp5.IDiscoverable
interface.erp5.IDivergenceController
interface.erp5.IDivergenceTester
interface.erp5.IDocument
interface.erp5.IDocumentProxy
interface.erp5.IDownloadable
interface.erp5.IEntity
interface.erp5.IExpandable
interface.erp5.IExplainable
interface.erp5.IExtensibleTraversable
interface.erp5.IFile
interface.erp5.IFormatConvertable
interface.erp5.IGeneratedDeliveryBuilder
interface.erp5.IGranulatable
interface.erp5.IHtmlConvertable
interface.erp5.IImmobilisationItem
interface.erp5.IMappedValue
interface.erp5.IMimeSender
...
...
@@ -38,6 +46,10 @@ interface.erp5.ISendable
interface.erp5.ISimilarityProvider
interface.erp5.ISimulatedDeliveryBuilder
interface.erp5.ISimulationMovement
interface.erp5.ITextConvertable
interface.erp5.ITextConvertableLegacy
interface.erp5.ITextDocument
interface.erp5.ITranslatable
interface.erp5.IUploadable
interface.erp5.IUrl
interface.erp5.IVersionable
\ No newline at end of file
product/ERP5/bootstrap/erp5_core/bt/template_mixin_id_list
View file @
7c72a354
mixin.erp5.AmountGeneratorMixin
mixin.erp5.BaseConvertableFileMixin
mixin.erp5.CachedConvertableMixin
mixin.erp5.CompositionMixin
mixin.erp5.CrawlableMixin
mixin.erp5.DiscoverableMixin
mixin.erp5.DocumentMixin
mixin.erp5.DocumentProxyMixin
mixin.erp5.DownloadableMixin
mixin.erp5.ExplainableMixin
mixin.erp5.MailMessageMixin
mixin.erp5.MovementCollectionUpdaterMixin
mixin.erp5.MovementGeneratorMixin
mixin.erp5.RuleMixin
mixin.erp5.SimulableMixin
mixin.erp5.TextConvertableMixin
mixin.erp5.UrlMixin
mixin.erp5.VirtualFolderMixin
\ No newline at end of file
product/ERP5/tests/testERP5Interfaces.py
View file @
7c72a354
...
...
@@ -49,9 +49,9 @@ implements_tuple_list = [
((
'erp5.component.document.Transformation'
,
'Transformation'
),
'IVariated'
),
((
'erp5.component.document.TransformedResource'
,
'TransformedResource'
),
'IVariated'
),
#IDocument
((
'
Products.ERP5.D
ocument.Document'
,
'Document'
),
'IDocument'
),
((
'
erp5.component.d
ocument.Document'
,
'Document'
),
'IDocument'
),
((
'erp5.component.document.Image'
,
'Image'
),
'IDocument'
),
((
'
Products.ERP5.D
ocument.File'
,
'File'
),
'IDocument'
),
((
'
erp5.component.d
ocument.File'
,
'File'
),
'IDocument'
),
((
'erp5.component.document.OOoDocument'
,
'OOoDocument'
),
'IDocument'
),
((
'erp5.component.document.TextDocument'
,
'TextDocument'
),
'IDocument'
),
((
'erp5.component.document.EmailDocument'
,
'EmailDocument'
),
'IDocument'
),
...
...
product/ERP5/tests/testERP5Web.py
View file @
7c72a354
...
...
@@ -441,7 +441,7 @@ Hé Hé Hé!""", page.asText().strip())
# and make sure that the base meta tag which is generated
# uses the web section rather than the portal
html_page
=
websection
()
from
Products.ERP5.D
ocument.Document
import
Document
from
erp5.component.d
ocument.Document
import
Document
base_list
=
re
.
findall
(
Document
.
base_parser
,
str
(
html_page
))
base_url
=
base_list
[
0
]
self
.
assertEqual
(
base_url
,
"%s/%s/"
%
(
websection
.
absolute_url
(),
...
...
@@ -478,7 +478,7 @@ Hé Hé Hé!""", page.asText().strip())
# and make sure that the base meta tag which is generated
# uses the web site rather than the portal
html_page
=
website
()
from
Products.ERP5.D
ocument.Document
import
Document
from
erp5.component.d
ocument.Document
import
Document
base_list
=
re
.
findall
(
Document
.
base_parser
,
str
(
html_page
))
base_url
=
base_list
[
0
]
self
.
assertEqual
(
base_url
,
"%s/%s/"
%
(
website
.
absolute_url
(),
web_page_en
.
getReference
()))
...
...
product/ERP5/tests/test_data/test_167_InstanceAndRelatedClassDefinedInSameBT/DocumentTemplateItem/File.py
deleted
100644 → 0
View file @
5a3a1624
##############################################################################
#
# Copyright (c) 2010 Nexedi SA and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly advised to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from
Products.ERP5Type.XMLObject
import
XMLObject
class
File
(
XMLObject
):
portal_type
=
'File'
isClassOverriden
=
True
product/ERP5/tests/test_data/test_167_InstanceAndRelatedClassDefinedInSameBT/PathTemplateItem/old_file.xml
deleted
100644 → 0
View file @
5a3a1624
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<tuple>
<global
name=
"File"
module=
"Products.ERP5Type.Document.File"
/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
old_file
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/tests/test_data/test_167_InstanceAndRelatedClassDefinedInSameBT/PathTemplateItem/some_file.xml
deleted
100644 → 0
View file @
5a3a1624
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"File"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
some_file
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/tests/test_data/test_167_InstanceAndRelatedClassDefinedInSameBT/PortalTypeTemplateItem/portal_types/Foo%20Type.xml
deleted
100644 → 0
View file @
5a3a1624
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Base Type"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Foo Type
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Base Type
</string>
</value>
</item>
<item>
<key>
<string>
type_class
</string>
</key>
<value>
<string>
ERP5TypeInformation
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/tests/test_data/test_167_InstanceAndRelatedClassDefinedInSameBT/PortalTypeTemplateItem/portal_types/Foo.xml
deleted
100644 → 0
View file @
5a3a1624
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Foo Type"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Foo
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Foo Type
</string>
</value>
</item>
<item>
<key>
<string>
type_class
</string>
</key>
<value>
<string>
XMLObject
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/tests/test_data/test_167_InstanceAndRelatedClassDefinedInSameBT/bt/template_document_id_list
deleted
100644 → 0
View file @
5a3a1624
File
\ No newline at end of file
product/ERP5/tests/test_data/test_167_InstanceAndRelatedClassDefinedInSameBT/bt/template_format_version
deleted
100644 → 0
View file @
5a3a1624
1
\ No newline at end of file
product/ERP5/tests/test_data/test_167_InstanceAndRelatedClassDefinedInSameBT/bt/template_path_list
deleted
100644 → 0
View file @
5a3a1624
old_file
some_file
\ No newline at end of file
product/ERP5/tests/test_data/test_167_InstanceAndRelatedClassDefinedInSameBT/bt/template_portal_type_id_list
deleted
100644 → 0
View file @
5a3a1624
Foo
Foo Type
\ No newline at end of file
product/ERP5/tests/test_data/test_167_InstanceAndRelatedClassDefinedInSameBT/bt/title
deleted
100644 → 0
View file @
5a3a1624
test_167_InstanceAndRelatedClassDefinedInSameBT
\ No newline at end of file
product/ERP5Form/OOoChart.py
View file @
7c72a354
...
...
@@ -34,7 +34,6 @@ from Products.Formulator.DummyField import fields
from
Products.Formulator.Field
import
ZMIField
from
Selection
import
Selection
from
Products.ERP5Type.Globals
import
get_request
from
Products.ERP5.Document.Document
import
VALID_IMAGE_FORMAT_LIST
from
zLOG
import
LOG
...
...
@@ -475,6 +474,7 @@ class OOoChartWidget(Widget.Widget):
# not editable (otherwise, REQUEST.form may contain listbox=()).
url
=
'%s/%s/%s?%s'
%
(
here
.
absolute_url
(),
form
.
getId
(),
field
.
getId
(),
make_query
(
query_dict
))
from
erp5.component.document.Document
import
VALID_IMAGE_FORMAT_LIST
if
format
in
VALID_IMAGE_FORMAT_LIST
:
return
'''<div class="OOoChartContent">
<img class="%s" src="%s" title="%s" alt="%s"/">
...
...
product/ERP5Form/tests/testOOoChart.py
View file @
7c72a354
...
...
@@ -34,7 +34,6 @@ from Testing import ZopeTestCase
from
Products.ERP5OOo.tests.utils
import
Validator
from
Acquisition
import
aq_base
from
Products.ERP5Type.Globals
import
get_request
from
Products.ERP5.Document.Document
import
VALID_IMAGE_FORMAT_LIST
from
lxml
import
etree
HTTP_OK
=
200
...
...
@@ -178,6 +177,7 @@ class TestOOoChart(ERP5TypeTestCase, ZopeTestCase.Functional):
# Test the differents render
# render image
from
erp5.component.document.Document
import
VALID_IMAGE_FORMAT_LIST
for
image_format
in
VALID_IMAGE_FORMAT_LIST
:
response
=
self
.
publish
(
'/%s/%s/%s?render_format=%s&display=medium'
...
...
@@ -271,6 +271,7 @@ class TestOOoChart(ERP5TypeTestCase, ZopeTestCase.Functional):
# Test the differents render
# render image
from
erp5.component.document.Document
import
VALID_IMAGE_FORMAT_LIST
for
image_format
in
VALID_IMAGE_FORMAT_LIST
:
response
=
self
.
publish
(
'/%s/%s/%s?render_format=%s&display=medium'
...
...
product/ERP5OOo/FormPrintout.py
View file @
7c72a354
...
...
@@ -286,7 +286,7 @@ class FormPrintout(Implicit, Persistent, RoleManager, Item, PropertyManager):
# XXX This is a temporary implementation:
# Calling a webservice must be done through a WebServiceMethod
# and a WebServiceConnection
from
Products.ERP5.D
ocument.Document
import
DocumentConversionServerProxy
,
enc
,
dec
from
erp5.component.d
ocument.Document
import
DocumentConversionServerProxy
,
enc
,
dec
server_proxy
=
DocumentConversionServerProxy
(
self
)
extension
=
guess_extension
(
content_type
).
strip
(
'.'
)
printout
=
dec
(
server_proxy
.
convertFile
(
enc
(
printout
),
...
...
product/ERP5OOo/OOoTemplate.py
View file @
7c72a354
...
...
@@ -53,7 +53,6 @@ try:
except
ImportError
:
SUPPORTS_WEBDAV_LOCKS
=
0
from
Products.ERP5.Document.Document
import
ConversionError
from
Products.Formulator.Widget
import
convert_to_xml_compatible_string
from
lxml
import
etree
from
lxml.etree
import
Element
...
...
product/ERP5OOo/__init__.py
View file @
7c72a354
...
...
@@ -64,6 +64,5 @@ def initialize( context ):
# allow import of various exceptions in restricted environment
# so we can catch them in ZODB scripts and inform user nicely
allow_module
(
'Products.ERP5.Document.Document.ConversionError'
)
allow_module
(
'xmlrpclib.Fault'
)
allow_module
(
'socket.error'
)
product/ERP5OOo/tests/testOOoBatchMode.py
View file @
7c72a354
...
...
@@ -31,7 +31,6 @@ import os
import
unittest
from
AccessControl.SecurityManagement
import
newSecurityManager
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5.Document.Document
import
ConversionError
class
TestOoodResponse
(
ERP5TypeTestCase
):
...
...
@@ -110,6 +109,7 @@ class TestOoodResponse(ERP5TypeTestCase):
ERP5Site_viewNothingAsOdt
=
self
.
getPortal
().
ERP5Site_viewNothingAsOdt
# This assumes that a conversion error is raised because oood coordinates
# are not defined in preferences.
from
erp5.component.document.Document
import
ConversionError
self
.
assertRaises
(
ConversionError
,
ERP5Site_viewNothingAsOdt
,
batch_mode
=
0
,
format
=
'pdf'
)
self
.
assertEqual
(
'text/html'
,
...
...
@@ -121,6 +121,7 @@ class TestOoodResponse(ERP5TypeTestCase):
ERP5Site_viewNothingAsOdt
=
self
.
getPortal
().
ERP5Site_viewNothingAsOdt
# This assumes that a conversion error is raised because oood coordinates
# are not defined in preferences.
from
erp5.component.document.Document
import
ConversionError
self
.
assertRaises
(
ConversionError
,
ERP5Site_viewNothingAsOdt
,
batch_mode
=
1
,
format
=
'pdf'
)
self
.
assertEqual
(
'text/html'
,
request
.
RESPONSE
.
getHeader
(
'content-type'
).
split
(
';'
)[
0
])
...
...
product/ERP5OOo/transforms/oood_commandtransform.py
View file @
7c72a354
# -*- coding: utf-8 -*-
from
Products.PortalTransforms.libtransforms.commandtransform
import
commandtransform
from
Products.PortalTransforms.interfaces
import
idatastream
from
Products.ERP5.D
ocument.Document
import
ConversionError
from
erp5.component.d
ocument.Document
import
ConversionError
from
Acquisition
import
aq_base
from
zope.interface
import
implements
from
OFS.Image
import
Image
as
OFSImage
...
...
@@ -17,11 +17,6 @@ from lxml.etree import SubElement
from
urllib
import
unquote
from
urlparse
import
parse_qsl
,
urlparse
# XXX Must be replaced by portal_data_adapters soon
from
Products.ERP5.Document.Document
import
DocumentConversionServerProxy
from
Products.ERP5.Document.Document
import
enc
from
Products.ERP5.Document.Document
import
dec
def
includeMetaContentType
(
html_node
):
"""XXX Temp workaround time to fix issue
in lxml when include_meta_content_type is not honoured
...
...
@@ -220,11 +215,17 @@ class OOOdCommandTransform(commandtransform):
return
xml_output
def
convertTo
(
self
,
format
):
# XXX Must be replaced by portal_data_adapters soon
from
erp5.component.document.Document
import
DocumentConversionServerProxy
server_proxy
=
DocumentConversionServerProxy
(
self
.
context
)
response_code
,
response_dict
,
message
=
\
server_proxy
.
getAllowedTargetItemList
(
self
.
mimetype
)
allowed_extension_list
=
response_dict
[
'response_data'
]
if
format
in
dict
(
allowed_extension_list
):
# XXX Must be replaced by portal_data_adapters soon
from
erp5.component.document.Document
import
enc
,
dec
response_code
,
response_dict
,
message
=
server_proxy
.
run_generate
(
''
,
enc
(
self
.
data
),
...
...
product/ERP5Type/Base.py
View file @
7c72a354
...
...
@@ -2540,7 +2540,7 @@ class Base(
# CMF 2.x. They use aliases and Zope3 style views now and make pretty sure
# not to let zpublisher reach this value.
index_html
=
None
# By the Way,
Products.ERP5.D
ocument.File and .Image define their own
# By the Way,
erp5.component.d
ocument.File and .Image define their own
# index_html to make sure this value here is not used so that they're
# downloadable by their naked URL.
...
...
product/ERP5Type/Utils.py
View file @
7c72a354
...
...
@@ -1650,7 +1650,7 @@ def legacyNormalizeUrl(url, base_url=None):
"""this method does normalisation itself.
The result is less reliable but better than nothing
"""
from
Products.ERP5.mixin.url
import no_host_protocol_list
from
erp5.component.mixin.UrlMixin
import no_host_protocol_list
# remove anchors
# http://www.example.com/page.html#ll -> http://www.example.com/page.html
url = re_cleanup_anchors.sub('', url)
...
...
product/ERP5Type/patches/OFSFile.py
View file @
7c72a354
...
...
@@ -16,3 +16,19 @@ File.manage_editForm = manage_editForm
# restore __repr__ after persistent > 4.4
# https://github.com/zopefoundation/Zope/issues/379
File
.
__repr__
=
Item
.
__repr__
def
_setData
(
self
,
data
):
"""
Originally from Document class. Added because it is used by
BusinessTemplate on OFS.Image.{File,Image} instances
"""
# update_data use len(data) when size is None, which breaks this method.
# define size = 0 will prevent len be use and keep the consistency of
# getData() and setData()
if
data
is
None
:
size
=
0
else
:
data
,
size
=
self
.
_read_data
(
data
)
# We call this method to make sure size is set and caches reset
self
.
update_data
(
data
,
size
=
size
)
File
.
_setData
=
_setData
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment