Create tracker entity from object
@param html
548093
function createTrackerEntity(data) {

    let result = data.data

    return new TrackerInfo({
        attempts: 1,
        id: data.gearTrackID,
        origin: result.fromCountry,
        destiny: result.destinationCountry,
        states: result.events.map((elem) => {
            return {
                state: elem.operationAttributeTranslated,
                date: moment.tz(elem.operationDateTime, "DD.MM.YYYY HH:mm:ss", zone),
                area: elem.operationPlaceNameTranslated,
                service: elem.serviceName
            }
        }).filter(state => {
            if (state.state == 'The track code is added to the database Track24.ru for automatic monitoring.')
                return false
            return true
        }).sort((a, b) => {
            let dateA = moment(a.date),
                dateB = moment(b.date)

            if (dateA.isBefore(dateB))
                return 1

            return -1
        })
    })
}
1118438
function (fn, create) {
  return subscribe.call(this, fn, function (value) {
    return Utils.trackNode(create(value));
  }, function (value) {
    this.value.replace(create(value));
  }).value.fragment;
}
1197734
@SuppressWarnings("unchecked")
    public <T> T trackEntity(Class<T> clazz, DocumentInfo documentFound) {
        return (T) trackEntity(clazz, documentFound.getId(), documentFound.getDocument(), documentFound.getMetadata(), noTracking);
    }
154596
def link_to_tracked(name, track_path = "/", options = {}, html_options = {})
      raise AnalyticsError.new("You must set Rubaidh::GoogleAnalytics.defer_load = false to use outbound link tracking") if GoogleAnalytics.defer_load == true
      html_options.merge!({:onclick => tracking_call(track_path)})
      link_to name, options, html_options
    end
149732
function createEntity(html, id) {
    let $ = parser.load(html)

    let table = $('tr.past')

    let states = utils.tableParser(table, {
        date: {
            idx: 3,
            mandatory: true
        },
        hours: {
            idx: 5,
            mandatory: true
        },
        state: {
            idx: 7,
            mandatory: true
        },
        area: {
            idx: 9,
            mandatory: false
        }
    }).map(line => {
        let d = line.date + ' ' + line.hours
        return {
            date: moment.tz(d, "DD/MM/YYYY HH:mm", zone).format(),
            state: line.state,
            area: line.area
        }
    })

    return new EntityInfo({
        id: id,
        states: states
    })
}
1034426
public function track(): void
	{
		if ($this->canTrack()) {
			$track = new TrackingEntity;

			$track->uid = $this->user->getUid();
			$track->inserted = new DateTime;
			$track->url = $this->getParam('url');
			$track->referer = $this->getParam('referer');
			$track->ip = $this->getIp();
			$track->browser = $this->getParam('browser');
			$track->utmSource = $this->getParam('utm_source');
			$track->utmMedium = $this->getParam('utm_medium');
			$track->utmCampaign = $this->getParam('utm_campaign');

			$this->orm->persistAndFlush($track);
		}
	}
593272
function (dom, kb, tracker, superIssue) {
      var form = dom.createElement('div') // form is broken as HTML behaviour can resurface on js error
      var stateStore = kb.any(tracker, WF('stateStore'))

      var sendNewIssue = function () {
        titlefield.setAttribute('class', 'pendingedit')
        titlefield.disabled = true
        var sts = []
        var issue

        var expandTemplate = function (template) {
          const now = new $rdf.Literal(new Date())
          const nnnn = '' + (new Date()).getTime()
          let YYYY = now.value.slice(0, 4)
          var MM = now.value.slice(5, 7)
          var DD = now.value.slice(8, 10)
          return template.replace('{N}', nnnn).replace('{YYYY}', YYYY).replace('{MM}', MM).replace('{DD}', DD)
        }
        // Where to store the new issue?
        var template = kb.anyValue(tracker, WF('issueURITemplate'))
        var issueDoc
        if (template) { // Does each issue do in its own file?
          template = $rdf.uri.join(template, stateStore.uri) // Template is relative
          issue = kb.sym(expandTemplate(template))
        } else {
          issue = kb.sym(stateStore.uri + '#' + 'Iss' + timestring())
        }
        issueDoc = issue.doc()

        // Basic 9 core predicates are stored in the main stateStore

        var title = kb.literal(titlefield.value)
        sts.push(new $rdf.Statement(issue, WF('tracker'), tracker, stateStore))
        sts.push(new $rdf.Statement(issue, DC('title'), title, stateStore))
        sts.push(new $rdf.Statement(issue, DCT('created'), new Date(), stateStore))
        var initialStates = kb.each(tracker, WF('initialState'))
        if (initialStates.length === 0) console.log('This tracker has no initialState')
        for (var i = 0; i < initialStates.length; i++) {
          sts.push(new $rdf.Statement(issue, ns.rdf('type'), initialStates[i], stateStore))
        }
        if (superIssue) sts.push(new $rdf.Statement(superIssue, WF('dependent'), issue, stateStore))

        // Other things are stores in the individual
        if (template) {
          sts.push(new $rdf.Statement(issue, WF('tracker'), tracker, issueDoc))
          sts.push(new $rdf.Statement(issue, ns.rdfs('seeAlso'), stateStore, issueDoc))
        }

        var sendComplete = function (uri, success, body) {
          if (!success) {
            console.log("Error: can't save new issue:" + body)
          } else {
            form.parentNode.removeChild(form)
            rerender(div)
            outliner.GotoSubject(issue, true, undefined, true, undefined)
          }
        }
        updater.update([], sts, sendComplete)
      }
      // form.addEventListener('submit', function() {try {sendNewIssue} catch(e){console.log('sendNewIssue: '+e)}}, false)
      // form.setAttribute('onsubmit', "function xx(){return false;}")

      UI.store.fetcher.removeCallback('done', 'expand') // @@ experimental -- does this kill the re-paint? no
      UI.store.fetcher.removeCallback('fail', 'expand')

      var states = kb.any(tracker, WF('issueClass'))
      var classLabel = UI.utils.label(states)
      form.innerHTML = '<h2>Add new ' + (superIssue ? 'sub ' : '') +
        classLabel + '</h2><p>Title of new ' + classLabel + ':</p>'
      var titlefield = dom.createElement('input')
      titlefield.setAttribute('type', 'text')
      titlefield.setAttribute('style', 'margin: 0.5em; font-size: 100%; padding: 0.3em;')
      titlefield.setAttribute('size', '100')
      titlefield.setAttribute('maxLength', '2048') // No arbitrary limits
      titlefield.select() // focus next user input
      titlefield.addEventListener('keyup', function (e) {
        if (e.keyCode === 13) {
          sendNewIssue()
        }
      }, false)
      form.appendChild(titlefield)
      return form
    }
528979
function () {
    var self = this;
    var trackedControllerEls = this.el.querySelectorAll('[tracked-controls]');
    this.trackedControllerEls = {};
    trackedControllerEls.forEach(function setupController (trackedControllerEl) {
      if (!trackedControllerEl.id) {
        warn('Found a tracked controller entity without an ID. ' +
             'Provide an ID or this controller will not be recorded');
        return;
      }
      trackedControllerEl.setAttribute('motion-capture-recorder', {
        autoRecord: false,
        visibleStroke: false
      });
      self.trackedControllerEls[trackedControllerEl.id] = trackedControllerEl;
      if (self.isRecording) {
        trackedControllerEl.components['motion-capture-recorder'].startRecording();
      }
    });
  }
920417
function track (error) {
  if (window.trackJs) {
    try {
      var message = error ? error.message + ' - code: ' + error.errorCode : JSON.stringify(error);
      window.trackJs.track(new Error(message));
    } catch (exc) {
      // Swallow
    }
  }
}
859494
function DirectLinkInfo(obj) {
    this.id = obj.tracking_no
    this.state = obj.status
    this.states = obj.states.reverse()
    this.trackerWebsite = directLink.getLink(obj.tracking_no)
}
237488
def _post_create(atdepth, entry, result):
    
    if not atdepth and entry is not None:
        if result is not None:
            #We need to get these results a UUID that will be saved so that any
            #instance methods applied to this object has a parent to refer to.
            retid = _tracker_str(result)
            entry["r"] = retid
            ekey = retid
        else: # pragma: no cover
            ekey = _tracker_str(cls)

        msg.info("{}: {}".format(ekey, entry), 1)
        record(ekey, entry)
1023885
function (obj, track, prune) {
        var list = this,
            ops = track && {
                created: [],
                updated: [],
                deleted: []
            },
            indexer = list._postman_listIndexKey,
            tmp;

        if (!_.isObject(obj)) { return ops; }

        // ensure that all properties in the object is updated in this list
        _.forOwn(obj, function (value, key) {
            // we need to create new variable if exists or update existing
            if (list.has(key)) {
                list.one(key).set(value);
                ops && ops.updated.push(key);
            }
            else {
                tmp = { value: value };
                tmp[indexer] = key;
                list.add(tmp);
                tmp = null;
                ops && ops.created.push(key);
            }
        });

        // now remove any variable that is not in source object
        // @note - using direct `this.reference` list of keys here so that we can mutate the list while iterating
        // on it
        if (prune !== false) {
            _.forEach(list.reference, function (value, key) {
                if (obj.hasOwnProperty(key)) { return; } // de not delete if source obj has this variable
                list.remove(key); // use PropertyList functions to remove so that the .members array is cleared too
                ops && ops.deleted.push(key);
            });
        }

        return ops;
    }
131232
def link_to_tracked_if(condition, name, track_path = "/", options = {}, html_options = {}, &block)
      raise AnalyticsError.new("You must set Rubaidh::GoogleAnalytics.defer_load = false to use outbound link tracking") if GoogleAnalytics.defer_load == true
      html_options.merge!({:onclick => tracking_call(track_path)})
      link_to_unless !condition, name, options, html_options, &block
    end
940046
function gaTrackerSnippet(options) {
	if (typeof options === 'string') {
		options = {id: arguments[0], domain: arguments[1]};
	} else {
		options = options || {};
	}

	var templateData = {};

	var defultValues = {
		id: 'XXXXX-X',
		domain: 'auto',
		globalName: 'ga'
	};

	Object.keys(defultValues).forEach(function(key) {
		var prop = options[key];
		if (prop) {
			if (typeof prop !== 'string') {
				throw new TypeError(prop + ' is not a string. ' + key + ' property must be a string.');
			}
			templateData[key] = prop;
		} else {
			templateData[key] = defultValues[key];
		}
	});

	if (!isVarName(templateData.globalName)) {
		throw new Error(templateData.globalName + ' cannot be used as a global variable name.');
	}

	if (templateData.id.indexOf('UA-') === 0) {
		templateData.id = templateData.id.substring(3);
	}

	var space;
	if (options.minify) {
		space = '';
	} else {
		space = ' ';
	}

	var code = templateData.globalName +
             '(\'create\',' + space +
             '\'UA-' + templateData.id + '\',' + space +
             '\'' + templateData.domain + '\');' +
             (options.minify ? '' : '\n') +
             templateData.globalName +
             '(\'send\',' + space + '\'pageview\');';

	if (options.singleQuotes === false) {
		code = code.replace(/'/g, '"');
	}

	return code;
}
1012228
private Tag entityToTag(String id, Entity tagEntity) {
    Tag tag = tagFactory.create(id);
    tag.setObjectIri(tagEntity.getString(EMX_TAG_OBJECT_IRI));
    tag.setLabel(tagEntity.getString(EMX_TAG_LABEL));
    tag.setRelationLabel(tagEntity.getString(EMX_TAG_RELATION_LABEL));
    tag.setCodeSystem(tagEntity.getString(EMX_TAG_CODE_SYSTEM));
    tag.setRelationIri(tagEntity.getString(EMX_TAG_RELATION_IRI));

    return tag;
  }
648467
public Object trackEntity(Class entityType, String id, ObjectNode document, ObjectNode metadata, boolean noTracking) {

        noTracking = this.noTracking || noTracking;  // if noTracking is session-wide then we want to override the passed argument

        if (StringUtils.isEmpty(id)) {
            return deserializeFromTransformer(entityType, null, document);
        }

        DocumentInfo docInfo = documentsById.getValue(id);
        if (docInfo != null) {
            // the local instance may have been changed, we adhere to the current Unit of Work
            // instance, and return that, ignoring anything new.

            if (docInfo.getEntity() == null) {
                docInfo.setEntity(entityToJson.convertToEntity(entityType, id, document));
            }

            if (!noTracking) {
                includedDocumentsById.remove(id);
                documentsByEntity.put(docInfo.getEntity(), docInfo);
            }

            return docInfo.getEntity();
        }

        docInfo = includedDocumentsById.get(id);
        if (docInfo != null) {
            if (docInfo.getEntity() == null) {
                docInfo.setEntity(entityToJson.convertToEntity(entityType, id, document));
            }

            if (!noTracking) {
                includedDocumentsById.remove(id);
                documentsById.add(docInfo);
                documentsByEntity.put(docInfo.getEntity(), docInfo);
            }

            return docInfo.getEntity();
        }

        Object entity = entityToJson.convertToEntity(entityType, id, document);

        String changeVector = metadata.get(Constants.Documents.Metadata.CHANGE_VECTOR).asText();
        if (changeVector == null) {
            throw new IllegalStateException("Document " + id + " must have Change Vector");
        }

        if (!noTracking) {
            DocumentInfo newDocumentInfo = new DocumentInfo();
            newDocumentInfo.setId(id);
            newDocumentInfo.setDocument(document);
            newDocumentInfo.setMetadata(metadata);
            newDocumentInfo.setEntity(entity);
            newDocumentInfo.setChangeVector(changeVector);

            documentsById.add(newDocumentInfo);
            documentsByEntity.put(entity, newDocumentInfo);
        }

        return entity;
    }
878839
static void writeTracker(JSONWriter writer, Tracker tracker)
			throws JSONException {
		writer.key("id");
		writer.value(tracker.getId());
		writer.key("name");
		writer.value(tracker.getName());
	}