mirror of
https://github.com/nasa/openmct.git
synced 2025-06-18 07:08:12 +00:00
[Persistence] Use identifierService from persistence
User identifierService from the persistence capability, for consistent interpretation of spaces associated with domain object identifiers.
This commit is contained in:
@ -44,12 +44,16 @@ define(
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @implements {Capability}
|
* @implements {Capability}
|
||||||
*/
|
*/
|
||||||
function PersistenceCapability(persistenceService, space, domainObject) {
|
function PersistenceCapability(
|
||||||
|
persistenceService,
|
||||||
|
identifierService,
|
||||||
|
domainObject
|
||||||
|
) {
|
||||||
// Cache modified timestamp
|
// Cache modified timestamp
|
||||||
this.modified = domainObject.getModel().modified;
|
this.modified = domainObject.getModel().modified;
|
||||||
|
|
||||||
this.domainObject = domainObject;
|
this.domainObject = domainObject;
|
||||||
this.space = space;
|
this.identifierService = identifierService;
|
||||||
this.persistenceService = persistenceService;
|
this.persistenceService = persistenceService;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -135,11 +139,8 @@ define(
|
|||||||
* be used to persist this object
|
* be used to persist this object
|
||||||
*/
|
*/
|
||||||
PersistenceCapability.prototype.getSpace = function () {
|
PersistenceCapability.prototype.getSpace = function () {
|
||||||
if (this.domainObject.getId().indexOf(":") !== -1) {
|
var id = this.domainObject.getId();
|
||||||
return this.domainObject.getId().split(":")[0];
|
return this.identifierService.parse(id).getSpace();
|
||||||
}
|
|
||||||
|
|
||||||
return this.space;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return PersistenceCapability;
|
return PersistenceCapability;
|
||||||
|
Reference in New Issue
Block a user