SmartIT_Extensions/BMC/smart-it-full-helix/scripts/app/feed/related-object-vo.js

42 lines
981 B
JavaScript

"use strict";
/**
* Value object for related object.
*
* @author Igor Samulenko
* @constructor
*/
function RelatedObjectVO() {
this.displayId = '';
this.type = '';
this.title = '';
this.classId = '';
this.eventType = '';
// flags
this.showHeader = true;
// derived fields
this.entityLink = '';
}
/**
* Setup inheritance chain.
*/
RelatedObjectVO.prototype = Object.create(BaseVO.prototype);
RelatedObjectVO.prototype.constructor = RelatedObjectVO;
/**
* @override
* @return {Array}
*/
RelatedObjectVO.prototype.getProps = function () {
return BaseVO.prototype.getProps().concat('displayId', 'type', 'title', 'classId', 'eventType');
};
RelatedObjectVO.prototype.isAsset = function () {
return this.type === EntityVO.TYPE_ASSET;
};
/**
* @override
*/
RelatedObjectVO.prototype.postBuild = function () {
if (this.isAsset()) {
this.entityLink = '#/' + this.type + '/' + this.displayId + '/' + this.classId;
}
};