From 3fc8cbc60658f5e64a84cecec809edc28f7d7912 Mon Sep 17 00:00:00 2001 From: Norbert Hartl Date: Mon, 12 Oct 2026 16:19:36 +0200 Subject: [PATCH] Send extraReceiver instead of scope when a route continues at another resource Object>>extraReceiver answers the receiver itself; a resource that stands for another one, like a link of ApptiveGrid, answers that one. Before, HOP sent scope, which only ApptiveBase defined. Co-Authored-By: Claude Opus 5.5 --- source/HOP-Core/HOPResourceRoute.class.st | 10 +++++----- source/HOP-Core/HOPVariableSegment.class.st | 2 +- source/HOP-Core/Object.extension.st | 10 ++++++++++ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/source/HOP-Core/HOPResourceRoute.class.st b/source/HOP-Core/HOPResourceRoute.class.st index b775e62..cbecead 100644 --- a/source/HOP-Core/HOPResourceRoute.class.st +++ b/source/HOP-Core/HOPResourceRoute.class.st @@ -30,12 +30,12 @@ HOPResourceRoute >> initialize [ { #category : 'as yet unclassified' } HOPResourceRoute >> matchExtraPath [ - | scopedReceiver | + | extraReceiver | - scopedReceiver := self receiver scope. - ^ (routeMatch matchExtraPathIn: scopedReceiver) asResourceRoute + extraReceiver := self receiver extraReceiver. + ^ (routeMatch matchExtraPathIn: extraReceiver) asResourceRoute previous: self; - resourceAt: scopedReceiver resourceLabel put: scopedReceiver; + resourceAt: extraReceiver resourceLabel put: extraReceiver; yourself ] @@ -83,7 +83,7 @@ HOPResourceRoute >> previous: aResourceRoute [ HOPResourceRoute >> receiver [ ^ receiver ifNil: [ receiver := routeMatch receiverNode - ifNil: [ previous receiver scope ] + ifNil: [ previous receiver extraReceiver ] ifNotNil: [ :node | self resourceOfNode: node ] ] ] diff --git a/source/HOP-Core/HOPVariableSegment.class.st b/source/HOP-Core/HOPVariableSegment.class.st index febc030..36504c6 100644 --- a/source/HOP-Core/HOPVariableSegment.class.st +++ b/source/HOP-Core/HOPVariableSegment.class.st @@ -175,7 +175,7 @@ HOPVariableSegment >> segmentNameSelector: anObject [ HOPVariableSegment >> uriFor: aResource resourceRoute: resourceRoute [ | effectiveRoute | effectiveRoute := resourceRoute previous ifNil: [ resourceRoute ]. - ((aResource isIdenticalTo: effectiveRoute receiver) or: [aResource isIdenticalTo: effectiveRoute receiver scope ]) ifTrue: [ + ((aResource isIdenticalTo: effectiveRoute receiver) or: [aResource isIdenticalTo: effectiveRoute receiver extraReceiver ]) ifTrue: [ ^ effectiveRoute receiverSegments collect: [ :each | each segmentIn: effectiveRoute ] ]. ^ (super uriFor: aResource container resourceRoute: resourceRoute) diff --git a/source/HOP-Core/Object.extension.st b/source/HOP-Core/Object.extension.st index 1ad52bd..9240658 100644 --- a/source/HOP-Core/Object.extension.st +++ b/source/HOP-Core/Object.extension.st @@ -5,6 +5,16 @@ Object >> addToHOPNode: aNode [ ^ aNode addSegment: self asHOPSegment ] +{ #category : '*HOP-Core' } +Object >> extraReceiver [ + "the object a route continues to resolve its extra path at, see + HOPResourceRoute>>matchExtraPath. By default it is the receiver itself; a resource + that stands for another one (a link or a hook for the space it gives access to) + answers that one" + + ^ self +] + { #category : '*HOP-Core' } Object class >> hopExposedClasses [