Skip to content

Commit 1afc238

Browse files
committed
[INTERNAL] sap.ui.model.odata.v4: use URL term
PS1: do it Change-Id: I46acdac4be6baa15ecc14bfe4c28ddde2289cbdf JIRA: CPOUI5ODATAV4-3396 CI: 219
1 parent 6e06b0c commit 1afc238

File tree

8 files changed

+80
-80
lines changed

8 files changed

+80
-80
lines changed

src/sap.ui.core/src/sap/ui/model/odata/v4/ODataMetaModel.js

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ sap.ui.define([
177177
* The metadata requestor
178178
* @param {string} sUrl
179179
* The URL to the $metadata document of the service
180-
* @param {string|string[]} [vAnnotationUri]
180+
* @param {string|string[]} [vAnnotationURL]
181181
* The URL (or an array of URLs) from which the annotation metadata are loaded
182182
* Supported since 1.41.0
183183
* @param {sap.ui.model.odata.v4.ODataModel} oModel
@@ -559,7 +559,7 @@ sap.ui.define([
559559
* The metadata requestor
560560
* @param {string} sUrl
561561
* The URL to the $metadata document of the service
562-
* @param {string|string[]} [vAnnotationUri]
562+
* @param {string|string[]} [vAnnotationURL]
563563
* The URL (or an array of URLs) from which the annotation metadata are loaded
564564
* Supported since 1.41.0
565565
* @param {sap.ui.model.odata.v4.ODataModel} oModel
@@ -571,10 +571,10 @@ sap.ui.define([
571571
* @param {string} [sLanguage]
572572
* The "sap-language" URL parameter
573573
*/
574-
function constructor(oRequestor, sUrl, vAnnotationUri, oModel, bSupportReferences, sLanguage) {
574+
function constructor(oRequestor, sUrl, vAnnotationURL, oModel, bSupportReferences, sLanguage) {
575575
MetaModel.call(this);
576-
this.aAnnotationUris = vAnnotationUri && !Array.isArray(vAnnotationUri)
577-
? [vAnnotationUri] : vAnnotationUri;
576+
this.aAnnotationURLs = vAnnotationURL && !Array.isArray(vAnnotationURL)
577+
? [vAnnotationURL] : vAnnotationURL;
578578
this.sDefaultBindingMode = BindingMode.OneTime;
579579
this.mETags = {};
580580
this.sForbiddenSchema = undefined; // data service's schema in case of a value help service
@@ -616,35 +616,35 @@ sap.ui.define([
616616
ODataMetaModel.prototype.$$valueAsPromise = true;
617617

618618
/**
619-
* Adds the given reference URI to the map of reference URIs for schemas.
619+
* Adds the given reference URL to the map of reference URLs for schemas.
620620
*
621621
* @param {string} sSchema
622622
* A namespace of a schema, for example "foo.bar."
623-
* @param {string} sReferenceUri
624-
* A URI to the metadata document for the given schema
625-
* @param {string} [sDocumentUri]
626-
* The URI to the metadata document containing the given reference to the given schema
623+
* @param {string} sReferenceURL
624+
* A URL to the metadata document for the given schema
625+
* @param {string} [sDocumentURL]
626+
* The URL to the metadata document containing the given reference to the given schema
627627
* @throws {Error}
628-
* If the schema has already been loaded from a different URI
628+
* If the schema has already been loaded from a different URL
629629
*
630630
* @private
631631
*/
632-
ODataMetaModel.prototype._addUrlForSchema = function (sSchema, sReferenceUri, sDocumentUri) {
632+
ODataMetaModel.prototype._addUrlForSchema = function (sSchema, sReferenceURL, sDocumentURL) {
633633
var sUrl0,
634634
mUrls = this.mSchema2MetadataUrl[sSchema];
635635

636636
if (!mUrls) {
637637
mUrls = this.mSchema2MetadataUrl[sSchema] = {};
638-
mUrls[sReferenceUri] = false;
639-
} else if (!(sReferenceUri in mUrls)) {
638+
mUrls[sReferenceURL] = false;
639+
} else if (!(sReferenceURL in mUrls)) {
640640
sUrl0 = Object.keys(mUrls)[0];
641641
if (mUrls[sUrl0]) {
642642
// document already processed, no different URLs allowed
643643
this._reportAndThrowError("A schema cannot span more than one document: "
644-
+ sSchema + " - expected reference URI " + sUrl0 + " but instead saw "
645-
+ sReferenceUri, sDocumentUri);
644+
+ sSchema + " - expected reference URL " + sUrl0 + " but instead saw "
645+
+ sReferenceURL, sDocumentURL);
646646
}
647-
mUrls[sReferenceUri] = false;
647+
mUrls[sReferenceURL] = false;
648648
}
649649
};
650650

@@ -697,7 +697,7 @@ sap.ui.define([
697697
* @see #_getAnnotationsForSchema
698698
*/
699699
ODataMetaModel.prototype._copyAnnotations = function (oMetaModel) {
700-
if (this.aAnnotationUris) {
700+
if (this.aAnnotationURLs) {
701701
throw new Error("Must not copy annotations when there are local annotation files");
702702
}
703703

@@ -788,7 +788,7 @@ sap.ui.define([
788788
* The schema, or a promise which is resolved without details or rejected with an error, or
789789
* <code>undefined</code>.
790790
* @throws {Error}
791-
* If the schema has already been loaded and read from a different URI
791+
* If the schema has already been loaded and read from a different URL
792792
*
793793
* @private
794794
*/
@@ -866,7 +866,7 @@ sap.ui.define([
866866
* @param {object[]} aAnnotationFiles
867867
* The metadata "JSON" of the additional annotation files
868868
* @throws {Error}
869-
* If metadata cannot be merged or if the schema has already been loaded from a different URI
869+
* If metadata cannot be merged or if the schema has already been loaded from a different URL
870870
*
871871
* @private
872872
*/
@@ -889,17 +889,17 @@ sap.ui.define([
889889
var oElement,
890890
sQualifiedName;
891891

892-
that.validate(that.aAnnotationUris[i], mAnnotationScope);
892+
that.validate(that.aAnnotationURLs[i], mAnnotationScope);
893893
for (sQualifiedName in mAnnotationScope) {
894894
if (sQualifiedName[0] !== "$") {
895895
if (sQualifiedName in mScope) {
896896
that._reportAndThrowError("A schema cannot span more than one document: "
897-
+ sQualifiedName, that.aAnnotationUris[i]);
897+
+ sQualifiedName, that.aAnnotationURLs[i]);
898898
}
899899
oElement = mAnnotationScope[sQualifiedName];
900900
mScope[sQualifiedName] = oElement;
901901
if (oElement.$kind === "Schema") {
902-
that._addUrlForSchema(sQualifiedName, that.aAnnotationUris[i]);
902+
that._addUrlForSchema(sQualifiedName, that.aAnnotationURLs[i]);
903903
that._doMergeAnnotations(oElement, mScope.$Annotations, true);
904904
}
905905
}
@@ -1139,10 +1139,10 @@ sap.ui.define([
11391139
aPromises
11401140
= [SyncPromise.resolve(this.oRequestor.read(this.sUrl, false, bPrefetch))];
11411141

1142-
if (this.aAnnotationUris) {
1143-
this.aAnnotationUris.forEach(function (sAnnotationUri) {
1142+
if (this.aAnnotationURLs) {
1143+
this.aAnnotationURLs.forEach(function (sAnnotationURL) {
11441144
aPromises.push(SyncPromise.resolve(
1145-
that.oRequestor.read(sAnnotationUri, true, bPrefetch)));
1145+
that.oRequestor.read(sAnnotationURL, true, bPrefetch)));
11461146
});
11471147
}
11481148
if (!bPrefetch) {
@@ -3749,21 +3749,21 @@ sap.ui.define([
37493749
* @returns {object}
37503750
* <code>mScope</code> to allow "chaining"
37513751
* @throws {Error}
3752-
* If validation fails or if the schema has already been loaded from a different URI
3752+
* If validation fails or if the schema has already been loaded from a different URL
37533753
*
37543754
* @private
37553755
*/
37563756
ODataMetaModel.prototype.validate = function (sUrl, mScope) {
3757-
var oDate, oLastModified, sSchema, oReference, sReferenceUri, i;
3757+
var oDate, oLastModified, sSchema, oReference, sReferenceURL, i;
37583758

37593759
if (!this.bSupportReferences) {
37603760
return mScope;
37613761
}
37623762

3763-
for (sReferenceUri in mScope.$Reference) {
3764-
oReference = mScope.$Reference[sReferenceUri];
3765-
// interpret reference URI relative to metadata URL
3766-
sReferenceUri = _Helper.makeAbsolute(sReferenceUri, this.sUrl);
3763+
for (sReferenceURL in mScope.$Reference) {
3764+
oReference = mScope.$Reference[sReferenceURL];
3765+
// interpret reference URL relative to metadata URL
3766+
sReferenceURL = _Helper.makeAbsolute(sReferenceURL, this.sUrl);
37673767

37683768
if ("$IncludeAnnotations" in oReference) {
37693769
this._reportAndThrowError("Unsupported IncludeAnnotations", sUrl);
@@ -3775,7 +3775,7 @@ sap.ui.define([
37753775
+ sSchema + " - is both included and defined",
37763776
sUrl);
37773777
}
3778-
this._addUrlForSchema(sSchema, sReferenceUri, sUrl);
3778+
this._addUrlForSchema(sSchema, sReferenceURL, sUrl);
37793779
}
37803780
}
37813781

src/sap.ui.core/src/sap/ui/model/odata/v4/ODataModel.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ sap.ui.define([
209209
* >"4 Resource Path"</a> in specification "OData Version 4.01. Part 2: URL Conventions"
210210
* is a valid data binding path within this model if a leading slash is added; for example
211211
* "/" + "SalesOrderList('A%2FB%26C')" to access an entity instance with key "A/B&C". Note
212-
* that appropriate URI encoding is necessary, see the example of
212+
* that appropriate URL encoding is necessary, see the example of
213213
* {@link sap.ui.model.odata.v4.ODataUtils.formatLiteral}. "4.5.1 Addressing Actions"
214214
* needs an operation binding, see {@link sap.ui.model.odata.v4.ODataContextBinding}.
215215
*
@@ -1736,7 +1736,7 @@ sap.ui.define([
17361736
* @param {object} oEntity
17371737
* The entity instance with the key property values
17381738
* @returns {sap.ui.base.SyncPromise<string|undefined>}
1739-
* A promise that gets resolved with the proper URI encoded key predicate, for example
1739+
* A promise that gets resolved with the proper URL encoded key predicate, for example
17401740
* "(Sector='A%2FB%26C',ID='42')" or "('42')", or <code>undefined</code>, if at least one key
17411741
* property is undefined. It gets rejected if the metadata cannot be fetched or in case the
17421742
* entity has no key properties according to metadata.
@@ -2027,7 +2027,7 @@ sap.ui.define([
20272027
* @param {object} oEntity
20282028
* The entity instance with the key property values
20292029
* @returns {string|undefined}
2030-
* The proper URI-encoded key predicate, for example "(Sector='A%2FB%26C',ID='42')" or
2030+
* The proper URL-encoded key predicate, for example "(Sector='A%2FB%26C',ID='42')" or
20312031
* "('42')", or <code>undefined</code> if at least one key property is undefined.
20322032
* @throws {Error}
20332033
* If the key predicate cannot be determined synchronously
@@ -2391,7 +2391,7 @@ sap.ui.define([
23912391

23922392
/**
23932393
* Normalizes the key predicates of a message's target using the sort order from the metadata,
2394-
* including proper URI encoding, e.g. "(Sector='A%2FB%26C',ID='42')" or "('42')".
2394+
* including proper URL encoding, e.g. "(Sector='A%2FB%26C',ID='42')" or "('42')".
23952395
*
23962396
* @param {string} sTarget
23972397
* The message target
@@ -2736,7 +2736,7 @@ sap.ui.define([
27362736
* @param {object} oEntity
27372737
* The entity instance with the key property values
27382738
* @returns {Promise<string|undefined>}
2739-
* A promise that gets resolved with the proper URI-encoded key predicate, for example
2739+
* A promise that gets resolved with the proper URL-encoded key predicate, for example
27402740
* "(Sector='A%2FB%26C',ID='42')" or "('42')", or <code>undefined</code> if at least one key
27412741
* property is undefined. It gets rejected if the metadata cannot be fetched, or in case the
27422742
* entity has no key properties according to the metadata.

src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Helper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1499,7 +1499,7 @@ sap.ui.define([
14991499
* is the alias in the key predicate, its value is the path in the instance). If not
15001500
* given, the entity's key is used.
15011501
* @returns {string|undefined}
1502-
* A filter using key properties without URI encoding, e.g.
1502+
* A filter using key properties without URL encoding, e.g.
15031503
* "Sector eq 'A/B&C' and ID eq 42)", or <code>undefined</code>, if at least one key
15041504
* property is undefined
15051505
* @throws {Error}
@@ -1541,7 +1541,7 @@ sap.ui.define([
15411541
* If true, the property name is not omitted if there is only one property
15421542
* (like "(ID='42')")
15431543
* @returns {string|undefined}
1544-
* The key predicate with proper URI encoding, e.g. "(Sector='A%2FB%26C',ID='42')" or
1544+
* The key predicate with proper URL encoding, e.g. "(Sector='A%2FB%26C',ID='42')" or
15451545
* "('42')", or <code>undefined</code>, if at least one key property is undefined
15461546
* @throws {Error}
15471547
* In case the entity type has no key properties according to metadata

0 commit comments

Comments
 (0)