Skip to content

Commit

Permalink
Rework
Browse files Browse the repository at this point in the history
  • Loading branch information
Shubhangi-cs committed Aug 8, 2023
1 parent 40dce98 commit 1b6515c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public enum ResourceConstants {
ERR_CHECK_ADVANCED_PARAM(null, "err.check.advanced.parameter"),
ERR_NOT_FOUND(null, "err.resource.not.found"),
ERR_NO_COLUMN_FOUND(null, "err.no.column.found"),
ERR_UNSUPPORTED_ASSOCIATEDENTITY(null, "err.unsupported.associatedEntity"),
ERR_UNSUPPORTED_ASSOCIATED_ENTITY(null, "err.unsupported.associated.entity"),
ERR_BUILDING_COLUMNS(null, "err.building.columns"),
DEBUG_NAVIGATION_NOT_FOUND(null, "debug.navigation.not.found"),
DEBUG_NAV_PROP_NOT_FOUND(null, "debug.nav.prop.not.found"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

import java.io.IOException;
import java.util.regex.Pattern;

import javax.annotation.Nullable;

/**
Expand Down Expand Up @@ -261,11 +262,11 @@ private void validateEntityParameter(FailureCollector failureCollector) {
.withConfigProperty(ENTITY_NAME);
}
}
if (SuccessFactorsUtil.isNotNullOrEmpty(associateEntityName)) {
if (SuccessFactorsUtil.isNullOrEmpty(getExpandOption()) && !containsMacro(EXPAND_OPTION)) {
failureCollector.addFailure(ResourceConstants.ERR_INVALID_ENTITY_CALL.getMsgForKey(), null);
}
if (SuccessFactorsUtil.isNotNullOrEmpty(associateEntityName)) {
if (SuccessFactorsUtil.isNullOrEmpty(getExpandOption()) && !containsMacro(EXPAND_OPTION)) {
failureCollector.addFailure(ResourceConstants.ERR_INVALID_ENTITY_CALL.getMsgForKey(), null);
}
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ public Schema buildExpandOutputSchema(String entityName, String expandOption, St
throw new SuccessFactorsServiceException(ResourceConstants.ERR_NO_COLUMN_FOUND.getMsgForKey(expandOption,
entityName), 4);
} else if (!pluginConfig.containsMacro(SuccessFactorsPluginConfig.ASSOCIATED_ENTITY_NAME)) {
throw new SuccessFactorsServiceException(ResourceConstants.ERR_UNSUPPORTED_ASSOCIATEDENTITY.
throw new SuccessFactorsServiceException(ResourceConstants.ERR_UNSUPPORTED_ASSOCIATED_ENTITY.
getMsgForKey(associatedEntity, entityName), 4);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ public ODataFeed readServiceEntityData(Edm edm, Long skip, Long top)
} catch (EdmException | EntityProviderException | IOException ex) {
if (pluginConfig.getAssociatedEntityName() != null) {
String errMsg =
ResourceConstants.ERR_UNSUPPORTED_ASSOCIATEDENTITY.
ResourceConstants.ERR_UNSUPPORTED_ASSOCIATED_ENTITY.
getMsgForKey(pluginConfig.getAssociatedEntityName(), pluginConfig.getEntityName());
throw new SuccessFactorsServiceException(errMsg, ex);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ err.missing.dataservice.version=No data service version number found. Please ens

## SAP SuccessFactors - metadata processing related messages
err.no.column.found=''{0}'' not found in the ''{1}'' entity.
err.unsupported.associatedEntity=''{0}'' not found in the ''{1}'' entity. Please ensure that associated entity is correct. Please check the property name in Admin Center > OData API Data Dictionary or entity metadata.
err.unsupported.associated.entity=''{0}'' not found in the ''{1}'' entity. Please ensure that associated entity is \
correct. Please check the property name in Admin Center > OData API Data Dictionary or entity metadata.

err.building.columns=Error while building ''{0}'' from service metadata for the given ''{1}'' entity.
debug.navigation.not.found=''{0}'' navigation property not found from the ''{1}''.
Expand Down

0 comments on commit 1b6515c

Please sign in to comment.