store/Context

Methods

getEntryById(entryId, optionalLoadParams) → {Promise.<Entry>}

Description:
  • Convenience method, to retrieve an entry from this context.

Source:
See:
  • EntryStore#getEntry
Parameters:
Name Type Description
entryId string
optionalLoadParams object

same parameter as in EntryStore#getEntry

Returns:
Type
Promise.<Entry>

getEntryURIbyId(entryId) → {string}

Description:
  • Expands the given entry id into a full URI.

Source:
Parameters:
Name Type Description
entryId string
Returns:

the URI for an entry in this context with the given id.

Type
string

(async) getHomeContextOf() → {Promise.<Entry>}

Description:
  • Finds the user or group that has this context as homecontext if any.

Source:
Returns:

if succeeds if context a homecontext of some user or group.

Type
Promise.<Entry>

getName() → {string}

Description:
  • The name for this context.

Source:
Returns:
Type
string

listEntries(sort, limit, page) → {Promise.<Array.<Entry>>}

Description:
  • Retrieves a list of entries in the context.

Source:
See:
  • EntryStore#getListEntries
Parameters:
Name Type Description
sort object

same sort object as provided in the optionalLoadParams to getEntry method.

limit object

same limit as provided in the optionalLoadParams to getEntry method.

page number

unless limit is set to -1 (no pagination) we need to specify which page to load, first page is 0.

Returns:

upon success the promise returns an array of entries.

Type
Promise.<Array.<Entry>>

newEntry(idopt) → {PrototypeEntry}

Description:
  • Factory method to create a PrototypeEntry that has the current context as container. Call commit on the PrototypeEntry to actually create it (returns a promise).

Source:
Parameters:
Name Type Attributes Description
id string <optional>

id for the entry, fails after commit if an entry exists already with this id.

Returns:
Type
PrototypeEntry

newGraph(graph, idopt) → {PrototypeEntry}

Description:
  • Factory method to create a PrototypeEntry whose resource is a Graph and has the current context as container. Call commit on the PrototypeEntry to actually create it (returns a promise).

Source:
Parameters:
Name Type Attributes Description
graph Graph | object

graph to store as a resource.

id string <optional>

id for the entry, fails upon commit if an entry exists already with this id.

Returns:
Type
PrototypeEntry
Description:
  • Factory method to create a PrototypeEntry that corresponds to a link that has the current context as container. Call commit on the PrototypeEntry to actually create it (returns a promise).

Source:
Parameters:
Name Type Attributes Description
link string

the URI for the resource we are making a link to, mandatory.

id string <optional>

id for the entry, fails after commit if an entry exists already with this id.

Returns:
Type
PrototypeEntry

newLinkRef(link, metadataLink, idopt) → {PrototypeEntry}

Description:
  • Factory method to create a PrototypeEntry that is a linkref that has the current context as container. Call commit on the PrototypeEntry to actually create it (returns a promise).

Source:
Parameters:
Name Type Attributes Description
link string

is the URI for the resource we are making a link to, mandatory.

metadataLink string

is the URI for the metadata are referring to, mandatory.

id string <optional>

id for the entry, fails after commit if an entry exists already with this id.

Returns:
Type
PrototypeEntry

newList(id) → {PrototypeEntry}

Description:
  • Factory method to create a PrototypeEntry whose resource is a List) and has the current context as container. Call commit on the PrototypeEntry to actually create it (returns a promise).

Source:
Parameters:
Name Type Description
id string

an optional id for the entry, fails on commit if an entry exists already with this id.

Returns:
Type
PrototypeEntry

newNamedEntry(idopt) → {PrototypeEntry

Description:
  • Factory method to create a PrototypeEntry that corresponds to a local named resource that has the current context as container. Call commit on the PrototypeEntry to actually create it (returns a promise).

Source:
Parameters:
Name Type Attributes Description
id string <optional>

id for the entry, fails after commit if an entry exists already with this id.

Returns:
Type
PrototypeEntry

newPipeline(id) → {PrototypeEntry}

Description:
  • Factory method to create a PrototypeEntry whose resource is a pipeline that has the current context as container. Call commit on the PrototypeEntry to actually create it (returns a promise).

Source:
Parameters:
Name Type Description
id string

an optional id for the entry, fails upon commit if an entry exists already with this id.

Returns:
Type
PrototypeEntry

newRef(link, metadataLink, idopt) → {PrototypeEntry}

Description:
  • Factory method to create a PrototypeEntry that is a reference and has the current context as container. Call commit on the PrototypeEntry to actually create it (returns a promise). The only difference to the newLinkRef method is that the EntryType is Reference instead of LinkReference which implies that there is no local metadata.

Source:
Parameters:
Name Type Attributes Description
link string

the URI for the resource we are making a link to, mandatory.

metadataLink string

the URI for the metadata are referring to, mandatory.

id string <optional>

for the entry, fails after commit if an entry exists already with this id.

Returns:
Type
PrototypeEntry

newString(stropt, id) → {PrototypeEntry}

Description:
  • Factory method to create a PrototypeEntry whose resource is a String that has the current context as container. Call commit on the PrototypeEntry to actually create it (returns a promise).

Source:
Parameters:
Name Type Attributes Description
str string <optional>

an optional string for the String Resource.

id string

an optional id for the entry, fails upon commit if an entry exists already with this id.

Returns:
Type
PrototypeEntry

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

Description:
  • Change of context name, succeeds if name is not in use already by another context.

Source:
Parameters:
Name Type Description
name string
Returns:
Type
Promise.<string>