Module providing bootstrap dialogs for finding and selecting entities.
- cwrc-public-entity-dialogs
- .lookupSourceMetadata
- .registerEntitySources(sources)
- .setEntityFormsRoot(url)
- .setCollectionsRoot(url)
- .setShowCreateNewButton(value)
- .setShowEditButton(value)
- .setShowNoLinkButton(value)
- .returnResult(result)
- .setEnabledSources(config)
- .initialize(entityType, entityLookupMethodName, entityLookupTitle, searchOptions)
- .popSearchPerson(searchOptions)
- .popSearchPlace(searchOptions)
- .popSearchOrganization(searchOptions)
- .popSearchTitle(searchOptions)
The list of possible entity lookup sources, their IDs, titles, and whether or not they're enabled.
Kind: static property of cwrc-public-entity-dialogs
Properties
Name | Type |
---|---|
cwrc | String |
viaf | String |
dbpedia | String |
geonames | String |
getty | String |
wikidata | String |
Register the entity lookup sources that will be used by this module. The sources object should have keys which correspond to the 4 entity types. The values of those keys should be Maps where the key is the lookup ID and the value is the lookup module.
Kind: static method of cwrc-public-entity-dialogs
See: cwrc-public-entity-dialogs.lookupSourceMetadata
Param | Type |
---|---|
sources | Object |
const viaf = require("viaf-entity-lookup");
const dbpedia = require("dbpedia-entity-lookup");
const sources = {
person: new Map().set("viaf", viaf).set("dbpedia", dbpedia),
place: new Map().set("viaf", viaf).set("dbpedia", dbpedia),
organization: new Map().set("viaf", viaf).set("dbpedia", dbpedia),
title: new Map().set("viaf", viaf).set("dbpedia", dbpedia)
};
Set the URL for where the CWRC entity management forms are located. Currently only used by Islandora CWRC Writer.
Kind: static method of cwrc-public-entity-dialogs
Param | Type |
---|---|
url | String |
Set the URL to use as the top level collection for create title entities. Currently only used by Islandora CWRC Writer.
Kind: static method of cwrc-public-entity-dialogs
See: 'cwrc-title-entity-dialog'
Param | Type |
---|---|
url | String |
Whether to show the Create New button, used to spawn the CWRC entity management forms. Currently only used by Islandora CWRC Writer.
Kind: static method of cwrc-public-entity-dialogs
Param | Type |
---|---|
value | Boolean |
Whether to show the Edit Selected button, used to spawn the CWRC entity management forms. Currently only used by Islandora CWRC Writer.
Kind: static method of cwrc-public-entity-dialogs
Param | Type |
---|---|
value | Boolean |
Whether to show the Tag Without Linking button, which allows the user to skip this dialog in the entity tagging process.
Kind: static method of cwrc-public-entity-dialogs
Param | Type |
---|---|
value | Boolean |
Call the success method specified in searchOptions with the entity lookup result.
Kind: static method of cwrc-public-entity-dialogs
Access: protected
Param | Type | Description |
---|---|---|
result | Object |
The entity lookup result |
result.uri | String |
The entity URI |
result.name | String |
The entity name/lemma |
result.repository | String |
The name of the entity lookup source |
Set which entity lookup sources are enabled, i.e. available to the user.
Kind: static method of cwrc-public-entity-dialogs
Param | Type |
---|---|
config | Object |
{'viaf': true, 'wikidata': true, 'getty': true, 'dbpedia': true, 'geonames': true}
cwrc-public-entity-dialogs.initialize(entityType, entityLookupMethodName, entityLookupTitle, searchOptions)
Initialize and display an entity lookup dialog.
Kind: static method of cwrc-public-entity-dialogs
Access: protected
Param | Type | Default | Description |
---|---|---|---|
entityType | String |
The entity type | |
entityLookupMethodName | String |
The name of the method to call on the lookup module | |
entityLookupTitle | String |
The dialog title | |
searchOptions | Object |
The search options | |
searchOptions.query | String |
The search query | |
searchOptions.success | function |
The function to call with the entity the user selected, see returnResult for the format | |
searchOptions.cancelled | function |
The function to call if the user cancelled the dialog | |
[searchOptions.parentEl] | Element |
document.body |
The element to append the dialog to |
[searchOptions.uri] | String |
The entity URI, if editing | |
[searchOptions.name] | String |
The entity name/lemma, if editing |
Open a person entity lookup dialog.
Kind: static method of cwrc-public-entity-dialogs
See: cwrc-public-entity-dialogs.initialize
Param | Type |
---|---|
searchOptions | Object |
Open a place entity lookup dialog.
Kind: static method of cwrc-public-entity-dialogs
See: cwrc-public-entity-dialogs.initialize
Param | Type |
---|---|
searchOptions | Object |
Open a organization entity lookup dialog.
Kind: static method of cwrc-public-entity-dialogs
See: cwrc-public-entity-dialogs.initialize
Param | Type |
---|---|
searchOptions | Object |
Open a title entity lookup dialog.
Kind: static method of cwrc-public-entity-dialogs
See: cwrc-public-entity-dialogs.initialize
Param | Type |
---|---|
searchOptions | Object |