Skip to content
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

LPS-81687 Semver #63701

Closed
wants to merge 41 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
8eb25fd
LPS-81609 Remove deprecated code
Aug 1, 2018
5480f0b
LPS-81609 Deprecate classes and methods
Aug 1, 2018
42b23a0
LPS-81609 Add function tracker
Jun 13, 2018
8f8b116
LPS-81609 Add expression observer
Aug 1, 2018
99e48af
LPS-81609 Add expression action handler
Aug 1, 2018
05a1daa
LPS-81609 Add parameter accessor
Aug 1, 2018
af43efa
LPS-81609 Add interfaces
Aug 2, 2018
0343768
LPS-81609 Update expression API
Aug 1, 2018
93f81da
LPS-81609 Update implementation to reflect API changes
Aug 1, 2018
420ed82
LPS-81609 Apply references to Aware interfaces
Aug 2, 2018
28fef8e
LPS-81609 Not needed
Jun 13, 2018
ee0d4de
LPS-81609 Update unit tests
Jun 13, 2018
aebb8d4
LPS-81609 Add the instanceId property to be able to get/update a prop…
rafaprax Sep 24, 2018
15baaab
LPS-81609 Update grammar to add ability to pass arrays as function pa…
rafaprax Sep 21, 2018
9395314
LPS-81609 Regenerate antlr classes via generateGrammarSource task
rafaprax Sep 21, 2018
19fd002
LPS-81609 Update expression visitors and listeners
rafaprax Sep 21, 2018
2218952
LPS-81609 DDMExpressionFunction implentations should de served by an …
rafaprax Sep 24, 2018
cec26ac
LPS-81609 Add and update tests
rafaprax Sep 24, 2018
669b69e
LPS-81687 Update form evaluator API
Jul 23, 2018
77fed03
LPS-81687 Update functions
Aug 2, 2018
1c8e137
LPS-81687 Add new functions
May 31, 2018
39d04b8
LPS-81687 Refactor form evaluator implementation
May 31, 2018
63eac4f
LPS-81687 Evaluator functions must be factories now
rafaprax Sep 24, 2018
518961c
LPS-81687 Backend can return partial context now, only returning the…
rafaprax Sep 24, 2018
7d04e7b
LPS-81687 Field value accessors must inform how to create an array ba…
rafaprax Sep 24, 2018
5645951
LPS-81687 Implement new evaluation api
rafaprax Sep 24, 2018
44033fe
LPS-81687 Apply usages
rafaprax Sep 24, 2018
b038e39
LPS-81687 Not needed anymore
rafaprax Sep 24, 2018
c2b7eab
LPS-81687 Use BigDecimal in numeric field implementation instead Double
rafaprax Sep 24, 2018
dcffc2c
LPS-81687 Add support to BigDecimal to SoyTemplateRecord
rafaprax Sep 24, 2018
84a365c
LPS-81687 List operands must be serialized as Array
rafaprax Sep 24, 2018
a4d0b4b
LPS-81687 Merge current context with the partial one returned by the …
rafaprax Sep 24, 2018
a9a76b6
LPS-81687 Simplify
rafaprax Sep 24, 2018
53bb117
LPS-81687 Fix validationExpression
rafaprax Sep 24, 2018
f7243b0
LPS-81687 Add, remove and update tests
rafaprax Sep 24, 2018
26ec9a5
LPS-81687 Not needed
rafaprax Sep 24, 2018
913d92e
LPS-81687 Sort
brianchandotcom Oct 1, 2018
f9859d7
LPS-81687 Please apply else where, this needs to be renamed to getPar…
brianchandotcom Oct 1, 2018
1f5c3eb
LPS-81609 Rename to *Optional and *Function
rafaprax Oct 2, 2018
ec53ac4
LPS-81609 Rename package
rafaprax Oct 2, 2018
72e3460
LPS-81687 Semver
rafaprax Oct 2, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -19,6 +19,10 @@
*/
public class DDMConstants {

public static final String EXPRESSION_FUNCTION_FACTORY_NAME =
"com.liferay.dynamic.data.mapping.expression." +
"DDMExpressionFunctionFactory";

public static final String RESOURCE_NAME =
"com.liferay.dynamic.data.mapping";

Expand Down
Expand Up @@ -41,7 +41,7 @@ public Locale getLocale() {
return _locale;
}

public <T> Optional<T> getParameter(String name, Class<?> clazz) {
public <T> Optional<T> getParameterOptional(String name, Class<?> clazz) {
Object value = _parameters.get(name);

if (value == null) {
Expand Down
Expand Up @@ -25,7 +25,7 @@
*/
public final class DDMDataProviderResponse implements Serializable {

public <T> Optional<T> getOutput(String name, Class<?> clazz) {
public <T> Optional<T> getOutputOptional(String name, Class<?> clazz) {
Object value = _ddmDataProviderResponseOutputs.get(name);

if (value == null) {
Expand Down
@@ -0,0 +1,106 @@
/**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/

package com.liferay.dynamic.data.mapping.expression;

/**
* @author Leonardo Barros
*/
public final class CreateExpressionRequest {

public DDMExpressionActionHandler getDDMExpressionActionHandler() {
return _ddmExpressionActionHandler;
}

public DDMExpressionFieldAccessor getDDMExpressionFieldAccessor() {
return _ddmExpressionFieldAccessor;
}

public DDMExpressionObserver getDDMExpressionObserver() {
return _ddmExpressionObserver;
}

public DDMExpressionParameterAccessor getDDMExpressionParameterAccessor() {
return _ddmExpressionParameterAccessor;
}

public String getExpression() {
return _expression;
}

public static class Builder {

public static Builder newBuilder(String expression) {
return new Builder(expression);
}

public CreateExpressionRequest build() {
return _createExpressionRequest;
}

public Builder withDDMExpressionActionHandler(
DDMExpressionActionHandler ddmExpressionActionHandler) {

_createExpressionRequest._ddmExpressionActionHandler =
ddmExpressionActionHandler;

return this;
}

public Builder withDDMExpressionFieldAccessor(
DDMExpressionFieldAccessor ddmExpressionFieldAccessor) {

_createExpressionRequest._ddmExpressionFieldAccessor =
ddmExpressionFieldAccessor;

return this;
}

public Builder withDDMExpressionObserver(
DDMExpressionObserver ddmExpressionObserver) {

_createExpressionRequest._ddmExpressionObserver =
ddmExpressionObserver;

return this;
}

public Builder withDDMExpressionParameterAccessor(
DDMExpressionParameterAccessor ddmExpressionParameterAccessor) {

_createExpressionRequest._ddmExpressionParameterAccessor =
ddmExpressionParameterAccessor;

return this;
}

private Builder(String expression) {
_createExpressionRequest._expression = expression;
}

private final CreateExpressionRequest _createExpressionRequest =
new CreateExpressionRequest();

}

private CreateExpressionRequest() {
}

private DDMExpressionActionHandler _ddmExpressionActionHandler;
private DDMExpressionFieldAccessor _ddmExpressionFieldAccessor;
private DDMExpressionObserver _ddmExpressionObserver;
private DDMExpressionParameterAccessor _ddmExpressionParameterAccessor;
private String _expression;

}
Expand Up @@ -18,8 +18,7 @@

import com.liferay.dynamic.data.mapping.expression.model.Expression;

import java.math.MathContext;

import java.util.Collections;
import java.util.Map;

/**
Expand All @@ -32,42 +31,116 @@ public interface DDMExpression<T> {

public Expression getModel();

public Map<String, VariableDependencies> getVariableDependenciesMap()
throws DDMExpressionException;
/**
* @deprecated As of Judson (7.1.x), with no direct replacement
*/
@Deprecated
public default Map<String, VariableDependencies>
getVariableDependenciesMap()
throws DDMExpressionException {

public void setBooleanVariableValue(
String variableName, Boolean variableValue);
return Collections.emptyMap();
}

public void setDDMExpressionFunction(
String functionName, DDMExpressionFunction ddmExpressionFunction);
/**
* @deprecated As of Judson (7.1.x), with no direct replacement
*/
@Deprecated
public default void setBooleanVariableValue(
String variableName, Boolean variableValue) {

setVariable(variableName, variableValue);
}

public void setDoubleVariableValue(
String variableName, Double variableValue);
/**
* @deprecated As of Judson (7.1.x), with no direct replacement
*/
@Deprecated
public default void setDDMExpressionFunction(
String functionName, DDMExpressionFunction ddmExpressionFunction) {
}

public void setExpressionStringVariableValue(
String variableName, String variableValue);
/**
* @deprecated As of Judson (7.1.x), with no direct replacement
*/
@Deprecated
public default void setDoubleVariableValue(
String variableName, Double variableValue) {

public void setFloatVariableValue(String variableName, Float variableValue);
setVariable(variableName, variableValue);
}

public void setIntegerVariableValue(
String variableName, Integer variableValue);
/**
* @deprecated As of Judson (7.1.x), with no direct replacement
*/
@Deprecated
public default void setExpressionStringVariableValue(
String variableName, String variableValue) {

public void setLongVariableValue(String variableName, Long variableValue);
setVariable(variableName, variableValue);
}

/**
* @deprecated As of Judson (7.1.x), with no direct replacement
*/
@Deprecated
public void setMathContext(MathContext mathContext);
public default void setFloatVariableValue(
String variableName, Float variableValue) {

public void setNumberVariableValue(
String variableName, Number variableValue);
setVariable(variableName, variableValue);
}

public void setObjectVariableValue(
String variableName, Object variableValue);
/**
* @deprecated As of Judson (7.1.x), with no direct replacement
*/
@Deprecated
public default void setIntegerVariableValue(
String variableName, Integer variableValue) {

public void setStringVariableValue(
setVariable(variableName, variableValue);
}

/**
* @deprecated As of Judson (7.1.x), with no direct replacement
*/
@Deprecated
public default void setLongVariableValue(
String variableName, Long variableValue) {

setVariable(variableName, variableValue);
}

/**
* @deprecated As of Judson (7.1.x), with no direct replacement
*/
@Deprecated
public default void setNumberVariableValue(
String variableName, Number variableValue) {

setVariable(variableName, variableValue);
}

/**
* @deprecated As of Judson (7.1.x), with no direct replacement
*/
@Deprecated
public default void setObjectVariableValue(
String variableName, Object variableValue) {

setVariable(variableName, variableValue);
}

/**
* @deprecated As of Judson (7.1.x), with no direct replacement
*/
@Deprecated
public default void setStringVariableValue(
String variableName, String variableValue)
throws DDMExpressionException;
throws DDMExpressionException {

setVariable(variableName, variableValue);
}

public void setVariable(String name, Object value);

}
@@ -0,0 +1,28 @@
/**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/

package com.liferay.dynamic.data.mapping.expression;

import aQute.bnd.annotation.ProviderType;

/**
* @author Leonardo Barros
*/
@ProviderType
public interface DDMExpressionActionHandler {

public ExecuteActionResponse executeAction(
ExecuteActionRequest executeActionRequest);

}
@@ -0,0 +1,28 @@
/**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/

package com.liferay.dynamic.data.mapping.expression;

import aQute.bnd.annotation.ProviderType;

/**
* @author Leonardo Barros
*/
@ProviderType
public interface DDMExpressionActionHandlerAware {

public void setDDMExpressionActionHandler(
DDMExpressionActionHandler ddmExpressionActionHandler);

}
Expand Up @@ -39,28 +39,6 @@ public DDMExpressionException(Throwable cause) {
super(cause);
}

/**
* @deprecated As of Judson (7.1.x), with no direct replacement
*/
@Deprecated
public static class FunctionNotAllowed extends DDMExpressionException {

public FunctionNotAllowed(String functionName) {
super(
String.format(
"The function name \"%s\" is not allowed", functionName));

_functionName = functionName;
}

public String getFunctionName() {
return _functionName;
}

private final String _functionName;

}

public static class FunctionNotDefined extends DDMExpressionException {

public FunctionNotDefined(Set<String> undefinedFunctionNames) {
Expand Down