Concept plugin

This plugin handles all of Infomakers supported Concepts types. The plugin itself will handle any type it's
configured to handle, but is dependent on external config and templates to enable create/edit actions on concepts.

Supported types

As of now these are the supported types (External link)

Plugin config

The plugin can be configured to handle one or many types, it can also be configured to handle one or many subtypes and/or owning concept type through associatedWith.
(e.g type x-im/place, subtypes, position, polygon).

Example Configs

Section:

{
    "id": "io.infomaker.concept.section",
    "name": "im-concept",
    "url": "https://plugins.writer.infomaker.io/v1/infomaker/im-list/dev/index.js",
    "style": "https://plugins.writer.infomaker.io/v1/infomaker/im-list/dev/style.js",
    "enabled": true,
    "mandatory": false,
    "data": {
        "label": "Section",
        "name": "x-im/section",
        "enableHierarchy": true,
        "associatedWith": "x-im/channel",
        "editable": false,
        "placeholderText": "Search for section",
        "icon": "fa-superpowers",
        "singleValue": true,
        "appendDataToLink": false,
        "provider": "writer",
        "pubStatus": "imext:draft",
        "searchOnFocus": true,
        "allowedConceptStatuses": ["draft", "usable"]
    }
}

Place:

{
    "id": "io.infomaker.concept.place",
    "name": "im-concept",
    "url": "https://plugins.writer.infomaker.io/v1/infomaker/im-list/dev/index.js",
    "style": "https://plugins.writer.infomaker.io/v1/infomaker/im-list/dev/style.js",
    "enabled": true,
    "mandatory": false,
    "data": {
        "label": "Places",
        "name": "x-im/place",
        "enableHierarchy": false,
        "editable": true,
        "appendDataToLink": true,
        "placeholderText": "Search for places",
        "googleMapAPIKey": "AIzaSyAdlr4ZwU9U8kD9ophla29QaHboNIiyj5c",
        "subtypes": [
            "position",
            "polygon"
        ]
    }
}

Author:

{
    "id": "io.infomaker.concept.author",
    "name": "im-concept",
    "url": "https://plugins.writer.infomaker.io/v1/infomaker/im-list/dev/index.js",
    "style": "https://plugins.writer.infomaker.io/v1/infomaker/im-list/dev/style.js",
    "enabled": true,
    "mandatory": false,
    "data": {
        "label": "Author",
        "name": "x-im/author",
        "enableHierarchy": false,
        "editable": false,
        "creatable": true,
        "placeholderText": "Search for author",
        "appendDataToLink": true,
        "provider": "writer",
        "pubStatus": "imext:draft"
    }
}

Tags:

{
    "id": "io.infomaker.concept",
    "name": "im-concept",
    "url": "https://plugins.writer.infomaker.io/v1/infomaker/im-list/dev/index.js",
    "style": "https://plugins.writer.infomaker.io/v1/infomaker/im-list/dev/style.js",
    "enabled": true,
    "mandatory": false,
    "data": {
        "label": "Tags",
        "name": "x-im/tag",
        "enableHierarchy": true,
        "editable": true,
        "placeholderText": "Search for tags",
        "rel": "subject",
        "searchOnFocus": false,
        "types": {
            "x-im/person": {
                "name": "Person",
                "editable": true,
                "icon": "fa-superpowers"
            },
            "x-im/organisation": {
                "name": "Organisation",
                "editable": true
            },
            "x-im/category": {
                "name": "Category",
                "editable": false
            },
            "x-im/channel": {
                "name": "Channel",
                "editable": false
            }
        }
    }
}

Writer config

To enable Concepts you need to add configuration to Writer as well.

"contentHost": {
    "protocol": "https://",
    "credentials": "include",
    "hostName": "xlibris.XX.XX.oc.writer.infomaker.io",
    "port": "7777",
    "healthPath": "/opencontent/health",
    "queryPath": "/opencontent/search",
    "objectPath": "/opencontent/objects"
},
"conceptServiceConfig": {
    "conceptPath": "https://s3-eu-west-1.amazonaws.com/concepts-config-prod/writer/",
    "contenttype": "Concept",
    "broaderLimit": 3,
    "relatedGeoFunction": "Contains",
    "relatedGeoExludeSelf": false,
    "searchLimit": 50,
    "sortField": "ConceptNameString",
    "titleSearchField": "ConceptNameString",
    "allowedConceptStatuses": ["draft", "usable"],
    "propertyMap": {
        ...
    }
}

Property map

Optional configuration to use if current Open Content does not run the default configuration for Concepts. The property map is used to translate different kind of OC configurations into prop names ConceptService can use.
The left hand side will be used by ConceptService, fill in the property-names from OC on the right hand side.

"propertyMap": {
    "uuid": "uuid",
    "ConceptName": "ConceptName",
    "ConceptNameString": "ConceptNameString",
    "ConceptStatus": "ConceptStatus",
    "ConceptDefinitionShort": "ConceptDefinitionShort",
    "ConceptDefinitionLong": "ConceptDefinitionLong",
    "ConceptImTypeFull": "ConceptImTypeFull",
    "ConceptImSubTypeFull": "ConceptImSubTypeFull",
    "ConceptGeometry": "ConceptGeometry",
    "ConceptAvatarUuid": "ConceptAvatarUuid",
    "ConceptAssociatedWith": "ConceptAssociatedWith",
    "ConceptAuthorFirstname": "ConceptAuthorFirstname",
    "ConceptAuthorLastname": "ConceptAuthorLastname",
    "ConceptAuthorEmail": "ConceptAuthorEmail",
    "ConceptImIdSubjectId": "ConceptImIdSubjectId",
    "ConceptBroaderRelation": "ConceptBroaderRelation",
    "ConceptAssociatedWithRelations": "ConceptAssociatedWithRelations",
    "ConceptAssociatedWithMeRelations": "ConceptAssociatedWithMeRelations",
    "ConceptReplacedByRelation": "ConceptReplacedByRelation"
}

Output

Each selected or created concept will generate a link inside the article's itemMeta element.

<link rel="subject" title="Cool corp." type="x-im/organisation" uuid="63d5dcc1-28f1-4892-9f44-142043541de1"/>

If the plugin config appendDataToLink is set to true, concept data will be added as data to the link. The article
data instructions are read from a remote config file that is unique per concept type.

<link rel="author" title="Rob Zombie!" type="x-im/author" uuid="ccdbcf5a-4fba-4d61-bb2f-8469a7c5d357">
    <data>
        <email>robert@demonoid.nu</email>
        <firstName>Rob</firstName>
        <lastName>Zombie</lastName>
        <facebookUrl>https://www.facebook.com/RobZombie/</facebookUrl>
        <shortDescription>Testar</shortDescription>
        <longDescription>Testar</longDescription>
    </data>
</link>

Broader

Concepts with a rel broader will be decorated with data about the concepts hierarchical chain to the depth
specified in ConcepService Config:

"broaderLimit": 3,
<link rel="subject" title="Elitserien" type="x-im/category" uuid="b3c8f46f-00db-4e23-a98f-69494582aacc">
    <links>
        <link rel="subject" title="Ishockey" type="x-im/category" uuid="72addee2-b68d-4f39-9e5f-0f1c45c0637e"/>
        <link rel="subject" title="Sport" type="x-im/category" uuid="45f12bb9-3cfc-494a-aeb5-49008812bb47"/>
    </links>
</link>

Associated with

Concepts that are associated with other concepts will decorate the article with information about this relationship

<links>
    <link title="Channel A" rel="subject" type="x-im/channel" uuid="abcd"/>
    <link title="Channel B" rel="subject" type="x-im/channel" uuid="efgh"/>

    <!--- This Concept has the associated-with set to uuid of concept "Channel A" --->
    <link title="Section A" rel="subject" type="x-im/section" uuid="1234">
        <links>
            <link title="Channel A" rel="associated-with" type="x-im/channel" uuid="abcd"/>
        </links>
    </link>

    <!--- This Concept has the associated-with set to uuid of concept "Channel B" --->
    <link title="Section B" rel="subject" type="x-im/section" uuid="12345">
        <links>
            <link title="Channel B" rel="associated-with" type="x-im/channel" uuid="efgh"/>
        </links>
    </link>

    <!--- This Concept has the associated-with set to uuids of concept "Channel A" and "Channel B" --->
    <link title="Section C" rel="subject" type="x-im/section" uuid="123456">
        <links>
            <link title="Channel A" rel="associated-with" type="x-im/channel" uuid="abcd"/>
            <link title="Channel B" rel="associated-with" type="x-im/channel" uuid="efgh"/>
        </links>
    </link>
</links>

Replaced by

If a concept has been marked with "replaced by", the new concept will be added if selected:

x-im/polygon

If the ConceptService config property relatedGeoFunction is set, a background check will be made to look up areas
that correlates with selected polygon. The correlating areas will be added to the article as a related-geo link tag.

Available functions are: "Contains", "Intersects", "IsWithin". These links are not displayed to the user but are
to be considered as an extension available for searching.

<link rel="subject" title="Oxhagen" type="x-im/place" uuid="952adffb-1a8e-492c-b5b1-175df1f91874">
<data>
    <geometry>POLYGON((16.337724687158243 56.67353746432897,
        16.34029960781254 56.674952121793844,
        16.339870454370157 56.67806418123245,
        16.337724687158243 56.67820563237095,
        16.333690644799844 56.677922729562766,
        16.330171586572305 56.677781277361916,
        16.3298282638184 56.67627242083415,
        16.32776832729496 56.67551796990587,
        16.327854157983438 56.67443342022474,
        16.33480644375004 56.67363177647931,
        16.337724687158243 56.67353746432897))</geometry>
    </data>
</link>
<link rel="related-geo">
    <data>
        <uuid title="Kalmar">320938f8-db94-11e5-b5d2-0a1d41d68578</uuid>
        <uuid title="Oxhagen">952adffb-1a8e-492c-b5b1-175df1f91874</uuid>
    </data>
</link>