Skip to content

Commit

Permalink
Rename IExpression.getParametersAsPlainStrings to getParameterNames
Browse files Browse the repository at this point in the history
Also renamed other stuff in metasfresh

Lookup validation rule shall support @CtxName/Default@ annotation
#585
  • Loading branch information
metas-ts committed Sep 14, 2017
1 parent 8a7a92c commit 36bf3e6
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 11 deletions.
Expand Up @@ -111,7 +111,7 @@ public boolean hasParameters()
@Override
public Set<String> getDependsOnFieldNames()
{
return CtxNames.asNames(PARAMETERS);
return CtxNames.toNames(PARAMETERS);
}

@Override
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/de/metas/ui/web/picking/PickingSlotRow.java
Expand Up @@ -367,6 +367,9 @@ public static final PickingSlotRowId ofPickingSlotId(final int pickingSlotId)

public static final PickingSlotRowId ofHU(final int pickingSlotId, final int huId, final int huStorageProductId)
{
Preconditions.checkArgument(pickingSlotId > 0, "pickingSlotId > 0");
Preconditions.checkArgument(huId > 0, "huId > 0");

return new PickingSlotRowId(pickingSlotId, huId, huStorageProductId);
}

Expand Down
Expand Up @@ -712,7 +712,7 @@ private DocumentFieldDependencyMap buildDependencies()
final DocumentFieldDependencyMap.Builder dependenciesBuilder = DocumentFieldDependencyMap.builder();

dependenciesBuilder.add(DocumentFieldDependencyMap.DOCUMENT_Readonly,
getReadonlyLogic().getParametersAsPlainStrings(),
getReadonlyLogic().getParameterNames(),
DependencyType.DocumentReadonlyLogic);

getFields().values().stream().forEach(field -> dependenciesBuilder.add(field.getDependencies()));
Expand Down
Expand Up @@ -1269,9 +1269,9 @@ private Optional<DocumentFieldDataBindingDescriptor> getDataBinding()
private DocumentFieldDependencyMap buildDependencies()
{
final DocumentFieldDependencyMap.Builder dependencyMapBuilder = DocumentFieldDependencyMap.builder()
.add(fieldName, getReadonlyLogicEffective().getParametersAsPlainStrings(), DependencyType.ReadonlyLogic)
.add(fieldName, getDisplayLogic().getParametersAsPlainStrings(), DependencyType.DisplayLogic)
.add(fieldName, getMandatoryLogicEffective().getParametersAsPlainStrings(), DependencyType.MandatoryLogic);
.add(fieldName, getReadonlyLogicEffective().getParameterNames(), DependencyType.ReadonlyLogic)
.add(fieldName, getDisplayLogic().getParameterNames(), DependencyType.DisplayLogic)
.add(fieldName, getMandatoryLogicEffective().getParameterNames(), DependencyType.MandatoryLogic);

final LookupDescriptor lookupDescriptor = getLookupDescriptorProvider().provideForScope(LookupScope.DocumentField);
if (lookupDescriptor != null)
Expand Down
Expand Up @@ -76,9 +76,9 @@ public String getExpressionString()
}

@Override
public Set<String> getParametersAsPlainStrings()
public Set<String> getParameterNames()
{
return CtxNames.asNames(PARAMETERS);
return CtxNames.toNames(PARAMETERS);
}

@Override
Expand Down
Expand Up @@ -152,9 +152,9 @@ public String getFormatedExpressionString()
}

@Override
public Set<String> getParametersAsPlainStrings()
public Set<String> getParameterNames()
{
return stringExpression.getParametersAsPlainStrings();
return stringExpression.getParameterNames();
}

@Override
Expand Down
Expand Up @@ -362,7 +362,7 @@ private SqlLookupDescriptor build()
}

dependsOnFieldNames = ImmutableSet.<String> builder()
.addAll(validationRule.getPrefilterWhereClause().getParametersAsPlainStrings())
.addAll(validationRule.getPrefilterWhereClause().getParameterNames())
.addAll(validationRule.getPostQueryFilter().getParameters())
.build();
}
Expand Down
Expand Up @@ -303,7 +303,7 @@ public LookupDataSourceContext build()
//
// Collect all values required by the post-query predicate
// failIfNotFound=false because it might be that NOT all postQueryPredicate's parameters are mandatory!
collectContextValues(CtxNames.parseStrings(postQueryPredicate.getParameters()), false);
collectContextValues(CtxNames.parseAll(postQueryPredicate.getParameters()), false);

//
// Build the effective context
Expand Down

0 comments on commit 36bf3e6

Please sign in to comment.