digitalbazaar/bedrock-angular-entity

Name: bedrock-angular-entity

Owner: Digital Bazaar, Inc.

Description: A bedrock module for displaying and editing entities based on an entity schema

Created: 2017-08-04 20:57:31.0

Updated: 2017-09-09 01:37:18.0

Pushed: 2017-09-20 18:01:52.0

Homepage: null

Size: 15

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

bedrock-angular-entity

The Bedrock Entity module enables an entity schema to be described using JSON, a UI to be dynamically built from the entity schema, and data to be input based on the UI. The data from the entity data model may then be serialized to a data structure such as JSON-LD using an external process.

Usage
entity
-entity-schema="$ctrl.entitySchema"
-entity-model="$ctrl.entityData"
-entity-template="$ctrl.entityTemplate"
-on-change="$ctrl.onSave(entityData)">
-entity>
Entity Schema
n example Entity Schema

context': 'https://w3id.org/flexform/v1',
: config.server.baseUri + '/forms/1',
pe: [
'EntitySchema',
'StormwaterSiteForm'

 label to display for entity schema
bel: 'Stormwater Site',
tribute: [ ? array of attribute inputs (see below) ? ]

Attribute Input Types
String Attribute

bel: 'Name',
delProperty: 'name',
taType: 'ShortString' // or 'LongString'

Number Attribute

bel: 'Age',
delProperty: 'age',
taType: 'Integer'  // or 'Decimal' or 'Number'

Geolocation Attribute

bel: 'Location',
delProperty: ?location?,
taType: ?Location?,
lueSchema: {
attribute: [{
  label: ?Latitude?,
  modelProperty: 'latitude',
  dataType: 'Decimal'
}, {
  label: ?Longitude?,
  modelProperty: ?longitude?,
  dataType: ?Decimal?
}]


Simple Selection Attribute

bel: 'Type',
delProperty: 'assetType',
taType: 'ShortString',
tion: [{
label: 'Bioretention',
value: 'BioretentionAsset'
 {
label: 'Filter Strip',
value: 'FilterStripAsset'
 {
label: 'Infiltration (Basin or Trench)',
value: 'InfiltrationAsset'
 {
label: 'Manufactured BMP',
value: 'ManufacturedBmpAsset'
 {
label: 'Permeable Pavement',
value: 'PermeablePavementAsset'
 {
label: 'Pond (Dry or Wet)',
value: 'PondAsset'
 {
label: 'Rooftop Runoff',
value: 'RooftopRunoffAsset'
 {
label: 'Sand Filter (Open or Closed)',
value: 'SandFilterAsset'
 {
label: 'Underground Detention',
value: 'UndergroundDetentionAsset'
 {
label: 'Wetland',
value: 'WetlandAsset'


Complex Selection Attribute

bel: 'Type',
delProperty: 'pickupOrDelivery',
taType: 'Object',
tion: [{
label: 'Delivery',
valueSchema: {
  attribute: [{
    label: ?Latitude?,
    modelProperty: 'latitude',
    dataType: 'Decimal'
  }, {
    label: ?Longitude?,
    modelProperty: ?longitude?,
    dataType: ?Decimal?
  }]
}, {
    label: 'Pickup',
    valueSchema: {
      label: ?Time?,
      attribute: [{
        modelProperty: ?pickupTime?,
        dataType: ?DateTime?
  }]
}


Date Attribute

bel: 'Date Implemented',
delProperty: 'implementationDate',
taType: 'Date'

Datetime Attribute

bel: 'Submission Time',
delProperty: 'submitted',
taType: 'Datetime'


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.