mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 05:01:07 +00:00
Add LinkValues.TO_RECORD_FROM_TABLE_DYNAMIC and FileDownloadValues.DOWNLOAD_URL_DYNAMIC
This commit is contained in:
@ -23,8 +23,12 @@ package com.kingsrook.qqq.backend.core.model.metadata.fields;
|
||||
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Objects;
|
||||
import com.kingsrook.qqq.backend.core.model.metadata.possiblevalues.PossibleValueEnum;
|
||||
import com.kingsrook.qqq.backend.core.utils.Pair;
|
||||
import com.kingsrook.qqq.backend.core.utils.ValueUtils;
|
||||
import com.kingsrook.qqq.backend.core.utils.collections.MapBuilder;
|
||||
|
||||
|
||||
@ -48,7 +52,6 @@ public enum AdornmentType
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
*******************************************************************************/
|
||||
@ -56,6 +59,7 @@ public enum AdornmentType
|
||||
{
|
||||
String TARGET = "target";
|
||||
String TO_RECORD_FROM_TABLE = "toRecordFromTable";
|
||||
String TO_RECORD_FROM_TABLE_DYNAMIC = "toRecordFromTableDynamic";
|
||||
}
|
||||
|
||||
|
||||
@ -72,6 +76,8 @@ public enum AdornmentType
|
||||
String SUPPLEMENTAL_PROCESS_NAME = "supplementalProcessName";
|
||||
String SUPPLEMENTAL_CODE_REFERENCE = "supplementalCodeReference";
|
||||
|
||||
String DOWNLOAD_URL_DYNAMIC = "downloadUrlDynamic";
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
// use these two together, as in: //
|
||||
// FILE_NAME_FORMAT = "Order %s Packing Slip.pdf" //
|
||||
@ -79,6 +85,17 @@ public enum AdornmentType
|
||||
////////////////////////////////////////////////////
|
||||
String FILE_NAME_FORMAT = "fileNameFormat";
|
||||
String FILE_NAME_FORMAT_FIELDS = "fileNameFormatFields";
|
||||
|
||||
/***************************************************************************
|
||||
**
|
||||
***************************************************************************/
|
||||
static String makeFieldDownloadUrl(String tableName, Serializable primaryKey, String fieldName, String fileName)
|
||||
{
|
||||
return ("/data/" + tableName + "/"
|
||||
+ URLEncoder.encode(Objects.requireNonNullElse(ValueUtils.getValueAsString(primaryKey), ""), StandardCharsets.UTF_8) + "/"
|
||||
+ fieldName + "/"
|
||||
+ URLEncoder.encode(Objects.requireNonNullElse(fileName, ""), StandardCharsets.UTF_8));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user