mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 13:10:44 +00:00
Refactor to get rid of Usage parameter in QCodeReference
This commit is contained in:
@ -74,7 +74,7 @@ public class ChildRecordListRenderer extends AbstractWidgetRenderer
|
|||||||
return (new Builder(new QWidgetMetaData()
|
return (new Builder(new QWidgetMetaData()
|
||||||
.withName(join.getName())
|
.withName(join.getName())
|
||||||
.withIsCard(true)
|
.withIsCard(true)
|
||||||
.withCodeReference(new QCodeReference(ChildRecordListRenderer.class, null))
|
.withCodeReference(new QCodeReference(ChildRecordListRenderer.class))
|
||||||
.withType(WidgetType.CHILD_RECORD_LIST.getType())
|
.withType(WidgetType.CHILD_RECORD_LIST.getType())
|
||||||
.withDefaultValue("joinName", join.getName())));
|
.withDefaultValue("joinName", join.getName())));
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,6 @@ import com.kingsrook.qqq.backend.core.logging.QLogger;
|
|||||||
import com.kingsrook.qqq.backend.core.model.metadata.QBackendMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.QBackendMetaData;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.QInstance;
|
import com.kingsrook.qqq.backend.core.model.metadata.QInstance;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeUsage;
|
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.dashboard.QWidgetMetaDataInterface;
|
import com.kingsrook.qqq.backend.core.model.metadata.dashboard.QWidgetMetaDataInterface;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.fields.AdornmentType;
|
import com.kingsrook.qqq.backend.core.model.metadata.fields.AdornmentType;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.fields.FieldAdornment;
|
import com.kingsrook.qqq.backend.core.model.metadata.fields.FieldAdornment;
|
||||||
@ -706,7 +705,7 @@ public class QInstanceEnricher
|
|||||||
.withTableName(table.getName())
|
.withTableName(table.getName())
|
||||||
.withIsHidden(true)
|
.withIsHidden(true)
|
||||||
.withPermissionRules(qInstance.getDefaultPermissionRules().clone()
|
.withPermissionRules(qInstance.getDefaultPermissionRules().clone()
|
||||||
.withCustomPermissionChecker(new QCodeReference(BulkTableActionProcessPermissionChecker.class, QCodeUsage.CUSTOMIZER)));
|
.withCustomPermissionChecker(new QCodeReference(BulkTableActionProcessPermissionChecker.class)));
|
||||||
|
|
||||||
List<QFieldMetaData> editableFields = new ArrayList<>();
|
List<QFieldMetaData> editableFields = new ArrayList<>();
|
||||||
for(QFieldSection section : CollectionUtils.nonNullList(table.getSections()))
|
for(QFieldSection section : CollectionUtils.nonNullList(table.getSections()))
|
||||||
@ -770,7 +769,7 @@ public class QInstanceEnricher
|
|||||||
.withTableName(table.getName())
|
.withTableName(table.getName())
|
||||||
.withIsHidden(true)
|
.withIsHidden(true)
|
||||||
.withPermissionRules(qInstance.getDefaultPermissionRules().clone()
|
.withPermissionRules(qInstance.getDefaultPermissionRules().clone()
|
||||||
.withCustomPermissionChecker(new QCodeReference(BulkTableActionProcessPermissionChecker.class, QCodeUsage.CUSTOMIZER)));
|
.withCustomPermissionChecker(new QCodeReference(BulkTableActionProcessPermissionChecker.class)));
|
||||||
|
|
||||||
List<QFieldMetaData> editableFields = table.getFields().values().stream()
|
List<QFieldMetaData> editableFields = table.getFields().values().stream()
|
||||||
.filter(QFieldMetaData::getIsEditable)
|
.filter(QFieldMetaData::getIsEditable)
|
||||||
@ -817,7 +816,7 @@ public class QInstanceEnricher
|
|||||||
.withTableName(table.getName())
|
.withTableName(table.getName())
|
||||||
.withIsHidden(true)
|
.withIsHidden(true)
|
||||||
.withPermissionRules(qInstance.getDefaultPermissionRules().clone()
|
.withPermissionRules(qInstance.getDefaultPermissionRules().clone()
|
||||||
.withCustomPermissionChecker(new QCodeReference(BulkTableActionProcessPermissionChecker.class, QCodeUsage.CUSTOMIZER)));
|
.withCustomPermissionChecker(new QCodeReference(BulkTableActionProcessPermissionChecker.class)));
|
||||||
|
|
||||||
List<QFieldMetaData> tableFields = table.getFields().values().stream().toList();
|
List<QFieldMetaData> tableFields = table.getFields().values().stream().toList();
|
||||||
process.getFrontendStep("review").setRecordListFields(tableFields);
|
process.getFrontendStep("review").setRecordListFields(tableFields);
|
||||||
|
@ -31,7 +31,6 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.function.Consumer;
|
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
import com.kingsrook.qqq.backend.core.actions.automation.RecordAutomationHandler;
|
import com.kingsrook.qqq.backend.core.actions.automation.RecordAutomationHandler;
|
||||||
@ -51,7 +50,6 @@ import com.kingsrook.qqq.backend.core.model.metadata.QInstance;
|
|||||||
import com.kingsrook.qqq.backend.core.model.metadata.QMiddlewareInstanceMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.QMiddlewareInstanceMetaData;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeType;
|
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeType;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeUsage;
|
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldMetaData;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.fields.ValueTooLongBehavior;
|
import com.kingsrook.qqq.backend.core.model.metadata.fields.ValueTooLongBehavior;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.joins.JoinOn;
|
import com.kingsrook.qqq.backend.core.model.metadata.joins.JoinOn;
|
||||||
@ -909,9 +907,9 @@ public class QInstanceValidator
|
|||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
**
|
**
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
private void validateTableCustomizer(String tableName, String customizerName, QCodeReference codeReference)
|
private void validateTableCustomizer(String tableName, String roleName, QCodeReference codeReference)
|
||||||
{
|
{
|
||||||
String prefix = "Table " + tableName + ", customizer " + customizerName + ": ";
|
String prefix = "Table " + tableName + ", customizer " + roleName + ": ";
|
||||||
|
|
||||||
if(!preAssertionsForCodeReference(codeReference, prefix))
|
if(!preAssertionsForCodeReference(codeReference, prefix))
|
||||||
{
|
{
|
||||||
@ -934,7 +932,7 @@ public class QInstanceValidator
|
|||||||
//////////////////////////////////////////////////
|
//////////////////////////////////////////////////
|
||||||
Object customizerInstance = getInstanceOfCodeReference(prefix, customizerClass);
|
Object customizerInstance = getInstanceOfCodeReference(prefix, customizerClass);
|
||||||
|
|
||||||
TableCustomizers tableCustomizer = TableCustomizers.forRole(customizerName);
|
TableCustomizers tableCustomizer = TableCustomizers.forRole(roleName);
|
||||||
if(tableCustomizer == null)
|
if(tableCustomizer == null)
|
||||||
{
|
{
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
@ -947,29 +945,9 @@ public class QInstanceValidator
|
|||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
// make sure the customizer instance can be cast to the expected type //
|
// make sure the customizer instance can be cast to the expected type //
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
if(customizerInstance != null && tableCustomizer.getTableCustomizer().getExpectedType() != null)
|
if(customizerInstance != null && tableCustomizer.getExpectedType() != null)
|
||||||
{
|
{
|
||||||
Object castedObject = getCastedObject(prefix, tableCustomizer.getTableCustomizer().getExpectedType(), customizerInstance);
|
assertObjectCanBeCasted(prefix, tableCustomizer.getExpectedType(), customizerInstance);
|
||||||
|
|
||||||
Consumer<Object> validationFunction = tableCustomizer.getTableCustomizer().getValidationFunction();
|
|
||||||
if(castedObject != null && validationFunction != null)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
validationFunction.accept(castedObject);
|
|
||||||
}
|
|
||||||
catch(ClassCastException e)
|
|
||||||
{
|
|
||||||
errors.add(prefix + "Error validating customizer type parameters: " + e.getMessage());
|
|
||||||
}
|
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// mmm, calling customizers w/ random data is expected to often throw, so, this check is iffy at best... //
|
|
||||||
// if we run into more trouble here, we might consider disabling the whole "validation function" check. //
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -979,18 +957,18 @@ public class QInstanceValidator
|
|||||||
|
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
**
|
** Make sure that a given object can be casted to an expected type.
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
private <T> T getCastedObject(String prefix, Class<T> expectedType, Object customizerInstance)
|
private <T> T assertObjectCanBeCasted(String errorPrefix, Class<T> expectedType, Object object)
|
||||||
{
|
{
|
||||||
T castedObject = null;
|
T castedObject = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
castedObject = expectedType.cast(customizerInstance);
|
castedObject = expectedType.cast(object);
|
||||||
}
|
}
|
||||||
catch(ClassCastException e)
|
catch(ClassCastException e)
|
||||||
{
|
{
|
||||||
errors.add(prefix + "CodeReference is not of the expected type: " + expectedType);
|
errors.add(errorPrefix + "CodeReference is not of the expected type: " + expectedType);
|
||||||
}
|
}
|
||||||
return castedObject;
|
return castedObject;
|
||||||
}
|
}
|
||||||
@ -1504,7 +1482,6 @@ public class QInstanceValidator
|
|||||||
|
|
||||||
if(assertCondition(possibleValueSource.getCustomCodeReference() != null, "custom-type possibleValueSource " + pvsName + " is missing a customCodeReference."))
|
if(assertCondition(possibleValueSource.getCustomCodeReference() != null, "custom-type possibleValueSource " + pvsName + " is missing a customCodeReference."))
|
||||||
{
|
{
|
||||||
assertCondition(QCodeUsage.POSSIBLE_VALUE_PROVIDER.equals(possibleValueSource.getCustomCodeReference().getCodeUsage()), "customCodeReference for possibleValueSource " + pvsName + " is not a possibleValueProvider.");
|
|
||||||
validateSimpleCodeReference("PossibleValueSource " + pvsName + " custom code reference: ", possibleValueSource.getCustomCodeReference(), QCustomPossibleValueProvider.class);
|
validateSimpleCodeReference("PossibleValueSource " + pvsName + " custom code reference: ", possibleValueSource.getCustomCodeReference(), QCustomPossibleValueProvider.class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1548,7 +1525,7 @@ public class QInstanceValidator
|
|||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
if(classInstance != null)
|
if(classInstance != null)
|
||||||
{
|
{
|
||||||
getCastedObject(prefix, expectedClass, classInstance);
|
assertObjectCanBeCasted(prefix, expectedClass, classInstance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,9 +23,6 @@ package com.kingsrook.qqq.backend.core.model.metadata.code;
|
|||||||
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import com.kingsrook.qqq.backend.core.actions.automation.RecordAutomationHandler;
|
|
||||||
import com.kingsrook.qqq.backend.core.actions.processes.BackendStep;
|
|
||||||
import com.kingsrook.qqq.backend.core.actions.values.QCustomPossibleValueProvider;
|
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
@ -36,7 +33,6 @@ public class QCodeReference implements Serializable
|
|||||||
{
|
{
|
||||||
private String name;
|
private String name;
|
||||||
private QCodeType codeType;
|
private QCodeType codeType;
|
||||||
private QCodeUsage codeUsage;
|
|
||||||
|
|
||||||
private String inlineCode;
|
private String inlineCode;
|
||||||
|
|
||||||
@ -54,11 +50,10 @@ public class QCodeReference implements Serializable
|
|||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
** Constructor that takes all args
|
** Constructor that takes all args
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
public QCodeReference(String name, QCodeType codeType, QCodeUsage codeUsage)
|
public QCodeReference(String name, QCodeType codeType)
|
||||||
{
|
{
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.codeType = codeType;
|
this.codeType = codeType;
|
||||||
this.codeUsage = codeUsage;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -81,35 +76,6 @@ public class QCodeReference implements Serializable
|
|||||||
{
|
{
|
||||||
this.name = javaClass.getName();
|
this.name = javaClass.getName();
|
||||||
this.codeType = QCodeType.JAVA;
|
this.codeType = QCodeType.JAVA;
|
||||||
|
|
||||||
if(BackendStep.class.isAssignableFrom(javaClass))
|
|
||||||
{
|
|
||||||
this.codeUsage = QCodeUsage.BACKEND_STEP;
|
|
||||||
}
|
|
||||||
else if(QCustomPossibleValueProvider.class.isAssignableFrom(javaClass))
|
|
||||||
{
|
|
||||||
this.codeUsage = QCodeUsage.POSSIBLE_VALUE_PROVIDER;
|
|
||||||
}
|
|
||||||
else if(RecordAutomationHandler.class.isAssignableFrom(javaClass))
|
|
||||||
{
|
|
||||||
this.codeUsage = QCodeUsage.RECORD_AUTOMATION_HANDLER;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
throw (new IllegalStateException("Unable to infer code usage type for class: " + javaClass.getName()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
** Constructor that just takes a java class and code usage.
|
|
||||||
*******************************************************************************/
|
|
||||||
public QCodeReference(Class<?> javaClass, QCodeUsage codeUsage)
|
|
||||||
{
|
|
||||||
this.name = javaClass.getName();
|
|
||||||
this.codeType = QCodeType.JAVA;
|
|
||||||
this.codeUsage = codeUsage;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -182,40 +148,6 @@ public class QCodeReference implements Serializable
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
** Getter for codeUsage
|
|
||||||
**
|
|
||||||
*******************************************************************************/
|
|
||||||
public QCodeUsage getCodeUsage()
|
|
||||||
{
|
|
||||||
return codeUsage;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
** Setter for codeUsage
|
|
||||||
**
|
|
||||||
*******************************************************************************/
|
|
||||||
public void setCodeUsage(QCodeUsage codeUsage)
|
|
||||||
{
|
|
||||||
this.codeUsage = codeUsage;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
** Setter for codeUsage
|
|
||||||
**
|
|
||||||
*******************************************************************************/
|
|
||||||
public QCodeReference withCodeUsage(QCodeUsage codeUsage)
|
|
||||||
{
|
|
||||||
this.codeUsage = codeUsage;
|
|
||||||
return (this);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
** Getter for inlineCode
|
** Getter for inlineCode
|
||||||
**
|
**
|
||||||
|
@ -174,7 +174,7 @@ public class ScriptsMetaDataProvider
|
|||||||
.withLabel("Contents")
|
.withLabel("Contents")
|
||||||
.withIsCard(true)
|
.withIsCard(true)
|
||||||
.withType(WidgetType.SCRIPT_VIEWER.getType())
|
.withType(WidgetType.SCRIPT_VIEWER.getType())
|
||||||
.withCodeReference(new QCodeReference(DefaultWidgetRenderer.class, null)));
|
.withCodeReference(new QCodeReference(DefaultWidgetRenderer.class)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -24,7 +24,6 @@ package com.kingsrook.qqq.backend.core.processes.implementations.etl.basic;
|
|||||||
|
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeType;
|
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeType;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeUsage;
|
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldMetaData;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldType;
|
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldType;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.processes.QBackendStepMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.processes.QBackendStepMetaData;
|
||||||
@ -59,8 +58,7 @@ public class BasicETLProcess
|
|||||||
.withName(FUNCTION_NAME_EXTRACT)
|
.withName(FUNCTION_NAME_EXTRACT)
|
||||||
.withCode(new QCodeReference()
|
.withCode(new QCodeReference()
|
||||||
.withName(BasicETLExtractFunction.class.getName())
|
.withName(BasicETLExtractFunction.class.getName())
|
||||||
.withCodeType(QCodeType.JAVA)
|
.withCodeType(QCodeType.JAVA))
|
||||||
.withCodeUsage(QCodeUsage.BACKEND_STEP))
|
|
||||||
.withInputData(new QFunctionInputMetaData()
|
.withInputData(new QFunctionInputMetaData()
|
||||||
.withField(new QFieldMetaData(FIELD_SOURCE_TABLE, QFieldType.STRING)));
|
.withField(new QFieldMetaData(FIELD_SOURCE_TABLE, QFieldType.STRING)));
|
||||||
|
|
||||||
@ -68,8 +66,7 @@ public class BasicETLProcess
|
|||||||
.withName(FUNCTION_NAME_TRANSFORM)
|
.withName(FUNCTION_NAME_TRANSFORM)
|
||||||
.withCode(new QCodeReference()
|
.withCode(new QCodeReference()
|
||||||
.withName(BasicETLTransformFunction.class.getName())
|
.withName(BasicETLTransformFunction.class.getName())
|
||||||
.withCodeType(QCodeType.JAVA)
|
.withCodeType(QCodeType.JAVA))
|
||||||
.withCodeUsage(QCodeUsage.BACKEND_STEP))
|
|
||||||
.withInputData(new QFunctionInputMetaData()
|
.withInputData(new QFunctionInputMetaData()
|
||||||
.withField(new QFieldMetaData(FIELD_MAPPING_JSON, QFieldType.STRING))
|
.withField(new QFieldMetaData(FIELD_MAPPING_JSON, QFieldType.STRING))
|
||||||
.withField(new QFieldMetaData(FIELD_DESTINATION_TABLE, QFieldType.STRING)));
|
.withField(new QFieldMetaData(FIELD_DESTINATION_TABLE, QFieldType.STRING)));
|
||||||
@ -78,8 +75,7 @@ public class BasicETLProcess
|
|||||||
.withName(FUNCTION_NAME_LOAD)
|
.withName(FUNCTION_NAME_LOAD)
|
||||||
.withCode(new QCodeReference()
|
.withCode(new QCodeReference()
|
||||||
.withName(BasicETLLoadFunction.class.getName())
|
.withName(BasicETLLoadFunction.class.getName())
|
||||||
.withCodeType(QCodeType.JAVA)
|
.withCodeType(QCodeType.JAVA))
|
||||||
.withCodeUsage(QCodeUsage.BACKEND_STEP))
|
|
||||||
.withInputData(new QFunctionInputMetaData()
|
.withInputData(new QFunctionInputMetaData()
|
||||||
.withField(new QFieldMetaData(FIELD_DESTINATION_TABLE, QFieldType.STRING)))
|
.withField(new QFieldMetaData(FIELD_DESTINATION_TABLE, QFieldType.STRING)))
|
||||||
.withOutputMetaData(new QFunctionOutputMetaData()
|
.withOutputMetaData(new QFunctionOutputMetaData()
|
||||||
|
@ -24,7 +24,6 @@ package com.kingsrook.qqq.backend.core.processes.implementations.etl.streamed;
|
|||||||
|
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeType;
|
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeType;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeUsage;
|
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldMetaData;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldType;
|
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldType;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.processes.QBackendStepMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.processes.QBackendStepMetaData;
|
||||||
@ -59,8 +58,7 @@ public class StreamedETLProcess
|
|||||||
.withName(FUNCTION_NAME_ETL)
|
.withName(FUNCTION_NAME_ETL)
|
||||||
.withCode(new QCodeReference()
|
.withCode(new QCodeReference()
|
||||||
.withName(StreamedETLBackendStep.class.getName())
|
.withName(StreamedETLBackendStep.class.getName())
|
||||||
.withCodeType(QCodeType.JAVA)
|
.withCodeType(QCodeType.JAVA))
|
||||||
.withCodeUsage(QCodeUsage.BACKEND_STEP))
|
|
||||||
.withInputData(new QFunctionInputMetaData()
|
.withInputData(new QFunctionInputMetaData()
|
||||||
.withField(new QFieldMetaData(FIELD_SOURCE_TABLE, QFieldType.STRING))
|
.withField(new QFieldMetaData(FIELD_SOURCE_TABLE, QFieldType.STRING))
|
||||||
.withField(new QFieldMetaData(FIELD_MAPPING_JSON, QFieldType.STRING))
|
.withField(new QFieldMetaData(FIELD_MAPPING_JSON, QFieldType.STRING))
|
||||||
|
@ -29,7 +29,6 @@ import com.kingsrook.qqq.backend.core.model.actions.processes.RunBackendStepOutp
|
|||||||
import com.kingsrook.qqq.backend.core.model.actions.tables.query.QQueryFilter;
|
import com.kingsrook.qqq.backend.core.model.actions.tables.query.QQueryFilter;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeType;
|
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeType;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeUsage;
|
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.processes.QBackendStepMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.processes.QBackendStepMetaData;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.processes.QFunctionInputMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.processes.QFunctionInputMetaData;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.processes.QRecordListMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.processes.QRecordListMetaData;
|
||||||
@ -71,8 +70,7 @@ public class LoadInitialRecordsStep implements BackendStep
|
|||||||
.withName("loadInitialRecords")
|
.withName("loadInitialRecords")
|
||||||
.withCode(new QCodeReference()
|
.withCode(new QCodeReference()
|
||||||
.withName(LoadInitialRecordsStep.class.getName())
|
.withName(LoadInitialRecordsStep.class.getName())
|
||||||
.withCodeType(QCodeType.JAVA)
|
.withCodeType(QCodeType.JAVA))
|
||||||
.withCodeUsage(QCodeUsage.BACKEND_STEP))
|
|
||||||
.withInputData(new QFunctionInputMetaData()
|
.withInputData(new QFunctionInputMetaData()
|
||||||
.withRecordListMetaData(new QRecordListMetaData()
|
.withRecordListMetaData(new QRecordListMetaData()
|
||||||
.withTableName(tableName))));
|
.withTableName(tableName))));
|
||||||
|
@ -33,7 +33,6 @@ import com.kingsrook.qqq.backend.core.model.actions.tables.insert.InsertOutput;
|
|||||||
import com.kingsrook.qqq.backend.core.model.data.QRecord;
|
import com.kingsrook.qqq.backend.core.model.data.QRecord;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.QInstance;
|
import com.kingsrook.qqq.backend.core.model.metadata.QInstance;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeUsage;
|
|
||||||
import com.kingsrook.qqq.backend.core.modules.backend.implementations.memory.MemoryRecordStore;
|
import com.kingsrook.qqq.backend.core.modules.backend.implementations.memory.MemoryRecordStore;
|
||||||
import com.kingsrook.qqq.backend.core.utils.TestUtils;
|
import com.kingsrook.qqq.backend.core.utils.TestUtils;
|
||||||
import org.junit.jupiter.api.AfterEach;
|
import org.junit.jupiter.api.AfterEach;
|
||||||
@ -99,7 +98,7 @@ class ChildInserterPostInsertCustomizerTest extends BaseTest
|
|||||||
private static void addPostInsertActionToTable(QInstance qInstance)
|
private static void addPostInsertActionToTable(QInstance qInstance)
|
||||||
{
|
{
|
||||||
qInstance.getTable(TestUtils.TABLE_NAME_PERSON_MEMORY)
|
qInstance.getTable(TestUtils.TABLE_NAME_PERSON_MEMORY)
|
||||||
.withCustomizer(TableCustomizers.POST_INSERT_RECORD.getTableCustomizer(), new QCodeReference(PersonPostInsertAddFavoriteShapeCustomizer.class, QCodeUsage.CUSTOMIZER));
|
.withCustomizer(TableCustomizers.POST_INSERT_RECORD.getRole(), new QCodeReference(PersonPostInsertAddFavoriteShapeCustomizer.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ class ParentWidgetRendererTest extends BaseTest
|
|||||||
.withName(ProcessWidgetRenderer.class.getSimpleName())
|
.withName(ProcessWidgetRenderer.class.getSimpleName())
|
||||||
.withGridColumns(12)
|
.withGridColumns(12)
|
||||||
.withLabel("Test Parent Widget")
|
.withLabel("Test Parent Widget")
|
||||||
.withCodeReference(new QCodeReference(ParentWidgetRenderer.class, null))
|
.withCodeReference(new QCodeReference(ParentWidgetRenderer.class))
|
||||||
.withIcon("local_shipping");
|
.withIcon("local_shipping");
|
||||||
qInstance.addWidget(parentWidget);
|
qInstance.addWidget(parentWidget);
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ class ProcessWidgetRendererTest extends BaseTest
|
|||||||
.withDefaultValue(ProcessWidgetRenderer.WIDGET_PROCESS_NAME, TestUtils.PROCESS_NAME_GREET_PEOPLE)
|
.withDefaultValue(ProcessWidgetRenderer.WIDGET_PROCESS_NAME, TestUtils.PROCESS_NAME_GREET_PEOPLE)
|
||||||
.withLabel("Test Process Widget")
|
.withLabel("Test Process Widget")
|
||||||
.withGridColumns(6)
|
.withGridColumns(6)
|
||||||
.withCodeReference(new QCodeReference(ProcessWidgetRenderer.class, null));
|
.withCodeReference(new QCodeReference(ProcessWidgetRenderer.class));
|
||||||
qInstance.addWidget(metaData);
|
qInstance.addWidget(metaData);
|
||||||
|
|
||||||
RenderWidgetInput input = new RenderWidgetInput();
|
RenderWidgetInput input = new RenderWidgetInput();
|
||||||
|
@ -85,7 +85,7 @@ class USMapRendererTest extends BaseTest
|
|||||||
.withName(USMapWidgetRenderer.class.getSimpleName())
|
.withName(USMapWidgetRenderer.class.getSimpleName())
|
||||||
.withGridColumns(12)
|
.withGridColumns(12)
|
||||||
.withLabel("Test Parent Widget")
|
.withLabel("Test Parent Widget")
|
||||||
.withCodeReference(new QCodeReference(USMapWidgetRenderer.class, null))
|
.withCodeReference(new QCodeReference(USMapWidgetRenderer.class))
|
||||||
.withIcon("local_shipping");
|
.withIcon("local_shipping");
|
||||||
qInstance.addWidget(parentWidget);
|
qInstance.addWidget(parentWidget);
|
||||||
|
|
||||||
|
@ -39,7 +39,6 @@ import com.kingsrook.qqq.backend.core.model.actions.scripts.ExecuteCodeOutput;
|
|||||||
import com.kingsrook.qqq.backend.core.model.data.QRecord;
|
import com.kingsrook.qqq.backend.core.model.data.QRecord;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.QInstance;
|
import com.kingsrook.qqq.backend.core.model.metadata.QInstance;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeUsage;
|
|
||||||
import com.kingsrook.qqq.backend.core.model.scripts.ScriptsMetaDataProvider;
|
import com.kingsrook.qqq.backend.core.model.scripts.ScriptsMetaDataProvider;
|
||||||
import com.kingsrook.qqq.backend.core.modules.backend.implementations.memory.MemoryRecordStore;
|
import com.kingsrook.qqq.backend.core.modules.backend.implementations.memory.MemoryRecordStore;
|
||||||
import com.kingsrook.qqq.backend.core.utils.TestUtils;
|
import com.kingsrook.qqq.backend.core.utils.TestUtils;
|
||||||
@ -90,7 +89,7 @@ class ExecuteCodeActionTest extends BaseTest
|
|||||||
private ExecuteCodeInput setupInput(QInstance qInstance, Map<String, Serializable> context, QCodeExecutionLoggerInterface executionLogger)
|
private ExecuteCodeInput setupInput(QInstance qInstance, Map<String, Serializable> context, QCodeExecutionLoggerInterface executionLogger)
|
||||||
{
|
{
|
||||||
ExecuteCodeInput executeCodeInput = new ExecuteCodeInput();
|
ExecuteCodeInput executeCodeInput = new ExecuteCodeInput();
|
||||||
executeCodeInput.setCodeReference(new QCodeReference(ScriptInJava.class, QCodeUsage.CUSTOMIZER));
|
executeCodeInput.setCodeReference(new QCodeReference(ScriptInJava.class));
|
||||||
executeCodeInput.setContext(context);
|
executeCodeInput.setContext(context);
|
||||||
executeCodeInput.setExecutionLogger(executionLogger);
|
executeCodeInput.setExecutionLogger(executionLogger);
|
||||||
return executeCodeInput;
|
return executeCodeInput;
|
||||||
|
@ -34,7 +34,6 @@ import com.kingsrook.qqq.backend.core.model.actions.scripts.TestScriptInput;
|
|||||||
import com.kingsrook.qqq.backend.core.model.actions.scripts.TestScriptOutput;
|
import com.kingsrook.qqq.backend.core.model.actions.scripts.TestScriptOutput;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.QInstance;
|
import com.kingsrook.qqq.backend.core.model.metadata.QInstance;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeUsage;
|
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldMetaData;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldType;
|
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldType;
|
||||||
import com.kingsrook.qqq.backend.core.utils.ValueUtils;
|
import com.kingsrook.qqq.backend.core.utils.ValueUtils;
|
||||||
@ -60,7 +59,7 @@ class TestScriptActionInterfaceTest extends BaseTest
|
|||||||
|
|
||||||
TestScriptInput testScriptInput = new TestScriptInput();
|
TestScriptInput testScriptInput = new TestScriptInput();
|
||||||
testScriptInput.setInputValues(Map.of("name", "Darin", "age", 42));
|
testScriptInput.setInputValues(Map.of("name", "Darin", "age", 42));
|
||||||
testScriptInput.setCodeReference(new QCodeReference(SampleScript.class, QCodeUsage.CUSTOMIZER));
|
testScriptInput.setCodeReference(new QCodeReference(SampleScript.class));
|
||||||
TestScriptOutput testScriptOutput = new TestScriptOutput();
|
TestScriptOutput testScriptOutput = new TestScriptOutput();
|
||||||
new SampleTestAction().execute(testScriptInput, testScriptOutput);
|
new SampleTestAction().execute(testScriptInput, testScriptOutput);
|
||||||
|
|
||||||
|
@ -46,7 +46,6 @@ import com.kingsrook.qqq.backend.core.model.data.QRecord;
|
|||||||
import com.kingsrook.qqq.backend.core.model.metadata.QInstance;
|
import com.kingsrook.qqq.backend.core.model.metadata.QInstance;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeType;
|
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeType;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeUsage;
|
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldMetaData;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldType;
|
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldType;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.fields.ValueTooLongBehavior;
|
import com.kingsrook.qqq.backend.core.model.metadata.fields.ValueTooLongBehavior;
|
||||||
@ -386,25 +385,25 @@ class QInstanceValidatorTest extends BaseTest
|
|||||||
assertValidationFailureReasons((qInstance) -> qInstance.getTable("person").withCustomizer(TableCustomizers.POST_QUERY_RECORD.getRole(), new QCodeReference()),
|
assertValidationFailureReasons((qInstance) -> qInstance.getTable("person").withCustomizer(TableCustomizers.POST_QUERY_RECORD.getRole(), new QCodeReference()),
|
||||||
"missing a code reference name", "missing a code type");
|
"missing a code reference name", "missing a code type");
|
||||||
|
|
||||||
assertValidationFailureReasons((qInstance) -> qInstance.getTable("person").withCustomizer(TableCustomizers.POST_QUERY_RECORD.getRole(), new QCodeReference(null, QCodeType.JAVA, null)),
|
assertValidationFailureReasons((qInstance) -> qInstance.getTable("person").withCustomizer(TableCustomizers.POST_QUERY_RECORD.getRole(), new QCodeReference(null, QCodeType.JAVA)),
|
||||||
"missing a code reference name");
|
"missing a code reference name");
|
||||||
|
|
||||||
assertValidationFailureReasons((qInstance) -> qInstance.getTable("person").withCustomizer(TableCustomizers.POST_QUERY_RECORD.getRole(), new QCodeReference("", QCodeType.JAVA, null)),
|
assertValidationFailureReasons((qInstance) -> qInstance.getTable("person").withCustomizer(TableCustomizers.POST_QUERY_RECORD.getRole(), new QCodeReference("", QCodeType.JAVA)),
|
||||||
"missing a code reference name");
|
"missing a code reference name");
|
||||||
|
|
||||||
assertValidationFailureReasons((qInstance) -> qInstance.getTable("person").withCustomizer(TableCustomizers.POST_QUERY_RECORD.getRole(), new QCodeReference("Test", null, null)),
|
assertValidationFailureReasons((qInstance) -> qInstance.getTable("person").withCustomizer(TableCustomizers.POST_QUERY_RECORD.getRole(), new QCodeReference("Test", null)),
|
||||||
"missing a code type");
|
"missing a code type");
|
||||||
|
|
||||||
assertValidationFailureReasons((qInstance) -> qInstance.getTable("person").withCustomizer(TableCustomizers.POST_QUERY_RECORD.getRole(), new QCodeReference("Test", QCodeType.JAVA, QCodeUsage.CUSTOMIZER)),
|
assertValidationFailureReasons((qInstance) -> qInstance.getTable("person").withCustomizer(TableCustomizers.POST_QUERY_RECORD.getRole(), new QCodeReference("Test", QCodeType.JAVA)),
|
||||||
"Class for Test could not be found");
|
"Class for Test could not be found");
|
||||||
|
|
||||||
assertValidationFailureReasons((qInstance) -> qInstance.getTable("person").withCustomizer(TableCustomizers.POST_QUERY_RECORD.getRole(), new QCodeReference(CustomizerWithNoVoidConstructor.class, QCodeUsage.CUSTOMIZER)),
|
assertValidationFailureReasons((qInstance) -> qInstance.getTable("person").withCustomizer(TableCustomizers.POST_QUERY_RECORD.getRole(), new QCodeReference(CustomizerWithNoVoidConstructor.class)),
|
||||||
"Instance of " + CustomizerWithNoVoidConstructor.class.getSimpleName() + " could not be created");
|
"Instance of " + CustomizerWithNoVoidConstructor.class.getSimpleName() + " could not be created");
|
||||||
|
|
||||||
assertValidationFailureReasons((qInstance) -> qInstance.getTable("person").withCustomizer(TableCustomizers.POST_QUERY_RECORD.getRole(), new QCodeReference(CustomizerThatIsNotOfTheRightBaseClass.class, QCodeUsage.CUSTOMIZER)),
|
assertValidationFailureReasons((qInstance) -> qInstance.getTable("person").withCustomizer(TableCustomizers.POST_QUERY_RECORD.getRole(), new QCodeReference(CustomizerThatIsNotOfTheRightBaseClass.class)),
|
||||||
"CodeReference is not of the expected type");
|
"CodeReference is not of the expected type");
|
||||||
|
|
||||||
assertValidationFailureReasons((qInstance) -> qInstance.getTable("person").withCustomizer(TableCustomizers.POST_QUERY_RECORD.getRole(), new QCodeReference(CustomizerWithOnlyPrivateConstructor.class, QCodeUsage.CUSTOMIZER)),
|
assertValidationFailureReasons((qInstance) -> qInstance.getTable("person").withCustomizer(TableCustomizers.POST_QUERY_RECORD.getRole(), new QCodeReference(CustomizerWithOnlyPrivateConstructor.class)),
|
||||||
"it does not have a public parameterless constructor");
|
"it does not have a public parameterless constructor");
|
||||||
|
|
||||||
/////////////////////////////////////////////
|
/////////////////////////////////////////////
|
||||||
@ -413,7 +412,7 @@ class QInstanceValidatorTest extends BaseTest
|
|||||||
// assertValidationFailureReasons((qInstance) -> qInstance.getTable("person").withCustomizer(TableCustomizers.POST_QUERY_RECORD.getRole(), new QCodeReference(CustomizerWithPrivateVisibility.class, QCodeUsage.CUSTOMIZER)),
|
// assertValidationFailureReasons((qInstance) -> qInstance.getTable("person").withCustomizer(TableCustomizers.POST_QUERY_RECORD.getRole(), new QCodeReference(CustomizerWithPrivateVisibility.class, QCodeUsage.CUSTOMIZER)),
|
||||||
// "it does not have a public parameterless constructor");
|
// "it does not have a public parameterless constructor");
|
||||||
|
|
||||||
assertValidationSuccess((qInstance) -> qInstance.getTable("person").withCustomizer(TableCustomizers.POST_QUERY_RECORD.getRole(), new QCodeReference(CustomizerValid.class, QCodeUsage.CUSTOMIZER)));
|
assertValidationSuccess((qInstance) -> qInstance.getTable("person").withCustomizer(TableCustomizers.POST_QUERY_RECORD.getRole(), new QCodeReference(CustomizerValid.class)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -912,7 +911,6 @@ class QInstanceValidatorTest extends BaseTest
|
|||||||
"is missing a customCodeReference");
|
"is missing a customCodeReference");
|
||||||
|
|
||||||
assertValidationFailureReasons((qInstance) -> qInstance.getPossibleValueSource(TestUtils.POSSIBLE_VALUE_SOURCE_CUSTOM).setCustomCodeReference(new QCodeReference()),
|
assertValidationFailureReasons((qInstance) -> qInstance.getPossibleValueSource(TestUtils.POSSIBLE_VALUE_SOURCE_CUSTOM).setCustomCodeReference(new QCodeReference()),
|
||||||
"not a possibleValueProvider",
|
|
||||||
"missing a code reference name",
|
"missing a code reference name",
|
||||||
"missing a code type");
|
"missing a code type");
|
||||||
}
|
}
|
||||||
@ -1437,7 +1435,7 @@ class QInstanceValidatorTest extends BaseTest
|
|||||||
{
|
{
|
||||||
QReportDataSource dataSource = qInstance.getReport(TestUtils.REPORT_NAME_SHAPES_PERSON).getDataSources().get(0);
|
QReportDataSource dataSource = qInstance.getReport(TestUtils.REPORT_NAME_SHAPES_PERSON).getDataSources().get(0);
|
||||||
dataSource.setSourceTable(null);
|
dataSource.setSourceTable(null);
|
||||||
dataSource.setStaticDataSupplier(new QCodeReference(null, QCodeType.JAVA, null));
|
dataSource.setStaticDataSupplier(new QCodeReference(null, QCodeType.JAVA));
|
||||||
},
|
},
|
||||||
"missing a code reference name");
|
"missing a code reference name");
|
||||||
|
|
||||||
@ -1445,7 +1443,7 @@ class QInstanceValidatorTest extends BaseTest
|
|||||||
{
|
{
|
||||||
QReportDataSource dataSource = qInstance.getReport(TestUtils.REPORT_NAME_SHAPES_PERSON).getDataSources().get(0);
|
QReportDataSource dataSource = qInstance.getReport(TestUtils.REPORT_NAME_SHAPES_PERSON).getDataSources().get(0);
|
||||||
dataSource.setSourceTable(null);
|
dataSource.setSourceTable(null);
|
||||||
dataSource.setStaticDataSupplier(new QCodeReference(ArrayList.class, null));
|
dataSource.setStaticDataSupplier(new QCodeReference(ArrayList.class));
|
||||||
},
|
},
|
||||||
"is not of the expected type");
|
"is not of the expected type");
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,6 @@ import com.kingsrook.qqq.backend.core.model.actions.tables.update.UpdateOutput;
|
|||||||
import com.kingsrook.qqq.backend.core.model.data.QRecord;
|
import com.kingsrook.qqq.backend.core.model.data.QRecord;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.QInstance;
|
import com.kingsrook.qqq.backend.core.model.metadata.QInstance;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeUsage;
|
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.tables.QTableMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.tables.QTableMetaData;
|
||||||
import com.kingsrook.qqq.backend.core.model.session.QSession;
|
import com.kingsrook.qqq.backend.core.model.session.QSession;
|
||||||
import com.kingsrook.qqq.backend.core.utils.TestUtils;
|
import com.kingsrook.qqq.backend.core.utils.TestUtils;
|
||||||
@ -486,7 +485,7 @@ class MemoryBackendModuleTest extends BaseTest
|
|||||||
///////////////////////////////////
|
///////////////////////////////////
|
||||||
// add a customizer to the table //
|
// add a customizer to the table //
|
||||||
///////////////////////////////////
|
///////////////////////////////////
|
||||||
table.withCustomizer(TableCustomizers.POST_QUERY_RECORD.getRole(), new QCodeReference(ShapeTestCustomizer.class, QCodeUsage.CUSTOMIZER));
|
table.withCustomizer(TableCustomizers.POST_QUERY_RECORD.getRole(), new QCodeReference(ShapeTestCustomizer.class));
|
||||||
|
|
||||||
//////////////////
|
//////////////////
|
||||||
// do an insert //
|
// do an insert //
|
||||||
|
@ -61,7 +61,6 @@ import com.kingsrook.qqq.backend.core.model.metadata.automation.PollingAutomatio
|
|||||||
import com.kingsrook.qqq.backend.core.model.metadata.automation.QAutomationProviderMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.automation.QAutomationProviderMetaData;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeType;
|
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeType;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeUsage;
|
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.dashboard.QWidgetMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.dashboard.QWidgetMetaData;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.fields.DisplayFormat;
|
import com.kingsrook.qqq.backend.core.model.metadata.fields.DisplayFormat;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldMetaData;
|
||||||
@ -239,7 +238,7 @@ public class TestUtils
|
|||||||
{
|
{
|
||||||
qInstance.addWidget(new QWidgetMetaData()
|
qInstance.addWidget(new QWidgetMetaData()
|
||||||
.withName(PersonsByCreateDateBarChart.class.getSimpleName())
|
.withName(PersonsByCreateDateBarChart.class.getSimpleName())
|
||||||
.withCodeReference(new QCodeReference(PersonsByCreateDateBarChart.class, null)));
|
.withCodeReference(new QCodeReference(PersonsByCreateDateBarChart.class)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -939,8 +938,7 @@ public class TestUtils
|
|||||||
.withName("prepare")
|
.withName("prepare")
|
||||||
.withCode(new QCodeReference()
|
.withCode(new QCodeReference()
|
||||||
.withName(MockBackendStep.class.getName())
|
.withName(MockBackendStep.class.getName())
|
||||||
.withCodeType(QCodeType.JAVA)
|
.withCodeType(QCodeType.JAVA))
|
||||||
.withCodeUsage(QCodeUsage.BACKEND_STEP)) // todo - needed, or implied in this context?
|
|
||||||
.withInputData(new QFunctionInputMetaData()
|
.withInputData(new QFunctionInputMetaData()
|
||||||
.withRecordListMetaData(new QRecordListMetaData().withTableName(TABLE_NAME_PERSON))
|
.withRecordListMetaData(new QRecordListMetaData().withTableName(TABLE_NAME_PERSON))
|
||||||
.withFieldList(List.of(
|
.withFieldList(List.of(
|
||||||
@ -977,8 +975,7 @@ public class TestUtils
|
|||||||
.withName("doWork")
|
.withName("doWork")
|
||||||
.withCode(new QCodeReference()
|
.withCode(new QCodeReference()
|
||||||
.withName(MockBackendStep.class.getName())
|
.withName(MockBackendStep.class.getName())
|
||||||
.withCodeType(QCodeType.JAVA)
|
.withCodeType(QCodeType.JAVA))
|
||||||
.withCodeUsage(QCodeUsage.BACKEND_STEP)) // todo - needed, or implied in this context?
|
|
||||||
.withInputData(new QFunctionInputMetaData()
|
.withInputData(new QFunctionInputMetaData()
|
||||||
.withRecordListMetaData(new QRecordListMetaData().withTableName(TABLE_NAME_PERSON))
|
.withRecordListMetaData(new QRecordListMetaData().withTableName(TABLE_NAME_PERSON))
|
||||||
.withFieldList(List.of(
|
.withFieldList(List.of(
|
||||||
@ -1018,8 +1015,7 @@ public class TestUtils
|
|||||||
.withName("getAgeStatistics")
|
.withName("getAgeStatistics")
|
||||||
.withCode(new QCodeReference()
|
.withCode(new QCodeReference()
|
||||||
.withName(GetAgeStatistics.class.getName())
|
.withName(GetAgeStatistics.class.getName())
|
||||||
.withCodeType(QCodeType.JAVA)
|
.withCodeType(QCodeType.JAVA))
|
||||||
.withCodeUsage(QCodeUsage.BACKEND_STEP))
|
|
||||||
.withInputData(new QFunctionInputMetaData()
|
.withInputData(new QFunctionInputMetaData()
|
||||||
.withRecordListMetaData(new QRecordListMetaData().withTableName(TABLE_NAME_PERSON)))
|
.withRecordListMetaData(new QRecordListMetaData().withTableName(TABLE_NAME_PERSON)))
|
||||||
.withOutputMetaData(new QFunctionOutputMetaData()
|
.withOutputMetaData(new QFunctionOutputMetaData()
|
||||||
@ -1033,8 +1029,7 @@ public class TestUtils
|
|||||||
.withName("addAge")
|
.withName("addAge")
|
||||||
.withCode(new QCodeReference()
|
.withCode(new QCodeReference()
|
||||||
.withName(AddAge.class.getName())
|
.withName(AddAge.class.getName())
|
||||||
.withCodeType(QCodeType.JAVA)
|
.withCodeType(QCodeType.JAVA))
|
||||||
.withCodeUsage(QCodeUsage.BACKEND_STEP))
|
|
||||||
.withInputData(new QFunctionInputMetaData()
|
.withInputData(new QFunctionInputMetaData()
|
||||||
.withFieldList(List.of(new QFieldMetaData("yearsToAdd", QFieldType.INTEGER))))
|
.withFieldList(List.of(new QFieldMetaData("yearsToAdd", QFieldType.INTEGER))))
|
||||||
.withOutputMetaData(new QFunctionOutputMetaData()
|
.withOutputMetaData(new QFunctionOutputMetaData()
|
||||||
@ -1064,8 +1059,7 @@ public class TestUtils
|
|||||||
.withName("prepare")
|
.withName("prepare")
|
||||||
.withCode(new QCodeReference()
|
.withCode(new QCodeReference()
|
||||||
.withName(MockBackendStep.class.getName())
|
.withName(MockBackendStep.class.getName())
|
||||||
.withCodeType(QCodeType.JAVA)
|
.withCodeType(QCodeType.JAVA))
|
||||||
.withCodeUsage(QCodeUsage.BACKEND_STEP)) // todo - needed, or implied in this context?
|
|
||||||
.withInputData(new QFunctionInputMetaData()
|
.withInputData(new QFunctionInputMetaData()
|
||||||
.withRecordListMetaData(new QRecordListMetaData().withTableName(TABLE_NAME_PERSON))
|
.withRecordListMetaData(new QRecordListMetaData().withTableName(TABLE_NAME_PERSON))
|
||||||
.withFieldList(List.of(
|
.withFieldList(List.of(
|
||||||
|
@ -28,7 +28,6 @@ import com.kingsrook.qqq.backend.core.model.metadata.QBackendMetaData;
|
|||||||
import com.kingsrook.qqq.backend.core.model.metadata.QInstance;
|
import com.kingsrook.qqq.backend.core.model.metadata.QInstance;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.authentication.QAuthenticationMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.authentication.QAuthenticationMetaData;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeUsage;
|
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldMetaData;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldType;
|
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldType;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.tables.QTableMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.tables.QTableMetaData;
|
||||||
@ -94,7 +93,7 @@ public class TestUtils
|
|||||||
.withAuthorizationType(AuthorizationType.API_KEY_HEADER)
|
.withAuthorizationType(AuthorizationType.API_KEY_HEADER)
|
||||||
.withBaseUrl("http://localhost:9999/mock")
|
.withBaseUrl("http://localhost:9999/mock")
|
||||||
.withContentType("application/json")
|
.withContentType("application/json")
|
||||||
.withActionUtil(new QCodeReference(MockApiActionUtils.class, QCodeUsage.CUSTOMIZER))
|
.withActionUtil(new QCodeReference(MockApiActionUtils.class))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -146,7 +145,7 @@ public class TestUtils
|
|||||||
.withAuthorizationType(AuthorizationType.BASIC_AUTH_API_KEY)
|
.withAuthorizationType(AuthorizationType.BASIC_AUTH_API_KEY)
|
||||||
.withBaseUrl("https://api.easypost.com/v2/")
|
.withBaseUrl("https://api.easypost.com/v2/")
|
||||||
.withContentType("application/json")
|
.withContentType("application/json")
|
||||||
.withActionUtil(new QCodeReference(EasyPostUtils.class, QCodeUsage.CUSTOMIZER))
|
.withActionUtil(new QCodeReference(EasyPostUtils.class))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,6 @@ import com.kingsrook.qqq.backend.core.model.actions.processes.RunBackendStepOutp
|
|||||||
import com.kingsrook.qqq.backend.core.model.metadata.QBackendMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.QBackendMetaData;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeType;
|
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeType;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeUsage;
|
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldMetaData;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldType;
|
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldType;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.processes.QBackendStepMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.processes.QBackendStepMetaData;
|
||||||
@ -127,8 +126,7 @@ public class BasicETLCleanupSourceFilesStep implements BackendStep
|
|||||||
.withName(STEP_NAME)
|
.withName(STEP_NAME)
|
||||||
.withCode(new QCodeReference()
|
.withCode(new QCodeReference()
|
||||||
.withName(this.getClass().getName())
|
.withName(this.getClass().getName())
|
||||||
.withCodeType(QCodeType.JAVA)
|
.withCodeType(QCodeType.JAVA))
|
||||||
.withCodeUsage(QCodeUsage.BACKEND_STEP))
|
|
||||||
.withInputData(new QFunctionInputMetaData()
|
.withInputData(new QFunctionInputMetaData()
|
||||||
.addField(new QFieldMetaData("moveOrDelete", QFieldType.STRING))
|
.addField(new QFieldMetaData("moveOrDelete", QFieldType.STRING))
|
||||||
.addField(new QFieldMetaData("destinationForMoves", QFieldType.STRING))));
|
.addField(new QFieldMetaData("destinationForMoves", QFieldType.STRING))));
|
||||||
|
@ -30,7 +30,6 @@ import com.kingsrook.qqq.backend.core.model.actions.processes.RunBackendStepInpu
|
|||||||
import com.kingsrook.qqq.backend.core.model.actions.processes.RunBackendStepOutput;
|
import com.kingsrook.qqq.backend.core.model.actions.processes.RunBackendStepOutput;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeType;
|
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeType;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeUsage;
|
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldMetaData;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldType;
|
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldType;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.processes.QBackendStepMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.processes.QBackendStepMetaData;
|
||||||
@ -76,8 +75,7 @@ public class BasicETLCollectSourceFileNamesStep implements BackendStep
|
|||||||
.withName(STEP_NAME)
|
.withName(STEP_NAME)
|
||||||
.withCode(new QCodeReference()
|
.withCode(new QCodeReference()
|
||||||
.withName(this.getClass().getName())
|
.withName(this.getClass().getName())
|
||||||
.withCodeType(QCodeType.JAVA)
|
.withCodeType(QCodeType.JAVA))
|
||||||
.withCodeUsage(QCodeUsage.BACKEND_STEP))
|
|
||||||
.withOutputMetaData(new QFunctionOutputMetaData()
|
.withOutputMetaData(new QFunctionOutputMetaData()
|
||||||
.withField(new QFieldMetaData(FIELD_SOURCE_FILE_PATHS, QFieldType.STRING))));
|
.withField(new QFieldMetaData(FIELD_SOURCE_FILE_PATHS, QFieldType.STRING))));
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,6 @@ package com.kingsrook.qqq.backend.module.filesystem.processes.implementations.fi
|
|||||||
|
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeType;
|
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeType;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeUsage;
|
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldMetaData;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldType;
|
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldType;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.processes.QBackendStepMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.processes.QBackendStepMetaData;
|
||||||
@ -68,8 +67,7 @@ public class FilesystemSyncProcess
|
|||||||
.withName(FilesystemSyncStep.STEP_NAME)
|
.withName(FilesystemSyncStep.STEP_NAME)
|
||||||
.withCode(new QCodeReference()
|
.withCode(new QCodeReference()
|
||||||
.withName(FilesystemSyncStep.class.getName())
|
.withName(FilesystemSyncStep.class.getName())
|
||||||
.withCodeType(QCodeType.JAVA)
|
.withCodeType(QCodeType.JAVA))
|
||||||
.withCodeUsage(QCodeUsage.BACKEND_STEP))
|
|
||||||
.withInputData(new QFunctionInputMetaData()
|
.withInputData(new QFunctionInputMetaData()
|
||||||
.addField(new QFieldMetaData(FIELD_SOURCE_TABLE, QFieldType.STRING))
|
.addField(new QFieldMetaData(FIELD_SOURCE_TABLE, QFieldType.STRING))
|
||||||
.addField(new QFieldMetaData(FIELD_ARCHIVE_TABLE, QFieldType.STRING))
|
.addField(new QFieldMetaData(FIELD_ARCHIVE_TABLE, QFieldType.STRING))
|
||||||
|
@ -22,16 +22,15 @@
|
|||||||
package com.kingsrook.qqq.backend.module.filesystem.local.actions;
|
package com.kingsrook.qqq.backend.module.filesystem.local.actions;
|
||||||
|
|
||||||
|
|
||||||
import java.util.function.Function;
|
|
||||||
import com.kingsrook.qqq.backend.core.exceptions.QException;
|
import com.kingsrook.qqq.backend.core.exceptions.QException;
|
||||||
import com.kingsrook.qqq.backend.core.model.actions.tables.query.QueryInput;
|
import com.kingsrook.qqq.backend.core.model.actions.tables.query.QueryInput;
|
||||||
import com.kingsrook.qqq.backend.core.model.actions.tables.query.QueryOutput;
|
import com.kingsrook.qqq.backend.core.model.actions.tables.query.QueryOutput;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.QInstance;
|
import com.kingsrook.qqq.backend.core.model.metadata.QInstance;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeUsage;
|
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.tables.QTableMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.tables.QTableMetaData;
|
||||||
import com.kingsrook.qqq.backend.module.filesystem.TestUtils;
|
import com.kingsrook.qqq.backend.module.filesystem.TestUtils;
|
||||||
import com.kingsrook.qqq.backend.module.filesystem.base.FilesystemRecordBackendDetailFields;
|
import com.kingsrook.qqq.backend.module.filesystem.base.FilesystemRecordBackendDetailFields;
|
||||||
|
import com.kingsrook.qqq.backend.module.filesystem.base.actions.AbstractPostReadFileCustomizer;
|
||||||
import com.kingsrook.qqq.backend.module.filesystem.base.actions.FilesystemTableCustomizers;
|
import com.kingsrook.qqq.backend.module.filesystem.base.actions.FilesystemTableCustomizers;
|
||||||
import org.junit.jupiter.api.Assertions;
|
import org.junit.jupiter.api.Assertions;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
@ -70,7 +69,7 @@ public class FilesystemQueryActionTest extends FilesystemActionTest
|
|||||||
QInstance instance = TestUtils.defineInstance();
|
QInstance instance = TestUtils.defineInstance();
|
||||||
|
|
||||||
QTableMetaData table = instance.getTable(TestUtils.TABLE_NAME_PERSON_LOCAL_FS_JSON);
|
QTableMetaData table = instance.getTable(TestUtils.TABLE_NAME_PERSON_LOCAL_FS_JSON);
|
||||||
table.withCustomizer(FilesystemTableCustomizers.POST_READ_FILE.getRole(), new QCodeReference(ValueUpshifter.class, QCodeUsage.CUSTOMIZER));
|
table.withCustomizer(FilesystemTableCustomizers.POST_READ_FILE.getRole(), new QCodeReference(ValueUpshifter.class));
|
||||||
reInitInstanceInContext(instance);
|
reInitInstanceInContext(instance);
|
||||||
|
|
||||||
queryInput.setTableName(TestUtils.defineLocalFilesystemJSONPersonTable().getName());
|
queryInput.setTableName(TestUtils.defineLocalFilesystemJSONPersonTable().getName());
|
||||||
@ -83,10 +82,10 @@ public class FilesystemQueryActionTest extends FilesystemActionTest
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static class ValueUpshifter implements Function<String, String>
|
public static class ValueUpshifter extends AbstractPostReadFileCustomizer
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public String apply(String s)
|
public String customizeFileContents(String s)
|
||||||
{
|
{
|
||||||
return (s.replaceAll("kingsrook.com", "KINGSROOK.COM"));
|
return (s.replaceAll("kingsrook.com", "KINGSROOK.COM"));
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,6 @@ import com.kingsrook.qqq.backend.core.model.actions.scripts.ExecuteCodeOutput;
|
|||||||
import com.kingsrook.qqq.backend.core.model.metadata.QInstance;
|
import com.kingsrook.qqq.backend.core.model.metadata.QInstance;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeType;
|
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeType;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeUsage;
|
|
||||||
import org.assertj.core.api.Assertions;
|
import org.assertj.core.api.Assertions;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;
|
import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;
|
||||||
@ -53,7 +52,7 @@ class ExecuteCodeActionTest extends BaseTest
|
|||||||
void testHelloWorld() throws QException
|
void testHelloWorld() throws QException
|
||||||
{
|
{
|
||||||
ExecuteCodeInput input = new ExecuteCodeInput()
|
ExecuteCodeInput input = new ExecuteCodeInput()
|
||||||
.withCodeReference(new QCodeReference("helloWorld.js", QCodeType.JAVA_SCRIPT, QCodeUsage.CUSTOMIZER)
|
.withCodeReference(new QCodeReference("helloWorld.js", QCodeType.JAVA_SCRIPT)
|
||||||
.withInlineCode("""
|
.withInlineCode("""
|
||||||
return "Hello, " + input"""))
|
return "Hello, " + input"""))
|
||||||
.withContext("input", "World");
|
.withContext("input", "World");
|
||||||
@ -256,7 +255,7 @@ class ExecuteCodeActionTest extends BaseTest
|
|||||||
TestOutput testOutput = new TestOutput();
|
TestOutput testOutput = new TestOutput();
|
||||||
|
|
||||||
ExecuteCodeInput input = new ExecuteCodeInput();
|
ExecuteCodeInput input = new ExecuteCodeInput();
|
||||||
input.setCodeReference(new QCodeReference("test.js", QCodeType.JAVA_SCRIPT, QCodeUsage.CUSTOMIZER).withInlineCode(code));
|
input.setCodeReference(new QCodeReference("test.js", QCodeType.JAVA_SCRIPT).withInlineCode(code));
|
||||||
input.withContext("input", testInput);
|
input.withContext("input", testInput);
|
||||||
input.withContext("output", testOutput);
|
input.withContext("output", testOutput);
|
||||||
|
|
||||||
|
@ -43,7 +43,6 @@ import com.kingsrook.qqq.backend.core.model.metadata.QBackendMetaData;
|
|||||||
import com.kingsrook.qqq.backend.core.model.metadata.QInstance;
|
import com.kingsrook.qqq.backend.core.model.metadata.QInstance;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.authentication.Auth0AuthenticationMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.authentication.Auth0AuthenticationMetaData;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeUsage;
|
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.fields.DisplayFormat;
|
import com.kingsrook.qqq.backend.core.model.metadata.fields.DisplayFormat;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldMetaData;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldType;
|
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldType;
|
||||||
@ -193,7 +192,7 @@ public class TestUtils
|
|||||||
.withField(new QFieldMetaData("cost", QFieldType.DECIMAL).withDisplayFormat(DisplayFormat.CURRENCY))
|
.withField(new QFieldMetaData("cost", QFieldType.DECIMAL).withDisplayFormat(DisplayFormat.CURRENCY))
|
||||||
.withField(new QFieldMetaData("price", QFieldType.DECIMAL).withDisplayFormat(DisplayFormat.CURRENCY));
|
.withField(new QFieldMetaData("price", QFieldType.DECIMAL).withDisplayFormat(DisplayFormat.CURRENCY));
|
||||||
|
|
||||||
table.withCustomizer(TableCustomizers.PRE_INSERT_RECORD.getRole(), new QCodeReference(PersonPreInsertCustomizer.class, QCodeUsage.CUSTOMIZER));
|
table.withCustomizer(TableCustomizers.PRE_INSERT_RECORD.getRole(), new QCodeReference(PersonPreInsertCustomizer.class));
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// make some changes to this table in the "main" api (but leave it like the backend in the ALTERNATIVE_API_NAME) //
|
// make some changes to this table in the "main" api (but leave it like the backend in the ALTERNATIVE_API_NAME) //
|
||||||
|
@ -42,7 +42,6 @@ import com.kingsrook.qqq.backend.core.model.metadata.QInstance;
|
|||||||
import com.kingsrook.qqq.backend.core.model.metadata.authentication.QAuthenticationMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.authentication.QAuthenticationMetaData;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeType;
|
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeType;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeUsage;
|
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.dashboard.QWidgetMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.dashboard.QWidgetMetaData;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldMetaData;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldType;
|
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldType;
|
||||||
@ -174,7 +173,7 @@ public class TestUtils
|
|||||||
{
|
{
|
||||||
qInstance.addWidget(new QWidgetMetaData()
|
qInstance.addWidget(new QWidgetMetaData()
|
||||||
.withName(PersonsByCreateDateBarChart.class.getSimpleName())
|
.withName(PersonsByCreateDateBarChart.class.getSimpleName())
|
||||||
.withCodeReference(new QCodeReference(PersonsByCreateDateBarChart.class, null)));
|
.withCodeReference(new QCodeReference(PersonsByCreateDateBarChart.class)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -248,7 +247,7 @@ public class TestUtils
|
|||||||
.withAssociatedScript(new AssociatedScript()
|
.withAssociatedScript(new AssociatedScript()
|
||||||
.withFieldName("testScriptId")
|
.withFieldName("testScriptId")
|
||||||
.withScriptTypeId(1)
|
.withScriptTypeId(1)
|
||||||
.withScriptTester(new QCodeReference(TestScriptAction.class, QCodeUsage.SCRIPT_TESTER)));
|
.withScriptTester(new QCodeReference(TestScriptAction.class)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -280,8 +279,7 @@ public class TestUtils
|
|||||||
.withName("prepare")
|
.withName("prepare")
|
||||||
.withCode(new QCodeReference()
|
.withCode(new QCodeReference()
|
||||||
.withName(MockBackendStep.class.getName())
|
.withName(MockBackendStep.class.getName())
|
||||||
.withCodeType(QCodeType.JAVA)
|
.withCodeType(QCodeType.JAVA))
|
||||||
.withCodeUsage(QCodeUsage.BACKEND_STEP)) // todo - needed, or implied in this context?
|
|
||||||
.withInputData(new QFunctionInputMetaData()
|
.withInputData(new QFunctionInputMetaData()
|
||||||
.withRecordListMetaData(new QRecordListMetaData().withTableName(TABLE_NAME_PERSON))
|
.withRecordListMetaData(new QRecordListMetaData().withTableName(TABLE_NAME_PERSON))
|
||||||
.withFieldList(List.of(
|
.withFieldList(List.of(
|
||||||
@ -319,8 +317,7 @@ public class TestUtils
|
|||||||
.withName("doWork")
|
.withName("doWork")
|
||||||
.withCode(new QCodeReference()
|
.withCode(new QCodeReference()
|
||||||
.withName(MockBackendStep.class.getName())
|
.withName(MockBackendStep.class.getName())
|
||||||
.withCodeType(QCodeType.JAVA)
|
.withCodeType(QCodeType.JAVA))
|
||||||
.withCodeUsage(QCodeUsage.BACKEND_STEP)) // todo - needed, or implied in this context?
|
|
||||||
.withInputData(new QFunctionInputMetaData()
|
.withInputData(new QFunctionInputMetaData()
|
||||||
.withRecordListMetaData(new QRecordListMetaData().withTableName(TABLE_NAME_PERSON))
|
.withRecordListMetaData(new QRecordListMetaData().withTableName(TABLE_NAME_PERSON))
|
||||||
.withFieldList(List.of(
|
.withFieldList(List.of(
|
||||||
@ -441,8 +438,7 @@ public class TestUtils
|
|||||||
.withName(STEP_NAME_SLEEPER)
|
.withName(STEP_NAME_SLEEPER)
|
||||||
.withCode(new QCodeReference()
|
.withCode(new QCodeReference()
|
||||||
.withName(SleeperStep.class.getName())
|
.withName(SleeperStep.class.getName())
|
||||||
.withCodeType(QCodeType.JAVA)
|
.withCodeType(QCodeType.JAVA))
|
||||||
.withCodeUsage(QCodeUsage.BACKEND_STEP))
|
|
||||||
.withInputData(new QFunctionInputMetaData()
|
.withInputData(new QFunctionInputMetaData()
|
||||||
.addField(new QFieldMetaData(SleeperStep.FIELD_SLEEP_MILLIS, QFieldType.INTEGER))));
|
.addField(new QFieldMetaData(SleeperStep.FIELD_SLEEP_MILLIS, QFieldType.INTEGER))));
|
||||||
}
|
}
|
||||||
@ -499,8 +495,7 @@ public class TestUtils
|
|||||||
.withName(STEP_NAME_THROWER)
|
.withName(STEP_NAME_THROWER)
|
||||||
.withCode(new QCodeReference()
|
.withCode(new QCodeReference()
|
||||||
.withName(ThrowerStep.class.getName())
|
.withName(ThrowerStep.class.getName())
|
||||||
.withCodeType(QCodeType.JAVA)
|
.withCodeType(QCodeType.JAVA))
|
||||||
.withCodeUsage(QCodeUsage.BACKEND_STEP))
|
|
||||||
.withInputData(new QFunctionInputMetaData()
|
.withInputData(new QFunctionInputMetaData()
|
||||||
.addField(new QFieldMetaData(ThrowerStep.FIELD_SLEEP_MILLIS, QFieldType.INTEGER))));
|
.addField(new QFieldMetaData(ThrowerStep.FIELD_SLEEP_MILLIS, QFieldType.INTEGER))));
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,6 @@ import com.kingsrook.qqq.backend.core.model.metadata.QInstance;
|
|||||||
import com.kingsrook.qqq.backend.core.model.metadata.authentication.QAuthenticationMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.authentication.QAuthenticationMetaData;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeType;
|
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeType;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeUsage;
|
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldMetaData;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldType;
|
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldType;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.processes.QBackendStepMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.processes.QBackendStepMetaData;
|
||||||
@ -169,8 +168,7 @@ public class TestUtils
|
|||||||
.withName("prepare")
|
.withName("prepare")
|
||||||
.withCode(new QCodeReference()
|
.withCode(new QCodeReference()
|
||||||
.withName(MockBackendStep.class.getName())
|
.withName(MockBackendStep.class.getName())
|
||||||
.withCodeType(QCodeType.JAVA)
|
.withCodeType(QCodeType.JAVA))
|
||||||
.withCodeUsage(QCodeUsage.BACKEND_STEP)) // todo - needed, or implied in this context?
|
|
||||||
.withInputData(new QFunctionInputMetaData()
|
.withInputData(new QFunctionInputMetaData()
|
||||||
.withRecordListMetaData(new QRecordListMetaData().withTableName("person"))
|
.withRecordListMetaData(new QRecordListMetaData().withTableName("person"))
|
||||||
.withFieldList(List.of(
|
.withFieldList(List.of(
|
||||||
|
@ -41,7 +41,6 @@ import com.kingsrook.qqq.backend.core.model.metadata.authentication.QAuthenticat
|
|||||||
import com.kingsrook.qqq.backend.core.model.metadata.branding.QBrandingMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.branding.QBrandingMetaData;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeType;
|
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeType;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeUsage;
|
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.dashboard.QWidgetMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.dashboard.QWidgetMetaData;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.dashboard.QWidgetMetaDataInterface;
|
import com.kingsrook.qqq.backend.core.model.metadata.dashboard.QWidgetMetaDataInterface;
|
||||||
import com.kingsrook.qqq.backend.core.model.metadata.dashboard.QuickSightChartMetaData;
|
import com.kingsrook.qqq.backend.core.model.metadata.dashboard.QuickSightChartMetaData;
|
||||||
@ -156,7 +155,7 @@ public class SampleMetaDataProvider
|
|||||||
{
|
{
|
||||||
qInstance.addWidget(new QWidgetMetaData()
|
qInstance.addWidget(new QWidgetMetaData()
|
||||||
.withName(PersonsByCreateDateBarChart.class.getSimpleName())
|
.withName(PersonsByCreateDateBarChart.class.getSimpleName())
|
||||||
.withCodeReference(new QCodeReference(PersonsByCreateDateBarChart.class, null)));
|
.withCodeReference(new QCodeReference(PersonsByCreateDateBarChart.class)));
|
||||||
|
|
||||||
QMetaDataVariableInterpreter interpreter = new QMetaDataVariableInterpreter();
|
QMetaDataVariableInterpreter interpreter = new QMetaDataVariableInterpreter();
|
||||||
String accountId = interpreter.interpret("${env.QUICKSIGHT_ACCOUNT_ID}");
|
String accountId = interpreter.interpret("${env.QUICKSIGHT_ACCOUNT_ID}");
|
||||||
@ -173,7 +172,7 @@ public class SampleMetaDataProvider
|
|||||||
.withRegion(Regions.US_EAST_2.getName())
|
.withRegion(Regions.US_EAST_2.getName())
|
||||||
.withName(QuickSightChartRenderer.class.getSimpleName())
|
.withName(QuickSightChartRenderer.class.getSimpleName())
|
||||||
.withLabel("Example Quicksight Chart")
|
.withLabel("Example Quicksight Chart")
|
||||||
.withCodeReference(new QCodeReference(QuickSightChartRenderer.class, null));
|
.withCodeReference(new QCodeReference(QuickSightChartRenderer.class));
|
||||||
|
|
||||||
qInstance.addWidget(quickSightChartMetaData);
|
qInstance.addWidget(quickSightChartMetaData);
|
||||||
}
|
}
|
||||||
@ -418,8 +417,7 @@ public class SampleMetaDataProvider
|
|||||||
.withName("doWork")
|
.withName("doWork")
|
||||||
.withCode(new QCodeReference()
|
.withCode(new QCodeReference()
|
||||||
.withName(MockBackendStep.class.getName())
|
.withName(MockBackendStep.class.getName())
|
||||||
.withCodeType(QCodeType.JAVA)
|
.withCodeType(QCodeType.JAVA))
|
||||||
.withCodeUsage(QCodeUsage.BACKEND_STEP)) // todo - needed, or implied in this context?
|
|
||||||
.withInputData(new QFunctionInputMetaData()
|
.withInputData(new QFunctionInputMetaData()
|
||||||
.withRecordListMetaData(new QRecordListMetaData().withTableName(TABLE_NAME_PERSON))
|
.withRecordListMetaData(new QRecordListMetaData().withTableName(TABLE_NAME_PERSON))
|
||||||
.withFieldList(List.of(
|
.withFieldList(List.of(
|
||||||
@ -561,8 +559,7 @@ public class SampleMetaDataProvider
|
|||||||
.withName(STEP_NAME_SLEEPER)
|
.withName(STEP_NAME_SLEEPER)
|
||||||
.withCode(new QCodeReference()
|
.withCode(new QCodeReference()
|
||||||
.withName(SleeperStep.class.getName())
|
.withName(SleeperStep.class.getName())
|
||||||
.withCodeType(QCodeType.JAVA)
|
.withCodeType(QCodeType.JAVA))
|
||||||
.withCodeUsage(QCodeUsage.BACKEND_STEP))
|
|
||||||
.withInputData(new QFunctionInputMetaData()
|
.withInputData(new QFunctionInputMetaData()
|
||||||
.withField(new QFieldMetaData(SleeperStep.FIELD_SLEEP_MILLIS, QFieldType.INTEGER))));
|
.withField(new QFieldMetaData(SleeperStep.FIELD_SLEEP_MILLIS, QFieldType.INTEGER))));
|
||||||
}
|
}
|
||||||
@ -619,8 +616,7 @@ public class SampleMetaDataProvider
|
|||||||
.withName(STEP_NAME_THROWER)
|
.withName(STEP_NAME_THROWER)
|
||||||
.withCode(new QCodeReference()
|
.withCode(new QCodeReference()
|
||||||
.withName(ThrowerStep.class.getName())
|
.withName(ThrowerStep.class.getName())
|
||||||
.withCodeType(QCodeType.JAVA)
|
.withCodeType(QCodeType.JAVA))
|
||||||
.withCodeUsage(QCodeUsage.BACKEND_STEP))
|
|
||||||
.withInputData(new QFunctionInputMetaData()
|
.withInputData(new QFunctionInputMetaData()
|
||||||
.withField(new QFieldMetaData(ThrowerStep.FIELD_SLEEP_MILLIS, QFieldType.INTEGER))));
|
.withField(new QFieldMetaData(ThrowerStep.FIELD_SLEEP_MILLIS, QFieldType.INTEGER))));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user