Merge remote-tracking branch 'origin/open987' into open-master
This commit is contained in:
@@ -28,7 +28,7 @@ define(
|
||||
editableObject,
|
||||
domainObject,
|
||||
cache,
|
||||
true // Not idempotent
|
||||
true // Idempotent
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
/*global define*/
|
||||
|
||||
|
||||
define(
|
||||
['./EditableLookupCapability'],
|
||||
function (EditableLookupCapability) {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Wrapper for the "relationship" capability;
|
||||
* ensures that any domain objects reachable in Edit mode
|
||||
* are also wrapped as EditableDomainObjects.
|
||||
*
|
||||
* Meant specifically for use by EditableDomainObject and the
|
||||
* associated cache; the constructor signature is particular
|
||||
* to a pattern used there and may contain unused arguments.
|
||||
*/
|
||||
return function EditableRelationshipCapability(
|
||||
relationshipCapability,
|
||||
editableObject,
|
||||
domainObject,
|
||||
cache
|
||||
) {
|
||||
// This is a "lookup" style capability (it looks up other
|
||||
// domain objects), but we do not want to return the same
|
||||
// specific value every time (composition may change)
|
||||
return new EditableLookupCapability(
|
||||
relationshipCapability,
|
||||
editableObject,
|
||||
domainObject,
|
||||
cache,
|
||||
false // Not idempotent
|
||||
);
|
||||
};
|
||||
}
|
||||
);
|
||||
@@ -14,6 +14,7 @@ define(
|
||||
'../capabilities/EditablePersistenceCapability',
|
||||
'../capabilities/EditableContextCapability',
|
||||
'../capabilities/EditableCompositionCapability',
|
||||
'../capabilities/EditableRelationshipCapability',
|
||||
'../capabilities/EditorCapability',
|
||||
'./EditableDomainObjectCache'
|
||||
],
|
||||
@@ -21,6 +22,7 @@ define(
|
||||
EditablePersistenceCapability,
|
||||
EditableContextCapability,
|
||||
EditableCompositionCapability,
|
||||
EditableRelationshipCapability,
|
||||
EditorCapability,
|
||||
EditableDomainObjectCache
|
||||
) {
|
||||
@@ -30,6 +32,7 @@ define(
|
||||
persistence: EditablePersistenceCapability,
|
||||
context: EditableContextCapability,
|
||||
composition: EditableCompositionCapability,
|
||||
relationship: EditableRelationshipCapability,
|
||||
editor: EditorCapability
|
||||
};
|
||||
|
||||
@@ -64,7 +67,10 @@ define(
|
||||
// Override certain capabilities
|
||||
editableObject.getCapability = function (name) {
|
||||
var delegateArguments = getDelegateArguments(name, arguments),
|
||||
capability = domainObject.getCapability.apply(this, delegateArguments),
|
||||
capability = domainObject.getCapability.apply(
|
||||
this,
|
||||
delegateArguments
|
||||
),
|
||||
factory = capabilityFactories[name];
|
||||
|
||||
return (factory && capability) ?
|
||||
|
||||
Reference in New Issue
Block a user