diff --git a/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/actions/dashboard/AbstractHTMLWidgetRenderer.java b/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/actions/dashboard/AbstractHTMLWidgetRenderer.java index 26481e78..2563079f 100644 --- a/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/actions/dashboard/AbstractHTMLWidgetRenderer.java +++ b/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/actions/dashboard/AbstractHTMLWidgetRenderer.java @@ -161,7 +161,7 @@ public abstract class AbstractHTMLWidgetRenderer extends AbstractWidgetRenderer public static String linkTableCreateWithDefaultValues(RenderWidgetInput input, String tableName, Map defaultValues) throws QException { String tablePath = QContext.getQInstance().getTablePath(tableName); - return (tablePath + "/create?defaultValues=" + URLEncoder.encode(JsonUtils.toJson(defaultValues), Charset.defaultCharset())); + return (tablePath + "/create#defaultValues=" + URLEncoder.encode(JsonUtils.toJson(defaultValues), Charset.defaultCharset())); } @@ -183,7 +183,6 @@ public abstract class AbstractHTMLWidgetRenderer extends AbstractWidgetRenderer - /******************************************************************************* ** *******************************************************************************/ diff --git a/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/actions/tables/GetAction.java b/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/actions/tables/GetAction.java index bd110c32..e2524591 100644 --- a/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/actions/tables/GetAction.java +++ b/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/actions/tables/GetAction.java @@ -65,16 +65,6 @@ public class GetAction - /******************************************************************************* - ** - *******************************************************************************/ - public QRecord executeForRecord(GetInput getInput) throws QException - { - return (execute(getInput).getRecord()); - } - - - /******************************************************************************* ** *******************************************************************************/ @@ -108,7 +98,7 @@ public class GetAction } GetOutput getOutput; - boolean usingDefaultGetInterface = false; + boolean usingDefaultGetInterface = false; if(getInterface == null) { getInterface = new DefaultGetInterface(); @@ -140,6 +130,43 @@ public class GetAction + /******************************************************************************* + ** shorthand way to call for the most common use-case, when you just want the + ** output record to be returned. + *******************************************************************************/ + public QRecord executeForRecord(GetInput getInput) throws QException + { + return (execute(getInput).getRecord()); + } + + + + /******************************************************************************* + ** more shorthand way to call for the most common use-case, when you just want the + ** output record to be returned, and you just want to pass in a table name and primary key. + *******************************************************************************/ + public static QRecord execute(String tableName, Serializable primaryKey) throws QException + { + GetAction getAction = new GetAction(); + GetInput getInput = new GetInput(tableName).withPrimaryKey(primaryKey); + return getAction.executeForRecord(getInput); + } + + + + /******************************************************************************* + ** more shorthand way to call for the most common use-case, when you just want the + ** output record to be returned, and you just want to pass in a table name and unique key + *******************************************************************************/ + public static QRecord execute(String tableName, Map uniqueKey) throws QException + { + GetAction getAction = new GetAction(); + GetInput getInput = new GetInput(tableName).withUniqueKey(uniqueKey); + return getAction.executeForRecord(getInput); + } + + + /******************************************************************************* ** Run a GetAction by using the QueryAction instead (e.g., with a filter made ** from the pkey/ukey, and returning the single record if found). diff --git a/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/actions/tables/QueryAction.java b/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/actions/tables/QueryAction.java index 29cd9f82..58cc53a3 100644 --- a/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/actions/tables/QueryAction.java +++ b/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/actions/tables/QueryAction.java @@ -151,6 +151,22 @@ public class QueryAction + /******************************************************************************* + ** shorthand way to call for the most common use-case, when you just want the + ** records to be returned, and you just want to pass in a table name and filter. + *******************************************************************************/ + public static List execute(String tableName, QQueryFilter filter) throws QException + { + QueryAction queryAction = new QueryAction(); + QueryInput queryInput = new QueryInput(); + queryInput.setTableName(tableName); + queryInput.setFilter(filter); + QueryOutput queryOutput = queryAction.execute(queryInput); + return (queryOutput.getRecords()); + } + + + /******************************************************************************* ** *******************************************************************************/ diff --git a/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/modules/authentication/implementations/Auth0AuthenticationModule.java b/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/modules/authentication/implementations/Auth0AuthenticationModule.java index f4895702..91210020 100644 --- a/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/modules/authentication/implementations/Auth0AuthenticationModule.java +++ b/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/modules/authentication/implementations/Auth0AuthenticationModule.java @@ -208,7 +208,7 @@ public class Auth0AuthenticationModule implements QAuthenticationModuleInterface // process a sessionUUID - looks up userSession record - cannot create token this way. // ///////////////////////////////////////////////////////////////////////////////////////// String sessionUUID = context.get(SESSION_UUID_KEY); - LOG.debug("Creating session from sessionUUID (userSession)", logPair("sessionUUID", maskForLog(sessionUUID))); + LOG.trace("Creating session from sessionUUID (userSession)", logPair("sessionUUID", maskForLog(sessionUUID))); if(sessionUUID != null) { accessToken = getAccessTokenFromSessionUUID(metaData, sessionUUID); @@ -266,7 +266,7 @@ public class Auth0AuthenticationModule implements QAuthenticationModuleInterface // decode the credentials from the header auth // ///////////////////////////////////////////////// String base64Credentials = context.get(BASIC_AUTH_KEY).trim(); - LOG.info("Creating session from basicAuthentication", logPair("base64Credentials", maskForLog(base64Credentials))); + LOG.trace("Creating session from basicAuthentication", logPair("base64Credentials", maskForLog(base64Credentials))); accessToken = getAccessTokenFromBase64BasicAuthCredentials(metaData, auth, base64Credentials); } catch(Auth0Exception e) @@ -285,7 +285,7 @@ public class Auth0AuthenticationModule implements QAuthenticationModuleInterface // process an api key - looks up client application token (creating token if needed) // /////////////////////////////////////////////////////////////////////////////////////// String apiKey = context.get(API_KEY); - LOG.info("Creating session from apiKey (accessTokenTable)", logPair("apiKey", maskForLog(apiKey))); + LOG.trace("Creating session from apiKey (accessTokenTable)", logPair("apiKey", maskForLog(apiKey))); if(apiKey != null) { accessToken = getAccessTokenFromApiKey(metaData, apiKey); diff --git a/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/processes/locks/ProcessLockUtils.java b/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/processes/locks/ProcessLockUtils.java index 5b736c2a..3dcc1de6 100644 --- a/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/processes/locks/ProcessLockUtils.java +++ b/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/processes/locks/ProcessLockUtils.java @@ -417,6 +417,12 @@ public class ProcessLockUtils { try { + if(processLock == null) + { + LOG.debug("No process lock passed in to release - returning with noop"); + return; + } + DeleteOutput deleteOutput = new DeleteAction().execute(new DeleteInput(ProcessLock.TABLE_NAME).withPrimaryKey(processLock.getId())); if(CollectionUtils.nullSafeHasContents(deleteOutput.getRecordsWithErrors())) {