-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugfix #12
Bugfix #12
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,7 @@ | |
|
||
import java.io.IOException; | ||
import java.util.regex.Pattern; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
/** | ||
|
@@ -45,9 +46,10 @@ public class SuccessFactorsPluginConfig extends PluginConfig { | |
private static final String REFERENCE_NAME = "referenceName"; | ||
private static final String REFERENCE_NAME_DESCRIPTION = "This will be used to uniquely identify this source/sink " + | ||
"for lineage, annotating metadata, etc."; | ||
private static final String ASSOCIATED_ENTITY_NAME = "associatedEntityName"; | ||
public static final String ASSOCIATED_ENTITY_NAME = "associatedEntityName"; | ||
private static final String NAME_SCHEMA = "schema"; | ||
private static final String PAGINATION_TYPE = "paginationType"; | ||
public static final String EXPAND_OPTION = "expandOption"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ideally these variables should be only for internal use. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But these are used in other classes as well. |
||
private static final String COMMON_ACTION = ResourceConstants.ERR_MISSING_PARAM_OR_MACRO_ACTION.getMsgForKey(); | ||
private static final Pattern PATTERN = Pattern.compile("\\(.*\\)"); | ||
private static final String SAP_SUCCESSFACTORS_ENTITY_NAME = "Entity Name"; | ||
|
@@ -78,6 +80,7 @@ public class SuccessFactorsPluginConfig extends PluginConfig { | |
"All the fields must be comma (,) separated.\n") | ||
private final String selectOption; | ||
|
||
@Name(EXPAND_OPTION) | ||
@Nullable | ||
@Macro | ||
@Description("List of navigation fields to be expanded in the extracted output data. For example: customManager. " + | ||
|
@@ -259,6 +262,12 @@ 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) | ||
.withConfigProperty(ASSOCIATED_ENTITY_NAME); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. formatting. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
} | ||
} | ||
|
||
/** | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ root.cause.log=Root Cause: | |
err.feature.not.supported=Entity 'Key' property based extraction is not supported. | ||
err.invalid.base.url=Please verify the provided base url is correct. Please contact the SAP administrator. | ||
err.invalid.credential=Please verify the connection parameters. Username or password is incorrect. | ||
err.invalid.entityCall=Associated Entity must be used with the expand field. Please provide the Expand fields. | ||
|
||
## SAP SuccessFactors - Design Time generic error | ||
err.odata.service.call={0} - {1} | ||
|
@@ -30,6 +31,9 @@ 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.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. | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. message can be refactored as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done. |
||
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}''. | ||
debug.nav.prop.not.found=''{0}'' navigation path not found in given entity ''{1}''. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we using public instead of private?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be public as used in other classes as well.