From 27fd6d2ae59480c4cebcfd5f1c302f8fef9df970 Mon Sep 17 00:00:00 2001 From: Gabriel Omar Cotelli Date: Wed, 26 Jun 2024 14:37:18 -0300 Subject: [PATCH 1/4] Add localization support setting the appropiate Locale for the requests including an Accept-Language header --- ...anCurrenciesRESTfulControllerTest.class.st | 64 ++++++-- ...ericanCurrenciesRESTfulController.class.st | 137 ++++++++---------- .../HttpRequestContext.class.st | 6 + .../RESTfulRequestHandlerBehavior.class.st | 113 +++++++++------ 4 files changed, 184 insertions(+), 136 deletions(-) diff --git a/source/Stargate-Examples-Tests/SouthAmericanCurrenciesRESTfulControllerTest.class.st b/source/Stargate-Examples-Tests/SouthAmericanCurrenciesRESTfulControllerTest.class.st index ced337f..5f6a546 100644 --- a/source/Stargate-Examples-Tests/SouthAmericanCurrenciesRESTfulControllerTest.class.st +++ b/source/Stargate-Examples-Tests/SouthAmericanCurrenciesRESTfulControllerTest.class.st @@ -39,6 +39,30 @@ SouthAmericanCurrenciesRESTfulControllerTest >> languageRange [ ^ 'de,en;q=0.5,es;q=0.6' ] +{ #category : 'private' } +SouthAmericanCurrenciesRESTfulControllerTest >> performTest [ + + self + use: [ :translator | + translator + translationFor: 'Argentine peso' in: 'es-AR' is: 'Peso'; + translationFor: 'Bolivian boliviano' in: 'es-AR' is: 'Boliviano'; + translationFor: 'Brazilian real' in: 'es-AR' is: 'Real brasileño'; + translationFor: 'Chilean peso' in: 'es-AR' is: 'Peso chileno'; + translationFor: 'Colombian peso' in: 'es-AR' is: 'Peso colombiano'; + translationFor: 'Guyanese dollar' in: 'es-AR' is: 'Dólar guyanés'; + translationFor: 'Paraguayan guaraní' in: 'es-AR' is: 'Guaraní'; + translationFor: 'Peruvian sol' in: 'es-AR' is: 'Sol'; + translationFor: 'Surinamese dollar' in: 'es-AR' is: 'Dólar surinamés'; + translationFor: 'Uruguayan peso' in: 'es-AR' is: 'Peso uruguayo'; + translationFor: 'Venezuelan bolívar soberano' in: 'es-AR' is: 'Bolívar'; + translationFor: '{1} was not found in the system' + in: 'es-AR' + is: 'No se encontró {1} en el sistema' + ] + asNaturalLanguageTranslatorDuring: [ super performTest ] +] + { #category : 'running' } SouthAmericanCurrenciesRESTfulControllerTest >> setUpResourceController [ @@ -54,7 +78,7 @@ SouthAmericanCurrenciesRESTfulControllerTest >> spanish [ { #category : 'private - language ranges' } SouthAmericanCurrenciesRESTfulControllerTest >> supportedLanguages [ - ^ Array with: self argentineSpanish with: self unitedStatesEnglish + ^ { self argentineSpanish . self unitedStatesEnglish } ] { #category : 'tests' } @@ -447,14 +471,36 @@ SouthAmericanCurrenciesRESTfulControllerTest >> testGetCurrenciesInSpanish [ { #category : 'tests' } SouthAmericanCurrenciesRESTfulControllerTest >> testGetCurrencyNotFoundShouldFail [ - self - should: [ - resourceController - currencyBasedOn: ( self requestToGETResourceIdentifiedBy: 'ZZZ' accepting: '*/*' ) - within: self newHttpRequestContext - ] - raise: HTTPClientError - withExceptionDo: [ :error | self assert: error code equals: 404 ] + self + should: [ + resourceController + currencyBasedOn: ( self requestToGETResourceIdentifiedBy: 'ZZZ' accepting: '*/*' ) + within: self newHttpRequestContext + ] + raise: HTTPClientError + withExceptionDo: [ :error | + self + assert: error code equals: 404; + assert: error messageText equals: 'ZZZ was not found in the system' + ] +] + +{ #category : 'tests' } +SouthAmericanCurrenciesRESTfulControllerTest >> testGetCurrencyNotFoundShouldFailInSpanish [ + + self + should: [ + | request | + request := self requestToGETResourceIdentifiedBy: 'ZZZ' accepting: '*/*'. + request setAcceptLanguage: self spanish. + resourceController currencyBasedOn: request within: self newHttpRequestContext + ] + raise: HTTPClientError + withExceptionDo: [ :error | + self + assert: error code equals: 404; + assert: error messageText equals: 'No se encontró ZZZ en el sistema' + ] ] { #category : 'tests' } diff --git a/source/Stargate-Examples/SouthAmericanCurrenciesRESTfulController.class.st b/source/Stargate-Examples/SouthAmericanCurrenciesRESTfulController.class.st index 017885e..2a81c68 100644 --- a/source/Stargate-Examples/SouthAmericanCurrenciesRESTfulController.class.st +++ b/source/Stargate-Examples/SouthAmericanCurrenciesRESTfulController.class.st @@ -11,7 +11,7 @@ Class { 'banknotesByCurrency', 'banknotesRequestHandler', 'currenciesRequestHandler', - 'currenciesByLanguage' + 'currencies' ], #category : 'Stargate-Examples-Currencies', #package : 'Stargate-Examples', @@ -27,21 +27,7 @@ SouthAmericanCurrenciesRESTfulController >> banknotesTemplate [ { #category : 'API' } SouthAmericanCurrenciesRESTfulController >> currenciesBasedOn: httpRequest within: requestContext [ - ^ currenciesRequestHandler - from: httpRequest - within: requestContext - getCollection: [ self currenciesInLanguageAt: requestContext ] -] - -{ #category : 'private' } -SouthAmericanCurrenciesRESTfulController >> currenciesInLanguageAt: requestContext [ - - | targetLanguage | - - targetLanguage := [ requestContext targetLanguageTag ] - on: NotFound - do: [ :error | error return: 'en-US' asLanguageTag ]. - ^ currenciesByLanguage at: targetLanguage + ^ currenciesRequestHandler from: httpRequest within: requestContext getCollection: [ currencies ] ] { #category : 'API' } @@ -56,14 +42,12 @@ SouthAmericanCurrenciesRESTfulController >> currencyBanknotesBasedOn: httpReques { #category : 'API' } SouthAmericanCurrenciesRESTfulController >> currencyBasedOn: httpRequest within: requestContext [ - ^ currenciesRequestHandler - from: httpRequest - within: requestContext - get: [ :isoCode | - ( self currenciesInLanguageAt: requestContext ) - detect: [ :currency | currency isoCode = isoCode ] - ifNone: [ NotFound signal ] - ] + ^ currenciesRequestHandler from: httpRequest within: requestContext get: [ :isoCode | + currencies + detect: [ :currency | currency isoCode = isoCode ] + ifNone: [ + NotFound signal: ( '{1} was not found in the system' localizedWithAll: { isoCode } ) ] + ] ] { #category : 'private' } @@ -158,66 +142,61 @@ SouthAmericanCurrenciesRESTfulController >> initializeBanknotesRequestHandler [ { #category : 'initialization' } SouthAmericanCurrenciesRESTfulController >> initializeCurrencies [ - currenciesByLanguage := Dictionary new - at: 'en-US' asLanguageTag - put: - ( OrderedCollection new - add: ( self currencyNamed: 'Argentine peso' symbol: '$' isoCode: 'ARS' ); - add: ( self currencyNamed: 'Bolivian boliviano' symbol: 'Bs.' isoCode: 'BOB' ); - add: ( self currencyNamed: 'Brazilian real' symbol: 'R$' isoCode: 'BRL' ); - add: ( self currencyNamed: 'Chilean peso' symbol: '$' isoCode: 'CLP' ); - add: ( self currencyNamed: 'Colombian peso' symbol: '$' isoCode: 'COP' ); - add: ( self currencyNamed: 'Guyanese dollar' symbol: '$' isoCode: 'GYD' ); - add: ( self currencyNamed: 'Paraguayan guaraní' symbol: '₲' isoCode: 'PYG' ); - add: ( self currencyNamed: 'Peruvian sol' symbol: 'S/.' isoCode: 'PEN' ); - add: ( self currencyNamed: 'Surinamese dollar' symbol: '$' isoCode: 'SRD' ); - add: ( self currencyNamed: 'Uruguayan peso' symbol: '$' isoCode: 'UYU' ); - add: ( self currencyNamed: 'Venezuelan bolívar soberano' symbol: 'Bs.S' isoCode: 'VES' ); - asArray ); - at: 'es-AR' asLanguageTag - put: - ( OrderedCollection new - add: ( self currencyNamed: 'Peso' symbol: '$' isoCode: 'ARS' ); - add: ( self currencyNamed: 'Boliviano' symbol: 'Bs.' isoCode: 'BOB' ); - add: ( self currencyNamed: 'Real brasileño' symbol: 'R$' isoCode: 'BRL' ); - add: ( self currencyNamed: 'Peso chileno' symbol: '$' isoCode: 'CLP' ); - add: ( self currencyNamed: 'Peso colombiano' symbol: '$' isoCode: 'COP' ); - add: ( self currencyNamed: 'Dólar guyanés' symbol: '$' isoCode: 'GYD' ); - add: ( self currencyNamed: 'Guaraní' symbol: '₲' isoCode: 'PYG' ); - add: ( self currencyNamed: 'Sol' symbol: 'S/.' isoCode: 'PEN' ); - add: ( self currencyNamed: 'Dólar surinamés' symbol: '$' isoCode: 'SRD' ); - add: ( self currencyNamed: 'Peso uruguayo' symbol: '$' isoCode: 'UYU' ); - add: ( self currencyNamed: 'Bolívar' symbol: 'Bs.S' isoCode: 'VES' ); - asArray ); - yourself + currencies := OrderedCollection new + add: ( self currencyNamed: 'Argentine peso' symbol: '$' isoCode: 'ARS' ); + add: ( self currencyNamed: 'Bolivian boliviano' symbol: 'Bs.' isoCode: 'BOB' ); + add: ( self currencyNamed: 'Brazilian real' symbol: 'R$' isoCode: 'BRL' ); + add: ( self currencyNamed: 'Chilean peso' symbol: '$' isoCode: 'CLP' ); + add: ( self currencyNamed: 'Colombian peso' symbol: '$' isoCode: 'COP' ); + add: ( self currencyNamed: 'Guyanese dollar' symbol: '$' isoCode: 'GYD' ); + add: ( self currencyNamed: 'Paraguayan guaraní' symbol: '₲' isoCode: 'PYG' ); + add: ( self currencyNamed: 'Peruvian sol' symbol: 'S/.' isoCode: 'PEN' ); + add: ( self currencyNamed: 'Surinamese dollar' symbol: '$' isoCode: 'SRD' ); + add: ( self currencyNamed: 'Uruguayan peso' symbol: '$' isoCode: 'UYU' ); + add: + ( self + currencyNamed: 'Venezuelan bolívar soberano' + symbol: 'Bs.S' + isoCode: 'VES' ); + asArray ] { #category : 'initialization' } SouthAmericanCurrenciesRESTfulController >> initializeCurrenciesRequestHandler [ - currenciesRequestHandler := RESTfulRequestHandlerBuilder new - handling: 'currencies' - extractingIdentifierWith: [ :httpRequest | self identifierIn: httpRequest ]; - whenResponding: self currencyVersion1dot0dot0MediaType - encodeToJsonApplying: - [ :resource :requestContext :writer | writer for: StargateCurrency do: [ :mapping | mapping mapInstVars ] ]; - createEntityTagHashing: [ :hasher :currency :requestContext | - hasher - include: currency name; - include: currency symbol; - include: currency isoCode - ]; - handleExceptionsApplying: [ :handler | handler addAsNotFoundError: NotFound ]; - directCachingWith: [ :caching | - caching - beImmutable; - when: [ :response :resource | resource isCollection ] apply: [ caching beStaleAfter: 1 day ]; - when: [ :response :resource | resource isCollection not and: [ resource symbol = '$' ] ] - apply: [ caching bePublic ] - ]; - addAsSupportedLanguage: 'en-US'; - addAsSupportedLanguage: 'es-AR'; - build + currenciesRequestHandler := RESTfulRequestHandlerBuilder new + handling: 'currencies' + extractingIdentifierWith: [ :httpRequest | + self identifierIn: httpRequest ]; + whenResponding: self currencyVersion1dot0dot0MediaType + encodeToJsonApplying: [ :resource :requestContext :writer | + writer for: StargateCurrency do: [ :mapping | + mapping + mapInstVars: #( #symbol #isoCode ); + mapProperty: #name + getter: [ :currency | currency name localized ] + ] + ]; + createEntityTagHashing: [ :hasher :currency :requestContext | + hasher + include: currency name localized; + include: currency symbol; + include: currency isoCode + ]; + handleExceptionsApplying: [ :handler | + handler addAsNotFoundError: NotFound ]; + directCachingWith: [ :caching | + caching + beImmutable; + when: [ :response :resource | resource isCollection ] + apply: [ caching beStaleAfter: 1 day ]; + when: [ :response :resource | + resource isCollection not and: [ resource symbol = '$' ] ] + apply: [ caching bePublic ] + ]; + addAsSupportedLanguage: 'en-US'; + addAsSupportedLanguage: 'es-AR'; + build ] { #category : 'private' } diff --git a/source/Stargate-Model/HttpRequestContext.class.st b/source/Stargate-Model/HttpRequestContext.class.st index 17a50c3..f05aa7f 100644 --- a/source/Stargate-Model/HttpRequestContext.class.st +++ b/source/Stargate-Model/HttpRequestContext.class.st @@ -139,3 +139,9 @@ HttpRequestContext >> withTargetLanguageTagDo: aBlock [ knownObjects at: #targetLanguageTag ifPresent: aBlock ] + +{ #category : 'accessing' } +HttpRequestContext >> withTargetLanguageTagDo: aBlock ifNone: noneBlock [ + + ^ knownObjects at: #targetLanguageTag ifPresent: aBlock ifAbsent: noneBlock +] diff --git a/source/Stargate-Model/RESTfulRequestHandlerBehavior.class.st b/source/Stargate-Model/RESTfulRequestHandlerBehavior.class.st index 93bf63f..c42c271 100644 --- a/source/Stargate-Model/RESTfulRequestHandlerBehavior.class.st +++ b/source/Stargate-Model/RESTfulRequestHandlerBehavior.class.st @@ -138,33 +138,36 @@ RESTfulRequestHandlerBehavior >> exceptionHandler [ { #category : 'API' } RESTfulRequestHandlerBehavior >> from: httpRequest within: requestContext get: aQueryEvaluationBlock [ - | resource response | - - self holdTargetMediaTypeAndLanguageFrom: httpRequest within: requestContext. - resource := resourceLocator - lookupResourceIdentifiedBy: httpRequest - evaluating: aQueryEvaluationBlock. - self - ifNoneMatchHeaderPresentIn: httpRequest - do: [ :etag | - etag - = ( self entityTagOf: resource encodedAs: requestContext targetMediaType within: requestContext ) - ifTrue: [ response := ZnResponse notModified. - response - setEntityTag: etag; - addToVary: 'Accept'. - self - applyCachingDirectivesFor: resource to: response within: requestContext; - putLanguageContentTagIn: response within: requestContext. - ^ response - ] - ]. - response := ZnResponse ok: ( self encodeResource: resource within: requestContext ). - self putEntityTagOf: resource in: response within: requestContext. - self - applyCachingDirectivesFor: resource to: response within: requestContext; - putLanguageContentTagIn: response within: requestContext. - ^ response + self holdTargetMediaTypeAndLanguageFrom: httpRequest within: requestContext. + ^ self useTargetLanguageTagIn: requestContext asCurrentLocaleDuring: [ + | resource response | + resource := resourceLocator + lookupResourceIdentifiedBy: httpRequest + evaluating: aQueryEvaluationBlock. + self ifNoneMatchHeaderPresentIn: httpRequest do: [ :etag | + | calculatedEtag | + calculatedEtag := self + entityTagOf: resource + encodedAs: requestContext targetMediaType + within: requestContext. + etag = calculatedEtag ifTrue: [ + response := ZnResponse notModified. + response + setEntityTag: etag; + addToVary: 'Accept'. + self + applyCachingDirectivesFor: resource to: response within: requestContext; + putLanguageContentTagIn: response within: requestContext. + ^ response + ] + ]. + response := ZnResponse ok: ( self encodeResource: resource within: requestContext ). + self putEntityTagOf: resource in: response within: requestContext. + self + applyCachingDirectivesFor: resource to: response within: requestContext; + putLanguageContentTagIn: response within: requestContext. + response + ] ] { #category : 'API' } @@ -210,21 +213,24 @@ RESTfulRequestHandlerBehavior >> from: httpRequest within: requestContext get: f { #category : 'API' } RESTfulRequestHandlerBehavior >> from: httpRequest within: requestContext getCollection: aQueryEvaluationBlock [ - | resourceCollection encodedResourceCollection response | - - self holdTargetMediaTypeAndLanguageFrom: httpRequest within: requestContext. - resourceCollection := paginationPolicy evaluateQuery: aQueryEvaluationBlock basedOn: httpRequest. - encodedResourceCollection := self - encodeResourceCollection: resourceCollection - basedOn: httpRequest - within: requestContext. - response := ZnResponse ok: encodedResourceCollection. - response addToVary: 'Accept'. - self paginationPolicy affect: response within: requestContext. - self - applyCachingDirectivesFor: resourceCollection to: response within: requestContext; - putLanguageContentTagIn: response within: requestContext. - ^ response + self holdTargetMediaTypeAndLanguageFrom: httpRequest within: requestContext. + ^ self useTargetLanguageTagIn: requestContext asCurrentLocaleDuring: [ + | resourceCollection encodedResourceCollection response | + resourceCollection := paginationPolicy + evaluateQuery: aQueryEvaluationBlock + basedOn: httpRequest. + encodedResourceCollection := self + encodeResourceCollection: resourceCollection + basedOn: httpRequest + within: requestContext. + response := ZnResponse ok: encodedResourceCollection. + response addToVary: 'Accept'. + self paginationPolicy affect: response within: requestContext. + self + applyCachingDirectivesFor: resourceCollection to: response within: requestContext; + putLanguageContentTagIn: response within: requestContext. + response + ] ] { #category : 'private' } @@ -319,6 +325,14 @@ RESTfulRequestHandlerBehavior >> serverUrl: aServerUrl [ resourceLocator baseUrl: aServerUrl ] +{ #category : 'private' } +RESTfulRequestHandlerBehavior >> useTargetLanguageTagIn: httpRequestContext asCurrentLocaleDuring: aBlock [ + + ^ httpRequestContext + withTargetLanguageTagDo: [ :language | CurrentLocale use: language during: aBlock ] + ifNone: aBlock +] + { #category : 'API' } RESTfulRequestHandlerBehavior >> withRepresentationIn: httpRequest within: requestContext createResourceWith: aCreationBlock thenDo: aBlock [ @@ -334,10 +348,13 @@ RESTfulRequestHandlerBehavior >> withRepresentationIn: httpRequest within: reque { #category : 'API' } RESTfulRequestHandlerBehavior >> withResourceCreatedFrom: httpRequest within: requestContext do: aBlock [ - | creationPolicy decodedRepresentation newResource | - - creationPolicy := self resourceCreationPolicyBasedOn: httpRequest within: requestContext. - decodedRepresentation := self decode: httpRequest within: requestContext. - newResource := self exceptionHandler handleConflictsDuring: [ aBlock value: decodedRepresentation ]. - ^ creationPolicy responseFor: newResource basedOn: httpRequest within: requestContext + | creationPolicy | + creationPolicy := self resourceCreationPolicyBasedOn: httpRequest within: requestContext. + ^ self useTargetLanguageTagIn: requestContext asCurrentLocaleDuring: [ + | decodedRepresentation newResource | + decodedRepresentation := self decode: httpRequest within: requestContext. + newResource := self exceptionHandler handleConflictsDuring: [ + aBlock value: decodedRepresentation ]. + creationPolicy responseFor: newResource basedOn: httpRequest within: requestContext + ] ] From 8a032c817e39ef72ce6952a26dac6141950bf68b Mon Sep 17 00:00:00 2001 From: Gabriel Omar Cotelli Date: Wed, 26 Jun 2024 14:50:36 -0300 Subject: [PATCH 2/4] Improve currencies example controller --- ...outhAmericanCurrenciesRESTfulController.class.st | 13 +++++-------- source/Stargate-Examples/StargateCurrency.class.st | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/source/Stargate-Examples/SouthAmericanCurrenciesRESTfulController.class.st b/source/Stargate-Examples/SouthAmericanCurrenciesRESTfulController.class.st index 2a81c68..62c015c 100644 --- a/source/Stargate-Examples/SouthAmericanCurrenciesRESTfulController.class.st +++ b/source/Stargate-Examples/SouthAmericanCurrenciesRESTfulController.class.st @@ -170,16 +170,13 @@ SouthAmericanCurrenciesRESTfulController >> initializeCurrenciesRequestHandler [ self identifierIn: httpRequest ]; whenResponding: self currencyVersion1dot0dot0MediaType encodeToJsonApplying: [ :resource :requestContext :writer | - writer for: StargateCurrency do: [ :mapping | - mapping - mapInstVars: #( #symbol #isoCode ); - mapProperty: #name - getter: [ :currency | currency name localized ] - ] - ]; + writer + for: StargateCurrency + do: [ :mapping | + mapping mapAccessors: #( #symbol #isoCode #name ) ] ]; createEntityTagHashing: [ :hasher :currency :requestContext | hasher - include: currency name localized; + include: currency name; include: currency symbol; include: currency isoCode ]; diff --git a/source/Stargate-Examples/StargateCurrency.class.st b/source/Stargate-Examples/StargateCurrency.class.st index 68aebc9..3b2ef77 100644 --- a/source/Stargate-Examples/StargateCurrency.class.st +++ b/source/Stargate-Examples/StargateCurrency.class.st @@ -37,7 +37,7 @@ StargateCurrency >> isoCode [ { #category : 'accessing' } StargateCurrency >> name [ - ^ name + ^ name localized ] { #category : 'accessing' } From d832eb91bf34d19db8be0944e4d74a1ba93c58f5 Mon Sep 17 00:00:00 2001 From: Gabriel Omar Cotelli Date: Fri, 28 Jun 2024 17:15:11 -0300 Subject: [PATCH 3/4] Add localization support for method used in implementation of DELETE routes --- .../RESTfulRequestHandlerBehavior.class.st | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/source/Stargate-Model/RESTfulRequestHandlerBehavior.class.st b/source/Stargate-Model/RESTfulRequestHandlerBehavior.class.st index c42c271..1f32d22 100644 --- a/source/Stargate-Model/RESTfulRequestHandlerBehavior.class.st +++ b/source/Stargate-Model/RESTfulRequestHandlerBehavior.class.st @@ -173,13 +173,16 @@ RESTfulRequestHandlerBehavior >> from: httpRequest within: requestContext get: a { #category : 'API' } RESTfulRequestHandlerBehavior >> from: httpRequest within: requestContext get: aQueryEvaluationBlock thenDo: actionBlock [ - | resource | + self holdTargetLanguageFrom: httpRequest within: requestContext. - resource := resourceLocator - lookupResourceIdentifiedBy: httpRequest - evaluating: aQueryEvaluationBlock. - self exceptionHandler handleConflictsDuring: [ actionBlock value: resource ]. - ^ ZnResponse noContent + ^ self useTargetLanguageTagIn: requestContext asCurrentLocaleDuring: [ + | resource | + resource := resourceLocator + lookupResourceIdentifiedBy: httpRequest + evaluating: aQueryEvaluationBlock. + self exceptionHandler handleConflictsDuring: [ actionBlock value: resource ]. + ZnResponse noContent + ] ] { #category : 'API' } @@ -233,13 +236,19 @@ RESTfulRequestHandlerBehavior >> from: httpRequest within: requestContext getCol ] ] +{ #category : 'private' } +RESTfulRequestHandlerBehavior >> holdTargetLanguageFrom: httpRequest within: requestContext [ + + httpRequest hasLanguageProrityList then: [ + requestContext targetLanguageTag: ( acceptNegotiator bestLanguageFor: httpRequest ) ] +] + { #category : 'private' } RESTfulRequestHandlerBehavior >> holdTargetMediaTypeAndLanguageFrom: httpRequest within: requestContext [ - httpRequest hasLanguageProrityList - then: [ requestContext targetLanguageTag: ( acceptNegotiator bestLanguageFor: httpRequest ) ]. + self holdTargetLanguageFrom: httpRequest within: requestContext. - ^ requestContext targetMediaType: ( acceptNegotiator bestRepresentationFor: httpRequest ) + ^ requestContext targetMediaType: ( acceptNegotiator bestRepresentationFor: httpRequest ) ] { #category : 'private' } From 492ed48c8a04de90cb8a4fff37daea2f3d6479ea Mon Sep 17 00:00:00 2001 From: Gabriel Omar Cotelli Date: Fri, 19 Jul 2024 13:09:35 -0300 Subject: [PATCH 4/4] Update dependencies --- rowan/projects/Hyperspace.ston | 2 +- rowan/projects/JRPC.ston | 2 +- rowan/projects/JSONWebToken.ston | 2 +- rowan/projects/Launchpad.ston | 2 +- rowan/projects/SortFunctions.ston | 2 +- rowan/projects/Teapot.ston | 2 +- .../BaselineOfStargate/BaselineOfStargate.class.st | 12 ++++++------ 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/rowan/projects/Hyperspace.ston b/rowan/projects/Hyperspace.ston index 6d08130..2a213c0 100644 --- a/rowan/projects/Hyperspace.ston +++ b/rowan/projects/Hyperspace.ston @@ -2,7 +2,7 @@ RwLoadSpecificationV2 { #specName: 'Hyperspace', #projectName : 'Hyperspace', #gitUrl : 'https://github.com/ba-st/Hyperspace.git', - #revision : 'v5', + #revision : 'v6', #projectSpecFile : 'rowan/project.ston', #componentNames : [ 'Deployment', diff --git a/rowan/projects/JRPC.ston b/rowan/projects/JRPC.ston index 195e287..9e29e9a 100644 --- a/rowan/projects/JRPC.ston +++ b/rowan/projects/JRPC.ston @@ -2,7 +2,7 @@ RwLoadSpecificationV2 { #specName: 'JRPC', #projectName : 'JRPC', #gitUrl : 'https://github.com/ba-st-dependencies/JRPC.git', - #revision : 'v4', + #revision : 'v5', #projectSpecFile : 'rowan/project.ston', #componentNames : [ 'Deployment' diff --git a/rowan/projects/JSONWebToken.ston b/rowan/projects/JSONWebToken.ston index 836ee5d..111a2c9 100644 --- a/rowan/projects/JSONWebToken.ston +++ b/rowan/projects/JSONWebToken.ston @@ -2,7 +2,7 @@ RwLoadSpecificationV2 { #specName: 'JSONWebToken', #projectName : 'JSONWebToken', #gitUrl : 'https://github.com/ba-st-dependencies/JSONWebToken.git', - #revision : 'v1', + #revision : 'v2', #projectSpecFile : 'rowan/project.ston', #componentNames : [ 'Deployment' diff --git a/rowan/projects/Launchpad.ston b/rowan/projects/Launchpad.ston index a49052b..147fee4 100644 --- a/rowan/projects/Launchpad.ston +++ b/rowan/projects/Launchpad.ston @@ -2,7 +2,7 @@ RwLoadSpecificationV2 { #specName: 'Launchpad', #projectName : 'Launchpad', #gitUrl : 'https://github.com/ba-st/Launchpad.git', - #revision : 'v5', + #revision : 'v6', #projectSpecFile : 'rowan/project.ston', #componentNames : [ 'Deployment', diff --git a/rowan/projects/SortFunctions.ston b/rowan/projects/SortFunctions.ston index c008dc2..7783b17 100644 --- a/rowan/projects/SortFunctions.ston +++ b/rowan/projects/SortFunctions.ston @@ -2,7 +2,7 @@ RwLoadSpecificationV2 { #specName: 'SortFunctions', #projectName : 'SortFunctions', #gitUrl : 'https://github.com/ba-st-dependencies/SortFunctions.git', - #revision : 'v1', + #revision : 'v2', #projectSpecFile : 'rowan/project.ston', #componentNames : [ 'Deployment' diff --git a/rowan/projects/Teapot.ston b/rowan/projects/Teapot.ston index c7e86b5..8a290b4 100644 --- a/rowan/projects/Teapot.ston +++ b/rowan/projects/Teapot.ston @@ -2,7 +2,7 @@ RwLoadSpecificationV2 { #specName: 'Teapot', #projectName : 'Teapot', #gitUrl : 'https://github.com/ba-st-dependencies/Teapot.git', - #revision : 'v2', + #revision : 'v3', #projectSpecFile : 'rowan/project.ston', #componentNames : [ 'Deployment' diff --git a/source/BaselineOfStargate/BaselineOfStargate.class.st b/source/BaselineOfStargate/BaselineOfStargate.class.st index eb1ff30..21745f4 100644 --- a/source/BaselineOfStargate/BaselineOfStargate.class.st +++ b/source/BaselineOfStargate/BaselineOfStargate.class.st @@ -76,12 +76,12 @@ BaselineOfStargate >> setUpCorePackages: spec [ BaselineOfStargate >> setUpDependencies: spec [ spec - baseline: 'Buoy' with: [ spec repository: 'github://ba-st/Buoy:v7' ]; + baseline: 'Buoy' with: [ spec repository: 'github://ba-st/Buoy:v8' ]; project: 'Buoy-Deployment' copyFrom: 'Buoy' with: [ spec loads: 'Deployment' ]; project: 'Buoy-SUnit' copyFrom: 'Buoy' with: [ spec loads: 'Dependent-SUnit-Extensions' ]. spec - baseline: 'Hyperspace' with: [ spec repository: 'github://ba-st/Hyperspace:v5' ]; + baseline: 'Hyperspace' with: [ spec repository: 'github://ba-st/Hyperspace:v6' ]; project: 'Hyperspace-Deployment' copyFrom: 'Hyperspace' with: [ spec loads: 'Deployment' ]; project: 'Hyperspace-Tools' copyFrom: 'Hyperspace' with: [ spec loads: 'Tools' ]; project: 'Hyperspace-SUnit' @@ -89,19 +89,19 @@ BaselineOfStargate >> setUpDependencies: spec [ with: [ spec loads: 'Dependent-SUnit-Extensions' ]. spec - baseline: 'Teapot' with: [ spec repository: 'github://ba-st-dependencies/Teapot:v2' ]; + baseline: 'Teapot' with: [ spec repository: 'github://ba-st-dependencies/Teapot:v3' ]; project: 'Teapot-Deployment' copyFrom: 'Teapot' with: [ spec loads: 'Deployment' ]. spec - baseline: 'JSONWebToken' with: [ spec repository: 'github://ba-st-dependencies/JSONWebToken:v1' ]; + baseline: 'JSONWebToken' with: [ spec repository: 'github://ba-st-dependencies/JSONWebToken:v2' ]; project: 'JSONWebToken-Deployment' copyFrom: 'JSONWebToken' with: [ spec loads: 'SSL' ]. spec - baseline: 'JRPC' with: [ spec repository: 'github://ba-st-dependencies/JRPC:v4' ]; + baseline: 'JRPC' with: [ spec repository: 'github://ba-st-dependencies/JRPC:v5' ]; project: 'JRPC-Deployment' copyFrom: 'JRPC' with: [ spec loads: 'Server-Deployment' ]. spec - baseline: 'Launchpad' with: [ spec repository: 'github://ba-st/Launchpad:v5' ]; + baseline: 'Launchpad' with: [ spec repository: 'github://ba-st/Launchpad:v6' ]; project: 'Launchpad-Deployment' copyFrom: 'Launchpad' with: [ spec loads: 'Deployment' ]; project: 'Launchpad-SUnit' copyFrom: 'Launchpad' with: [ spec loads: 'Dependent-SUnit-Extensions' ] ]