Defines baja.HistorySpace.
new (require("baja/hist/HistorySpace"))()
Represents a history:HistorySpace in BajaScript.
Extends:
Methods
-
clearAllRecords( [obj])
-
Clear records from the specified histories via their ORDs.
Parameters:
Name Type Argument Description objObject | String | Array | baja.Ord <optional>
The ORDs or object literal.
Properties
Name Type Argument Description ordsString | baja.Ord | Array An array of baja.Ord. Or an array
of ORD Strings. Or a single baja.Ord. Or a single String ORD.okfunction <optional>
(Deprecated: use Promise) Called once the
records have been successfully cleared.failfunction <optional>
(Deprecated: use Promise) Called if the
history devices fails to resolve.batchbaja.comm.Batch <optional>
if defined, any network calls will be
batched into this object.Returns:
A promise that's resolved once all of the records have
been cleared.- Type
- Promise
-
clearOldRecords( [obj])
-
Clear the history records before the specified absolute time.
Parameters:
Name Type Argument Description objObject | String | Array | baja.Ord <optional>
The ORDs or object literal.
Properties
Name Type Argument Description ordsString | baja.Ord | Array An array of baja.Ord. Or an array
of ORD Strings. Or a single baja.Ord. Or a single String ORD.beforebaja.AbsTime If the first argument is not an object
literal, the before date can be passed in as the second argument. The
before absolute time specifies the deletion range.okfunction <optional>
(Deprecated: use Promise) Called once the
records have been successfully cleared.failfunction <optional>
(Deprecated: use Promise) Called if the
history devices fails to resolve.batchbaja.comm.Batch <optional>
if defined, any network calls will be
batched into this object.Returns:
A promise that's resolved once all of the records have
been cleared.- Type
- Promise
-
deleteHistories( [obj])
-
Delete the specified histories.
Parameters:
Name Type Argument Description objObject | String | Array | baja.Ord <optional>
The ORDs or object literal.
Properties
Name Type Argument Description ordsString | baja.Ord | Array An array of baja.Ord. Or an array
of ORD Strings. Or a single baja.Ord. Or a single String ORD.okfunction <optional>
(Deprecated: use Promise) Called once the
records have been successfully cleared.failfunction <optional>
(Deprecated: use Promise) Called if the
history devices fails to resolve.batchbaja.comm.Batch <optional>
if defined, any network calls will be
batched into this object.Returns:
A promise that's resolved once all of the histories
have been deleted.- Type
- Promise
-
equals(obj)
-
Indicates whether some other object is equal to this one.
Parameters:
Name Type Description objObject the reference object with which to compare.
- Inherited From:
Returns:
true if this object is the same as the obj argument; false otherwise.
- Type
- Boolean
-
equivalent(obj)
-
Equivalence test.
equivalent()is used to compare if two Objects have equivalent
state, but might not want to return true for equals since it
it has implied semantics for many operations. The default
implementation returns the result of baja.Object#equals.Parameters:
Name Type Description obj- Inherited From:
Returns:
- Type
- Boolean
-
getAgents( [is] [, batch])
-
Returns a promise that resolves to the agent list for this Object.
Parameters:
Name Type Argument Description isArray.<String> <optional>
An optional array of filters to add to the
agent query.batchbaja.comm.Batch <optional>
An optional object used to batch network
calls together.- Inherited From:
- See:
Returns:
A promise that will resolve with the Agent Info.
- Type
- Promise
-
getIcon()
-
Return the Object's Icon.
- Inherited From:
Returns:
- Type
- baja.Icon
-
getNavChildren(obj)
-
Access the Nav Children.
Parameters:
Name Type Description objObject the Object Literal for the method's arguments.
Properties
Name Type Argument Description okfunction <optional>
(Deprecated: use Promise) called when we have
the Nav Children. An array of Nav Children is passed as an argument into
this function.failfunction <optional>
(Deprecated: use Promise) called if the
function fails to complete.- Inherited From:
Returns:
a promise that will be resolved
once the nav children have been retrieved.- Type
- Promise.<Array.<baja.NavNode>>
Example
container.getNavChildren() .then(function (kids) { baja.outln('retrieved nav children: ' + kids.join()); }) .catch(function (err) { baja.error('failed to retrieve nav children: ' + err); }); -
getNavDescription()
-
Return the Nav Description.
- Inherited From:
Returns:
- Type
- String
-
getNavDisplayName()
-
Return the Nav Display Name.
- Inherited From:
Returns:
- Type
- String
-
getNavIcon()
-
Return the Nav Icon for this node.
- Inherited From:
Returns:
- Type
- baja.Icon
-
getNavName()
-
Return the Nav Name.
- Inherited From:
Returns:
- Type
- String
-
getNavOrd( [params])
-
Return the Nav ORD.
If passing
sessionAware, the returned ORD may return session information
when BajaScript is running in Workbench (most commonly including the IP
address and fox|foxs schemes). Note that a session-aware ORD is not safe
to pass directly up to a station for resolution as in an RPC or servlet
call, as a station won't know how to open a FOX session to itself.Parameters:
Name Type Argument Description paramsobject <optional>
Properties
Name Type Argument Description sessionAwareboolean <optional>
include session information if
available- Inherited From:
Returns:
- Type
- baja.Ord
Examples
When running in Workbench, connected to a station at ip:1.2.3.4, session information can be retrieved.
console.log(services.getNavOrd()); // local:|station:|slot:/Services console.log(services.getNavOrd({ sessionAware: true }); // ip:1.2.3.4|fox:|station:|slot:/ServicesWhen running in a browser, session information is never present.
console.log(services.getNavOrd()); // local:|station:|slot:/Services console.log(services.getNavOrd({ sessionAware: true }); // local:|station:|slot:/Services -
getNavParent()
-
Return the Nav Parent (or null if there's no parent).
- Inherited From:
Returns:
- Type
- baja.NavContainer
-
getNavTypeSpec()
-
Return the type spec of object this nav node navigates too.
- Inherited From:
Returns:
The nav type spec.
- Type
- String
-
getType()
-
Get the type of this instance.
- Inherited From:
Returns:
- Type
- Type
-
getTypeDisplayName( [cx])
-
Gets the friendly type display name for this object.
Parameters:
Name Type Argument Description cxObject <optional>
a context to be passed down to Type
- Since:
-
- Niagara 4.10
- Inherited From:
- See:
-
- baja.Type#getDisplayName
Returns:
If no context is provided, the type
display name is returned synchronously as a string. If context provided,
the type display name is resolved via a promise as a string.- Type
- Promise.<string> | string
-
toString( [cx])
-
Returns the String representation of this Object.
When implementing
toString()on one of your own Objects, it should
adhere to the following contract.- When called with no arguments, it must return a string directly.
- It can also be called with an object literal. In this case, it may
return a Promise to be resolved with a string, or it may return a string
directly as normal. This case is sort of analogous to
javax.baja.sys.Localizable#toString(Context).
Therefore, when calling
toString()on an Object of unknown Type using an
object literal as an argument, it's important to wrap the call in
Promise.resolve().Parameters:
Name Type Argument Description cxObject <optional>
optional context information to be used when
formatting the string- Inherited From:
Returns:
a string (if no context passed), or
either a string or a Promise (if context passed).Examples
When no context is passed, toString() must always return a string directly.
var bool = comp.get('boolean'); baja.outln(bool.toString()); // 'false'When a context is passed, some Objects may return a Promise.
var bool = comp.get('boolean'); bool.toString({ trueText: 'Yes', falseText: 'No' }) .then(function (str) { baja.outln(str); // 'No' });If you don't know the type of the Object, use Promise.resolve() for safety.
var displayFacets = comp.get('displayFacets'), value = comp.get('value'); Promise.resolve(value.toString(displayFacets.toObject())) .then(function (str) { baja.outln(str); // formatted according to displayFacets }); -
valueOf()
-
Return the inner value of the object.
By default the object's instance is returned.
- Inherited From:
Returns:
the inner value of the object or just the object's instance.
- Type
- *