Skip to content

Commit 34bb449

Browse files
committed
Trial client implementation
1 parent 3369894 commit 34bb449

28 files changed

+809
-0
lines changed

.project

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
'srcDirectory' : 'src'
3+
}

src/.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
#format : #tonel
3+
}

src/Trias-Core-Tests/TriasResponseTest.class.st

Lines changed: 25 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Class {
2+
#name : #TriasTest,
3+
#superclass : #TestCase,
4+
#category : #'Trias-Core-Tests'
5+
}

src/Trias-Core-Tests/package.st

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Package { #name : #'Trias-Core-Tests' }

src/Trias-Core/Trias.class.st

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Class {
2+
#name : #Trias,
3+
#superclass : #Object,
4+
#instVars : [
5+
'locationResult',
6+
'schemas'
7+
],
8+
#classInstVars : [
9+
'current'
10+
],
11+
#category : #'Trias-Core'
12+
}
13+
14+
{ #category : #accessing }
15+
Trias class >> current [
16+
^ current ifNil: [
17+
current := self new ]
18+
]
19+
20+
{ #category : #accessing }
21+
Trias >> locationResult: aResult [
22+
locationResult := aResult
23+
]
24+
25+
{ #category : #accessing }
26+
Trias >> schemas: aXSDSchemaSet [
27+
schemas := aXSDSchemaSet
28+
]
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Class {
2+
#name : #TriasContentHandler,
3+
#superclass : #SAX2ContentHandler,
4+
#instVars : [
5+
'elementRootClass'
6+
],
7+
#category : #'Trias-Core'
8+
}
9+
10+
{ #category : #'as yet unclassified' }
11+
TriasContentHandler >> elementRootClass [
12+
^ TriasObject
13+
]
14+
15+
{ #category : #'handling - content' }
16+
TriasContentHandler >> startElement: element attributes: attributes [
17+
| o |
18+
o := (self elementRootClass elementWithName: element) new.
19+
(self parser = self parser parsingResult)
20+
ifTrue: [ self parser parsingResult: o ]
21+
ifFalse: [ self parser parsingResult perform: element with: o ]
22+
]
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Class {
2+
#name : #TriasDeliveryPayload,
3+
#superclass : #TriasObject,
4+
#instVars : [
5+
'locationInformationResponse'
6+
],
7+
#category : #'Trias-Core'
8+
}
9+
10+
{ #category : #'as yet unclassified' }
11+
TriasDeliveryPayload class >> xmlElementName [
12+
^ 'DeliveryPayload'
13+
]
14+
15+
{ #category : #accessing }
16+
TriasDeliveryPayload >> locationInformationResponse [
17+
^ locationInformationResponse
18+
]
19+
20+
{ #category : #accessing }
21+
TriasDeliveryPayload >> locationInformationResponse: aTriasLocationInformationResponse [
22+
locationInformationResponse := aTriasLocationInformationResponse
23+
]

src/Trias-Core/TriasElement.class.st

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Class {
2+
#name : #TriasElement,
3+
#superclass : #TriasObject,
4+
#instVars : [
5+
'serviceDelivery'
6+
],
7+
#category : #'Trias-Core'
8+
}
9+
10+
{ #category : #'as yet unclassified' }
11+
TriasElement class >> xmlElementName [
12+
^ 'Trias'
13+
]
14+
15+
{ #category : #accessing }
16+
TriasElement >> serviceDelivery [
17+
^ serviceDelivery
18+
]
19+
20+
{ #category : #'as yet unclassified' }
21+
TriasElement >> serviceDelivery: aTriasServiceDelivery [
22+
serviceDelivery := aTriasServiceDelivery
23+
]
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Class {
2+
#name : #TriasGeoPosition,
3+
#superclass : #TriasObject,
4+
#instVars : [
5+
'longitude',
6+
'latitude'
7+
],
8+
#category : #'Trias-Core'
9+
}
10+
11+
{ #category : #'as yet unclassified' }
12+
TriasGeoPosition class >> xmlElementName [
13+
^ 'GeoPosition'
14+
]
15+
16+
{ #category : #accessing }
17+
TriasGeoPosition >> latitude: aString [
18+
latitude := aString
19+
]
20+
21+
{ #category : #accessing }
22+
TriasGeoPosition >> longitude: aString [
23+
longitude := aString
24+
]
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Class {
2+
#name : #TriasInternationalText,
3+
#superclass : #TriasObject,
4+
#instVars : [
5+
'text',
6+
'language'
7+
],
8+
#category : #'Trias-Core'
9+
}
10+
11+
{ #category : #testing }
12+
TriasInternationalText class >> isAbstract [
13+
^ self == TriasInternationalText
14+
]
15+
16+
{ #category : #accessing }
17+
TriasInternationalText >> language: aString [
18+
language := aString
19+
]
20+
21+
{ #category : #printing }
22+
TriasInternationalText >> printOn: aStream [
23+
aStream << text asString
24+
]
25+
26+
{ #category : #accessing }
27+
TriasInternationalText >> text: aString [
28+
text := aString
29+
]

src/Trias-Core/TriasLocality.class.st

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Class {
2+
#name : #TriasLocality,
3+
#superclass : #TriasObject,
4+
#instVars : [
5+
'code',
6+
'name'
7+
],
8+
#category : #'Trias-Core'
9+
}
10+
11+
{ #category : #'as yet unclassified' }
12+
TriasLocality class >> xmlElementName [
13+
^ 'Locality'
14+
]
15+
16+
{ #category : #accessing }
17+
TriasLocality >> localityCode: aString [
18+
code := aString
19+
]
20+
21+
{ #category : #'as yet unclassified' }
22+
TriasLocality >> localityName: aTriasLocalityName [
23+
name := aTriasLocalityName
24+
]
25+
26+
{ #category : #printing }
27+
TriasLocality >> printOn: aStream [
28+
aStream << 'Locality: ' << name asString << ' (' << code asString << ')'
29+
]
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Class {
2+
#name : #TriasLocalityName,
3+
#superclass : #TriasInternationalText,
4+
#category : #'Trias-Core'
5+
}
6+
7+
{ #category : #'as yet unclassified' }
8+
TriasLocalityName class >> xmlElementName [
9+
^ 'LocalityName'
10+
]

src/Trias-Core/TriasLocation.class.st

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
Class {
2+
#name : #TriasLocation,
3+
#superclass : #TriasObject,
4+
#instVars : [
5+
'stopPoint',
6+
'name',
7+
'geoPosition',
8+
'locality',
9+
'poi'
10+
],
11+
#category : #'Trias-Core'
12+
}
13+
14+
{ #category : #'as yet unclassified' }
15+
TriasLocation class >> xmlElementName [
16+
^ 'Location'
17+
]
18+
19+
{ #category : #accessing }
20+
TriasLocation >> geoPosition: aTriasGeoPosition [
21+
geoPosition := aTriasGeoPosition
22+
]
23+
24+
{ #category : #accessing }
25+
TriasLocation >> locality: aTriasLocality [
26+
locality := aTriasLocality
27+
]
28+
29+
{ #category : #accessing }
30+
TriasLocation >> locationName: aTriasLocationName [
31+
name := aTriasLocationName
32+
]
33+
34+
{ #category : #'as yet unclassified' }
35+
TriasLocation >> pointOfInterest: aTriasPointOfInterest [
36+
poi := TriasPointOfInterest
37+
]
38+
39+
{ #category : #printing }
40+
TriasLocation >> printOn: aStream [
41+
aStream << 'Location: '.
42+
name printOn: aStream.
43+
locality ifNotNil: [ locality printOn: aStream ].
44+
stopPoint ifNotNil: [ stopPoint printOn: aStream ].
45+
poi ifNotNil: [ poi printOn: aStream ]
46+
]
47+
48+
{ #category : #accessing }
49+
TriasLocation >> stopPoint: aTriasStopPoint [
50+
stopPoint := aTriasStopPoint
51+
]
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
Class {
2+
#name : #TriasLocationInformationResponse,
3+
#superclass : #TriasObject,
4+
#instVars : [
5+
'locationResult',
6+
'locationResults'
7+
],
8+
#category : #'Trias-Core'
9+
}
10+
11+
{ #category : #'as yet unclassified' }
12+
TriasLocationInformationResponse class >> xmlElementName [
13+
^ 'LocationInformationResponse'
14+
]
15+
16+
{ #category : #accessing }
17+
TriasLocationInformationResponse >> locationResult: aTriasLocationResult [
18+
self locationResults add: aTriasLocationResult
19+
]
20+
21+
{ #category : #accessing }
22+
TriasLocationInformationResponse >> locationResults [
23+
^ locationResults ifNil: [
24+
locationResults := OrderedCollection new ].
25+
]
26+
27+
{ #category : #translating }
28+
TriasLocationInformationResponse >> translateName: aString [
29+
(aString = 'Location') ifTrue: [
30+
^ 'LocationResult' ].
31+
^ aString
32+
]
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Class {
2+
#name : #TriasLocationName,
3+
#superclass : #TriasInternationalText,
4+
#category : #'Trias-Core'
5+
}
6+
7+
{ #category : #'as yet unclassified' }
8+
TriasLocationName class >> xmlElementName [
9+
^ 'LocationName'
10+
]
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
Class {
2+
#name : #TriasLocationResult,
3+
#superclass : #TriasObject,
4+
#instVars : [
5+
'location',
6+
'complete',
7+
'probability',
8+
'mode'
9+
],
10+
#category : #'Trias-Core'
11+
}
12+
13+
{ #category : #'as yet unclassified' }
14+
TriasLocationResult class >> xmlElementName [
15+
^ 'LocationResult'
16+
]
17+
18+
{ #category : #accessing }
19+
TriasLocationResult >> complete: aString [
20+
complete := aString = 'true'
21+
]
22+
23+
{ #category : #'as yet unclassifiedtesting' }
24+
TriasLocationResult >> isNotComplete [
25+
^ complete not
26+
]
27+
28+
{ #category : #accessing }
29+
TriasLocationResult >> location [
30+
^ location
31+
]
32+
33+
{ #category : #'as yet unclassified' }
34+
TriasLocationResult >> location: aTriasLocation [
35+
location := aTriasLocation
36+
]
37+
38+
{ #category : #accessing }
39+
TriasLocationResult >> mode: aTriasMode [
40+
mode := aTriasMode
41+
]
42+
43+
{ #category : #printing }
44+
TriasLocationResult >> printOn: aStream [
45+
location printOn: aStream.
46+
aStream << ', complete: ' << complete asString
47+
]
48+
49+
{ #category : #accessing }
50+
TriasLocationResult >> probability: aString [
51+
probability := aString
52+
]

0 commit comments

Comments
 (0)