# Class: NoteShort

## NoteShort(treeCache, row, branches)

This note's representation is used in note tree and is kept in TreeCache.

## Constructor

#### new NoteShort(treeCache, row, branches)

##### Parameters:

Name | Type | Description
--- | --- | ---
`treeCache` | TreeCache |
`row` | Object.<string, Object> |
`branches` | Array.<Branch> | all relevant branches, i.e. where this note is either child or parent

Source:
  - entities/note_short.js, line 18

### Members

#### archived

Source:
  - entities/note_short.js, line 35

#### children :Array.<string>

##### Type:

- Array.<string>

Source:
  - entities/note_short.js, line 44

#### childToBranch :Object.<string, string>

##### Type:

- Object.<string, string>

Source:
  - entities/note_short.js, line 50

#### contentLength

Source:
  - entities/note_short.js, line 25

#### cssClass

Source:
  - entities/note_short.js, line 37

#### iconClass

Source:
  - entities/note_short.js, line 39

#### isDeleted

Source:
  - entities/note_short.js, line 33

#### isProtected

Source:
  - entities/note_short.js, line 27

#### mime

Source:
  - entities/note_short.js, line 31

#### noteId

Source:
  - entities/note_short.js, line 21

#### parents :Array.<string>

##### Type:

- Array.<string>

Source:
  - entities/note_short.js, line 42

#### parentToBranch :Object.<string, string>

##### Type:

- Object.<string, string>

Source:
  - entities/note_short.js, line 47

#### title

Source:
  - entities/note_short.js, line 23

#### type

Source:
  - entities/note_short.js, line 29

### Methods

#### (async) getAttribute(type, name) → {Promise.<Attribute>}

##### Parameters:

Name | Type | Description
--- | --- | ---
`type` | string | attribute type (label, relation, etc.)
`name` | string | attribute name

Source:
  - entities/note_short.js, line 227

##### Returns:

attribute of given type and name. If there's more such attributes, first is returned. Returns null if there's no such attribute belonging to this note.

Type
  Promise.<Attribute>

#### (async) getAttributes(typeopt, nameopt) → {Promise.<Array.<Attribute>>}

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`type` | string | <optional> | (optional) attribute type to filter
`name` | string | <optional> | (optional) attribute name to filter

Source:
  - entities/note_short.js, line 161

##### Returns:

all note's attributes, including inherited ones

Type
  Promise.<Array.<Attribute>>

#### (async) getAttributeValue(type, name) → {Promise.<string>}

##### Parameters:

Name | Type | Description
--- | --- | ---
`type` | string | attribute type (label, relation, etc.)
`name` | string | attribute name

Source:
  - entities/note_short.js, line 238

##### Returns:

attribute value of given type and name or null if no such attribute exists.

Type
  Promise.<string>

#### (async) getBranches() → {Promise.<Array.<Branch>>}

Source:
  - entities/note_short.js, line 117

##### Returns:

Type
  Promise.<Array.<Branch>>

#### (async) getChildBranches() → {Promise.<Array.<Branch>>}

Source:
  - entities/note_short.js, line 129

##### Returns:

Type
  Promise.<Array.<Branch>>

#### getChildNoteIds() → {Array.<string>}

Source:
  - entities/note_short.js, line 147

##### Returns:

Type
  Array.<string>

#### (async) getChildNotes() → {Promise.<Array.<NoteShort>>}

Source:
  - entities/note_short.js, line 152

##### Returns:

Type
  Promise.<Array.<NoteShort>>

#### (async) getLabel(name) → {Promise.<Attribute>}

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | string | label name

Source:
  - entities/note_short.js, line 260

##### Returns:

label if it exists, null otherwise

Type
  Promise.<Attribute>

#### (async) getLabelDefinitions(nameopt) → {Promise.<Array.<Attribute>>}

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`name` | string | <optional> | label name to filter

Source:
  - entities/note_short.js, line 193

##### Returns:

all note's label definitions, including inherited ones

Type
  Promise.<Array.<Attribute>>

#### (async) getLabels(nameopt) → {Promise.<Array.<Attribute>>}

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`name` | string | <optional> | label name to filter

Source:
  - entities/note_short.js, line 185

##### Returns:

all note's labels (attributes with type label), including inherited ones

Type
  Promise.<Array.<Attribute>>

#### (async) getLabelValue(name) → {Promise.<string>}

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | string | label name

Source:
  - entities/note_short.js, line 272

##### Returns:

label value if label exists, null otherwise

Type
  Promise.<string>

#### getParentNoteIds() → {Array.<string>}

Source:
  - entities/note_short.js, line 137

##### Returns:

Type
  Array.<string>

#### (async) getParentNotes() → {Promise.<Array.<NoteShort>>}

Source:
  - entities/note_short.js, line 142

##### Returns:

Type
  Promise.<Array.<NoteShort>>

#### (async) getRelation(name) → {Promise.<Attribute>}

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | string | relation name

Source:
  - entities/note_short.js, line 266

##### Returns:

relation if it exists, null otherwise

Type
  Promise.<Attribute>

#### (async) getRelationDefinitions(nameopt) → {Promise.<Array.<Attribute>>}

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`name` | string | <optional> | relation name to filter

Source:
  - entities/note_short.js, line 209

##### Returns:

all note's relation definitions including inherited ones

Type
  Promise.<Array.<Attribute>>

#### (async) getRelations(nameopt) → {Promise.<Array.<Attribute>>}

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`name` | string | <optional> | relation name to filter

Source:
  - entities/note_short.js, line 201

##### Returns:

all note's relations (attributes with type relation), including inherited ones

Type
  Promise.<Array.<Attribute>>

#### (async) getRelationTarget(name) → {Promise.<NoteShort>|null}

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | string |

Source:
  - entities/note_short.js, line 284

##### Returns:

target note of the relation or null (if target is empty or note was not found)

Type
  Promise.<NoteShort> | null

#### (async) getRelationTargets(nameopt) → {Promise.<Array.<NoteShort>>}

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`name` | string | <optional> | relation name to filter

Source:
  - entities/note_short.js, line 294

##### Returns:

Type
  Promise.<Array.<NoteShort>>

#### (async) getRelationValue(name) → {Promise.<string>}

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | string | relation name

Source:
  - entities/note_short.js, line 278

##### Returns:

relation value if relation exists, null otherwise

Type
  Promise.<string>

#### (async) getTargetRelations() → {Promise.<Array.<Attribute>>}

Get relations which target this note

Source:
  - entities/note_short.js, line 318

##### Returns:

Type
  Promise.<Array.<Attribute>>

#### (async) hasAttribute(type, name) → {Promise.<boolean>}

##### Parameters:

Name | Type | Description
--- | --- | ---
`type` | string | attribute type (label, relation, etc.)
`name` | string | attribute name

Source:
  - entities/note_short.js, line 218

##### Returns:

true if note has an attribute with given type and name (including inherited)

Type
  Promise.<boolean>

#### hasChildren() → {boolean}

Source:
  - entities/note_short.js, line 124

##### Returns:

Type
  boolean

#### (async) hasLabel(name) → {Promise.<boolean>}

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | string | label name

Source:
  - entities/note_short.js, line 248

##### Returns:

true if label exists (including inherited)

Type
  Promise.<boolean>

#### (async) hasRelation(name) → {Promise.<boolean>}

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | string | relation name

Source:
  - entities/note_short.js, line 254

##### Returns:

true if relation exists (including inherited)

Type
  Promise.<boolean>

#### invalidate__attributeCache()

Clear note's attributes cache to force fresh reload for next attribute request. Cache is note instance scoped.

Source:
  - entities/note_short.js, line 309

#### isJson() → {boolean}

Source:
  - entities/note_short.js, line 92

##### Returns:

Type
  boolean