File: interfaces.py

package info (click to toggle)
zope-atseng 0.3.2-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 312 kB
  • ctags: 223
  • sloc: python: 1,301; makefile: 32; sh: 5
file content (158 lines) | stat: -rw-r--r-- 5,166 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# -*- coding: iso-8859-1 -*-

"""
ATSchemaEditorNG

(C) 2003,2004, Andreas Jung, ZOPYX Software Development and Consulting
and Contributors
D-72070 T´┐Żbingen, Germany

Contact: andreas@andreas-jung.com

License: see LICENSE.txt

$Id: interfaces.py 976 2004-12-10 07:17:04Z ajung $
"""

from Interface import Interface

class IParentManagedSchema(Interface):
    """ mix-in class for AT content-types whose schema is managed by
        the parent container and retrieved through acquisition.
    """

    def _wrap_schema(schema):
        """ return aquisition wrapped schema """

    def _lookupChanges(atse_schema_id):
        """ Checks if schema has changed """

    def Schema(schema_id=None):
        """ Retrieve schema from parent object. The client class should
            override the method as Schema(self) and then call his method
            of the baseclass with the corresponding schema_id.
        """

class ISchemaEditor(Interface):
    """ a simple TTW editor for Archetypes schemas """
    
    def atse_init():
        """ only for compat reasons """

    def _clear(safe=False):
        """ emply btree schema store and object parent type """

    def atse_registerSchema( schema_id, schema, filtered_schemas=(), 
                             undeleteable_fields=(), 
                             undeleteable_schematas=('default', 'metadata'), 
                             domain='plone'):
        """ registers a working copy of a schema """

    def atse_registerObject( obj,
                             filtered_schemas=(), 
                             undeleteable_fields=(), 
                             undeleteable_schematas=('default', 'metadata'), 
                             domain='plone'):
        """
        Using that method you can register an object.
        Information needed are extracted from it. The Schema id
        is set to the portal type of the object.
        """

    def atse_unregisterSchema(schema_id):
        """ unregister schema """

    def atse_reRegisterSchema(schema_id, schema):
        """ re-registering schema """

    def atse_reRegisterObject(object):
        """ re-registering object """

    def atse_getSchemaById(schema_id):
        """ return a schema by its schema_id """

    def atse_getRegisteredSchemata():
        """
        Returns all registered schemata
        """
        
    def atse_selectRegisteredSchema(schema_template, REQUEST=None):
        """
        Redirection
        """
        
    def atse_isSchemaRegistered(schema_id):
        """ returns True if schema exists """

    def atse_getDefaultSchema():
        """ returns the first schema in list """

    def atse_getDefaultSchemaId():
        """ returns default schema id """

    def atse_getSchemataNames( schema_id, filter=True):
        """ return names of all schematas """

    def atse_getSchemata( schema_id, name):
        """ return a schemata given by its name """

    def atse_addSchemata( schema_id, schema_template, name, RESPONSE=None):
        """ add a new schemata """

    def atse_delSchemata( schema_id, schema_template, name, RESPONSE=None):
        """ delete a schemata """

    def atse_delField( schema_id, schema_template, name, RESPONSE=None):
        """ remove a field from the  schema"""

    def atse_update( schema_id, schema_template, fielddata,  REQUEST, RESPONSE=None):
        """ update a single field"""

    def atse_schemataMoveLeft( schema_id, schema_template, name, RESPONSE=None):
        """ move a schemata to the left"""

    def atse_schemataMoveRight( schema_id, schema_template, name, RESPONSE=None):
        """ move a schemata to the right"""

    def atse_fieldMoveLeft( schema_id, schema_template, name, RESPONSE=None):
        """ move a field of a schemata to the left"""

    def atse_fieldMoveRight( schema_id, schema_template, name, RESPONSE=None):
        """ move a field of a schemata to the right"""

    def atse_changeSchemataForField( schema_id, schema_template, name, schemata_name, RESPONSE=None):
        """ move a field from the current fieldset to another one """

    def atse_getField( schema_id, name):
        """ return a field by its name """

    def atse_getFieldType( field):
        """ return the type of a field """

    def atse_formatVocabulary( field):
        """ format the DisplayList of a field to be displayed
            within a textarea.
        """
        
    def atse_schema_baseclass( schema_id):
        """ return name of baseclass """

    def atse_isFieldVisible( fieldname, mode='view', schema_id=None):
        """
        Returns True if the given field is visible
        in the given mode. Default is view.
        """

    def atse_editorCanUpdate( portal_type):
        """
        Returns True if an object was registered and
        its portal_type could be saved.
        """

    def atse_updateManagedSchema( portal_type,
                                  schema_template,
                                  REQUEST=None, RESPONSE=None):
        """
        Update stored issue schema for all managed schemas.
        That can only done, if an complete object was registered.
        """