Пример #1
0
"""
Schema: Dashboard
=================

Contains
--------

Dashboard: Dashboard config to store gridster settings


"""

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

DashboardSchema = base_object('dashboardconfig', all_roles='crew')

DashboardSchema['properties'].update({
    'locked': {'type': 'boolean', 'title': 'Locked Dashboard',
               'description': 'Determines whether the Dashboard should '
                              'be locked against changes.'},
    'refreshrate': {'title': 'Refreshrate', 'type': 'number',
                    'description': 'General refresh rate of dashboard'},
    'shared': {'type': 'boolean', 'title': 'Shared Dashboard',
               'description': 'Share Dashboard with the crew'},
    'description': {'type': 'string', 'format': 'html',
                    'title': 'Dashboard description',
                    'description': 'Dashboard description'},
    'cards': {
        'type': 'array',
        'default': [],
Пример #2
0
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

__author__ = "Heiko 'riot' Weinen"
__license__ = "AGPLv3"
"""

Schema: Spreadsheet
===================

Contains
--------

Definition of a spreadsheet object to represent EtherCalc documents.


"""

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

SpreadsheetSchema = base_object('spreadsheet', all_roles='crew')

SpreadsheetForm = defaultform

Spreadsheet = {'schema': SpreadsheetSchema, 'form': SpreadsheetForm}
Пример #3
0
--------

Project reference entry for the todo management

See also
--------

Provisions


"""

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

ProjectSchema = base_object('project', all_roles='crew')

ProjectSchema['properties'].update({
    'creatoruuid': {
        'type': 'string', 'title': 'Creator',
        'description': 'Creator of Project'
    },
    'priority': {
        'type': 'number', 'title': 'Priority',
        'description': '1 is Highest priority', 'minimum': 1
    },
    'tags': {
        'type': 'string', 'title': 'Tags',
        'description': 'Attached tags'
    },
    'notes': {
Пример #4
0
--------

Geoobject: General geoobject configuration data encapsulating geojson

See also
--------

Provisions


"""

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

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

GeoObjectSchema['properties'].update({
    'layer': {
        'pattern': '^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-['
                   'a-fA-F0-9]{4}-[a-fA-F0-9]{12}$',
        'type': 'string',
        'title': 'Unique GeoObject Layer ID'
    },
    'iconcolor': {
        'type': 'string', 'title': 'Icon Color',
        # 'format': 'color',
        'description': 'GeoObject icon color indicator', 'default':
            'white'
    },
    'newvar': {'type': 'string', 'title': 'Foobar'},
Пример #5
0
"""
Schema: Controllable
====================

Contains
--------

Controllable: Patterns of remote control


"""

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

ControllableSchema = base_object('controllable')

ControllableSchema['properties'].update({
    'description': {
        'type': 'string'
    },
    'type': {
        'enum': ['analog', 'digital']
    },
    'min': {
        'type': 'integer',
        'default': 0
    },
    'center': {
        'type': 'integer',
        'default': 127
Пример #6
0
__author__ = "Heiko 'riot' Weinen"
__license__ = "AGPLv3"
"""
Schema: Vessel
==============

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': {
Пример #7
0
                        "title": _("Argument Value")
                    },
                },
            },
        },
        "duration": {
            "type": "number",
            "title": _("Duration"),
            "description": _("Timeout in seconds to swith to the next "
                             "screen"),
        },
    },
}

ClientconfigSchema = base_object("client",
                                 roles_list=["crew"],
                                 roles_create=["crew"])

ClientconfigSchema["properties"].update({
    "autologin": {
        "type": "boolean",
        "title": _("Automatic login"),
        "description": _("Automatically logs in this client."),
    },
    "active": {
        "type": "boolean",
        "title": _("Active client"),
        "description": _("Indicates whether client is currently active."),
    },
    "locked": {
        "type":
Пример #8
0
"""
from isomer.schemata.defaultform import (
    savebutton,
    lookup_field,
    # country_field,
    # area_field,
)
from isomer.schemata.base import base_object, uuid_object, language_field

blend_modes = [
    "normal", "multiply", "screen", "overlay", "darken", "lighten",
    "color-dodge", "color-burn", "difference", "exclusion", "hue",
    "saturation", "color", "luminosity"
]

ProfileSchema = base_object("profile", roles_create="crew")

ProfileSchema["properties"].update({
    "name": {
        "type": "string",
        "title": "Name",
        "description": "Profile name"
    },
    "userdata": {
        "id": "#profile.userdata",
        "type": "object",
        "properties": {
            "name": {
                "type": "string",
                "minLength": 1,
                "title": "Name",
Пример #9
0
"""

Schema: Equipment
=================

Contains
--------

Equipment specifications

"""

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

EquipmentSchema = base_object('equipment', all_roles='crew')

StatusEnums = [
    'Okay', 'Not quite right', 'Broken', 'Maintenance', 'Needs attention'
]

EquipmentSchema['properties'].update({
    'notes': {
        'type': 'string',
        'format': 'html',
        'title': 'User notes',
        'description': 'Entry notes'
    },
    'status': {
        'type': 'string',
        'title': 'Status',
Пример #10
0
"""
Schema: region
==============

Contains
--------

region: combines groups of moderators with region-local locations and other meta data


"""

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'},
Пример #11
0
"""

Schema: Case
============

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': {
Пример #12
0
--------

Book reference entry for the library.

See also
--------

Provisions


"""

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

BookSchema = base_object('book', all_roles='crew')

BookSchema['properties'].update({
    'authors': {
        'type': 'array',
        'default': [],
        'items': {
            'type': 'string',
            'title': 'Authors',
            'description': 'Authors of Book'
        },
        'minItems': 0
    },
    'publisher': {
        'type': 'string',
        'title': 'Publisher',
Пример #13
0
Schema: Mapview
===============

Contains
--------

MapView: User generated Mapviews


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

MapViewSchema = base_object('mapview',
                            roles_read=['admin', 'crew'],
                            roles_write=['admin', 'navigator', 'crew'],
                            roles_create=['admin', 'navigator', 'crew'],
                            roles_list=['admin', 'crew'])

MapViewSchema['properties'].update({
    'name': {
        'type': 'string',
        'minLength': 1,
        'title': 'Name',
        'description': 'Name of view'
    },
    'color': {
        'type': 'string',
        'title': 'View Color',
        'format': 'color',
        'description': 'This views color indicator'
Пример #14
0
Task reference entry for the todo management

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',
Пример #15
0
Calendar object for grouping of Events

See also
--------

Provisions


"""

from isomer.schemata.base import base_object
from isomer.schemata.defaultform import editbuttons
from isomer.schemata.geometry import GeometrySchema

CalendarSchema = base_object('calendar', all_roles='crew')

CalendarSchema['properties'].update({
    "category": {
        "type": "string"
    },
    "description": {
        "type": "string"
    },
    "color": {
        "type": "string",
        "format": "color"
    },
    "tz": {
        'type': "string"
    },
Пример #16
0
===============

Contains
--------

SessionType: Generic object to store data about lectures, lightning talks etc. 


"""

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

SessionTypeSchema = base_object('sessiontype',
                                roles_write=['chair'],
                                roles_create=['chair'],
                                roles_read=['crew'],
                                roles_list=['crew'])

SessionTypeSchema['properties'].update({
    'name': {
        'type': 'string',
        'title': 'Title',
        'description': 'Title of SessionType'
    },
    'open': {
        'type': 'boolean',
        'title': 'Open',
        'description': 'Allow SessionType type registration'
    },
    'length': {
Пример #17
0
"""

Schema: Achievement
=================

Contains
--------

Generic countable thing definition


"""

from isomer.schemata.base import base_object

AchievementSchema = base_object('achievement', all_roles='crew')

AchievementSchema['properties'].update({
    'notes': {
        'type': 'string', 'format': 'html', 'title': 'User notes',
        'description': 'Entry notes'
    },
})

AchievementForm = [
    {
        'type': 'section',
        'htmlClass': 'row',
        'items': [
            {
                'type': 'section',
Пример #18
0
Schema: WikiPage
================

Contains
--------

WikiPage: WikiPage to store collaborative data


"""

from isomer.schemata.defaultform import defaultform, editbuttons
from copy import deepcopy
from isomer.schemata.base import base_object

WikiPageSchema = base_object('wikipage', all_roles='crew')

WikiPageSchema['properties'].update({
    'title': {
        'type': 'string',
        'title': 'Page Title',
        'description': 'Short title'
    },
    'html': {
        'type': 'string',
        'format': 'html',
        'title': 'Page content',
        'description': 'Content'
    },
    # 'text': {'type': 'string', 'title': 'Raw text',
    #          'description': 'Unrendered raw text'},
Пример #19
0
"""
Schema: Radio
=============

Contains
--------

Radio: Radio configurations to store onboard radio system data


"""

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

RadioConfigSchema = base_object('radio')

RadioConfigSchema['properties'].update({
    'model': {
        'type': 'string',
        'minLength': 1,
        'title': 'Model',
        'description': 'Radio model'
    },
    'manufacturer': {
        'type': 'string',
        'minLength': 1,
        'title': 'Manufacturer',
        'description': 'Radio manufacturer'
    },
    'radiotype': {
Пример #20
0
--------

Shareable object for common item time sharing management

See also
--------

Provisions


"""

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

ShareableSchema = base_object('shareable', all_roles='crew')

ShareableSchema['properties'].update({
    'creatoruuid': {
        'type': 'string',
        'title': 'Creator',
        'description': 'Creator of Shareable'
    },
    'created': {
        'type': 'string',
        'format': 'datetimepicker',
        'title': 'Creation time',
        'description': 'Time of object creation'
    },
    'priority': {
        'type': 'number',
Пример #21
0
Schema: Controller
==================

Contains
--------

Controller: Remote control input device to controllable mapping


"""

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'
Пример #22
0
"""
Schema: Chat Message
====================

Contains
--------

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,
Пример #23
0
Route: A configurable group of predefined layers

See also
--------

Provisions


"""

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

RouteSchema = base_object('route',
                          roles_read=['admin', 'crew'],
                          roles_write=['admin', 'navigator'],
                          roles_create=['admin', 'navigator'],
                          roles_list=['admin', 'crew'])

RouteSchema['properties'].update({
    'color': {
        'type': 'string',
        'title': 'Group Color',
        'format': 'color',
        'description': 'This group'
        's color indicator'
    },
    'notes': {
        'type': 'string',
        'format': 'html',
        'title': 'User notes',
Пример #24
0
===============

Contains
--------

Session: Generic object to store data about lectures, lightning talks etc. 


"""

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',
Пример #25
0
__license__ = "AGPLv3"
"""
Schema: AmbientLoop
============

Contains
--------

ambientLoop: Metadata about ambient sound loops for ambient scenes. 

"""

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'
    },
})
Пример #26
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'}
                }
            ]
Пример #27
0
LayerGroup: A configurable group of predefined layers

See also
--------

Provisions


"""

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

LayerGroupSchema = base_object('layergroup',
                               roles_read=['admin', 'crew'],
                               roles_write=['admin', 'navigator'],
                               roles_create=['admin', 'navigator'],
                               roles_list=['admin', 'crew'])

LayerGroupSchema['properties'].update({
    'owner': {
        'type': 'string',
        'minLength': 36,
        'title': "Owner's Unique ID",
        'description': 'HIDDEN'
    },
    'color': {
        'type': 'string',
        'title': 'Group Color',
        'format': 'color',
        'description': 'This group'
Пример #28
0
Schema: MeshNode
============

Contains
--------

MeshNode reference entry for the mesh to set up pump start times and
durations as well as conditions..


"""

from isomer.schemata.defaultform import savebutton
from isomer.schemata.base import base_object

MeshNodeSchema = base_object('meshnode')

MeshNodeSchema['properties'].update({
    'notes': {
        'type': 'string',
        'format': 'html',
        'title': 'User notes',
        'description': 'Entry notes'
    },
    'hub': {
        'type': 'boolean',
        'title': 'Hub node',
        'description': 'This node has data about other nodes'
    },
    'address': {
        'type': 'string',
Пример #29
0
Schema: Countable
=================

Contains
--------

Generic countable thing definition


"""

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

CountableSchema = base_object('countable', all_roles='crew')

CountableSchema['properties'].update({
    'notes': {
        'type': 'string', 'format': 'html', 'title': 'User notes',
        'description': 'Entry notes'
    },
    'amount': {'type': 'number', 'title': 'Amount counted', 'default': 0}

})

CountableForm = [
    {
        'type': 'section',
        'htmlClass': 'row',
        'items': [
Пример #30
0
"""
Schema: System
==============

Contains
--------

System: Global systemwide settings


"""
from isomer.schemata.defaultform import savebutton
from isomer.schemata.base import base_object, language_field

SystemconfigSchema = base_object("systemconfig",
                                 roles_read=["admin", "crew"],
                                 roles_write=["admin"])

SystemconfigSchema["properties"].update({
    "active": {
        "type": "boolean",
        "title": "Active configuration",
        "description": "Determines which configuration will be used. "
        "Only one can be active.",
        "default": False,
    },
    "salt": {
        "type": "string",
        "minLength": 1,
        "title": "Salt",
        "description": "System hashing salt",