Skip to content

Commit a3c156a

Browse files
committed
CSW Query can have more than one sortby clause
1 parent 862573d commit a3c156a

File tree

9 files changed

+133
-70
lines changed

9 files changed

+133
-70
lines changed

modules/unsupported/csw/net.opengis.csw/csw.genmodel

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
<genDataTypes ecoreDataType="csw20.ecore#//QName"/>
3030
<genDataTypes ecoreDataType="csw20.ecore#//Duration"/>
3131
<genDataTypes ecoreDataType="csw20.ecore#//Map"/>
32+
<genDataTypes ecoreDataType="csw20.ecore#//SortByArray"/>
3233
<genClasses image="false" ecoreClass="csw20.ecore#//AbstractQueryType"/>
3334
<genClasses image="false" ecoreClass="csw20.ecore#//AbstractRecordType"/>
3435
<genClasses ecoreClass="csw20.ecore#//AcknowledgementType">
@@ -149,7 +150,7 @@
149150
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference csw20.ecore#//QueryType/elementSetName"/>
150151
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute csw20.ecore#//QueryType/elementName"/>
151152
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference csw20.ecore#//QueryType/constraint"/>
152-
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference csw20.ecore#//QueryType/sortBy"/>
153+
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EAttribute csw20.ecore#//QueryType/sortBy"/>
153154
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute csw20.ecore#//QueryType/typeNames"/>
154155
</genClasses>
155156
<genClasses ecoreClass="csw20.ecore#//RangeOfValuesType">

modules/unsupported/csw/net.opengis.csw/csw20.ecore

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -678,14 +678,7 @@
678678
<details key="namespace" value="##targetNamespace"/>
679679
</eAnnotations>
680680
</eStructuralFeatures>
681-
<eStructuralFeatures xsi:type="ecore:EReference" name="sortBy" eType="#//SortBy"
682-
containment="true" resolveProxies="false">
683-
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
684-
<details key="kind" value="element"/>
685-
<details key="name" value="SortBy"/>
686-
<details key="namespace" value="http://www.opengis.net/ogc"/>
687-
</eAnnotations>
688-
</eStructuralFeatures>
681+
<eStructuralFeatures xsi:type="ecore:EAttribute" name="sortBy" eType="#//SortByArray"/>
689682
<eStructuralFeatures xsi:type="ecore:EAttribute" name="typeNames" lowerBound="1"
690683
eType="#//TypeNameListType_1">
691684
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
@@ -1288,4 +1281,5 @@
12881281
<eClassifiers xsi:type="ecore:EDataType" name="QName" instanceClassName="javax.xml.namespace.QName"/>
12891282
<eClassifiers xsi:type="ecore:EDataType" name="Duration" instanceClassName="javax.xml.datatype.Duration"/>
12901283
<eClassifiers xsi:type="ecore:EDataType" name="Map" instanceClassName="java.util.Map"/>
1284+
<eClassifiers xsi:type="ecore:EDataType" name="SortByArray" instanceClassName="org.opengis.filter.sort.SortBy[]"/>
12911285
</ecore:EPackage>

modules/unsupported/csw/net.opengis.csw/src/main/java/net/opengis/cat/csw20/Csw20Package.java

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1543,7 +1543,7 @@ public interface Csw20Package extends EPackage {
15431543
int QUERY_TYPE__CONSTRAINT = ABSTRACT_QUERY_TYPE_FEATURE_COUNT + 2;
15441544

15451545
/**
1546-
* The feature id for the '<em><b>Sort By</b></em>' containment reference.
1546+
* The feature id for the '<em><b>Sort By</b></em>' attribute.
15471547
* <!-- begin-user-doc -->
15481548
* <!-- end-user-doc -->
15491549
* @generated
@@ -2551,6 +2551,16 @@ public interface Csw20Package extends EPackage {
25512551
int MAP = 57;
25522552

25532553

2554+
/**
2555+
* The meta object id for the '<em>Sort By Array</em>' data type.
2556+
* <!-- begin-user-doc -->
2557+
* <!-- end-user-doc -->
2558+
* @see net.opengis.cat.csw20.impl.Csw20PackageImpl#getSortByArray()
2559+
* @generated
2560+
*/
2561+
int SORT_BY_ARRAY = 58;
2562+
2563+
25542564
/**
25552565
* Returns the meta object for class '{@link net.opengis.cat.csw20.AbstractQueryType <em>Abstract Query Type</em>}'.
25562566
* <!-- begin-user-doc -->
@@ -3592,15 +3602,15 @@ public interface Csw20Package extends EPackage {
35923602
EReference getQueryType_Constraint();
35933603

35943604
/**
3595-
* Returns the meta object for the containment reference '{@link net.opengis.cat.csw20.QueryType#getSortBy <em>Sort By</em>}'.
3605+
* Returns the meta object for the attribute '{@link net.opengis.cat.csw20.QueryType#getSortBy <em>Sort By</em>}'.
35963606
* <!-- begin-user-doc -->
35973607
* <!-- end-user-doc -->
3598-
* @return the meta object for the containment reference '<em>Sort By</em>'.
3608+
* @return the meta object for the attribute '<em>Sort By</em>'.
35993609
* @see net.opengis.cat.csw20.QueryType#getSortBy()
36003610
* @see #getQueryType()
36013611
* @generated
36023612
*/
3603-
EReference getQueryType_SortBy();
3613+
EAttribute getQueryType_SortBy();
36043614

36053615
/**
36063616
* Returns the meta object for the attribute '{@link net.opengis.cat.csw20.QueryType#getTypeNames <em>Type Names</em>}'.
@@ -4565,6 +4575,16 @@ public interface Csw20Package extends EPackage {
45654575
*/
45664576
EDataType getMap();
45674577

4578+
/**
4579+
* Returns the meta object for data type '<em>Sort By Array</em>'.
4580+
* <!-- begin-user-doc -->
4581+
* <!-- end-user-doc -->
4582+
* @return the meta object for data type '<em>Sort By Array</em>'.
4583+
* @model instanceClass="org.opengis.filter.sort.SortBy[]"
4584+
* @generated
4585+
*/
4586+
EDataType getSortByArray();
4587+
45684588
/**
45694589
* Returns the factory that creates the instances of the model.
45704590
* <!-- begin-user-doc -->
@@ -5418,12 +5438,12 @@ interface Literals {
54185438
EReference QUERY_TYPE__CONSTRAINT = eINSTANCE.getQueryType_Constraint();
54195439

54205440
/**
5421-
* The meta object literal for the '<em><b>Sort By</b></em>' containment reference feature.
5441+
* The meta object literal for the '<em><b>Sort By</b></em>' attribute feature.
54225442
* <!-- begin-user-doc -->
54235443
* <!-- end-user-doc -->
54245444
* @generated
54255445
*/
5426-
EReference QUERY_TYPE__SORT_BY = eINSTANCE.getQueryType_SortBy();
5446+
EAttribute QUERY_TYPE__SORT_BY = eINSTANCE.getQueryType_SortBy();
54275447

54285448
/**
54295449
* The meta object literal for the '<em><b>Type Names</b></em>' attribute feature.
@@ -6199,6 +6219,15 @@ interface Literals {
61996219
*/
62006220
EDataType MAP = eINSTANCE.getMap();
62016221

6222+
/**
6223+
* The meta object literal for the '<em>Sort By Array</em>' data type.
6224+
* <!-- begin-user-doc -->
6225+
* <!-- end-user-doc -->
6226+
* @see net.opengis.cat.csw20.impl.Csw20PackageImpl#getSortByArray()
6227+
* @generated
6228+
*/
6229+
EDataType SORT_BY_ARRAY = eINSTANCE.getSortByArray();
6230+
62026231
}
62036232

62046233
} //Csw20Package

modules/unsupported/csw/net.opengis.csw/src/main/java/net/opengis/cat/csw20/QueryType.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,21 +126,19 @@ public interface QueryType extends AbstractQueryType {
126126
* @return the value of the '<em>Sort By</em>' containment reference.
127127
* @see #setSortBy(SortBy)
128128
* @see net.opengis.cat.csw20.Csw20Package#getQueryType_SortBy()
129-
* @model type="net.opengis.cat.csw20.SortBy" containment="true"
130-
* extendedMetaData="kind='element' name='SortBy' namespace='http://www.opengis.net/ogc'"
131-
* @generated
129+
* @model
132130
*/
133-
SortBy getSortBy();
131+
SortBy[] getSortBy();
134132

135133
/**
136-
* Sets the value of the '{@link net.opengis.cat.csw20.QueryType#getSortBy <em>Sort By</em>}' containment reference.
134+
* Sets the value of the '{@link net.opengis.cat.csw20.QueryType#getSortBy <em>Sort By</em>}' attribute.
137135
* <!-- begin-user-doc -->
138136
* <!-- end-user-doc -->
139-
* @param value the new value of the '<em>Sort By</em>' containment reference.
137+
* @param value the new value of the '<em>Sort By</em>' attribute.
140138
* @see #getSortBy()
141139
* @generated
142140
*/
143-
void setSortBy(SortBy value);
141+
void setSortBy(SortBy[] value);
144142

145143
/**
146144
* Returns the value of the '<em><b>Type Names</b></em>' attribute.

modules/unsupported/csw/net.opengis.csw/src/main/java/net/opengis/cat/csw20/impl/Csw20FactoryImpl.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
import org.eclipse.emf.ecore.impl.EFactoryImpl;
6666

6767
import org.eclipse.emf.ecore.plugin.EcorePlugin;
68+
import org.opengis.filter.sort.SortBy;
6869

6970
/**
7071
* <!-- begin-user-doc -->
@@ -187,6 +188,8 @@ public Object createFromString(EDataType eDataType, String initialValue) {
187188
return createDurationFromString(eDataType, initialValue);
188189
case Csw20Package.MAP:
189190
return createMapFromString(eDataType, initialValue);
191+
case Csw20Package.SORT_BY_ARRAY:
192+
return createSortByArrayFromString(eDataType, initialValue);
190193
default:
191194
throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
192195
}
@@ -226,6 +229,8 @@ public String convertToString(EDataType eDataType, Object instanceValue) {
226229
return convertDurationToString(eDataType, instanceValue);
227230
case Csw20Package.MAP:
228231
return convertMapToString(eDataType, instanceValue);
232+
case Csw20Package.SORT_BY_ARRAY:
233+
return convertSortByArrayToString(eDataType, instanceValue);
229234
default:
230235
throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
231236
}
@@ -851,6 +856,24 @@ public String convertMapToString(EDataType eDataType, Object instanceValue) {
851856
return super.convertToString(eDataType, instanceValue);
852857
}
853858

859+
/**
860+
* <!-- begin-user-doc -->
861+
* <!-- end-user-doc -->
862+
* @generated
863+
*/
864+
public SortBy[] createSortByArrayFromString(EDataType eDataType, String initialValue) {
865+
return (SortBy[])super.createFromString(initialValue);
866+
}
867+
868+
/**
869+
* <!-- begin-user-doc -->
870+
* <!-- end-user-doc -->
871+
* @generated
872+
*/
873+
public String convertSortByArrayToString(EDataType eDataType, Object instanceValue) {
874+
return super.convertToString(instanceValue);
875+
}
876+
854877
/**
855878
* <!-- begin-user-doc -->
856879
* <!-- end-user-doc -->

modules/unsupported/csw/net.opengis.csw/src/main/java/net/opengis/cat/csw20/impl/Csw20PackageImpl.java

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,13 @@ public class Csw20PackageImpl extends EPackageImpl implements Csw20Package {
495495
*/
496496
private EDataType mapEDataType = null;
497497

498+
/**
499+
* <!-- begin-user-doc -->
500+
* <!-- end-user-doc -->
501+
* @generated
502+
*/
503+
private EDataType sortByArrayEDataType = null;
504+
498505
/**
499506
* Creates an instance of the model <b>Package</b>, registered with
500507
* {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
@@ -1437,8 +1444,8 @@ public EReference getQueryType_Constraint() {
14371444
* <!-- end-user-doc -->
14381445
* @generated
14391446
*/
1440-
public EReference getQueryType_SortBy() {
1441-
return (EReference)queryTypeEClass.getEStructuralFeatures().get(3);
1447+
public EAttribute getQueryType_SortBy() {
1448+
return (EAttribute)queryTypeEClass.getEStructuralFeatures().get(3);
14421449
}
14431450

14441451
/**
@@ -2242,6 +2249,15 @@ public EDataType getMap() {
22422249
return mapEDataType;
22432250
}
22442251

2252+
/**
2253+
* <!-- begin-user-doc -->
2254+
* <!-- end-user-doc -->
2255+
* @generated
2256+
*/
2257+
public EDataType getSortByArray() {
2258+
return sortByArrayEDataType;
2259+
}
2260+
22452261
/**
22462262
* <!-- begin-user-doc -->
22472263
* <!-- end-user-doc -->
@@ -2393,7 +2409,7 @@ public void createPackageContents() {
23932409
createEReference(queryTypeEClass, QUERY_TYPE__ELEMENT_SET_NAME);
23942410
createEAttribute(queryTypeEClass, QUERY_TYPE__ELEMENT_NAME);
23952411
createEReference(queryTypeEClass, QUERY_TYPE__CONSTRAINT);
2396-
createEReference(queryTypeEClass, QUERY_TYPE__SORT_BY);
2412+
createEAttribute(queryTypeEClass, QUERY_TYPE__SORT_BY);
23972413
createEAttribute(queryTypeEClass, QUERY_TYPE__TYPE_NAMES);
23982414

23992415
rangeOfValuesTypeEClass = createEClass(RANGE_OF_VALUES_TYPE);
@@ -2505,6 +2521,7 @@ public void createPackageContents() {
25052521
qNameEDataType = createEDataType(QNAME);
25062522
durationEDataType = createEDataType(DURATION);
25072523
mapEDataType = createEDataType(MAP);
2524+
sortByArrayEDataType = createEDataType(SORT_BY_ARRAY);
25082525
}
25092526

25102527
/**
@@ -2679,7 +2696,7 @@ public void initializePackageContents() {
26792696
initEReference(getQueryType_ElementSetName(), this.getElementSetNameType(), null, "elementSetName", null, 0, 1, QueryType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
26802697
initEAttribute(getQueryType_ElementName(), this.getQName(), "elementName", null, 0, -1, QueryType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
26812698
initEReference(getQueryType_Constraint(), this.getQueryConstraintType(), null, "constraint", null, 0, 1, QueryType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
2682-
initEReference(getQueryType_SortBy(), this.getSortBy(), null, "sortBy", null, 0, 1, QueryType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
2699+
initEAttribute(getQueryType_SortBy(), this.getSortByArray(), "sortBy", null, 0, 1, QueryType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
26832700
initEAttribute(getQueryType_TypeNames(), this.getTypeNameListType_1(), "typeNames", null, 1, 1, QueryType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
26842701

26852702
initEClass(rangeOfValuesTypeEClass, RangeOfValuesType.class, "RangeOfValuesType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
@@ -2798,6 +2815,7 @@ public void initializePackageContents() {
27982815
initEDataType(qNameEDataType, QName.class, "QName", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
27992816
initEDataType(durationEDataType, Duration.class, "Duration", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
28002817
initEDataType(mapEDataType, Map.class, "Map", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
2818+
initEDataType(sortByArrayEDataType, SortBy[].class, "SortByArray", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
28012819

28022820
// Create resource
28032821
createResource(eNS_URI);
@@ -3445,14 +3463,6 @@ protected void createExtendedMetaDataAnnotations() {
34453463
"name", "Constraint",
34463464
"namespace", "##targetNamespace"
34473465
});
3448-
addAnnotation
3449-
(getQueryType_SortBy(),
3450-
source,
3451-
new String[] {
3452-
"kind", "element",
3453-
"name", "SortBy",
3454-
"namespace", "http://www.opengis.net/ogc"
3455-
});
34563466
addAnnotation
34573467
(getQueryType_TypeNames(),
34583468
source,

0 commit comments

Comments
 (0)