Пример #1
0
class get(authorized_event):
    """A client requires a schema to validate data or display a form"""

    roles = ["admin"]
    tags = [
        {"name": "admin", "description": "Administrative topics"},
        {"name": "configuration", "description": "Configuration topics"}
    ]
    summary = "Get component configuration data"
    channel_hints = {
        'uuid': {
        }
    }

    args = {
        "uuid": uuid_object()
    }
Пример #2
0
                              roles_read='crew')

NodeStateSchema['properties'].update({
    'color': {
        'type': 'string',
        'format': 'color'
    },
    'readonly': {
        'type': 'boolean',
        'default': False,
        'description': 'Not user-toggleable when checked'
    },
    'excluded': {
        'type': 'array',
        'default': [],
        'items': uuid_object('Excluded')
    },
    'label-activated': {
        'type': 'string'
    },
    'icon': {
        'type': 'string'
    },
    'active': {
        'type': 'boolean',
        'default': False
    },
    'group': {
        'type': 'string'
    },
    'untrigger': {
Пример #3
0
"""

from isomer.schemata.defaultform import *
from isomer.schemata.base import base_object, uuid_object

AmbientLoopSchema = base_object('ambientloop')

AmbientLoopSchema['properties'].update({
    'description': {
        'type': 'string',
        'format': 'html',
        'title': 'Loop description',
        'description': 'Loop description'
    },
    'file':
    uuid_object('file', description='Select a loop file'),
    'default_volume': {
        'type': 'number'
    },
})

audio_file_filter = {"name": {"$regex": ".*\\.(mp3|wav|ogg|au|jpg)$"}}

AmbientLoopForm = [{
    'type':
    'section',
    'htmlClass':
    'row',
    'items': [{
        'type':
        'section',
Пример #4
0
==============

Contains
--------

Vessel: Vesselprofile to store Vessel specific settings


"""
from isomer.schemata.base import base_object, uuid_object

VesselSchema = base_object('vessel')

VesselSchema['properties'].update({
    'mapviewuuid':
    uuid_object('Unique Vessel Moving Mapview ID'),
    'sog': {
        'type': 'number',
        'title': 'SOG',
        'description': 'Speed over ground (kn)'
    },
    'cog': {
        'type': 'number',
        'title': 'COG',
        'description': 'Course over ground (rel. to true North)'
    },
    'rot': {
        'type': 'number',
        'title': 'ROT',
        'description': 'Rate of turn (+-720°/min)'
    },
Пример #5
0

"""

from isomer.schemata.defaultform import editbuttons, section, lookup_field
from isomer.schemata.base import base_object, uuid_object

SessionSchema = base_object('session',
                            roles_create='crew',
                            roles_list=['admin', 'chair'],
                            roles_read=['admin', 'chair'],
                            roles_write=['admin', 'chair'])

SessionSchema['properties'].update({
    'sessiontype':
    uuid_object('Session Type', 'Select a session type'),
    'name': {
        'type': 'string',
        'title': 'Title',
        'description': 'Title of session'
    },
    'abstract': {
        'type': 'string',
        'title': 'Abstract',
        'format': 'html',
        'description': 'Abstract description'
    },
    'keywords': {
        'type': 'string',
        'title': 'Keywords',
        'description': 'Space or comma separated descriptive keywords'
Пример #6
0
============

Contains
--------

Case - against IUU fishery

"""

from isomer.schemata.defaultform import editbuttons, lookup_field
from isomer.schemata.base import base_object, uuid_object

caseSchema = base_object('case', all_roles='crew')

caseSchema['properties'].update({
    'report': uuid_object(title='Report', description='Associated report'),
    'reporter': uuid_object(title='Reporter', description='Reporting user'),
    'vessel': uuid_object(title='Vessel', description='Select a Vessel'),
    'evidence': {
        'type': 'array',
        'items': {
            'type': 'object',
            'properties': {
                'evidence_type': {
                    'type': 'string',
                    'enum': ['photo', 'video', 'ais-track', 'satellite-image', 'witness-report', 'inspection']
                },
                #'details': {
                #    'type': uuid_object(title='Details', description='Evidence details')
                #}
            }
Пример #7
0
See also
--------

Provisions


"""

from isomer.schemata.defaultform import defaultform, section, lookup_field, editbuttons
from isomer.schemata.base import base_object, uuid_object

GeoObjectSchema = base_object('geoobject', all_roles='crew')

GeoObjectSchema['properties'].update({
    'layer':
    uuid_object('Unique GeoObject Layer ID'),
    'type': {
        'type': 'string',
        'title': 'Type',
        'description': 'Free-form classification with reserved types'
    },
    'color': {
        'type': 'string',
        'title': 'Background Color',
        'format': 'color',
        'description': 'GeoObject background color indicator',
        'default': '#4384BF'
    },
    'iconcolor': {
        'type': 'string',
        'title': 'Icon Color',
Пример #8
0
 },
 'notes': {
     'type': 'string',
     'format': 'html',
     'title': 'User notes',
     'description': 'Custom user notes'
 },
 'viewtype': {
     'enum': ['vessel', 'user'],
     'title': 'View Type',
     'description': 'Shows what type of mapview this is'
 },
 'layergroups': {
     'type': 'array',
     'description': 'List of available Layergroups',
     'items': uuid_object('Select a Layergroup'),
     'default': []
 },
 'coords': {
     # TODO: Decide if we want to integrate null island as default
     "lat": {
         "id": "lat",
         "type": "number",
         "maximum": 90,
         "minimum": -90,
         "title": "Latitude of coordinate.",
         "description": "",
         "name": "lat",
         "default": 54.17805
     },
     "lng": {
Пример #9
0
"""

from isomer.schemata.defaultform import editbuttons, section, lookup_field, rating_widget
from isomer.schemata.base import base_object, uuid_object

ReviewSchema = base_object('review', roles_create='chair', hide_owner=False)

ReviewSchema['properties'].update({
    'status': {
        'type': 'string',
        'enum': ['Denied', 'Accepted', 'Not reviewed'],
        'default': 'Not reviewed'
    },
    'calendar_reference':
    uuid_object(title='Calendar'),
    'session_reference':
    uuid_object(title='Session'),
    'comments': {
        'type': 'string',
        'format': 'html'
    },
    'rating': {
        'type': 'integer'
    }
})

ReviewForm = [
    section(2, 2, [['owner', 'status'],
                   [
                       lookup_field('calendar_reference', 'calendar'),
Пример #10
0
                            "map": {
                                'valueProperty': "uuid",
                                'nameProperty': 'name'
                            }
                        }
                    }
                ]
            }
        ]
    },
    editbuttons
]

TaskgroupExtends = DefaultExtension(
    {
        'closed_group': uuid_object('Default "Closed" group', default=['f7525ffb-0f30-4654-bb72-602fb17247af']),
        # Taskgroup "Closed"
        'open_groups': {
            'type': 'array',
            'title': 'Open Groups',
            'description': 'Taskgroups with open tasks for Todo list',
            'default': [
                "52fc2c8d-bf7a-4835-bbfe-82d3ddf3742f",  # Taskgroup "New"
                "9d7f146e-1307-47d5-a2cf-bc26f0f515d5",  # Taskgroup "In progress"
            ],
            'items': uuid_object('Open groups')
        }
    },
    [
        lookup_field('modules.closed_group', 'taskgroup', 'Select a group for closed tasks'),
        {
Пример #11
0
ChatChannel: Definitions of chat rooms


"""

from isomer.schemata.defaultform import editbuttons
from isomer.schemata.base import base_object, uuid_object

ChannelSchema = base_object('chatchannel', all_roles='crew')

ChannelSchema['properties'].update({
    'users': {
        'type': 'array',
        'default': [],
        'items': uuid_object('Unique User ID of participant')
    },
    'topic': {
        'type': 'string'
    },
    'tags': {
        'type': 'string',
        'title': 'Tags',
        'description': 'Attached tags'
    }
})

ChannelForm = ['name', 'topic', 'tags', editbuttons]

ChatChannel = {'schema': ChannelSchema, 'form': ChannelForm}
Пример #12
0

"""

from isomer.schemata.defaultform import editbuttons
from isomer.schemata.base import base_object, uuid_object

# Basic File definitions

FileSchema = base_object('file', all_roles='crew')

FileSchema['properties'].update({
    'type': {'type': 'string', 'enum': ['file', 'folder', 'link']},
    'special': {'type': 'string'},
    'hash': {'type': 'string'},
    'size': {'type': 'number'},
    'mtime': {'type': 'number'},
    'path': {'type': 'string'},
    'volume': uuid_object(display=False)
})

FileEditForm = [
    'name',
    'directory',
    'special',
    'size',
    editbuttons
]

File = {'schema': FileSchema, 'form': FileEditForm}
Пример #13
0
locationSchema = base_object('location', no_additional=True)


locationSchema['properties'].update({
    'title': {'type': 'string'},
    'description': {'type': 'string'},
    'degree': {'type': 'string'},
    'emptySince': {'type': 'string', 'format': 'datetime'},
    'buildingType': {'type': 'string'},
    'reporter': {'type': 'string'},
    'street': {'type': 'string'},
    'city': {'type': 'string'},
    'postcode': {'type': 'string'},
    'coordinate': geo_coordinate(),
    'region': uuid_object('region'),
    'active': {'type': 'boolean'},
    'demolished': {'type': 'boolean'},
    'demolish_rumor': {'type': 'boolean'},
    'slug': {'type': 'string'},
    'slug_aliases': {'type': 'string'},
    'created': {'type': 'string', 'format': 'datetime'},
    'updated': {'type': 'string', 'format': 'datetime'},
})

locationForm = [
    {
        'type': 'section',
        'htmlClass': 'row',
        'items': [
            {
Пример #14
0
                'items': [
                    'shared', 'locked'
                ]
            },
        ]
    },
    {
        'key': 'cards',
        'add': "Add widget",
        'style': {
            'add': "btn-success"
        },
        'items': [
            'cards[].title',
            'cards[].widgettype',
            lookup_field('cards[].valuetype', 'sensordatatype', 'Select a Sensor Value', 'name',
                         select_type='uiselect'),
        ],
        'startEmpty': True,
    },
    'description',
    editbuttons
]

DashboardExtends = DefaultExtension(
    {'dashboarduuid': uuid_object('Default Dashboard')},
    lookup_field('modules.dashboarduuid', 'dashboardconfig')
)

DashboardConfig = {'schema': DashboardSchema, 'form': DashboardForm, 'extends': DashboardExtends}
Пример #15
0
"""

from isomer.schemata.defaultform import *
from isomer.schemata.base import base_object, uuid_object

BeverageSchema = base_object('beverage')

BeverageSchema['properties'].update({
    'description': {
        'type': 'string',
        'format': 'html',
        'title': 'Beverage description',
        'description': 'Beverage description'
    },
    'supplier':
    uuid_object('supplier', description='Select a supplier'),
    'volume': {
        'type': 'string'
    },
    'amount_per_crate': {
        'type': 'integer'
    },
    'price_selling': {
        'type': 'number'
    },
    'price_buying': {
        'type': 'number'
    },
    'price_crate': {
        'type': 'number'
    },
Пример #16
0
See also
--------

Provisions


"""

from isomer.schemata.defaultform import editbuttons, section, lookup_field
from isomer.schemata.tag import TagData, TagForm
from isomer.schemata.base import base_object, uuid_object

TaskSchema = base_object('task', all_roles='crew')

TaskSchema['properties'].update({
    'project': uuid_object('Project which this task is part of', 'Select a project'),
    'creator': uuid_object('Creator', 'Select a creator'),
    'assignee': uuid_object('Assignee', 'Select an assignee'),
    'taskgroup': uuid_object(title='Task group', description='Group, this task belongs to'),
    'tags': TagData,
    'alert_time': {
        'type': 'string', 'title': 'Alert',
        'format': 'datetimepicker',
        'description': 'Alert time'
    },
    'due_time': {
        'type': 'string', 'title': 'Due',
        'format': 'datetimepicker',
        'description': 'Due time'
    },
    'priority': {
Blacklist - against IUU fishery

"""

from isomer.schemata.defaultform import editbuttons, lookup_field
from isomer.schemata.base import base_object, uuid_object

blacklistSchema = base_object('blacklist', all_roles='crew')

blacklistSchema['properties'].update({
    'imo': {
        'type': 'string',
        'title': 'IMO Id', 'description': 'Blacklisted IMO identity'
    },
    'vessel': uuid_object(title='Vessel', description='Blacklisted vessel details'),
    'report': uuid_object(title='Report', description='Associated report'),
    'case': uuid_object(title='Case', description='Associated case file'),
    'notes': {'type': 'string', 'format': 'html', 'title': 'User notes',
              'description': 'Entry notes'}
})

blacklistForm = [
    {
        'type': 'section',
        'htmlClass': 'row',
        'items': [
            {
                'type': 'section',
                'htmlClass': 'col-xs-6',
                'items': [
Пример #18
0
"""

from isomer.schemata.defaultform import *
from isomer.schemata.base import base_object, uuid_object, geo_coordinate

regionSchema = base_object('region', no_additional=True)


regionSchema['properties'].update({
    'title': {'type': 'string'},
    'description': {'type': 'string'},
    'zoom': {'type': 'integer', 'max': 16, 'min': 5},
    'coordinate': geo_coordinate(),
    'moderators': {
        'type': 'array',
        'items': uuid_object('user'),
    },
    'active': {'type': 'boolean'},
    'hide': {'type': 'boolean'},
    'hide_message': {'type': 'string'},
    'slug': {'type': 'string'},
    'slug_aliases': {'type': 'string'},
    'created': {'type': 'string', 'format': 'datetime'},
    'updated': {'type': 'string', 'format': 'datetime'},
})

regionForm = [
    {
        'type': 'section',
        'htmlClass': 'row',
        'items': [
Пример #19
0
 },
 'description': {
     'type': 'string',
     'format': 'html',
     'title': 'Taskgrid description',
     'description': 'Taskgrid description'
 },
 'cards': {
     'type': 'array',
     'default': [],
     'items': {
         'type': 'object',
         'id': '#Card',
         'name': 'TaskGridCard',
         'properties': {
             'taskgroup': uuid_object('Associated Unique Task Group ID'),
             'position': {
                 'type': 'object',
                 'properties': {
                     'x': {
                         'type': 'number'
                     },
                     'y': {
                         'type': 'number'
                     }
                 }
             },
             'size': {
                 'type': 'object',
                 'properties': {
                     'width': {
Пример #20
0
     },
 },
 "settings": {
     "id": "#profile.settings",
     "type": "object",
     "properties": {
         "language":
         language_field(),
         "color": {
             "type": "string",
             "title": "User Color",
             "format": "color",
             "description": "Color used for map annotations, chat etc",
         },
         "theme":
         uuid_object(title="theme",
                     description="Theme used for user interface"),
         "screen_filter": {
             "type": "object",
             "title": "Screen filter",
             "description": "Adjust overall colors freely",
             "properties": {
                 "color": {
                     "type": "string",
                     "format": "color"
                 },
                 "mode": {
                     "type": "string",
                     "enum": blend_modes
                 },
                 "opacity": {
                     "type": "number",
Пример #21
0
AmbientSceneSchema = base_object('ambientscene')

AmbientSceneSchema['properties'].update({
    'description': {
        'type': 'string',
        'format': 'html',
        'title': 'Scene description',
        'description': 'AmbientScene description'
    },
    'loops': {
        'type': 'array',
        'items': {
            'type': 'object',
            'properties': {
                'uuid': uuid_object('Loop', 'Select a loop'),
                'volume': {
                    'type': 'number'
                },
                'on': {
                    'type': 'boolean'
                }
            }
        }
    },
    'default_volume': {
        'type': 'number'
    },
})

AmbientSceneForm = [{
Пример #22
0
ChatMessage: ChatMessage to store messages in rooms and private chats


"""

from isomer.schemata.defaultform import defaultform
from isomer.schemata.base import base_object, uuid_object

ChatMessageSchema = base_object('chatmessage', all_roles='crew')

ChatMessageSchema['properties'].update({
    'timestamp': {
        'type': 'string',
        'title': 'Timestamp',
        'format': 'datetimepicker',
        'description': 'Message timestamp'
    },
    'recipient':
    uuid_object('Unique User ID of recipient'),
    'sender':
    uuid_object('Unique User ID of sender'),
    'content': {
        'type': 'string',
        'minLength': 1,
        'title': 'Name',
        'description': 'Chat Message name'
    }
})

ChatMessage = {'schema': ChatMessageSchema, 'form': defaultform}
Пример #23
0
         "street_2": {
             "type": "string"
         },
         "city": {
             "type": "string"
         },
         "state": {
             "type": "string"
         },
         "zip_code": {
             "type": "string"
         }
     }
 },
 "coordinate": geo_coordinate(),
 "region": uuid_object("region"),
 "type": {
     "type": "string",
     "enum": ["repossession", "vacant", "defect", "other"]
 },
 "active": {
     "type": "boolean",
     "roles": {
         "write": "moderator"
     },
     "default": False
 },
 "demolished": {
     "type": "boolean",
     "default": False
 },
Пример #24
0
Schema: BeverageOrder
=====================

Contains
--------

BeverageOrder: Stores orders of beverages

"""

from isomer.schemata.defaultform import *
from isomer.schemata.base import base_object, uuid_object

BeverageOrderSchema = base_object('beverage_order', roles_write='owner', roles_read='crew')
BeverageOrderSchema['properties'].update({
    'supplier': uuid_object('supplier'),
    'items': {
        'type': 'array',
        'default': [],
        'items': {
            'type': 'object',
            'items': [
                {
                    'beverage': uuid_object('beverage', 'Select a beverage')
                },
                {
                    'crates': {'type': 'integer'}
                }
            ]
        }
    }
Пример #25
0
Contains
--------

Report - against IUU fishery

"""

from isomer.schemata.defaultform import editbuttons, lookup_field, create_object
from isomer.schemata.base import base_object, uuid_object

reportSchema = base_object('report', all_roles='crew')

reportSchema['properties'].update({
    'vessel':
    uuid_object(title='Vessel', description='Select a Vessel'),
    'notes': {
        'type': 'string',
        'format': 'html',
        'title': 'User notes',
        'description': 'Additional notes and remarks'
    },
    'noticed': {
        'type': 'string',
        'format': 'datetimepicker',
        'title': 'Date & Time',
        'description': 'When did you notice the vessel'
    },
    'reason': {
        'type': 'string',
        'title': 'Reason',
Пример #26
0
from isomer.schemata.defaultform import defaultform
from isomer.schemata.base import base_object, uuid_object

ControllerSchema = base_object('controller')

ControllerSchema['properties'].update({
    'description': {
        'type': 'string'
    },
    'mappings': {
        'type': 'array',
        'items': {
            'type': 'object',
            'properties': {
                'controltype': {
                    'enum': ['analog', 'digital']
                },
                'controlaxis': {
                    'type': 'integer'
                },
                'controlbutton': {
                    'type': 'integer'
                },
                'controluuid': uuid_object('Associated uuid of Controllable')
            }
        }
    }
})

Controller = {'schema': ControllerSchema, 'form': defaultform}
Пример #27
0
--------

Provisions


"""

from isomer.schemata.base import uuid_object, base_object
from isomer.schemata.defaultform import editbuttons, section, fieldset, lookup_field  # , collapsible
from isomer.schemata.geometry import GeometrySchema

EventSchema = base_object('event', all_roles='crew')

EventSchema['properties'].update({
    "calendar":
    uuid_object('Associated calendar', display=True),
    "dtstart": {
        "format": "datetimepicker",
        "type": "string",
        "description": "Event starting time"
    },
    "dtend": {
        "format": "datetimepicker",
        "type": "string",
        "description": "Event ending time"
    },
    "summary": {
        "type": "string",
        "format": "html"
    },
    "location": {
Пример #28
0
        's color indicator'
    },
    'shared': {
        'type': 'boolean',
        'title': 'Shared group',
        'description': 'Share group with the crew'
    },
    'notes': {
        'type': 'string',
        'format': 'html',
        'title': 'User notes',
        'description': 'Custom user notes'
    },
    'layers': {
        'type': 'array',
        'items': uuid_object('Unique Layer ID')
    }
})

LayerGroupForm = [
    'name', 'notes', {
        'key':
        'layers',
        'add':
        "Add layer",
        'style': {
            'add': "btn-success"
        },
        'items': [{
            'key': 'layers[]',
            'type': 'strapselect',
Пример #29
0
Shift: Stores shift information for timetables and assisted rotation


"""

from isomer.schemata.defaultform import *
from isomer.schemata.base import uuid_object

# TODO: Convert to base_object

ShiftSchema = {
    'id': '#shiftconfig',
    'type': 'object',
    'name': 'shiftconfig',
    'properties': {
        'uuid': uuid_object('Unique Shift ID'),
        'name': {
            'type': 'string', 'minLength': 1, 'title': 'Name',
            'description': 'Shift name'
        },
        'locked': {
            'type': 'boolean', 'title': 'Locked Shift',
            'description': 'Determines whether the Shift should '
                           'be locked against changes.'
        },
        'description': {
            'type': 'string', 'format': 'html',
            'title': 'Shift description',
            'description': 'Shift description'
        },
        'useruuid': uuid_object('Associated Unique User ID')