Skip to content

Commit

Permalink
LPD-37559 Using new MSOD object relationship field names
Browse files Browse the repository at this point in the history
  • Loading branch information
4lejandrito authored and brianchandotcom committed Sep 30, 2024
1 parent 0ddbb22 commit 8724e53
Show file tree
Hide file tree
Showing 35 changed files with 273 additions and 273 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public String getPathParameter() {
public APIApplication.Schema getRequestSchema() {
return _getSchema(
(String)properties.get(
"r_requestAPISchemaToAPIEndpoints_c_" +
"r_requestAPISchemaToAPIEndpoints_l_" +
"apiSchemaERC"),
schemas);
}
Expand All @@ -118,7 +118,7 @@ public APIApplication.Schema getRequestSchema() {
public APIApplication.Schema getResponseSchema() {
return _getSchema(
(String)properties.get(
"r_responseAPISchemaToAPIEndpoints_c_" +
"r_responseAPISchemaToAPIEndpoints_l_" +
"apiSchemaERC"),
schemas);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void validateAPIEndpointRelationship(
Map<String, Serializable> values = objectEntry.getValues();

long apiEndpointId = (long)values.get(
"r_" + relationshipName + "_c_apiEndpointId");
"r_" + relationshipName + "_l_apiEndpointId");

if (!isValidObjectEntry("L_API_ENDPOINT", apiEndpointId)) {
throw new ObjectEntryValuesException.InvalidObjectField(
Expand Down Expand Up @@ -130,7 +130,7 @@ public void validateAPIEndpointRelationship(
StringBundler.concat(
"id ne '", objectEntry.getObjectEntryId(),
"' and r_", relationshipName,
"_c_apiEndpointId eq '", apiEndpointId, "'"),
"_l_apiEndpointId eq '", apiEndpointId, "'"),
objectDefinition.getExternalReferenceCode()))) {

throw new ObjectEntryValuesException.InvalidObjectField(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ else if (StringUtil.equals(externalReferenceCode, "L_API_ENDPOINT")) {

return GetterUtil.getLong(
values.get(
"r_apiApplicationToAPIEndpoints_c_apiApplicationId"));
"r_apiApplicationToAPIEndpoints_l_apiApplicationId"));
}
else if (StringUtil.equals(externalReferenceCode, "L_API_FILTER")) {
Map<String, Serializable> apiFilterObjectEntryValues =
Expand All @@ -127,7 +127,7 @@ else if (StringUtil.equals(externalReferenceCode, "L_API_FILTER")) {
_objectEntryLocalService.fetchObjectEntry(
GetterUtil.getLong(
apiFilterObjectEntryValues.get(
"r_apiEndpointToAPIFilters_c_apiEndpointId")));
"r_apiEndpointToAPIFilters_l_apiEndpointId")));

if (apiEndpointObjectEntry == null) {
return 0;
Expand All @@ -138,7 +138,7 @@ else if (StringUtil.equals(externalReferenceCode, "L_API_FILTER")) {

return GetterUtil.getLong(
apiEndpointObjectEntryValues.get(
"r_apiApplicationToAPIEndpoints_c_apiApplicationId"));
"r_apiApplicationToAPIEndpoints_l_apiApplicationId"));
}
else if (StringUtil.equals(externalReferenceCode, "L_API_PROPERTY")) {
Map<String, Serializable> apiPropertyObjectEntryValues =
Expand All @@ -148,7 +148,7 @@ else if (StringUtil.equals(externalReferenceCode, "L_API_PROPERTY")) {
_objectEntryLocalService.fetchObjectEntry(
GetterUtil.getLong(
apiPropertyObjectEntryValues.get(
"r_apiSchemaToAPIProperties_c_apiSchemaId")));
"r_apiSchemaToAPIProperties_l_apiSchemaId")));

if (apiSchemaObjectEntry == null) {
return 0;
Expand All @@ -159,13 +159,13 @@ else if (StringUtil.equals(externalReferenceCode, "L_API_PROPERTY")) {

return GetterUtil.getLong(
apiSchemaObjectEntryValues.get(
"r_apiApplicationToAPISchemas_c_apiApplicationId"));
"r_apiApplicationToAPISchemas_l_apiApplicationId"));
}
else if (StringUtil.equals(externalReferenceCode, "L_API_SCHEMA")) {
Map<String, Serializable> values = objectEntry.getValues();

return GetterUtil.getLong(
values.get("r_apiApplicationToAPISchemas_c_apiApplicationId"));
values.get("r_apiApplicationToAPISchemas_l_apiApplicationId"));
}
else if (StringUtil.equals(externalReferenceCode, "L_API_SORT")) {
Map<String, Serializable> apiSortObjectEntryValues =
Expand All @@ -175,7 +175,7 @@ else if (StringUtil.equals(externalReferenceCode, "L_API_SORT")) {
_objectEntryLocalService.fetchObjectEntry(
GetterUtil.getLong(
apiSortObjectEntryValues.get(
"r_apiEndpointToAPISorts_c_apiEndpointId")));
"r_apiEndpointToAPISorts_l_apiEndpointId")));

if (apiEndpointObjectEntry == null) {
return 0;
Expand All @@ -186,7 +186,7 @@ else if (StringUtil.equals(externalReferenceCode, "L_API_SORT")) {

return GetterUtil.getLong(
apiEndpointObjectEntryValues.get(
"r_apiApplicationToAPIEndpoints_c_apiApplicationId"));
"r_apiApplicationToAPIEndpoints_l_apiApplicationId"));
}

if (_log.isDebugEnabled()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ public void onBeforeUpdate(
originalObjectEntry.getValues(), objectEntry.getValues(),
"httpMethod", "path", "pathParameter",
"pathParameterDescription", "retrieveType",
"r_apiApplicationToAPIEndpoints_c_apiApplicationId",
"r_requestAPISchemaToAPIEndpoints_c_apiSchemaId",
"r_responseAPISchemaToAPIEndpoints_c_apiSchemaId")) {
"r_apiApplicationToAPIEndpoints_l_apiApplicationId",
"r_requestAPISchemaToAPIEndpoints_l_apiSchemaId",
"r_responseAPISchemaToAPIEndpoints_l_apiSchemaId")) {

_validate(objectEntry);
}
Expand Down Expand Up @@ -129,7 +129,7 @@ private void _validate(ObjectEntry objectEntry) {

long apiApplicationId = GetterUtil.getLong(
values.get(
"r_apiApplicationToAPIEndpoints_c_apiApplicationId"));
"r_apiApplicationToAPIEndpoints_l_apiApplicationId"));

if (!_validationHelper.isValidObjectEntry(
"L_API_APPLICATION", apiApplicationId)) {
Expand All @@ -141,7 +141,7 @@ private void _validate(ObjectEntry objectEntry) {
}

long responseAPISchemaId = GetterUtil.getLong(
values.get("r_responseAPISchemaToAPIEndpoints_c_apiSchemaId"));
values.get("r_responseAPISchemaToAPIEndpoints_l_apiSchemaId"));

APIApplication.Endpoint.Scope scope =
APIApplication.Endpoint.Scope.parse(
Expand All @@ -153,7 +153,7 @@ private void _validate(ObjectEntry objectEntry) {
}

long requestAPISchemaId = GetterUtil.getLong(
values.get("r_requestAPISchemaToAPIEndpoints_c_apiSchemaId"));
values.get("r_requestAPISchemaToAPIEndpoints_l_apiSchemaId"));

if (requestAPISchemaId != 0) {
_validateAPISchema(apiApplicationId, requestAPISchemaId, scope);
Expand Down Expand Up @@ -187,8 +187,8 @@ else if (Objects.equals(method, Http.Method.POST)) {
"id ne '", objectEntry.getObjectEntryId(),
"' and httpMethod eq '", values.get("httpMethod"),
"' and path eq '", values.get("path"),
"' and r_apiApplicationToAPIEndpoints_c_apiApplicationId eq '",
values.get("r_apiApplicationToAPIEndpoints_c_apiApplicationId"),
"' and r_apiApplicationToAPIEndpoints_l_apiApplicationId eq '",
values.get("r_apiApplicationToAPIEndpoints_l_apiApplicationId"),
"'");
ObjectDefinition apiEndpointObjectDefinition =
_objectDefinitionLocalService.getObjectDefinition(
Expand Down Expand Up @@ -249,7 +249,7 @@ private void _validateAPISchema(
if (!Objects.equals(
apiApplicationId,
apiSchemaValues.get(
"r_apiApplicationToAPISchemas_c_apiApplicationId"))) {
"r_apiApplicationToAPISchemas_l_apiApplicationId"))) {

throw new ObjectEntryValuesException.InvalidObjectField(
null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ private void _validate(ObjectEntry objectEntry) {
Map<String, Serializable> values = objectEntry.getValues();

long apiSchemaId = GetterUtil.getLong(
values.get("r_apiSchemaToAPIProperties_c_apiSchemaId"));
values.get("r_apiSchemaToAPIProperties_l_apiSchemaId"));

if (!_validationHelper.isValidObjectEntry(
"L_API_SCHEMA", apiSchemaId)) {
Expand Down Expand Up @@ -183,7 +183,7 @@ private void _validate(ObjectEntry objectEntry) {
}

long parentAPIPropertyId = GetterUtil.getLong(
values.get("r_apiPropertyToAPIProperties_c_apiPropertyId"));
values.get("r_apiPropertyToAPIProperties_l_apiPropertyId"));

if (parentAPIPropertyId != 0) {
if (!_validationHelper.isValidObjectEntry(
Expand All @@ -204,7 +204,7 @@ private void _validate(ObjectEntry objectEntry) {

if (!Objects.equals(
apiPropertyValues.get(
"r_apiSchemaToAPIProperties_c_apiSchemaId"),
"r_apiSchemaToAPIProperties_l_apiSchemaId"),
apiSchemaId)) {

throw new ObjectEntryValuesException.InvalidObjectField(
Expand Down Expand Up @@ -247,9 +247,9 @@ private void _validate(ObjectEntry objectEntry) {
StringBundler.concat(
"id ne '", objectEntry.getObjectEntryId(),
"' and name eq '", values.get("name"), "' and ",
"r_apiPropertyToAPIProperties_c_apiPropertyId ",
"r_apiPropertyToAPIProperties_l_apiPropertyId ",
"eq '", parentAPIPropertyId, "' and ",
"r_apiSchemaToAPIProperties_c_apiSchemaId eq '",
"r_apiSchemaToAPIProperties_l_apiSchemaId eq '",
apiSchemaId, "'"),
_objectDefinitionLocalService.getObjectDefinition(
objectEntry.getObjectDefinitionId())),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private void _validate(ObjectEntry objectEntry) {
"L_API_APPLICATION",
GetterUtil.getLong(
values.get(
"r_apiApplicationToAPISchemas_c_" +
"r_apiApplicationToAPISchemas_l_" +
"apiApplicationId")))) {

throw new ObjectEntryValuesException.InvalidObjectField(
Expand Down Expand Up @@ -96,10 +96,10 @@ private void _validate(ObjectEntry objectEntry) {
StringBundler.concat(
"id ne '", objectEntry.getObjectEntryId(),
"' and name eq '", values.get("name"),
"' and r_apiApplicationToAPISchemas_c_",
"' and r_apiApplicationToAPISchemas_l_",
"apiApplicationId eq '",
values.get(
"r_apiApplicationToAPISchemas_c_" +
"r_apiApplicationToAPISchemas_l_" +
"apiApplicationId"),
"'"),
"L_API_SCHEMA"))) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ definition {
if (isSet(applicationId)) {
Click.pauseClickAt(
locator1 = "TextInput#ANY_WITH_NAME",
name = "r_apiApplicationToAPIEndpoints_c_apiApplicationId");
name = "r_apiApplicationToAPIEndpoints_l_apiApplicationId");

Click(
applicationId = ${applicationId},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ definition {
"httpMethod": "${httpMethod}",
"name": "${name}",
"path": "${path}",
"r_apiApplicationToAPIEndpoints_c_apiApplicationERC": "${apiApplicationERC}"
"r_apiApplicationToAPIEndpoints_l_apiApplicationERC": "${apiApplicationERC}"
''';

if (isSet(requestSchemaId)) {
var body = StringUtil.add(${body}, ", \"r_requestAPISchemaToAPIEndpoints_c_apiSchemaId\": ${requestSchemaId}", "");
var body = StringUtil.add(${body}, ", \"r_requestAPISchemaToAPIEndpoints_l_apiSchemaId\": ${requestSchemaId}", "");
}

if (isSet(responseSchemaId)) {
var body = StringUtil.add(${body}, ", \"r_responseAPISchemaToAPIEndpoints_c_apiSchemaId\": ${responseSchemaId}", "");
var body = StringUtil.add(${body}, ", \"r_responseAPISchemaToAPIEndpoints_l_apiSchemaId\": ${responseSchemaId}", "");
}

var curl = StringUtil.add(${curl}, " -d { ${body} }", "");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ definition {
var curl = FilterAPI._curlAPIFilter(virtualHost = ${virtualHost});
var body = '''
"oDataFilter": "${filterValue}",
"r_apiEndpointToAPIFilters_c_apiEndpointERC": "${endpointERC}"
"r_apiEndpointToAPIFilters_l_apiEndpointERC": "${endpointERC}"
''';

var curl = StringUtil.add(${curl}, " -d { ${body} }", "");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ definition {
"name": "${name}",
"objectFieldERC": "${objectFieldERC}",
"objectRelationshipNames": "${relationshipName}",
"r_apiSchemaToAPIProperties_c_apiSchemaERC": "${schemaERC}"
"r_apiSchemaToAPIProperties_l_apiSchemaERC": "${schemaERC}"
''';

var curl = StringUtil.add(${curl}, " -d { ${body} }", "");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ definition {
"externalReferenceCode": "${schemaERC}",
"mainObjectDefinitionERC": "${mainObjectDefinitionERC}",
"name": "${name}",
"r_apiApplicationToAPISchemas_c_apiApplicationERC": "${apiApplicationERC}"
"r_apiApplicationToAPISchemas_l_apiApplicationERC": "${apiApplicationERC}"
}
''';

Expand Down Expand Up @@ -102,7 +102,7 @@ definition {

var response = JSONCurlUtil.put(${curl});

var schemaErc = JSONUtil.getWithJSONPath(${response}, "$.r_requestAPISchemaToAPIEndpoints_c_apiSchemaERC");
var schemaErc = JSONUtil.getWithJSONPath(${response}, "$.r_requestAPISchemaToAPIEndpoints_l_apiSchemaERC");

TestUtils.assertEquals(
actual = ${schemaErc},
Expand All @@ -119,7 +119,7 @@ definition {

var response = JSONCurlUtil.put(${curl});

var schemaId = JSONUtil.getWithJSONPath(${response}, "$.r_requestAPISchemaToAPIEndpoints_c_apiSchemaId");
var schemaId = JSONUtil.getWithJSONPath(${response}, "$.r_requestAPISchemaToAPIEndpoints_l_apiSchemaId");

TestUtils.assertEquals(
actual = ${schemaId},
Expand All @@ -136,7 +136,7 @@ definition {

var response = JSONCurlUtil.put(${curl});

var schemaErc = JSONUtil.getWithJSONPath(${response}, "$.r_responseAPISchemaToAPIEndpoints_c_apiSchemaERC");
var schemaErc = JSONUtil.getWithJSONPath(${response}, "$.r_responseAPISchemaToAPIEndpoints_l_apiSchemaERC");

TestUtils.assertEquals(
actual = ${schemaErc},
Expand All @@ -153,7 +153,7 @@ definition {

var response = JSONCurlUtil.put(${curl});

var schemaId = JSONUtil.getWithJSONPath(${response}, "$.r_responseAPISchemaToAPIEndpoints_c_apiSchemaId");
var schemaId = JSONUtil.getWithJSONPath(${response}, "$.r_responseAPISchemaToAPIEndpoints_l_apiSchemaId");

TestUtils.assertEquals(
actual = ${schemaId},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ definition {
var curl = SortAPI._curlAPISort(virtualHost = ${virtualHost});
var body = '''
"oDataSort": "${sortValue}",
"r_apiEndpointToAPISorts_c_apiEndpointERC": ${endpointERC}
"r_apiEndpointToAPISorts_l_apiEndpointERC": ${endpointERC}
''';

var curl = StringUtil.add(${curl}, " -d { ${body} }", "");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ definition {
var response = EndpointAPI.getAPIEndpoints();

var actualValue = JSONPathUtil.getProperty(
property = "$.items..r_responseAPISchemaToAPIEndpoints_c_apiSchemaERC",
property = "$.items..r_responseAPISchemaToAPIEndpoints_l_apiSchemaERC",
response = ${response});

TestUtils.assertEquals(
Expand Down
Loading

0 comments on commit 8724e53

Please sign in to comment.