diff --git a/cws-core/src/main/java/jpl/cws/core/db/SchedulerDbService.java b/cws-core/src/main/java/jpl/cws/core/db/SchedulerDbService.java index 73f1d62d..83d015bd 100644 --- a/cws-core/src/main/java/jpl/cws/core/db/SchedulerDbService.java +++ b/cws-core/src/main/java/jpl/cws/core/db/SchedulerDbService.java @@ -16,6 +16,7 @@ import org.springframework.jdbc.support.lob.LobCreator; import java.io.ByteArrayOutputStream; +import java.sql.Array; import java.sql.PreparedStatement; import java.sql.SQLException; import java.sql.Timestamp; diff --git a/cws-core/src/main/java/jpl/cws/core/web/CwsSecurityFilter.java b/cws-core/src/main/java/jpl/cws/core/web/CwsSecurityFilter.java index 16e0a7ff..c484f6c8 100644 --- a/cws-core/src/main/java/jpl/cws/core/web/CwsSecurityFilter.java +++ b/cws-core/src/main/java/jpl/cws/core/web/CwsSecurityFilter.java @@ -41,6 +41,7 @@ public abstract class CwsSecurityFilter implements javax.servlet.Filter { private static final Logger log = LoggerFactory.getLogger(CwsSecurityFilter.class); public static final String CWS_TOKEN_COOKIE_NAME = "cwsToken"; + public static final String CWS_USERNAME_COOKIE_NAME = "cwsUsername"; static final String COOKIES_HEADER = "Set-Cookie"; @@ -564,6 +565,7 @@ else if (resourceId.startsWith("process/")) { protected void setCwsTokenCookie(HttpServletRequest req, HttpServletResponse resp) { String cwsToken = req.getSession().getId(); WebUtils.addCookie(CWS_TOKEN_COOKIE_NAME, cwsToken, null, "/", resp); + WebUtils.addUnsecureCookie(CWS_USERNAME_COOKIE_NAME, getUsernameFromReq(req), null, "/", resp); cwsSecurityService.addNewCwsTokenToDb(cwsToken, getUsernameFromReq(req)); //addCwsSessionId(getUsernameFromReq(req), req.getSession().getId()); } diff --git a/cws-core/src/main/java/jpl/cws/core/web/WebUtils.java b/cws-core/src/main/java/jpl/cws/core/web/WebUtils.java index ddf90183..89f94b61 100644 --- a/cws-core/src/main/java/jpl/cws/core/web/WebUtils.java +++ b/cws-core/src/main/java/jpl/cws/core/web/WebUtils.java @@ -212,6 +212,15 @@ public static void addCookie(String name, String value, String domain, String pa Cookie cookie = constructCookie(name, value, domain, path); resp.addCookie(cookie); } + + public static void addUnsecureCookie(String name, String value, String domain, String path, HttpServletResponse resp) { + if (!isValidCookieString(name) || !isValidCookieString(value)) { + throw new IllegalArgumentException("Cookie name and/or value is invalid (contains unacceptable characters)!"); + } + Cookie cookie = constructCookie(name, value, domain, path); + cookie.setHttpOnly(false); + resp.addCookie(cookie); + } diff --git a/cws-service/src/main/java/jpl/cws/controller/RestService.java b/cws-service/src/main/java/jpl/cws/controller/RestService.java index 833556de..6f7b97fc 100644 --- a/cws-service/src/main/java/jpl/cws/controller/RestService.java +++ b/cws-service/src/main/java/jpl/cws/controller/RestService.java @@ -55,11 +55,7 @@ import org.springframework.mock.web.MockMultipartFile; import org.springframework.stereotype.Controller; import org.springframework.util.MultiValueMap; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.servlet.ModelAndView; diff --git a/cws-service/src/main/java/jpl/cws/service/CwsConsoleService.java b/cws-service/src/main/java/jpl/cws/service/CwsConsoleService.java index fa5837b6..83c1d84e 100644 --- a/cws-service/src/main/java/jpl/cws/service/CwsConsoleService.java +++ b/cws-service/src/main/java/jpl/cws/service/CwsConsoleService.java @@ -636,7 +636,15 @@ public Map getInputVariablesForProcess(String processInstanceId) } inputVarMap.put("[" + historicVariableInstance.getCreateTime().toString() + "]" + varName + " (" + varType + ", " + mimeType + ")", encodedString); } else { - inputVarMap.put("[" + historicVariableInstance.getCreateTime().toString() + "]" + varName + " (" + varType + ")", fileName); + InputStream fileInputStream = fileValue.getValue(); + String encodedString = ""; + try { + byte[] sourceBytes = IOUtils.toByteArray(fileInputStream); + encodedString += Base64.getEncoder().encodeToString(sourceBytes); + } catch (IOException e) { + log.error("Error converting file to Base64"); + } + inputVarMap.put("[" + historicVariableInstance.getCreateTime().toString() + "]" + varName + "(" + varType + ") {" + fileName + "}", encodedString); } } else { InputStream fileInputStream = fileValue.getValue(); @@ -647,7 +655,7 @@ public Map getInputVariablesForProcess(String processInstanceId) } catch (IOException e) { log.error("Error converting file to Base64"); } - inputVarMap.put("[" + historicVariableInstance.getCreateTime().toString() + "]" + varName + "(" + varType + ") {" + fileName + "}", encodedString); + inputVarMap.put("[" + historicVariableInstance.getCreateTime().toString() + "]" + varName + " (" + varType + ") {" + fileName + "}", encodedString); } } } @@ -699,7 +707,16 @@ public Map getOutputVariablesForProcess(String processInstanceId } outputVarMap.put(varName + " (" + varType + ", " + mimeType + ")", encodedString); } else { - outputVarMap.put(varName + " (" + varType + ")", fileName); + InputStream fileInputStream = fileValue.getValue(); + String encodedString = ""; + try { + byte[] sourceBytes = IOUtils.toByteArray(fileInputStream); + encodedString += Base64.getEncoder().encodeToString(sourceBytes); + } catch (IOException e) { + log.error("Error converting file to Base64"); + } + outputVarMap.put("[" + historicVariableInstance.getCreateTime().toString() + "]" + varName + " (" + varType + ") {" + fileName + "}", encodedString); + } } else { InputStream fileInputStream = fileValue.getValue(); @@ -710,7 +727,7 @@ public Map getOutputVariablesForProcess(String processInstanceId } catch (IOException e) { log.error("Error converting file to Base64"); } - outputVarMap.put(varName + "(" + varType + ") {" + fileName + "}", encodedString); + outputVarMap.put(varName + " (" + varType + ") {" + fileName + "}", encodedString); } } } diff --git a/cws-ui/src/main/webapp/css/history.css b/cws-ui/src/main/webapp/css/history.css index 256306cc..2b094aeb 100644 --- a/cws-ui/src/main/webapp/css/history.css +++ b/cws-ui/src/main/webapp/css/history.css @@ -69,10 +69,26 @@ summary { align-items: center; } +.proc-var-flex-main-sub-1 { + align-self: start; + display: flex; + flex-wrap: nowrap; + justify-content: space-between; +} + +.proc-var-flex-main-sub-2 { + width: 150px; + word-wrap: break-word; + overflow: hidden; +} + +.proc-var-flex-main-sub-3 { + width: 200px; + word-wrap: break-word; +} + .proc-var-flex-btn { align-self: start; - margin-top: auto; - margin-bottom: auto; } #logDataNest { diff --git a/cws-ui/src/main/webapp/css/processes.css b/cws-ui/src/main/webapp/css/processes.css index 784abc61..b4e97319 100644 --- a/cws-ui/src/main/webapp/css/processes.css +++ b/cws-ui/src/main/webapp/css/processes.css @@ -136,4 +136,25 @@ summary { justify-content: space-between; align-items: flex-start; gap: 0px; +} + +.var-row-div-flex { + display: flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: flex-start; + align-items: flex-start; + align-content: center; +} + +.var-row-div-flex-sub-1 { + width: 85%; + max-width: 300px; + min-height: 25px; + float:left; + overflow-wrap: break-word; +} + +.var-row-div-flex-sub-2 { + flex-grow: 1; } \ No newline at end of file diff --git a/install/cws-ui/deployments.ftl b/install/cws-ui/deployments.ftl index f1c54f01..fc0d8a31 100644 --- a/install/cws-ui/deployments.ftl +++ b/install/cws-ui/deployments.ftl @@ -12,11 +12,15 @@ +