src/lib/model/object-type.model.ts
Representation of an object type. Object types are defined with the system definition and describe different kind of objects that allowed to be created.
Properties |
Methods |
constructor(json: IObjectType)
|
||||||||
Defined in src/lib/model/object-type.model.ts:124
|
||||||||
Creates a new instance
Parameters :
|
Optional actualLabel |
actualLabel:
|
Type : string
|
Defined in src/lib/model/object-type.model.ts:124
|
allowedcontexttypes |
allowedcontexttypes:
|
Type : ContextType[]
|
Defined in src/lib/model/object-type.model.ts:111
|
List of context types this object type is allowed to be created in |
description |
description:
|
Type : string
|
Defined in src/lib/model/object-type.model.ts:98
|
Object types description |
elements |
elements:
|
Type : any[]
|
Defined in src/lib/model/object-type.model.ts:107
|
Elements are the properties defining the object type. Those elements are also used for defining a form model for the object types input form but (may) also contain hidden elements. |
group |
group:
|
Type : string
|
Defined in src/lib/model/object-type.model.ts:102
|
Object types can be grouped. This property holds the name of the group the current type belongs to |
iconId |
iconId:
|
Type : string
|
Defined in src/lib/model/object-type.model.ts:74
|
ID of the object types icon |
id |
id:
|
Type : string
|
Defined in src/lib/model/object-type.model.ts:53
|
Object types ID |
implements |
implements:
|
Type : string[]
|
Defined in src/lib/model/object-type.model.ts:57
|
List of all supertypes |
isAbstract |
isAbstract:
|
Type : boolean
|
Defined in src/lib/model/object-type.model.ts:70
|
Flag indicating whether or not the object type is an abstract type other types can inherit from |
isContextFolder |
isContextFolder:
|
Type : boolean
|
Defined in src/lib/model/object-type.model.ts:66
|
Flag indicating whether or not the object type is a context folder |
label |
label:
|
Type : string
|
Defined in src/lib/model/object-type.model.ts:94
|
Object types label |
maxFiles |
maxFiles:
|
Type : number
|
Defined in src/lib/model/object-type.model.ts:82
|
Maximum number of files to be attached to this type |
minFiles |
minFiles:
|
Type : number
|
Defined in src/lib/model/object-type.model.ts:78
|
Minimum number of files to be attached to this type |
name |
name:
|
Type : string
|
Defined in src/lib/model/object-type.model.ts:86
|
Object types internal name |
Optional parenttypes |
parenttypes:
|
Type : string[]
|
Defined in src/lib/model/object-type.model.ts:120
|
qname |
qname:
|
Type : string
|
Defined in src/lib/model/object-type.model.ts:90
|
Object types full qualified internal name |
shareable |
shareable:
|
Type : boolean
|
Defined in src/lib/model/object-type.model.ts:119
|
Flag indicating whether or not this object type can be shared |
supertypes |
supertypes:
|
Type : string[]
|
Defined in src/lib/model/object-type.model.ts:115
|
List of parent types the current type inherits from |
getParentTypes | ||||
getParentTypes(allowedlocations: )
|
||||
Defined in src/lib/model/object-type.model.ts:153
|
||||
Parameters :
Returns :
string[]
|
export interface IObjectType {
id: string;
implements?: string[];
folder: boolean;
iscontextfolder: boolean;
abstract: boolean;
icon?: any;
maxfiles: number;
minfiles: number;
name: string;
qname: string;
label: string;
description: string;
group?: any;
elements: any[];
allowedcontexttypes?: ContextType[];
supertypes?: any[];
shareable: boolean;
allowedlocations?: {
parenttypes: ParentTypes[];
};
}
/**
* @ignore
*/
export interface ParentTypes {
name: string;
count: string;
uri: string;
}
/**
* @ignore
*/
export interface ContextType {
name: string;
label: string;
description?: string;
}
/**
* Representation of an object type. Object types are defined with the system definition and describe
* different kind of objects that allowed to be created.
*/
export class ObjectType {
/**
* Object types ID
*/
id: string;
/**
* List of all supertypes
*/
implements: string[];
/**
* @ignore
* is basically the same as isContextFolder, because we do not allow other folders than context folder
*/
isFolder: boolean;
/**
* Flag indicating whether or not the object type is a context folder
*/
isContextFolder: boolean;
/**
* Flag indicating whether or not the object type is an abstract type other types can inherit from
*/
isAbstract: boolean;
/**
* ID of the object types icon
*/
iconId: string;
/**
* Minimum number of files to be attached to this type
*/
minFiles: number;
/**
* Maximum number of files to be attached to this type
*/
maxFiles: number;
/**
* Object types internal name
*/
name: string;
/**
* Object types full qualified internal name
*/
qname: string;
/**
* Object types label
*/
label: string;
/**
* Object types description
*/
description: string;
/**
* Object types can be grouped. This property holds the name of the group the current type belongs to
*/
group: string;
/**
* Elements are the properties defining the object type. Those elements are also used for defining a form model
* for the object types input form but (may) also contain hidden elements.
*/
elements: any[];
/**
* List of context types this object type is allowed to be created in
*/
allowedcontexttypes: ContextType[];
/**
* List of parent types the current type inherits from
*/
supertypes: string[];
/**
* Flag indicating whether or not this object type can be shared
*/
shareable: boolean;
parenttypes?: string[];
/*
* Represents the original label of the object type. Utilized for obtaining translated labels for specific qnames, such as 'sysdmscontenttemplate'.
*/
actualLabel?: string;
/**
* Creates a new instance
* @param json The JSON object received from the backend. This will be used to construct the new object type instance
*/
constructor(json: IObjectType) {
this.id = json.id;
this.implements = json.implements ? json.implements : [];
this.isFolder = json.folder;
this.isContextFolder = json.iscontextfolder;
this.isAbstract = json.abstract;
this.iconId = json.icon ? json.icon.id : null;
this.maxFiles = json.maxfiles;
this.minFiles = json.minfiles;
this.name = json.name;
this.qname = json.qname;
this.label = json.label;
this.description = json.description;
this.group = json.group ? json.group.label : "";
this.elements = json.elements;
this.allowedcontexttypes = json.allowedcontexttypes
? json.allowedcontexttypes
: [];
this.supertypes = json.supertypes ? json.supertypes.map(t => t.name) : [];
this.shareable = json.shareable;
this.parenttypes = this.getParentTypes(json.allowedlocations);
this.actualLabel = json.label;
}
getParentTypes(allowedlocations): string[] {
if (allowedlocations) {
return allowedlocations.parenttypes.map(types => types.name);
}
return [];
}
}