Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

This toolkit element enables the generation of one or more types of entity based on the document or content metadata. The expressions default to replacement strings, or $SCRIPT(...) can be used to return a string using javascript.

...

Code Block
 ],    "mediaType": ["Social"],
    "metadata": {"json": [{
        "actor": {
            "displayName": "CRM Buddy",
            "followersCount": "245",
            "friendsCount": "0",
            "id": "id:twitter.com:835627776",
            "image": "http://a0.twimg.com/profile_images/2630355549/8cad59efaddd57283dbb159332336744_normal.jpeg",
            "languages": ["en"],
            "link": "http://www.twitter.com/FocalCRM",
            "links": [{"rel": "me"}],
            "listedCount": "6",
            "objectType": "person",
            "postedTime": "2012-09-20T13:59:56.000Z",
            "preferredUsername": "FocalCRM",
            "statusesCount": "3688",
            "summary": "",
            "verified": "false"
        },

 

...

Extracting Entities From Arrays with iterateOver

You can use iterateOver to create an entity for each object in an array.

...

In the example above the iterateOver value is set to "victim" meaning that the Structured Analysis Harvester Manual Entities will iterate (or loop) over the metadata.victim[] objects and create an entity for each object in the array.

...

You can still throw errors from the script by checking if "(_iterator==null)" if you want to) This enables writing objects that will handle fields being either primitives or objects (eg by checking vs _iterator and _value).

 

...

Specifying Entity Geographic Location

It is also possible to set values for entity parameters using Javascript functions declared in Globals.

...