Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions source/HOP-Core/HOPResourceRoute.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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
]

Expand Down Expand Up @@ -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 ] ]
]

Expand Down
2 changes: 1 addition & 1 deletion source/HOP-Core/HOPVariableSegment.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 10 additions & 0 deletions source/HOP-Core/Object.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -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 [

Expand Down
Loading