src/lib/model/dms-object.model.ts
Representation of a dms object.
Properties |
constructor(json: any)
|
||||||||
Defined in src/lib/model/dms-object.model.ts:133
|
||||||||
Creates a new instance
Parameters :
|
content |
content:
|
Type : any
|
Defined in src/lib/model/dms-object.model.ts:109
|
The objects content (file). May be empty as dms objects can be created without contents |
contentFileName |
contentFileName:
|
Type : string
|
Defined in src/lib/model/dms-object.model.ts:113
|
The contents filename |
contentFileSize |
contentFileSize:
|
Type : string
|
Defined in src/lib/model/dms-object.model.ts:117
|
The contents filesize |
contextFolder |
contextFolder:
|
Type : literal type
|
Defined in src/lib/model/dms-object.model.ts:77
|
Information about the objects context folder |
created |
created:
|
Type : any
|
Defined in src/lib/model/dms-object.model.ts:93
|
Information about the objects creation. Includes the date it was created and the user that created the object |
data |
data:
|
Type : any
|
Defined in src/lib/model/dms-object.model.ts:81
|
Indexdata of the object |
description |
description:
|
Type : string
|
Defined in src/lib/model/dms-object.model.ts:36
|
objects description |
id |
id:
|
Type : string
|
Defined in src/lib/model/dms-object.model.ts:28
|
objects ID |
isActiveVersion |
isActiveVersion:
|
Type : boolean
|
Defined in src/lib/model/dms-object.model.ts:56
|
Flag indicating whether or not this is the active version of the object |
isContextFolder |
isContextFolder:
|
Type : boolean
|
Defined in src/lib/model/dms-object.model.ts:73
|
Flag indicating whether or not the object is a context folder |
isFavorite |
isFavorite:
|
Type : boolean
|
Defined in src/lib/model/dms-object.model.ts:64
|
Flag indicating whether or not the object has been marked as favorite |
isFinalized |
isFinalized:
|
Type : boolean
|
Defined in src/lib/model/dms-object.model.ts:60
|
Flag indicating whether or not has been finalized |
lock |
lock:
|
Type : any
|
Defined in src/lib/model/dms-object.model.ts:105
|
Flag indicating whether or not the object is locked. Locked objects are not allowed to be changed |
modified |
modified:
|
Type : any
|
Defined in src/lib/model/dms-object.model.ts:97
|
Information about the objects last modification. Includes the date it was modified and the user that modified the object |
processcount |
processcount:
|
Type : any
|
Defined in src/lib/model/dms-object.model.ts:101
|
Information about the number of active process. |
resubmissions |
resubmissions:
|
Type : any[]
|
Default value : []
|
Defined in src/lib/model/dms-object.model.ts:125
|
List of resubmissions for the object |
rights |
rights:
|
Type : any
|
Defined in src/lib/model/dms-object.model.ts:85
|
special right/permissions set up for the object |
shares |
shares:
|
Type : any
|
Defined in src/lib/model/dms-object.model.ts:89
|
Information about the sharing status of the object |
storageInfo |
storageInfo:
|
Type : any[]
|
Default value : []
|
Defined in src/lib/model/dms-object.model.ts:129
|
Storage info of the object |
subscriptions |
subscriptions:
|
Type : any[]
|
Default value : []
|
Defined in src/lib/model/dms-object.model.ts:121
|
List of subscriptions for the object |
title |
title:
|
Type : string
|
Defined in src/lib/model/dms-object.model.ts:32
|
objects title |
Optional type |
type:
|
Type : ObjectType
|
Defined in src/lib/model/dms-object.model.ts:52
|
objects type |
typeName |
typeName:
|
Type : string
|
Defined in src/lib/model/dms-object.model.ts:48
|
object type name |
version |
version:
|
Type : number
|
Defined in src/lib/model/dms-object.model.ts:40
|
objects version number |
import {ObjectType} from './object-type.model';
/**
* @ignore
*/
export class DmsObjectAttachment {
id: number;
name: string;
size: number;
type: string;
previewUri: string;
/**
* @param json - server sent JSON for a dms object
*/
constructor(json: any) {
Object.assign(this, json);
}
}
/**
* Representation of a dms object.
*/
export class DmsObject {
/**
* objects ID
*/
id: string;
/**
* objects title
*/
title: string;
/**
* objects description
*/
description: string;
/**
* objects version number
*/
version: number;
/**
* @ignore
*/
versions: any[];
/**
* object type name
*/
typeName: string;
/**
* objects type
*/
type?: ObjectType;
/**
* Flag indicating whether or not this is the active version of the object
*/
isActiveVersion: boolean;
/**
* Flag indicating whether or not has been finalized
*/
isFinalized: boolean;
/**
* Flag indicating whether or not the object has been marked as favorite
*/
isFavorite: boolean;
/**
* @ignore
* same as isContextFolder because we do not allow other folders than context folders
*/
isFolder: boolean;
/**
* Flag indicating whether or not the object is a context folder
*/
isContextFolder: boolean;
/**
* Information about the objects context folder
*/
contextFolder: { id: string, typeName: string, type?: ObjectType, title: string, description: string, data: Object };
/**
* Indexdata of the object
*/
data: any;
/**
* special right/permissions set up for the object
*/
rights: any;
/**
* Information about the sharing status of the object
*/
shares: any;
/**
* Information about the objects creation. Includes the date it was created and the user that created the object
*/
created: any;
/**
* Information about the objects last modification. Includes the date it was modified and the user that modified the object
*/
modified: any;
/**
* Information about the number of active process.
*/
processcount: any;
/**
* Flag indicating whether or not the object is locked. Locked objects are not allowed to be changed
*/
lock: any;
/**
* The objects content (file). May be empty as dms objects can be created without contents
*/
content: any;
/**
* The contents filename
*/
contentFileName: string;
/**
* The contents filesize
*/
contentFileSize: string;
/**
* List of subscriptions for the object
*/
subscriptions: any[] = [];
/**
* List of resubmissions for the object
*/
resubmissions: any[] = [];
/**
* Storage info of the object
*/
storageInfo: any[] = [];
/**
* @ignore
*/
additionalvisibility: any[] = [];
/**
* Creates a new instance
* @param json The JSON object received from the backend. This will be used to construct the new dms object instance
*/
constructor(json: any) {
// create a DmsObject based on the server JSON
this.id = json.id;
this.title = json.title;
this.description = json.description;
this.version = json.version;
this.versions = json.versions;
this.data = json.data;
this.typeName = json.type;
this.isActiveVersion = json.activeversion;
this.isFinalized = json.finalized;
this.isFavorite = json.favorite;
this.isFolder = json.folder;
this.isContextFolder = !!json.iscontextfolder;
this.processcount = json.processcount;
this.storageInfo = json.storageinfo;
if (json.contents && json.contents[0]) {
this.contentFileName = json.contents[0].path;
this.contentFileSize = json.contents[0].size;
}
if (json.contextfolder) {
this.contextFolder = {
id: json.contextfolder.id,
typeName: json.contextfolder.type,
title: json.contextfolder.title,
description: json.contextfolder.description,
data: json.contextfolder.data
};
}
if (json.created) {
this.created = {
on: json.created.on,
by: {
id: json.created.by.id,
title: json.created.by.title,
name: json.created.by.name
}
};
}
if (json.modified) {
this.modified = {
on: json.modified.on,
by: {
id: json.modified.by.id,
title: json.modified.by.title,
name: json.modified.by.name
}
};
}
// lock informations
if (json.lock !== 'NOT_LOCKED' && json.lockinfo) {
this.lock = {
on: json.lockinfo.time,
by: {
me: json.lock === 'LOCKED_BY_SESSION_USER',
other: json.lock === 'LOCKED_BY_OTHER_USER',
name: json.lockinfo.username,
label: json.lockinfo.usertitle
}
};
}
// rights section
if (json.rights && json.rights.length > 0) {
this.rights = {
select: json.rights[0].privileges.select,
edit: json.rights[0].privileges.edit && !(this.lock && this.lock.by.other),
delete: json.rights[0].privileges.delete && !(this.lock && this.lock.by.other),
finalize: json.rights[0].privileges.finalize && !(this.lock && this.lock.by.other),
recycle: json.rights[0].privileges.recycle && !(this.lock && this.lock.by.other),
share: json.rights[0].privileges.share && !(this.lock && this.lock.by.other),
};
} else {
this.rights = {
select: false,
edit: false,
delete: false,
finalize: false,
recycle: false,
share: false
};
}
if (json.shares) {
this.shares = json.shares;
}
// content section
if (json.contentid) {
this.content = {
id: json.contentid,
type: json.contenttype,
count: json.contentcount || 0,
linked: json.contentid !== json.id,
contents: json.contents
};
}
if (json.subscriptions) {
this.subscriptions = json.subscriptions;
}
if (json.resubmissions) {
this.resubmissions = json.resubmissions;
}
if (json.additionalvisibility) {
this.additionalvisibility = json.additionalvisibility;
}
}
}