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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
erp5
Commits
801a347e
Commit
801a347e
authored
Feb 22, 2012
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Component should have never been a Document but a mixin.
parent
be17e8bd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
12 deletions
+8
-12
product/ERP5Type/Core/DocumentComponent.py
product/ERP5Type/Core/DocumentComponent.py
+2
-2
product/ERP5Type/Core/ExtensionComponent.py
product/ERP5Type/Core/ExtensionComponent.py
+2
-2
product/ERP5Type/mixin/component.py
product/ERP5Type/mixin/component.py
+4
-8
No files found.
product/ERP5Type/Core/DocumentComponent.py
View file @
801a347e
...
@@ -27,11 +27,11 @@
...
@@ -27,11 +27,11 @@
#
#
##############################################################################
##############################################################################
from
Products.ERP5Type.
Core.Component
import
Component
from
Products.ERP5Type.
mixin.component
import
ComponentMixin
from
AccessControl
import
ClassSecurityInfo
from
AccessControl
import
ClassSecurityInfo
from
Products.ERP5Type
import
Permissions
from
Products.ERP5Type
import
Permissions
class
DocumentComponent
(
Component
):
class
DocumentComponent
(
Component
Mixin
):
# CMF Type Definition
# CMF Type Definition
meta_type
=
'ERP5 Document Component'
meta_type
=
'ERP5 Document Component'
portal_type
=
'Document Component'
portal_type
=
'Document Component'
...
...
product/ERP5Type/Core/ExtensionComponent.py
View file @
801a347e
...
@@ -27,11 +27,11 @@
...
@@ -27,11 +27,11 @@
#
#
##############################################################################
##############################################################################
from
Products.ERP5Type.
Core.Component
import
Component
from
Products.ERP5Type.
mixin.component
import
ComponentMixin
from
AccessControl
import
ClassSecurityInfo
from
AccessControl
import
ClassSecurityInfo
from
Products.ERP5Type
import
Permissions
from
Products.ERP5Type
import
Permissions
class
ExtensionComponent
(
Component
):
class
ExtensionComponent
(
Component
Mixin
):
# CMF Type Definition
# CMF Type Definition
meta_type
=
'ERP5 Extension Component'
meta_type
=
'ERP5 Extension Component'
portal_type
=
'Extension Component'
portal_type
=
'Extension Component'
...
...
product/ERP5Type/
Core/C
omponent.py
→
product/ERP5Type/
mixin/c
omponent.py
View file @
801a347e
...
@@ -39,11 +39,7 @@ from Products.ERP5Type.ConsistencyMessage import ConsistencyMessage
...
@@ -39,11 +39,7 @@ from Products.ERP5Type.ConsistencyMessage import ConsistencyMessage
from
zLOG
import
LOG
,
INFO
from
zLOG
import
LOG
,
INFO
class
Component
(
Base
):
class
ComponentMixin
(
Base
):
# CMF Type Definition
meta_type
=
'ERP5 Component'
portal_type
=
'Component'
isPortalContent
=
1
isPortalContent
=
1
isRADContent
=
1
isRADContent
=
1
isDelivery
=
ConstantGetter
(
'isDelivery'
,
value
=
True
)
isDelivery
=
ConstantGetter
(
'isDelivery'
,
value
=
True
)
...
@@ -132,7 +128,7 @@ class Component(Base):
...
@@ -132,7 +128,7 @@ class Component(Base):
previous_validation_workflow
[
'error_message'
]
=
''
previous_validation_workflow
[
'error_message'
]
=
''
previous_validation_workflow
[
'text_content'
]
=
''
previous_validation_workflow
[
'text_content'
]
=
''
else
:
else
:
super
(
Component
,
self
).
_setTextContent
(
text_content
)
super
(
Component
Mixin
,
self
).
_setTextContent
(
text_content
)
self
.
validate
()
self
.
validate
()
if
validation_state
==
'modified'
:
if
validation_state
==
'modified'
:
...
@@ -142,7 +138,7 @@ class Component(Base):
...
@@ -142,7 +138,7 @@ class Component(Base):
previous_validation_workflow
[
'error_message'
]
=
''
previous_validation_workflow
[
'error_message'
]
=
''
previous_validation_workflow
[
'text_content'
]
=
''
previous_validation_workflow
[
'text_content'
]
=
''
else
:
else
:
return
super
(
Component
,
self
).
_setTextContent
(
text_content
)
return
super
(
Component
Mixin
,
self
).
_setTextContent
(
text_content
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getTextContent'
)
'getTextContent'
)
...
@@ -161,7 +157,7 @@ class Component(Base):
...
@@ -161,7 +157,7 @@ class Component(Base):
if
text_content_non_validated
:
if
text_content_non_validated
:
return
text_content_non_validated
return
text_content_non_validated
return
super
(
Component
,
self
).
getTextContent
()
return
super
(
Component
Mixin
,
self
).
getTextContent
()
def
_getErrorMessage
(
self
):
def
_getErrorMessage
(
self
):
current_workflow
=
self
.
workflow_history
[
'component_validation_workflow'
][
-
1
]
current_workflow
=
self
.
workflow_history
[
'component_validation_workflow'
][
-
1
]
...
...
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