Passed
Pull Request — 2.x (#1977)
by
unknown
05:04
created

IWorksheetLayouts.getLayoutsList()   A

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 2
rs 10
c 0
b 0
f 0
cc 1
nop 1
1
# -*- coding: utf-8 -*-
2
#
3
# This file is part of SENAITE.CORE.
4
#
5
# SENAITE.CORE is free software: you can redistribute it and/or modify it under
6
# the terms of the GNU General Public License as published by the Free Software
7
# Foundation, version 2.
8
#
9
# This program is distributed in the hope that it will be useful, but WITHOUT
10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12
# details.
13
#
14
# You should have received a copy of the GNU General Public License along with
15
# this program; if not, write to the Free Software Foundation, Inc., 51
16
# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
#
18
# Copyright 2018-2021 by it's authors.
19
# Some rights reserved, see README and LICENSE.
20
21
from zope.interface import Interface
22
23
# BBB: Only kept for backwards compatibility
24
from senaite.core.interfaces import ISamples as IAnalysisRequestsFolder
25
26
27
class ISenaiteSiteRoot(Interface):
28
    """Marker interface for the Senaite Site Root
29
    """
30
31
32
class IBikaLIMS(Interface):
33
    """Marker interface that defines a Zope 3 browser layer.
34
35
    N.B. Please use ISenaiteSite interface
36
    """
37
38
39
class ISenaiteSite(IBikaLIMS):
40
    """Marker interface for Zope 3 browser layers.
41
    """
42
43
44
class IAutoGenerateID(Interface):
45
    """Auto-generate ID with ID server
46
    """
47
48
49
class IMultiCatalogBehavior(Interface):
50
    """Support multiple catalogs for Dexterity contents
51
    """
52
53
54
class IActionHandlerPool(Interface):
55
    """Marker interface for the ActionHandlerPool utility
56
    """
57
58
59
class IAuditLog(Interface):
60
    """Marker interface for Audit Log
61
    """
62
63
64
class IAuditable(Interface):
65
    """Marker inteface for auditable contents
66
    """
67
68
69
class IDoNotSupportSnapshots(Interface):
70
    """Marker inteface for non-auditable contents
71
    """
72
73
74
class IAuditLogCatalog(Interface):
75
    """Audit Log Catalog
76
    """
77
78
79
class IGenerateID(Interface):
80
    """Marker Interface to generate an ID
81
    """
82
83
84
class IHaveNoBreadCrumbs(Interface):
85
    """Items which do not display breadcrumbs
86
    """
87
88
89
class IAutoImportLog(Interface):
90
    """Auto Import Log
91
    """
92
93
94
class IClientFolder(Interface):
95
    """Client folder
96
    """
97
98
99
class IClient(Interface):
100
    """Client
101
    """
102
103
104
class IBatchFolder(Interface):
105
    """Batch folder
106
    """
107
108
109
class IBatch(Interface):
110
    """Batch
111
    """
112
113
114
class IBatchLabels(Interface):
115
    """Batch label
116
    """
117
118
119
class IAnalysisRequest(Interface):
120
    """Analysis Request
121
    """
122
123
124
class IHaveDescendants(Interface):
125
    """Marker interface for objects that have Descendants
126
    """
127
128
    def getDescendants(self, all_descendants=False):
129
        """Returns descendants of this object
130
        :param all_descendants: if True, returns all descendants from hierarchy
131
        """
132
133
134
class IAnalysisRequestWithPartitions(IHaveDescendants):
135
    """Marker interface for Analysis Requests that have Partitions
136
    """
137
138
139
class IAnalysisRequestPartition(Interface):
140
    """Marker interface for Analysis Requests that are also Partitions
141
    """
142
143
144
class IAnalysisRequestRetest(Interface):
145
    """Marker interface for Analysis Requests that are Retests
146
    """
147
148
149
class IAnalysisRequestSecondary(Interface):
150
    """Marker interface for Secondary Analysis Requests
151
    """
152
153
154
class IAnalysisRequestAddView(Interface):
155
    """AR Add view
156
    """
157
158
159
class IInvoiceView(Interface):
160
    """Invoice View
161
    """
162
163
164
class IAnalysis(Interface):
165
    """Analysis
166
    """
167
168
169
class IRoutineAnalysis(Interface):
170
    """This adapter distinguishes normal analyses from Duplicates, References,
171
    Rejections, etc.
172
    """
173
174
175
class IAnalysisSpec(Interface):
176
    """Analysis Specs
177
    """
178
179
180
class IDuplicateAnalysis(Interface):
181
    """DuplicateAnalysis
182
    """
183
184
185
class IReferenceAnalysis(Interface):
186
    """Reference Analyses
187
    """
188
189
190
class IRejectAnalysis(Interface):
191
    """This adapter distinguishes normal analyses from Duplicates, References,
192
    Rejections, etc.
193
    """
194
195
196
class IReportFolder(Interface):
197
    """Report folder
198
    """
199
200
201
class ISampleCondition(Interface):
202
    """Sample Condition
203
    """
204
205
206
class ISampleConditions(Interface):
207
    """Sample Conditions
208
    """
209
210
211
class ISampleMatrix(Interface):
212
    """Sample Matrix
213
    """
214
215
216
class ISampleMatrices(Interface):
217
    """Sample Matrices
218
    """
219
220
221
class ISamplingDeviation(Interface):
222
    """Sampling Deviation
223
    """
224
225
226
class ISamplingDeviations(Interface):
227
    """Sampling Deviations
228
    """
229
230
231
class IWorksheetFolder(Interface):
232
    """WorksheetFolder
233
    """
234
235
236
class IWorksheet(Interface):
237
    """Worksheet
238
    """
239
240
241
class IReferenceSample(Interface):
242
    """Reference Sample
243
    """
244
245
246
class IReferenceSamplesFolder(Interface):
247
    """Reference Samples Folder
248
    """
249
250
251
class IReportsFolder(Interface):
252
    """Reports Folder
253
    """
254
255
256
class IInvoice(Interface):
257
    """Invoice
258
    """
259
260
261
class IBikaSetup(Interface):
262
    """Marker interface for the LIMS Setup
263
    """
264
265
266
class IAnalysisCategory(Interface):
267
    """Marker interface for an Analysis Category
268
    """
269
270
271
class IAnalysisCategories(Interface):
272
    """Marker interface for Analysis Categories
273
    """
274
275
276
class IBaseAnalysis(Interface):
277
    """Marker interface for base Analysis
278
    """
279
280
281
class IAnalysisService(Interface):
282
    """Marker interface for Analysis Service
283
    """
284
285
286
class IAnalysisServices(Interface):
287
    """Marker interface for Analysis Services
288
    """
289
290
291
class IAttachmentTypes(Interface):
292
    """Marker interface for Attachment types
293
    """
294
295
296
class ICalculation(Interface):
297
    """Marker interface for a Calculation
298
    """
299
300
301
class ICalculations(Interface):
302
    """Marker interface for Calculations
303
    """
304
305
306
class IContacts(Interface):
307
    """Marker interface for Contacts
308
    """
309
310
311
class IContact(Interface):
312
    """Marker interface for a single Contact
313
    """
314
315
316
class IDepartments(Interface):
317
    """Marker interface for a Departments
318
    """
319
320
321
class IContainer(Interface):
322
    """Marker interface for Container
323
    """
324
325
326
class IContainers(Interface):
327
    """Marker interface for Containers
328
    """
329
330
331
class IContainerType(Interface):
332
    """Marker interface for Container Type
333
    """
334
335
336
class IContainerTypes(Interface):
337
    """Marker interface for Container types
338
    """
339
340
341
class IIdentifierTypes(Interface):
342
    """TODO: Remove in senaite.core 1.3.3
343
    """
344
345
346
class IHaveIdentifiers(Interface):
347
    """TODO: Remove in senaite.core 1.3.3
348
    """
349
350
351
class IInstrument(Interface):
352
    """Marker interface for an Instrument
353
    """
354
355
356
class IInstruments(Interface):
357
    """Marker interface for Instruments
358
    """
359
360
361
class IInstrumentType(Interface):
362
    """Marker interface for an instrument type
363
    """
364
365
366
class IInstrumentTypes(Interface):
367
    """Marker interface for instrument types
368
    """
369
370
371
class IInstrumentLocation(Interface):
372
    """A physical place, where instruments can be located
373
    """
374
375
376
class IInstrumentLocations(Interface):
377
    """Physical places, where instruments can be located
378
    """
379
380
381
class IInstrumentCalibration(Interface):
382
    """Instrument Calibration
383
    """
384
385
386
class IInstrumentCertification(Interface):
387
    """Instrument Certification
388
    """
389
390
391
class IInstrumentValidation(Interface):
392
    """Instrument Validation
393
    """
394
395
396
class IAnalysisSpecs(Interface):
397
    """Marker interface for Analysis Specs
398
    """
399
400
401
class IDynamicResultsRange(Interface):
402
    """Marker interface for Dynamic Result Range
403
    """
404
405
406
class IAnalysisProfile(Interface):
407
    """Marker interface for an Analysis Profile
408
    """
409
410
411
class IAnalysisProfiles(Interface):
412
    """Marker interface for analysis profiles
413
    """
414
415
416
class IARTemplate(Interface):
417
    """Marker interface for an AR Template
418
    """
419
420
421
class IARTemplates(Interface):
422
    """Marker interface for AR templates
423
    """
424
425
426
class ILaboratory(Interface):
427
    """Marker interface for Laboratory
428
    """
429
430
431
class ILabContacts(Interface):
432
    """Marker interface for Lab contacts
433
    """
434
435
436
class ILabContact(Interface):
437
    """Marker interface for a lab contact
438
    """
439
440
441
class IManufacturer(Interface):
442
    """Marker interface for Manufacturer
443
    """
444
445
446
class IManufacturers(Interface):
447
    """Marker interface for Manufacturers
448
    """
449
450
451
class IMethods(Interface):
452
    """Marker interface for Methods
453
    """
454
455
456
class IMethod(Interface):
457
    """Marker interface for Method
458
    """
459
460
461
class IMultifile(Interface):
462
    """Marker interface for a Multifile
463
    """
464
465
466
class ILabProducts(Interface):
467
    """Marker interface for Lab Products
468
    """
469
470
471
class ILabProduct(Interface):
472
    """Marker interface for a LabProduct
473
    """
474
475
476
class ISamplePoint(Interface):
477
    """Marker interface for a Sample Point
478
    """
479
480
481
class ISamplePoints(Interface):
482
    """Marker interface for Sample Points
483
    """
484
485
486
class IStorageLocation(Interface):
487
    """Marker interface for a Storage Location
488
    """
489
490
491
class IStorageLocations(Interface):
492
    """Marker interface for Storage Location
493
    """
494
495
496
class ISampleType(Interface):
497
    """Marker interface for a Sample Type
498
    """
499
500
501
class ISampleTypes(Interface):
502
    """Marker interface for Sample Types
503
    """
504
505
506
class ISupplier(Interface):
507
    """Marker interface for a Supplier
508
    """
509
510
511
class ISuppliers(Interface):
512
    """Marker interface for Suplliers
513
    """
514
515
516
class ISupplyOrder(Interface):
517
    """Marker interface for a Supplier Order
518
    """
519
520
521
class ISupplyOrderFolder(Interface):
522
    """Marker interface for Supply Order Folder
523
    """
524
525
526
class ISubGroups(Interface):
527
    """Sub-groups configuration folder
528
    """
529
530
531
class ISubGroup(Interface):
532
    """Sub-Group
533
    """
534
535
536
class IPreservations(Interface):
537
    """Marker interface for Preservations
538
    """
539
540
541
class IReferenceDefinitions(Interface):
542
    """Marker interface for Reference Definitions
543
    """
544
545
546
class IWorksheetTemplates(Interface):
547
    """Marker interface for Worksheet Templates
548
    """
549
550
551
class IWorksheetTemplate(Interface):
552
    """Marker interface for Worksheet Template
553
    """
554
555
556
class IWorksheetLayouts(Interface):
557
    """Marker interface for additional Worksheet layouts
558
    """
559
560
    def getLayoutsList(self):
561
        """Returns tuples of layouts where key is the name of the view and value is name of layout
562
        """
563
564
565
class IBikaCatalog(Interface):
566
    """Marker interface for bika_catalog
567
    """
568
569
570
class IBikaAnalysisCatalog(Interface):
571
    """Marker interface for senaite_catalog_analysis
572
    """
573
574
575
class IBikaSetupCatalog(Interface):
576
    """Marker interface for senaite_catalog_setup
577
    """
578
579
580
class IBikaCatalogAnalysisRequestListing(Interface):
581
    """Marker interface for bika_catalog_analysisrequest_listing
582
    """
583
584
585
class IBikaCatalogAutoImportLogsListing(Interface):
586
    """Marker interface for bika_catalog_autoimportlogs_listing
587
    """
588
589
590
class IBikaCatalogWorksheetListing(Interface):
591
    """Marker interface for bika_catalog_worksheet_listing
592
    """
593
594
595
class IBikaCatalogReport(Interface):
596
    """Marker interface for bika_catalog_report
597
    """
598
599
600
class IIdServer(Interface):
601
    """Marker Interface for ID server
602
    """
603
604
    def generate_id(self, portal_type, batch_size=None):
605
        """Generate a new id for 'portal_type'
606
        """
607
608
609
class IIdServerVariables(Interface):
610
    """Marker interfaces for variables generator for ID Server
611
    """
612
613
    def get_variables(self, **kw):
614
        """Returns a dict with variables
615
        """
616
617
618
class IIdServerTypeID(Interface):
619
    """Marker interface for type id resolution for ID Server
620
    """
621
622
    def get_type_id(self, **kw):
623
        """Returns the type id for the context passed in the constructor, that
624
        is used for custom ID formatting, regardless of the real portal type of
625
        the context. Return None if no type id can be resolved by this adapter
626
        """
627
628
629
class IReferenceWidgetVocabulary(Interface):
630
    """Return values for reference widgets in AR contexts
631
    """
632
633
    def __call__(**kwargs):
634
        """Call method
635
        """
636
637
638
class IDisplayListVocabulary(Interface):
639
    """Make vocabulary from catalog query.
640
641
    Return a DisplayList.
642
    kwargs are added to contentFilter.
643
    """
644
645
    def __call__(**kwargs):
646
        """Call method
647
        """
648
649
650
class IFieldIcons(Interface):
651
    """Used to signal an analysis result out of range alert
652
    """
653
654
    def __call__(self, result=None, **kwargs):
655
        """Returns a dictionary: with the keys 'field', 'icon', 'message'.
656
657
        If result is specified, it's checked instead of the database.  This
658
        is for form validations.
659
660
        Analysis range checkers can include a 'specification' in kwargs to
661
        override the spec derived from the context. It should be a dict
662
        w/ 'min', 'max', and 'error' keys.
663
        """
664
665
666
class IResultOutOfRange(Interface):
667
    """Any code which wants to check some condition and flag an Analysis as
668
    out of range, uses this interface
669
    """
670
    def __call(result=None):
671
        """The adapter must return a dictionary to indicate range out of bounds:
672
        {
673
         out_of_range: boolean - the result is out of bounds,
674
         acceptable: boolean - the result is in acceptable error margin,
675
         spec_values: dict - the min/max/error values for the failed spec
676
        }
677
678
        If the adapter returns a value that resolves to boolean False, the
679
        analysis is assumed not to have triggered the out of range conditions
680
681
        If a result is present in the request, it is passed here to be checked.
682
        if result is None, the value from the database is checked.
683
684
        """
685
686
687
class IATWidgetVisibility(Interface):
688
    """Adapter to modify the default list of fields to show on each view.
689
690
    Archetypes uses a widget attribute called 'visible' to decide which fields
691
    are editable or viewable in different contexts (view and edit).
692
693
    This adapter lets you create/use arbitrary keys in the field.widget.visible
694
    attribute, or or any other condition to decide if a particular field is
695
    displayed or not.
696
697
    an attribute named 'sort', if present, is an integer.
698
    It is used to allow some adapters to take preference over others.
699
    It's default is '1000', other lower values will take preference over higher
700
    values.
701
    """
702
703
    def __call__(widget, instance, mode, vis_dict, default=None, field=None):
704
        """Returns the visibility attribute for this particular field, in the
705
        current context.
706
707
        :arg field: the AT schema field object
708
        :arg mode: 'edit', 'view', or some custom mode, eg 'add', 'secondary'
709
        :arg vis_dict: the original schema value of field.widget.visible
710
        :arg default: value returned by the base Archetypes.Widget.isVisible
711
712
        In default Archetypes the value for the attribute on the field may
713
        either be a dict with a mapping for edit and view::
714
715
            visible = { 'edit' :'hidden', 'view': 'invisible' }
716
717
        Or a single value for all modes::
718
719
            True/1:  'visible'
720
            False/0: 'invisible'
721
            -1:      'hidden'
722
723
        visible: The field is shown in the view/edit screen
724
        invisible: The field is skipped when rendering the visVisibleiew/edit
725
                   screen
726
        hidden: The field is added as <input type="hidden" />
727
        The default state is 'visible'.
728
729
        The default rules are always applied, but any IATWidgetVisibility
730
        adapters found are called and permitted to modify the value.
731
        """
732
733
734
class ISetupDataSetList(Interface):
735
    """Allow products to register distributed setup datasets (xlsx files).
736
737
    Each ISetupDataSetList adapter returns a list of values to be included in
738
    the load_setup_data view
739
    """
740
741
742
class IJSONReadExtender(Interface):
743
    """This interface allows an adapter to modify an object's data before
744
    it is sent to the HTTP response.
745
    """
746
747
    def __call__(obj_data):
748
        """obj_data is the current python dictionary that will go to json.
749
        it should be modified in place, there is no need to return a value.
750
        """
751
752
753
class ISetupDataImporter(Interface):
754
    """ISetupDataImporter adapters are responsible for importing sections of
755
    the load_setup_data xlsx workbooks.
756
    """
757
758
759
class IPricelist(Interface):
760
    """Folder view marker for Pricelist
761
    """
762
763
764
class IPricelistFolder(Interface):
765
    """Folder view marker for PricelistFolder instance
766
    """
767
768
769
class IProductivityReport(Interface):
770
    """Reports are enumerated manually in reports/*.pt - but addional reports
771
    can be added to this list by extension packages using this adapter.
772
773
    The adapter must return a dictionary:
774
775
    {
776
     title: text (i18n translated),
777
     description: text (i18n translated),
778
     query_form: html <fieldset> of controls used to enter report
779
                 parameters (excluding <form> tags and <submit> button)
780
     module: The name of the module containing a class named "Report"
781
             an instance of this class will be used to create the report
782
    }
783
    """
784
785
786
class IAdministrationReport(Interface):
787
    """Reports are enumerated manually in reports/*.pt - but addional reports
788
    can be added to this list by extension packages using this adapter.
789
790
    The adapter must return a dictionary:
791
792
    {
793
     title: text (i18n translated),
794
     description: text (i18n translated),
795
     query_form: html <fieldset> of controls used to enter report
796
                 parameters (excluding <form> tags and <submit> button)
797
     module: The name of the module containing a class named "Report"
798
             an instance of this class will be used to create the report
799
    }
800
    """
801
802
803
class IHeaderTableFieldRenderer(Interface):
804
    """
805
    Allows an adapter to return the HTML content of the rendered field view,
806
    in header_table listings. The adapter must be registered with
807
    name=FieldName.
808
809
    If the field is a Reference, and the user has View permission on the
810
    target object, the field is rendered as <a href="absolute_url">Title</a>.
811
812
    If no adapter is found, and the field is not a reference, it is rendered
813
    with the normal AT field view machine.
814
815
    In a ZCML somewhere:
816
817
        <adapter
818
          for="bika.lims.interfaces.IAnalysisRequest"
819
          factory="package.module.spanner"
820
          provides="bika.lims.interfaces.IHeaderTableFieldRenderer"
821
          name="NameOfArchetypesField"
822
        />
823
824
    and the callable:
825
826
        class spanner:
827
            def __init__(self, context):
828
                self.context = context
829
            def __call__(self, field):
830
                field_content = field.get(self.context)
831
                return "<span>%"+field_content+"</span>"
832
833
    """
834
835
    def __call__(field):
836
        """
837
        Accepts an Archetypes Field, returns HTML.
838
        """
839
840
841
# BBB: Backwards compatibility
842
class IReflexRule(Interface):
843
    """Removed in 2.0rc3
844
    """
845
846
847
# BBB: Backwards compatibility
848
class IReflexRuleFolder(Interface):
849
    """Removed in 2.0rc3
850
    """
851
852
853
class IDepartment(Interface):
854
    """Marker interface for a Department
855
    """
856
857
858
class IProxyField(Interface):
859
    """A field that proxies transparently to the field of another object.
860
    Mainly needed for AnalysisRequest fields that are actually stored on the
861
    Sample.
862
863
    TODO: Remove after the field manager has been removed from `senaite.jsonapi`
864
    """
865
866
867
class IRemarksField(Interface):
868
    """An append-only TextField which saves information about each edit
869
    """
870
871
872
class IARAnalysesField(Interface):
873
    """A field that manages AR Analyses
874
    """
875
876
877
class IFrontPageAdapter(Interface):
878
    """Front Page Url Finder Adapter's Interface
879
    """
880
881
    def get_front_page_url(self):
882
        """Get url of necessary front-page
883
        """
884
885
886
class INumberGenerator(Interface):
887
    """A utility to generates unique numbers by key
888
    """
889
890
891
class ITopRightHTMLComponentsHook(Interface):
892
    """Marker interface to hook html components in bikalisting
893
    """
894
895
896
class ITopLeftHTMLComponentsHook(Interface):
897
    """Marker interface to hook html components in bikalisting
898
    """
899
900
901
class ITopWideHTMLComponentsHook(Interface):
902
    """Marker interface to hook html components in bikalisting
903
    """
904
905
906
class IGetDefaultFieldValueARAddHook(Interface):
907
    """Marker interface to hook default
908
    """
909
910
911
class IGetStickerTemplates(Interface):
912
    """Marker interface to get stickers for a specific content type.
913
914
    An IGetStickerTemplates adapter should return a result with the
915
    following format:
916
917
    :return: [{'id': <template_id>,
918
             'title': <template_title>}, ...]
919
    """
920
921
922
class IARReport(Interface):
923
    """Marker interface for published AR Reports
924
    """
925
926
927
class ICancellable(Interface):
928
    """Marker for those objects that can be cancelled (have state "cancelled")
929
    """
930
931
932
class IDeactivable(Interface):
933
    """Marker for those objects that can be deactivated (have state "inactive")
934
    """
935
936
937
class IWorkflowActionAdapter(Interface):
938
    """Marker for adapters in charge of processing workflow action requests
939
    from views
940
    """
941
942
943
class IWorkflowActionUIDsAdapter(IWorkflowActionAdapter):
944
    """Marker for adapters in charge of processing workflow action requests
945
    from views, but meant for redirection only
946
    """
947
948
949
class IVerified(Interface):
950
    """Marker interface for verified objects
951
    """
952
953
954
class ISubmitted(Interface):
955
    """Marker interface for submitted objects
956
    """
957
958
959
class IReceived(Interface):
960
    """Marker interface for received objects
961
    """
962
963
964
class IInternalUse(Interface):
965
    """Marker interface for objects only lab personnel must have access
966
    """
967
968
969
class IDetachedPartition(Interface):
970
    """Marker interface for samples that have been detached from its primary
971
    """
972
973
974
class IGuardAdapter(Interface):
975
    """Marker interface for guard adapters
976
    """
977
978
    def guard(self, transition):
979
        """Return False if you want to block the transition
980
        """
981
982
983
class IAddSampleFieldsFlush(Interface):
984
    """Marker interface for field dependencies flush for Add Sample form
985
    """
986
987
    def get_flush_settings(self):
988
        """Returns a dict where the key is the name of the field and the value
989
        is an array dependencies as field names
990
        """
991
992
993
class IAddSampleObjectInfo(Interface):
994
    """Marker interface for objects metadata mapping
995
    """
996
997
    def get_object_info(self):
998
        """Returns the dict representation of the context object for its
999
        correct consumption by Sample Add form:
1000
1001
        {'id': <id_of_the_object>,
1002
         'uid': <uid_of_the_object>,
1003
         'title': <title_of_the_object>,
1004
         'filter_queries': {
1005
             <dependent_field_name>: {
1006
                 <catalog_index>: <criteria>
1007
             }
1008
         },
1009
         'field_values': {
1010
             <dependent_field_name>: {
1011
                <uid>: <dependent_uid>,
1012
                <title>: <dependent_title>
1013
            }
1014
         }
1015
1016
        Besides the basic keys (id, uid, title), two additional keys can be
1017
        provided:
1018
        - filter_queries: contains the filter queries for other fields to be
1019
          applied when the value of current field changes.
1020
        - field_values: contains default values for other fields to be applied
1021
          when the value of the current field changes.
1022
        """
1023
1024
1025
class IAddSampleConfirmation(Interface):
1026
    """Marker interface for confirmation Add Sample form confirmation
1027
    """
1028
1029
    def check_confirmation(self, records):
1030
        """Returns a dict when user confirmation is required for the creation
1031
        of samples when the Save button from Add Sample form is pressed. Returns
1032
        None otherwise
1033
        """
1034
1035
1036
class IAddSampleRecordsValidator(Interface):
1037
    """Marker interface for Add Sample Records validators
1038
    """
1039
1040
    def validate(self, records):
1041
        """Returns None if all records are valid. Returns an error dict like
1042
        follows otherwise, so the error messages it contains is displayed at
1043
        the top of the Add Sample form view.
1044
            {"message": "", "fielderrors": {}}
1045
        """
1046
1047
1048
class IClientAwareMixin(Interface):
1049
    """Marker interface for objects that can be bound to a Client, either
1050
    because they can be added inside a Client folder or because it can be
1051
    assigned through a Reference field
1052
    """
1053
1054
    def getClient(self):
1055
        """Returns the client this object is bound to, if any
1056
        """
1057
1058
    def getClientUID(self):
1059
        """Returns the client UID this object is bound to, if any
1060
        """
1061
1062
1063
class ISampleTypeAwareMixin(Interface):
1064
    """Marker interface for objects that can be assigned to one, or multiple
1065
    SampleType objects through a ReferenceField
1066
    """
1067
1068
    def getSampleType(self):
1069
        """Returns the sample type(s) assigned to this object, if any
1070
        """
1071
1072
    def getSampleTypeUID(self):
1073
        """Returns the UID(s) of the Sample Type(s) assigned to this object
1074
        """
1075
1076
    def getSampleTypeTitle(self):
1077
        """Returns the title or a comma separated list of sample type titles
1078
        """
1079
1080
1081
class IHavePrice(Interface):
1082
    """Marker interface for objects that have a Price
1083
    """
1084
1085
    def getPrice(self):
1086
        """Returns the price of the instance
1087
        """
1088
1089
    def getTotalPrice(self):
1090
        """Returns the total price of the instance
1091
        """
1092
1093
1094
class IHaveInstrument(Interface):
1095
    """Marker interface for objects that have Instrument(s) assigned
1096
    """
1097
1098
    def getInstrument(self):
1099
        """Returns the instrument or instruments the instance is assigned to
1100
        """
1101
1102
1103
class IHaveDepartment(Interface):
1104
    """Marker interface for objects that have Department(s) assigned
1105
    """
1106
1107
    def getDepartment(self):
1108
        """Returns the department or departments the instance is assigned to
1109
        """
1110
1111
1112
class IOrganisation(Interface):
1113
    """Marker interface for IOrganisation object
1114
    """
1115
1116
    def getName(self):
1117
        """Returns the name of the organisation. Masks Title()
1118
        """
1119
1120
1121
class IHaveAnalysisCategory(Interface):
1122
    """Marker interface for objects that have AnalysisCategory(ies) assigned
1123
    """
1124
1125
    def getCategory(self):
1126
        """Returns the category(ies) assigned to this instance
1127
        """
1128
1129
    def getCategoryUID(self):
1130
        """Returns the UID of the category(ies) assigned to this instance
1131
        """
1132
1133
    def getCategoryTitle(self):
1134
        """Returns the title of the category(ies) assigned to this instance
1135
        """
1136
1137
1138
class IARImportFolder(Interface):
1139
    """Marker interface for a folder that contains ARImports
1140
    TODO: Legacy type. Remove after 1.3.3
1141
    """
1142
1143
1144
class IARImport(Interface):
1145
    """Marker interface for an ARImport
1146
    TODO: Legacy type. Remove after 1.3.3
1147
    """
1148
1149
1150
class ISamplingRoundTemplates(Interface):
1151
    """Marker interface for Sampling Round Templates
1152
    TODO: Legacy type. Remove after 1.3.3
1153
    """
1154
1155
1156
class ISamplingRoundTemplate(Interface):
1157
    """Marker interface for a Sampling Round Template
1158
    TODO: Legacy type. Remove after 1.3.3
1159
    """
1160
1161
1162
class IListingSearchableTextProvider(Interface):
1163
    """Adapter to add additional search values for the listing searchable text
1164
    catalog index
1165
    """
1166
    pass
1167
1168
1169
class IBatchBookView(Interface):
1170
    """Marker interface for batchbook view
1171
    """
1172