class ArchiveFileSearchSchema(colander.MappingSchema): ead_id = el('string') archiveFile = el('string') archive_id = el('int') archivefile_id = el('string') has_scans = el('boolean') status = el('int') start = el('int', default=0) limit = el('int', default=1000)
class SearchSchema(colander.MappingSchema): user = el('string') date_from = el('datetime') date_to = el('datetime') object_id = el('string') object_type = el('string', validator=colander.OneOf(['scan', 'ead'])) message = el('string', validator=colander.OneOf( ["create", "update", "move", "delete"])) start = el('int', default=0) limit = el('int', default=1000) order_by = el('string', default='date', missing='date') order_dir = colander.SchemaNode(colander.String(), validator=colander.OneOf(['ASC', 'DESC']), missing='ASC', default='ASC')
class EadSearchSchema(colander.MappingSchema): archive = el('string') archive_id = el('string') country = el('string') findingaid = el('string') institution = el('string') language = el('string')
class ArchiveFileGetSchema(colander.MappingSchema): # parameters to pass to GET archiveFile archive_id = el('int') archiveFile = el('string')
class ArchiveFilePutSchema(colander.MappingSchema): # parameters for "PUT" archiveFile status = el('int') user = el('string')
class EadSchema(colander.MappingSchema): user = el('string') status = colander.SchemaNode(colander.Int(), validator=colander.OneOf([0, 1, 2]), missing=1, default=1)
class ArchiveSchema(colander.MappingSchema): archive = el('string') archive_description = el('string') country_code = el('string') institution = el('string') institution_description = el('string')
class ComponentSearchSchema(colander.MappingSchema): archive = el('string') archiveFile = el('string') archive_id = el('int') contains_text = el('string') country = el('string') date_from = el('date') date_to = el('date') ead_id = el('string') findingaid = el('string') institution = el('string') is_archiveFile = el('boolean') is_component = el('boolean') language = el('string') limit = el('int', default=1000) order_by = el('string') start = el('int', default=0) xpath = el('string')
class GetComponentForViewerSchema(colander.MappingSchema): ead_id = el('string', required=True) xpath = el('string', required=False) archiveFile = el('string', required=False) show_in_tree = el('boolean')
class ComponentTreeSearchSchema(colander.MappingSchema): ead_id = el('string', required=True) # is_component has default True mostly for reasons of backwards compatility is_component = el('boolean', default=True) prune = el('boolean', default=True)