Commit 80023d59 authored by Jérome Perrin's avatar Jérome Perrin

Add interface for Rules



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@7104 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 31dc6d03
...@@ -57,6 +57,9 @@ class AmortisationRule(Rule): ...@@ -57,6 +57,9 @@ class AmortisationRule(Rule):
security = ClassSecurityInfo() security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation) security.declareObjectProtected(Permissions.AccessContentsInformation)
__implements__ = ( Interface.Predicate,
Interface.Rule )
# Default Properties # Default Properties
property_sheets = ( PropertySheet.Base property_sheets = ( PropertySheet.Base
, PropertySheet.XMLObject , PropertySheet.XMLObject
......
...@@ -48,6 +48,9 @@ class DeliveryRule(Rule): ...@@ -48,6 +48,9 @@ class DeliveryRule(Rule):
security = ClassSecurityInfo() security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation) security.declareObjectProtected(Permissions.AccessContentsInformation)
__implements__ = ( Interface.Predicate,
Interface.Rule )
# Default Properties # Default Properties
property_sheets = ( PropertySheet.Base property_sheets = ( PropertySheet.Base
, PropertySheet.XMLObject , PropertySheet.XMLObject
......
...@@ -47,6 +47,9 @@ class InvoiceRule(DeliveryRule): ...@@ -47,6 +47,9 @@ class InvoiceRule(DeliveryRule):
isPortalContent = 1 isPortalContent = 1
isRADContent = 1 isRADContent = 1
__implements__ = ( Interface.Predicate,
Interface.Rule )
# Declarative security # Declarative security
security = ClassSecurityInfo() security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation) security.declareObjectProtected(Permissions.AccessContentsInformation)
......
...@@ -54,6 +54,9 @@ class InvoiceTransactionRule(Rule, PredicateMatrix): ...@@ -54,6 +54,9 @@ class InvoiceTransactionRule(Rule, PredicateMatrix):
security = ClassSecurityInfo() security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation) security.declareObjectProtected(Permissions.AccessContentsInformation)
__implements__ = ( Interface.Predicate,
Interface.Rule )
# Default Properties # Default Properties
property_sheets = ( PropertySheet.Base property_sheets = ( PropertySheet.Base
, PropertySheet.XMLObject , PropertySheet.XMLObject
......
...@@ -52,6 +52,9 @@ class InvoicingRule(Rule): ...@@ -52,6 +52,9 @@ class InvoicingRule(Rule):
security = ClassSecurityInfo() security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation) security.declareObjectProtected(Permissions.AccessContentsInformation)
__implements__ = ( Interface.Predicate,
Interface.Rule )
# Default Properties # Default Properties
property_sheets = ( PropertySheet.Base property_sheets = ( PropertySheet.Base
, PropertySheet.XMLObject , PropertySheet.XMLObject
......
...@@ -49,6 +49,9 @@ class OrderRule(DeliveryRule): ...@@ -49,6 +49,9 @@ class OrderRule(DeliveryRule):
security = ClassSecurityInfo() security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation) security.declareObjectProtected(Permissions.AccessContentsInformation)
__implements__ = ( Interface.Predicate,
Interface.Rule )
# Default Properties # Default Properties
property_sheets = ( PropertySheet.Base property_sheets = ( PropertySheet.Base
, PropertySheet.XMLObject , PropertySheet.XMLObject
......
...@@ -54,6 +54,9 @@ class PaymentRule(Rule): ...@@ -54,6 +54,9 @@ class PaymentRule(Rule):
security = ClassSecurityInfo() security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation) security.declareObjectProtected(Permissions.AccessContentsInformation)
__implements__ = ( Interface.Predicate,
Interface.Rule )
# Default Properties # Default Properties
property_sheets = ( PropertySheet.Base property_sheets = ( PropertySheet.Base
, PropertySheet.XMLObject , PropertySheet.XMLObject
......
...@@ -49,6 +49,9 @@ class ProductionOrderRule(OrderRule): ...@@ -49,6 +49,9 @@ class ProductionOrderRule(OrderRule):
security = ClassSecurityInfo() security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation) security.declareObjectProtected(Permissions.AccessContentsInformation)
__implements = ( Interface.Predicate,
Interface.Rule )
# Default Properties # Default Properties
property_sheets = ( PropertySheet.Base property_sheets = ( PropertySheet.Base
, PropertySheet.XMLObject , PropertySheet.XMLObject
......
...@@ -72,6 +72,9 @@ class Rule(XMLObject, Predicate): ...@@ -72,6 +72,9 @@ class Rule(XMLObject, Predicate):
security = ClassSecurityInfo() security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation) security.declareObjectProtected(Permissions.AccessContentsInformation)
__implements__ = ( Interface.Predicate,
Interface.Rule )
# Default Properties # Default Properties
property_sheets = ( PropertySheet.Base property_sheets = ( PropertySheet.Base
, PropertySheet.XMLObject , PropertySheet.XMLObject
......
...@@ -51,6 +51,8 @@ class TransformationRule(Rule): ...@@ -51,6 +51,8 @@ class TransformationRule(Rule):
# Declarative security # Declarative security
security = ClassSecurityInfo() security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation) security.declareObjectProtected(Permissions.AccessContentsInformation)
__implements__ = ( Interface.Predicate,
Interface.Rule )
# Default Properties # Default Properties
property_sheets = ( PropertySheet.Base property_sheets = ( PropertySheet.Base
, PropertySheet.XMLObject , PropertySheet.XMLObject
......
...@@ -134,6 +134,8 @@ class TransformationSourcingRule(Rule): ...@@ -134,6 +134,8 @@ class TransformationSourcingRule(Rule):
# Declarative security # Declarative security
security = ClassSecurityInfo() security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation) security.declareObjectProtected(Permissions.AccessContentsInformation)
__implements__ = ( Interface.Predicate,
Interface.Rule )
# Default Properties # Default Properties
property_sheets = ( PropertySheet.Base property_sheets = ( PropertySheet.Base
, PropertySheet.XMLObject , PropertySheet.XMLObject
......
##############################################################################
#
# Copyright (c) 2002 Nexedi SARL and Contributors. All Rights Reserved.
# Jean-Paul Smets-Solanes <jp@nexedi.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability 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
# garantees and support are strongly adviced 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.
#
##############################################################################
try:
from Interface import Interface
except ImportError:
# for Zope versions before 2.6.0
from Interface import Base as Interface
class Rule(Interface):
"""A Rule describes transformations of documents.
"""
def constructNewAppliedRule(context):
"""Create a new applied rule in the context.
An applied rule is an instanciation of a Rule. The applied rule is
linked to the Rule through the `specialise` relation.
"""
def expand(applied_rule):
"""Expand this applied rule to create new documents inside the
applied rule.
"""
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