digirati-annotation-bridge
Advanced tools
Comparing version 0.1.9 to 0.1.10
import { addCaptureModel, addInteractiveResource, addResourceTemplate } from 'digirati-annotation-redux/es/actions/resourceTemplate'; | ||
import { getCurrentResourceTemplate, getForm } from 'digirati-annotation-redux/es/query/resourceTemplateQuery'; | ||
import { getCurrentDraft } from 'digirati-annotation-redux/es/query/draftQuery'; | ||
@@ -7,2 +9,17 @@ import { BODY_TYPE, COMBINE, CONFORMS_TO, DESCRIPTION, EXTERNALISE, FORM_FIELDS, HUMAN_READABLE, ID, INPUT_TYPE, MOTIVATED_BY, MULTIPLE, PURPOSE, RDFS_LABEL, SERIALIZE, TITLE, TYPE, UI_GROUP, SELECTOR } from './vocab'; | ||
export function getW3CAnnotationBody(state) { | ||
var currentDraft = getCurrentDraft(state); | ||
var resourceTemplate = getCurrentResourceTemplate(state); | ||
var captureModels = getForm(resourceTemplate).fields; | ||
var values = currentDraft.input; | ||
return captureModels.map(function (model) { | ||
return { | ||
type: model.omekaMetaData.bodyType.label, | ||
purpose: model.omekaMetaData.purpose.label, | ||
value: values[model.id] | ||
}; | ||
}); | ||
} | ||
export function omekaImportResourceTemplate(dispatch, resourceTemplate) { | ||
@@ -9,0 +26,0 @@ // Set the resource template |
// DUBLIN CORE CONSTANTS | ||
export var ID = '@id'; | ||
export var CONTEXT = '@context'; | ||
export var TYPE = '@type'; | ||
@@ -4,0 +5,0 @@ export var DESCRIPTION = 'dcterms:description'; |
'use strict'; | ||
exports.__esModule = true; | ||
exports.getW3CAnnotationBody = getW3CAnnotationBody; | ||
exports.omekaImportResourceTemplate = omekaImportResourceTemplate; | ||
@@ -9,2 +10,6 @@ exports.default = omekaCreateStore; | ||
var _resourceTemplateQuery = require('digirati-annotation-redux/es/query/resourceTemplateQuery'); | ||
var _draftQuery = require('digirati-annotation-redux/es/query/draftQuery'); | ||
var _vocab = require('./vocab'); | ||
@@ -14,2 +19,17 @@ | ||
function getW3CAnnotationBody(state) { | ||
var currentDraft = (0, _draftQuery.getCurrentDraft)(state); | ||
var resourceTemplate = (0, _resourceTemplateQuery.getCurrentResourceTemplate)(state); | ||
var captureModels = (0, _resourceTemplateQuery.getForm)(resourceTemplate).fields; | ||
var values = currentDraft.input; | ||
return captureModels.map(function (model) { | ||
return { | ||
type: model.omekaMetaData.bodyType.label, | ||
purpose: model.omekaMetaData.purpose.label, | ||
value: values[model.id] | ||
}; | ||
}); | ||
} | ||
function omekaImportResourceTemplate(dispatch, resourceTemplate) { | ||
@@ -16,0 +36,0 @@ // Set the resource template |
@@ -6,2 +6,3 @@ 'use strict'; | ||
var ID = exports.ID = '@id'; | ||
var CONTEXT = exports.CONTEXT = '@context'; | ||
var TYPE = exports.TYPE = '@type'; | ||
@@ -8,0 +9,0 @@ var DESCRIPTION = exports.DESCRIPTION = 'dcterms:description'; |
{ | ||
"name": "digirati-annotation-bridge", | ||
"version": "0.1.9", | ||
"version": "0.1.10", | ||
"description": "Describe annotation-bridge here", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
10558
207