UNPKG

grafo-client

Version:

Grafo Client API Library

1 lines 1.45 kB
var Util=require("../util"),CommentNotifType=require("./comment_notification_type");function Document(t){t&&(t.document?(docInit(this,t.document.doc),this.privileges=t.document.privileges,this.userId=t.userId,this.sessionId=t.sessionId,this.restoring=t.restoring):docInit(this,t))}var docInit=function(t,e){t.id=e.id,t.title=e.title,t.iri=e.iri,t.iriPrefix=e.iriPrefix,t.description=e.description,t.owner=e.owner,getNotificationType(t,e),t.dateCreated=Util.unixFormatToDate(e.dateCreated),t.dateDeleted=Util.unixFormatToDate(e.dateDeleted),t.lastModified=Util.unixFormatToDate(e.lastModified),t.parent=e.parent,t.needForceDirectedLayout=e.needForceDirectedLayout,t.deleted=e.deleted};Document.prototype.setTitle=function(t){this.title=t},Document.prototype.setParent=function(t){this.parent=t},Document.prototype.setIri=function(t){this.iri=t},Document.prototype.setIriPrefix=function(t){this.iriPrefix=t},Document.prototype.setDescription=function(t){this.description=t},Document.prototype.setNeedForceDirectedLayout=function(t){this.needForceDirectedLayout=t},Document.prototype.getTitle=function(){return this.title},Document.prototype.getId=function(){return this.id};var getNotificationType=function(t,e){e.ownerCommentNotification?t.commentNotificationType=CommentNotifType.resolveCommentNotifTypes(e.ownerCommentNotification):t.commentNotificationType=CommentNotifType.resolveCommentNotifTypes(e.commentNotificationType)};module.exports=Document;