- Source:
Methods
(async) commit() → {Promise.<EntryInfo>}
- Description:
Pushes the entry information to the repository, e.g. posts to basepath/{contextId}/entry/{entryId}
- Source:
Returns:
- Type
- Promise.<EntryInfo>
getACL(asIds) → {Object}
- Description:
The acl object returned looks like: { admin: [principalURI1, principalURI2, ...], rread: [principalURI3, ...], rwrite: [principalURI4, ...], mread: [principalURI5, ...], mwrite: [principalURI6, ...] }
There will always be an array for each key, it might be empty though. The principalURI* will always be an URI to the resource of a user or group entry.
Please note that a non empty acl overrides any defaults from the surrounding context.
- Source:
Parameters:
Name | Type | Default | Description |
---|---|---|---|
asIds |
boolean |
false
|
if true the principalURIs are shortened to entry identifiers. |
Returns:
an acl object.
- Type
- Object
getCachedExternalMetadataURI() → {String}
- Source:
Returns:
- Type
- String
getContributors() → {Array}
- Source:
Returns:
an array of URIs to the contributors using their Entry resource URIs, e.g. ["http://somerepo/_principals/resource/4"], never null although the array might be empty.
- Type
- Array
getCreationDate() → {Date}
- Source:
Returns:
the date when the entry was created.
- Type
- Date
getCreator() → {String}
- Source:
Returns:
a URI to creator, the user Entry resource URI is used, e.g. "http://somerepo/_principals/resource/4", never null.
- Type
- String
getEntry() → {Entry}
- Source:
Returns:
- Type
- Entry
getEntryType() → {String}
- Source:
- See:
-
- terms#entryType
Returns:
one of the entryTypes
- Type
- String
getEntryURI() → {String}
- Source:
Returns:
- Type
- String
getExternalMetadataURI() → {String}
- Source:
Returns:
- Type
- String
getFormat() → {string}
- Source:
Returns:
the format of the resource of this entry.
- Type
- string
getGraph() → {rdfjson/Graph}
- Source:
Returns:
- Type
- rdfjson/Graph
getGraphType() → {String}
- Description:
the graph type of the entry, e.g. "User", "List", "String", etc. The allowed values are available in types beginning with 'GT_'. E.g. to check if the entry is a list: if (ei.getGraphType() === types.GT_LIST) {...}
- Source:
Returns:
- Type
- String
getId() → {String}
- Source:
Returns:
the id of the entry
- Type
- String
getLabel() → {string}
- Source:
Returns:
the label of the resource of this entry, typically set when uploading a file.
- Type
- string
(async) getMetadataRevisionGraph(revisionURI) → {Promise.<rdfjson/Graph>}
- Description:
Retrieves the metadata graph of a certain revision from its graph.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
revisionURI |
Returns:
- Type
- Promise.<rdfjson/Graph>
getMetadataRevisions() → {Array.<{time: Date, by: string, rev: string, uri: string}>}
- Description:
Extracts an array of metadata revisions from the graph. Each revision is an object that contains:
- time - when the change was made (Date)
- by - the user who performed the change (entryURI)
- rev - the revision number (string)
- uri - an URI to this revision (string)
The uri of the revision can be used by the method getMetadataRevisionGraph to get a hold of the actual new graph that caused the revision.
- Source:
Returns:
a sorted array of revisions, latest revision first.
- Type
- Array.<{time: Date, by: string, rev: string, uri: string}>
getMetadataURI() → {String}
- Source:
Returns:
- Type
- String
getModificationDate() → {Date}
- Source:
Returns:
the date of last modification (according to the repository, local changes are not reflected).
- Type
- Date
getName() → {String}
- Description:
If the entry is a user, group or context there can be a name. In general the name is accessed on the resource, but in certain situations we do not have the resource yet(not loaded) but we still have the name (from a search where the name is provided but not the resource), in this case we can access this name here.
- Source:
Returns:
a username, groupname or contextname of the entry
- Type
- String
getResourceType() → {String}
- Description:
the resource type of the entry, e.g. "Information", "Resolvable" etc. The allowed values are available in types beginning with 'RT_'. E.g. to check if the entry is an information resource: if (ei.getResourceType() === types.RT_INFORMATIONRESOURCE) {...}
- Source:
Returns:
- Type
- String
getResourceURI() → {String}
- Source:
Returns:
- Type
- String
getSize() → {number|undefined}
- Source:
Returns:
- Type
- number | undefined
getStatus() → {string}
- Source:
Returns:
the status of this entry, always a URI.
- Type
- string
hasACL() → {boolean}
- Description:
if the entry has an explicit ACL or if the containing contexts ACL is used.
- Source:
Returns:
- Type
- boolean
hasMetadataRevisions() → {boolean}
- Description:
Checks if there are any metadata revisions for this entry, in practise this is always true if provenance is enabled for this entry.
- Source:
Returns:
true if there is at least one metadata revision.
- Type
- boolean
isDisabled() → {boolean}
- Description:
If the entry is a user there can be a disabled state. In general the disabled state is accessed on the resource, but in certain situations we do not have the resource yet(not loaded) but we still have the disabled state (from a search where the disabled state is provided but not the resource), in this case we can access the disabled state here.
- Source:
Returns:
a disabled state of a user
- Type
- boolean
setACL(acl)
- Description:
Replaces the current acl with the provided acl. The acl object is the same as you get from the getACL call. The first difference is that the acl object from this method is allowed to be empty or leave out some keys that are not to be set. The second difference is that it allows entryIds as values in the arrays, not only full resource URIs, both have to refer to principals though.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
acl |
Object | same kind of object you get from getACL. |
setExternalMetadataURI(uri)
- Source:
Parameters:
Name | Type | Description |
---|---|---|
uri |
String |
setFormat(format)
- Description:
Sets a new format of the resource in the graph, call commit to push the updated graph to the repository.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
format |
string | a format in the form application/json or text/plain. |
setGraph(graph)
- Source:
Parameters:
Name | Type | Description |
---|---|---|
graph |
rdfjson/Graph |
setLabel(label)
- Description:
Sets a new label of the resource in the graph, call commit to push the updated graph to the repository.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
label |
string | a new label for the resource. |
(protected) setModificationDate(date)
- Description:
A method to be used internally / within the library after modifying operations return successfull with a new modified date.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
date |
string |
setResourceURI(uri)
- Source:
Parameters:
Name | Type | Description |
---|---|---|
uri |
String |
setStatus(status)
- Description:
Sets a new status for this entry
- Source:
Parameters:
Name | Type | Description |
---|---|---|
status |
string |