Commit daafd0e6 authored by Arnaud Fontaine's avatar Arnaud Fontaine

WIP: Move all TypeProviders to ERP5Type Product.

parent 78a8f52c
...@@ -37,7 +37,7 @@ from erp5.component.test.testERP5BankingCheckPayment \ ...@@ -37,7 +37,7 @@ from erp5.component.test.testERP5BankingCheckPayment \
import TestERP5BankingCheckPaymentMixin import TestERP5BankingCheckPaymentMixin
from erp5.component.test.testERP5BankingMoneyDeposit \ from erp5.component.test.testERP5BankingMoneyDeposit \
import TestERP5BankingMoneyDepositMixin import TestERP5BankingMoneyDepositMixin
from Products.ERP5Form.PreferenceTool import Priority from Products.ERP5Type.Tool.PreferenceTool import Priority
# Needed in order to have a log file inside the current folder # Needed in order to have a log file inside the current folder
os.environ['EVENT_LOG_FILE'] = os.path.join(os.getcwd(), 'zLOG.log') os.environ['EVENT_LOG_FILE'] = os.path.join(os.getcwd(), 'zLOG.log')
......
...@@ -45,7 +45,7 @@ from Tool import IdTool, TemplateTool,\ ...@@ -45,7 +45,7 @@ from Tool import IdTool, TemplateTool,\
TestTool, DomainTool, AlarmTool,\ TestTool, DomainTool, AlarmTool,\
TrashTool, ContributionTool, NotificationTool, PasswordTool,\ TrashTool, ContributionTool, NotificationTool, PasswordTool,\
GadgetTool, ContributionRegistryTool, IntrospectionTool,\ GadgetTool, ContributionRegistryTool, IntrospectionTool,\
AcknowledgementTool, SolverTool,\ AcknowledgementTool,\
UrlRegistryTool, InterfaceTool,\ UrlRegistryTool, InterfaceTool,\
CertificateAuthorityTool, InotifyTool CertificateAuthorityTool, InotifyTool
from Document import PythonScript, SQLMethod from Document import PythonScript, SQLMethod
...@@ -65,7 +65,6 @@ portal_tools = ( IdTool.IdTool, ...@@ -65,7 +65,6 @@ portal_tools = ( IdTool.IdTool,
ContributionRegistryTool.ContributionRegistryTool, ContributionRegistryTool.ContributionRegistryTool,
IntrospectionTool.IntrospectionTool, IntrospectionTool.IntrospectionTool,
AcknowledgementTool.AcknowledgementTool, AcknowledgementTool.AcknowledgementTool,
SolverTool.SolverTool,
UrlRegistryTool.UrlRegistryTool, UrlRegistryTool.UrlRegistryTool,
CertificateAuthorityTool.CertificateAuthorityTool, CertificateAuthorityTool.CertificateAuthorityTool,
InotifyTool.InotifyTool, InotifyTool.InotifyTool,
......
...@@ -38,7 +38,7 @@ from Products.ERP5Type.tests.utils import reindex ...@@ -38,7 +38,7 @@ from Products.ERP5Type.tests.utils import reindex
from Products.DCWorkflow.DCWorkflow import ValidationFailed from Products.DCWorkflow.DCWorkflow import ValidationFailed
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
from Products.ERP5Type.tests.Sequence import SequenceList from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5Form.PreferenceTool import Priority from Products.ERP5Type.Tool.PreferenceTool import Priority
from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod
......
...@@ -33,7 +33,7 @@ import unittest ...@@ -33,7 +33,7 @@ import unittest
from unittest import expectedFailure from unittest import expectedFailure
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Form.PreferenceTool import Priority from Products.ERP5Type.Tool.PreferenceTool import Priority
class TestTemplate(ERP5TypeTestCase): class TestTemplate(ERP5TypeTestCase):
......
...@@ -31,7 +31,7 @@ from AccessControl import ClassSecurityInfo ...@@ -31,7 +31,7 @@ from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint from Products.ERP5Type import Permissions, PropertySheet, Constraint
from Products.ERP5Type.Core.Folder import Folder from Products.ERP5Type.Core.Folder import Folder
from Products.CMFCore.utils import getToolByName from Products.CMFCore.utils import getToolByName
from Products.ERP5Form.PreferenceTool import PreferenceTool from Products.ERP5Type.Tool.PreferenceTool import PreferenceTool
class Priority: class Priority:
""" names for priorities """ names for priorities
......
...@@ -47,7 +47,6 @@ import OOoChart, PDFTemplate, Report, PDFForm, ParallelListField ...@@ -47,7 +47,6 @@ import OOoChart, PDFTemplate, Report, PDFForm, ParallelListField
import PlanningBox, POSBox, FormBox, EditorField, ProxyField, DurationField import PlanningBox, POSBox, FormBox, EditorField, ProxyField, DurationField
import RelationField, ImageField, MultiRelationField, MultiLinkField, InputButtonField import RelationField, ImageField, MultiRelationField, MultiLinkField, InputButtonField
import CaptchaField import CaptchaField
import PreferenceTool
from Products.Formulator.FieldRegistry import FieldRegistry from Products.Formulator.FieldRegistry import FieldRegistry
from Products.Formulator import StandardFields, HelperFields from Products.Formulator import StandardFields, HelperFields
...@@ -56,7 +55,7 @@ from Products.CMFCore.utils import registerIcon ...@@ -56,7 +55,7 @@ from Products.CMFCore.utils import registerIcon
object_classes = ( Form.ERP5Form, FSForm.ERP5FSForm, PDFTemplate.PDFTemplate, object_classes = ( Form.ERP5Form, FSForm.ERP5FSForm, PDFTemplate.PDFTemplate,
Report.ERP5Report, PDFForm.PDFForm) Report.ERP5Report, PDFForm.PDFForm)
portal_tools = ( SelectionTool.SelectionTool, PreferenceTool.PreferenceTool ) portal_tools = ( SelectionTool.SelectionTool, )
content_classes = ( ) content_classes = ( )
content_constructors = () content_constructors = ()
......
...@@ -39,7 +39,7 @@ from DateTime import DateTime ...@@ -39,7 +39,7 @@ from DateTime import DateTime
from Products.ERP5Type.tests.testERP5Type import PropertySheetTestCase from Products.ERP5Type.tests.testERP5Type import PropertySheetTestCase
from Products.ERP5Type.tests.utils import createZODBPythonScript from Products.ERP5Type.tests.utils import createZODBPythonScript
from Products.ERP5Form.PreferenceTool import Priority from Products.ERP5Type.Tool.PreferenceTool import Priority
# should match what's configured by default in HtmlStylePreference # should match what's configured by default in HtmlStylePreference
default_large_image_height = 768 default_large_image_height = 768
......
...@@ -61,7 +61,7 @@ from Products.CMFCore.utils import getToolByName ...@@ -61,7 +61,7 @@ from Products.CMFCore.utils import getToolByName
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
from AccessControl import getSecurityManager from AccessControl import getSecurityManager
from Products.ERP5.Document.Document import NotConvertedError from Products.ERP5.Document.Document import NotConvertedError
from Products.ERP5Form.PreferenceTool import Priority from Products.ERP5Type.Tool.PreferenceTool import Priority
from Products.ERP5Type.tests.utils import createZODBPythonScript from Products.ERP5Type.tests.utils import createZODBPythonScript
from Products.ERP5Type.Globals import get_request from Products.ERP5Type.Globals import get_request
import os import os
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5OOo.tests.testDms import makeFileUpload from Products.ERP5OOo.tests.testDms import makeFileUpload
from Products.ERP5Form.PreferenceTool import Priority from Products.ERP5Type.Tool.PreferenceTool import Priority
class TestOOoConversionServerRetry(ERP5TypeTestCase): class TestOOoConversionServerRetry(ERP5TypeTestCase):
......
...@@ -26,14 +26,14 @@ ...@@ -26,14 +26,14 @@
# #
############################################################################## ##############################################################################
from Products.ERP5Form.Document.PreferenceType import PreferenceType from Products.ERP5Type.Core.PreferenceType import PreferenceType
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions from Products.ERP5Type import Permissions
from Products.ERP5Type.dynamic.accessor_holder import AccessorHolderType from Products.ERP5Type.dynamic.accessor_holder import AccessorHolderType
from Products.ERP5Type.Accessor.TypeDefinition import list_types from Products.ERP5Type.Accessor.TypeDefinition import list_types
from Products.ERP5Type.Utils import convertToUpperCase from Products.ERP5Type.Utils import convertToUpperCase
from Products.ERP5Form.PreferenceTool import PreferenceMethod from Products.ERP5Type.Tool.PreferenceTool import PreferenceMethod
def _generatePreferenceToolAccessorHolder(portal_type_name, def _generatePreferenceToolAccessorHolder(portal_type_name,
accessor_holder_list): accessor_holder_list):
......
...@@ -299,7 +299,7 @@ class ERP5Site(ResponseHeaderGenerator, FolderMixIn, CMFSite, CacheCookieMixin): ...@@ -299,7 +299,7 @@ class ERP5Site(ResponseHeaderGenerator, FolderMixIn, CMFSite, CacheCookieMixin):
if pref.getPreferenceState() == 'global': if pref.getPreferenceState() == 'global':
break break
else: else:
from Products.ERP5Form.PreferenceTool import Priority from Products.ERP5Type.Tool.PreferenceTool import Priority
pref = preference_tool.newContent(id, portal_type, pref = preference_tool.newContent(id, portal_type,
priority=Priority.SITE, title='Default ' + portal_type) priority=Priority.SITE, title='Default ' + portal_type)
pref.enable() pref.enable()
......
...@@ -40,7 +40,6 @@ from Products.ERP5Type import Permissions ...@@ -40,7 +40,6 @@ from Products.ERP5Type import Permissions
from Products.ERP5Type.Cache import CachingMethod from Products.ERP5Type.Cache import CachingMethod
from Products.ERP5Type.Utils import convertToUpperCase from Products.ERP5Type.Utils import convertToUpperCase
from Products.ERP5Type.TransactionalVariable import getTransactionalVariable from Products.ERP5Type.TransactionalVariable import getTransactionalVariable
from Products.ERP5Form import _dtmldir
from BTrees.OIBTree import OIBTree from BTrees.OIBTree import OIBTree
_marker = object() _marker = object()
...@@ -105,10 +104,6 @@ class PreferenceTool(BaseTool): ...@@ -105,10 +104,6 @@ class PreferenceTool(BaseTool):
aq_preference_generated = False aq_preference_generated = False
security.declareProtected(
Permissions.ManagePortal, 'manage_overview' )
manage_overview = DTMLFile( 'explainPreferenceTool', _dtmldir )
security.declarePrivate('manage_afterAdd') security.declarePrivate('manage_afterAdd')
def manage_afterAdd(self, item, container) : def manage_afterAdd(self, item, container) :
""" init the permissions right after creation """ """ init the permissions right after creation """
......
...@@ -90,7 +90,8 @@ def initialize( context ): ...@@ -90,7 +90,8 @@ def initialize( context ):
# Import Product Components # Import Product Components
from Tool import (CacheTool, MemcachedTool, SessionTool, from Tool import (CacheTool, MemcachedTool, SessionTool,
TypesTool, WebServiceTool, PropertySheetTool, TypesTool, WebServiceTool, PropertySheetTool,
ComponentTool, CategoryTool) ComponentTool, CategoryTool,
PreferenceTool, SolverTool)
import Document import Document
from Base import Base from Base import Base
import XMLObject import XMLObject
...@@ -110,7 +111,9 @@ def initialize( context ): ...@@ -110,7 +111,9 @@ def initialize( context ):
WebServiceTool.WebServiceTool, WebServiceTool.WebServiceTool,
PropertySheetTool.PropertySheetTool, PropertySheetTool.PropertySheetTool,
ComponentTool.ComponentTool, ComponentTool.ComponentTool,
CategoryTool.CategoryTool CategoryTool.CategoryTool,
PreferenceTool.PreferenceTool,
SolverTool.SolverTool
) )
# Do initialization step # Do initialization step
initializeProduct(context, this_module, globals(), initializeProduct(context, this_module, globals(),
......
...@@ -12,3 +12,4 @@ from role_provider import ILocalRoleAssignor, ILocalRoleGenerator ...@@ -12,3 +12,4 @@ from role_provider import ILocalRoleAssignor, ILocalRoleGenerator
from types_tool import ITypesTool, ITypeProvider from types_tool import ITypesTool, ITypeProvider
from property_recordable import IPropertyRecordable from property_recordable import IPropertyRecordable
from predicate import IPredicate from predicate import IPredicate
from delivery_solver_factory import IDeliverySolverFactory
...@@ -59,7 +59,7 @@ from Testing.ZopeTestCase import PortalTestCase, user_name ...@@ -59,7 +59,7 @@ from Testing.ZopeTestCase import PortalTestCase, user_name
from Products.DCWorkflow.DCWorkflow import ValidationFailed from Products.DCWorkflow.DCWorkflow import ValidationFailed
from Products.PythonScripts.PythonScript import PythonScript from Products.PythonScripts.PythonScript import PythonScript
from Products.ERP5Type.Accessor.Constant import PropertyGetter as ConstantGetter from Products.ERP5Type.Accessor.Constant import PropertyGetter as ConstantGetter
from Products.ERP5Form.PreferenceTool import Priority from Products.ERP5Type.Tool.PreferenceTool import Priority
from zLOG import LOG, DEBUG from zLOG import LOG, DEBUG
from Products.ERP5Type.Utils import convertToUpperCase from Products.ERP5Type.Utils import convertToUpperCase
from Products.ERP5Type.tests.backportUnittest import SetupSiteError from Products.ERP5Type.tests.backportUnittest import SetupSiteError
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment