1 | ## $Id: interfaces.py 14188 2016-09-26 05:13:42Z henrik $ |
---|
2 | ## |
---|
3 | ## Copyright (C) 2014 Uli Fouquet & Henrik Bettermann |
---|
4 | ## This program is free software; you can redistribute it and/or modify |
---|
5 | ## it under the terms of the GNU General Public License as published by |
---|
6 | ## the Free Software Foundation; either version 2 of the License, or |
---|
7 | ## (at your option) any later version. |
---|
8 | ## |
---|
9 | ## This program is distributed in the hope that it will be useful, |
---|
10 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
11 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
12 | ## GNU General Public License for more details. |
---|
13 | ## |
---|
14 | ## You should have received a copy of the GNU General Public License |
---|
15 | ## along with this program; if not, write to the Free Software |
---|
16 | ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
17 | ## |
---|
18 | |
---|
19 | from zope import schema |
---|
20 | from waeup.ikoba.interfaces import IIkobaObject |
---|
21 | from waeup.ikoba.customers.interfaces import ( |
---|
22 | ICustomer, ICustomerDocument, ICustomerPDFDocument, IContract) |
---|
23 | from waeup.ikoba.customers.vocabularies import ( |
---|
24 | ConCatProductSource, CustomerDocumentSource) |
---|
25 | from waeup.ikoba.products.productoptions import ProductOptionField |
---|
26 | from ikobacustom.uniben.interfaces import MessageFactory as _ |
---|
27 | |
---|
28 | |
---|
29 | class IUnibenCustomer(ICustomer): |
---|
30 | """Representation of a customer. |
---|
31 | |
---|
32 | """ |
---|
33 | |
---|
34 | # Customer document interfaces |
---|
35 | |
---|
36 | |
---|
37 | class IUnibenCustomerDocument(ICustomerDocument): |
---|
38 | """A customer document. |
---|
39 | |
---|
40 | """ |
---|
41 | |
---|
42 | class IUnibenCustomerPDFDocument(ICustomerPDFDocument): |
---|
43 | """A customer pdf document. |
---|
44 | |
---|
45 | """ |
---|
46 | |
---|
47 | # Customer contract interfaces |
---|
48 | |
---|
49 | class IUnibenContract(IContract): |
---|
50 | """A customer contract sample with document attached. |
---|
51 | |
---|
52 | """ |
---|
53 | |
---|
54 | doc1 = schema.Choice( |
---|
55 | title = _(u'Biographical Citation'), |
---|
56 | source = CustomerDocumentSource(), |
---|
57 | required = False, |
---|
58 | ) |
---|
59 | |
---|
60 | doc2 = schema.Choice( |
---|
61 | title = _(u'Supporting Statement'), |
---|
62 | source = CustomerDocumentSource(), |
---|
63 | required = False, |
---|
64 | ) |
---|
65 | |
---|
66 | doc3 = schema.Choice( |
---|
67 | title = _(u'Narrative Write-Up'), |
---|
68 | source = CustomerDocumentSource(), |
---|
69 | required = False, |
---|
70 | ) |
---|
71 | |
---|
72 | doc4 = schema.Choice( |
---|
73 | title = _(u'Itemized Statement'), |
---|
74 | source = CustomerDocumentSource(), |
---|
75 | required = False, |
---|
76 | ) |
---|
77 | |
---|
78 | doc5 = schema.Choice( |
---|
79 | title = _(u'Significant Publivations'), |
---|
80 | source = CustomerDocumentSource(), |
---|
81 | required = False, |
---|
82 | ) |
---|
83 | |
---|
84 | doc6 = schema.Choice( |
---|
85 | title = _(u'Curriculum Vitae'), |
---|
86 | source = CustomerDocumentSource(), |
---|
87 | required = False, |
---|
88 | ) |
---|
89 | |
---|
90 | doc7 = schema.Choice( |
---|
91 | title = _(u'Previous Awards'), |
---|
92 | source = CustomerDocumentSource(), |
---|
93 | required = False, |
---|
94 | ) |
---|
95 | |
---|
96 | doc8 = schema.Choice( |
---|
97 | title = _(u'Leadership Roles'), |
---|
98 | source = CustomerDocumentSource(), |
---|
99 | required = False, |
---|
100 | ) |
---|
101 | |
---|
102 | doc9 = schema.Choice( |
---|
103 | title = _(u'Photos and Illustrations'), |
---|
104 | source = CustomerDocumentSource(), |
---|
105 | required = False, |
---|
106 | ) |
---|
107 | |
---|
108 | |
---|
109 | doc10 = schema.Choice( |
---|
110 | title = _(u'State of H-Index'), |
---|
111 | source = CustomerDocumentSource(), |
---|
112 | required = False, |
---|
113 | ) |
---|
114 | |
---|
115 | doc11 = schema.Choice( |
---|
116 | title = _(u'Reference Letters'), |
---|
117 | source = CustomerDocumentSource(), |
---|
118 | required = False, |
---|
119 | ) |
---|
120 | |
---|
121 | class IRIAAContract(IUnibenContract): |
---|
122 | """A Retention of Name contract. |
---|
123 | |
---|
124 | """ |
---|
125 | |
---|
126 | class IRIAAContractOfficialUse(IIkobaObject): |
---|
127 | """Interface for editing RIAA official use data. |
---|
128 | |
---|
129 | """ |
---|
130 | |
---|
131 | comment = schema.Text( |
---|
132 | title= _('Reason for rejection'), |
---|
133 | required = False, |
---|
134 | ) |
---|
135 | |
---|
136 | |
---|
137 | class IRIAAContractProcess(IRIAAContract, IRIAAContractOfficialUse): |
---|
138 | """Interface for processing RIAA data. |
---|
139 | """ |
---|
140 | |
---|
141 | product_options = schema.List( |
---|
142 | title = _(u'Options/Fees'), |
---|
143 | value_type = ProductOptionField(), |
---|
144 | required = False, |
---|
145 | readonly = False, |
---|
146 | defaultFactory=list, |
---|
147 | ) |
---|
148 | |
---|
149 | class IRIAAContractEdit(IRIAAContract): |
---|
150 | """Interface for editing RIAA data by customers. |
---|
151 | |
---|
152 | """ |
---|
153 | |
---|
154 | doc1 = schema.Choice( |
---|
155 | title = _(u'Biographical Citation'), |
---|
156 | source = CustomerDocumentSource(), |
---|
157 | required = True, |
---|
158 | ) |
---|
159 | |
---|
160 | doc2 = schema.Choice( |
---|
161 | title = _(u'Supporting Statement'), |
---|
162 | source = CustomerDocumentSource(), |
---|
163 | required = True, |
---|
164 | ) |
---|
165 | |
---|
166 | doc3 = schema.Choice( |
---|
167 | title = _(u'Narrative Write-Up'), |
---|
168 | source = CustomerDocumentSource(), |
---|
169 | required = True, |
---|
170 | ) |
---|
171 | |
---|
172 | doc4 = schema.Choice( |
---|
173 | title = _(u'Itemized Statement'), |
---|
174 | source = CustomerDocumentSource(), |
---|
175 | required = True, |
---|
176 | ) |
---|
177 | |
---|
178 | doc5 = schema.Choice( |
---|
179 | title = _(u'Significant Publivations'), |
---|
180 | source = CustomerDocumentSource(), |
---|
181 | required = True, |
---|
182 | ) |
---|
183 | |
---|
184 | doc6 = schema.Choice( |
---|
185 | title = _(u'Curriculum Vitae'), |
---|
186 | source = CustomerDocumentSource(), |
---|
187 | required = True, |
---|
188 | ) |
---|
189 | |
---|
190 | doc7 = schema.Choice( |
---|
191 | title = _(u'Previous Awards'), |
---|
192 | source = CustomerDocumentSource(), |
---|
193 | required = True, |
---|
194 | ) |
---|
195 | |
---|
196 | doc8 = schema.Choice( |
---|
197 | title = _(u'Leadership Roles'), |
---|
198 | source = CustomerDocumentSource(), |
---|
199 | required = True, |
---|
200 | ) |
---|
201 | |
---|
202 | doc9 = schema.Choice( |
---|
203 | title = _(u'Photos and Illustrations'), |
---|
204 | source = CustomerDocumentSource(), |
---|
205 | required = True, |
---|
206 | ) |
---|
207 | |
---|
208 | |
---|
209 | doc10 = schema.Choice( |
---|
210 | title = _(u'State of H-Index'), |
---|
211 | source = CustomerDocumentSource(), |
---|
212 | required = True, |
---|
213 | ) |
---|
214 | |
---|
215 | doc11 = schema.Choice( |
---|
216 | title = _(u'Reference Letters'), |
---|
217 | source = CustomerDocumentSource(), |
---|
218 | required = True, |
---|
219 | ) |
---|