# Class: NoteShort

## NoteShort(froca, row)

FIXME: since there's no "full note" anymore we can rename this to Note This note's representation is used in note tree and is kept in Froca.

## Constructor

#### new NoteShort(froca, row)

##### Parameters:

Name | Type | Description
--- | --- | ---
`froca` | Froca |
`row` | Object.<string, Object> |

Source:
  - entities/note_short.js, line 28

### Members

#### attributes :Array.<string>

##### Type:

- Array.<string>

Source:
  - entities/note_short.js, line 37

#### children :Array.<string>

##### Type:

- Array.<string>

Source:
  - entities/note_short.js, line 45

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

##### Type:

- Object.<string, string>

Source:
  - entities/note_short.js, line 51

#### isProtected :boolean

##### Type:

- boolean

Source:
  - entities/note_short.js, line 62

#### mime :string

content-type, e.g. "application/json"

##### Type:

- string

Source:
  - entities/note_short.js, line 72

#### noteId :string

##### Type:

- string

Source:
  - entities/note_short.js, line 58

#### parents :Array.<string>

##### Type:

- Array.<string>

Source:
  - entities/note_short.js, line 43

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

##### Type:

- Object.<string, string>

Source:
  - entities/note_short.js, line 48

#### targetRelations :Array.<string>

##### Type:

- Array.<string>

Source:
  - entities/note_short.js, line 40

#### title :string

##### Type:

- string

Source:
  - entities/note_short.js, line 60

#### type :string

one of 'text', 'code', 'file' or 'render'

##### Type:

- string

Source:
  - entities/note_short.js, line 67

### Methods

#### getAttribute(type, name) → {Attribute}

##### Parameters:

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

Source:
  - entities/note_short.js, line 499

##### 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
  Attribute

#### getAttributes(typeopt, nameopt) → {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 237

##### Returns:

all note's attributes, including inherited ones

Type
  Array.<Attribute>

#### getAttributeValue(type, name) → {string}

##### Parameters:

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

Source:
  - entities/note_short.js, line 521

##### Returns:

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

Type
  string

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

Deprecated:
  - use getParentBranches() instead
Source:
  - entities/note_short.js, line 162

##### Returns:

Type
  Array.<Branch>

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

Deprecated:
  - use getParentBranchIds() instead
Source:
  - entities/note_short.js, line 145

##### Returns:

Type
  Array.<string>

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

Source:
  - entities/note_short.js, line 172

##### Returns:

Type
  Array.<Branch>

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

Source:
  - entities/note_short.js, line 210

##### Returns:

Type
  Array.<string>

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

Source:
  - entities/note_short.js, line 215

##### Returns:

Type
  Promise.<Array.<NoteShort>>

#### getLabel(name) → {Attribute}

##### Parameters:

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

Source:
  - entities/note_short.js, line 561

##### Returns:

label if it exists, null otherwise

Type
  Attribute

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

##### Parameters:

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

Source:
  - entities/note_short.js, line 385

##### Returns:

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

Type
  Array.<Attribute>

#### getLabelValue(name) → {string}

##### Parameters:

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

Source:
  - entities/note_short.js, line 585

##### Returns:

label value if label exists, null otherwise

Type
  string

#### (async) getNoteComplement() → {Promise.<NoteComplement>}

Return note complement which is most importantly note's content

Source:
  - entities/note_short.js, line 707

##### Returns:

Type
  Promise.<NoteComplement>

#### getOwnedAttribute(type, name) → {Attribute}

##### Parameters:

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

Source:
  - entities/note_short.js, line 488

##### 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
  Attribute

#### getOwnedAttributes(typeopt, nameopt) → {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 224

##### Returns:

all note's attributes, including inherited ones

Type
  Array.<Attribute>

#### getOwnedAttributeValue(type, name) → {string}

##### Parameters:

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

Source:
  - entities/note_short.js, line 510

##### Returns:

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

Type
  string

#### getOwnedLabel(name) → {Attribute}

##### Parameters:

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

Source:
  - entities/note_short.js, line 555

##### Returns:

label if it exists, null otherwise

Type
  Attribute

#### getOwnedLabels(nameopt) → {Array.<Attribute>}

##### Parameters:

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

Source:
  - entities/note_short.js, line 377

##### Returns:

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

Type
  Array.<Attribute>

#### getOwnedLabelValue(name) → {string}

##### Parameters:

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

Source:
  - entities/note_short.js, line 579

##### Returns:

label value if label exists, null otherwise

Type
  string

#### getOwnedRelation(name) → {Attribute}

##### Parameters:

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

Source:
  - entities/note_short.js, line 567

##### Returns:

relation if it exists, null otherwise

Type
  Attribute

#### getOwnedRelations(nameopt) → {Array.<Attribute>}

##### Parameters:

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

Source:
  - entities/note_short.js, line 453

##### Returns:

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

Type
  Array.<Attribute>

#### getOwnedRelationValue(name) → {string}

##### Parameters:

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

Source:
  - entities/note_short.js, line 591

##### Returns:

relation value if relation exists, null otherwise

Type
  string

#### getParentBranches() → {Array.<Branch>}

Source:
  - entities/note_short.js, line 152

##### Returns:

Type
  Array.<Branch>

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

Source:
  - entities/note_short.js, line 137

##### Returns:

Type
  Array.<string>

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

Source:
  - entities/note_short.js, line 180

##### Returns:

Type
  Array.<string>

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

Source:
  - entities/note_short.js, line 185

##### Returns:

Type
  Array.<NoteShort>

#### getRelation(name) → {Attribute}

##### Parameters:

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

Source:
  - entities/note_short.js, line 573

##### Returns:

relation if it exists, null otherwise

Type
  Attribute

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

##### Parameters:

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

Source:
  - entities/note_short.js, line 461

##### Returns:

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

Type
  Array.<Attribute>

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

##### Parameters:

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

Source:
  - entities/note_short.js, line 603

##### 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 613

##### Returns:

Type
  Promise.<Array.<NoteShort>>

#### getRelationValue(name) → {string}

##### Parameters:

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

Source:
  - entities/note_short.js, line 597

##### Returns:

relation value if relation exists, null otherwise

Type
  string

#### getScriptEnv() → {string|null}

Source:
  - entities/note_short.js, line 751

##### Returns:

JS script environment - either "frontend" or "backend"

Type
  string | null

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

Get relations which target this note

Source:
  - entities/note_short.js, line 686

##### Returns:

Type
  Array.<Attribute>

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

Get relations which target this note

Source:
  - entities/note_short.js, line 696

##### Returns:

Type
  Array.<NoteShort>

#### getTemplateNotes() → {Array.<NoteShort>}

Source:
  - entities/note_short.js, line 627

##### Returns:

Type
  Array.<NoteShort>

#### hasAttribute(type, name) → {boolean}

##### Parameters:

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

Source:
  - entities/note_short.js, line 470

##### Returns:

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

Type
  boolean

#### hasChildren() → {boolean}

Source:
  - entities/note_short.js, line 167

##### Returns:

Type
  boolean

#### hasLabel(name) → {boolean}

##### Parameters:

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

Source:
  - entities/note_short.js, line 537

##### Returns:

true if label exists (including inherited)

Type
  boolean

#### hasOwnedAttribute(type, name) → {boolean}

##### Parameters:

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

Source:
  - entities/note_short.js, line 479

##### Returns:

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

Type
  boolean

#### hasOwnedLabel(name) → {boolean}

##### Parameters:

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

Source:
  - entities/note_short.js, line 531

##### Returns:

true if label exists (excluding inherited)

Type
  boolean

#### hasOwnedRelation(name) → {boolean}

##### Parameters:

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

Source:
  - entities/note_short.js, line 543

##### Returns:

true if relation exists (excluding inherited)

Type
  boolean

#### hasRelation(name) → {boolean}

##### Parameters:

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

Source:
  - entities/note_short.js, line 549

##### Returns:

true if relation exists (including inherited)

Type
  boolean

#### invalidateAttributeCache()

Deprecated:
  - NOOP
Source:
  - entities/note_short.js, line 679

#### isHtml() → {boolean}

Source:
  - entities/note_short.js, line 746

##### Returns:

true if this note is HTML

Type
  boolean

#### isJavaScript() → {boolean}

Source:
  - entities/note_short.js, line 738

##### Returns:

true if this note is JavaScript (code or attachment)

Type
  boolean

#### isJson() → {boolean}

Source:
  - entities/note_short.js, line 110

##### Returns:

Type
  boolean