Changes for page SMB - Dynamically Manipulate Settings
Last modified by Erik Bakker on 2024/09/03 09:17
From version 25.1
edited by Bouke Reitsma
on 2024/07/01 10:22
on 2024/07/01 10:22
Change comment:
There is no comment for this version
To version 28.1
edited by Erik Bakker
on 2024/07/01 13:10
on 2024/07/01 13:10
Change comment:
There is no comment for this version
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. BoukeReitsma1 +XWiki.ebakker - Content
-
... ... @@ -36,9 +36,9 @@ 36 36 [[image:Main.Images.Microlearning.WebHome@advanced-file-connectivity-dynamically-manipulate-smb-settings--standard-service-activator.png]] 37 37 38 38 Here, we must define an expression to set the host based on a supplied value. Important in this expression is that we correctly reference the complete name of the SMB Session Factory support object in the flow and that once the host is set, the actual message is passed along. An example of such an expression is: 39 - 39 + 40 40 {{code}}@'smb.gtwydynm.exit.support.smb-session'.setHost(headers.server) ?: #root{{/code}} 41 - 41 + 42 42 This expression will set the host based on the value in the header called "server" and, once done, will pass the full message to the output channel. 43 43 44 44 [[image:Main.Images.Microlearning.WebHome@advanced-file-connectivity-dynamically-manipulate-smb-settings--standard-service-activator-filled-in.png]] ... ... @@ -52,9 +52,9 @@ 52 52 [[image:Main.Images.Microlearning.WebHome@advanced-file-connectivity-dynamically-manipulate-smb-settings--standard-service-activator.png]] 53 53 54 54 Here, we must define an expression to set the host based on a supplied value. Important in this expression is that we correctly reference the complete name of the SMB Session Factory support object in the flow and that once the host is set, the actual message is passed along. An example of such an expression is: 55 - 55 + 56 56 {{code}}@'smb.gtwydynm.exit.support.smb-session'.setShareAndDir(headers.share) ?: #root{{/code}} 57 - 57 + 58 58 This expression will set the host based on the value in the header called "server" and, once done, will pass the full message to the output channel. 59 59 60 60 [[image:Main.Images.Microlearning.WebHome@advanced-file-connectivity-dynamically-manipulate-smb-settings--standard-service-activator-filled-in-share-and-dir.png]] ... ... @@ -61,6 +61,22 @@ 61 61 62 62 {{warning}}Note that you can combine multiple dynamic settings into one expression to keep the number of components efficient. In that case the code will look something as follows {{code}}@'smb.gtwydynm.exit.support.smb-session'.setShareAndDir(headers.share) ?: @'smb.gtwydynm.exit.support.smb-session'.setHost(headers.server) ?: #root{{/code}}{{/warning}} 63 63 64 +=== 3.3 Additional Dynamic Options === 65 + 66 +Although we don't think these options will be used much we define them here for the sake of completeness and give you examples on how to make these additional values dynamically. 67 + 68 +==== 3.3.1 Port ==== 69 + 70 +{{code}}@'smb.gtwydynm.exit.support.smb-session'.setPort(headers.port) ?: #root{{/code}} 71 + 72 +==== 3.3.2 Username ==== 73 + 74 +{{code}}@'smb.gtwydynm.exit.support.smb-session'.setUsername(headers.username) ?: #root{{/code}} 75 + 76 +==== 3.3.3 Password ==== 77 + 78 +{{code}}@'smb.gtwydynm.exit.support.smb-session'.setPassword(headers.password) ?: #root{{/code}} 79 + 64 64 == 4. Key takeaways == 65 65 66 66 * This option is the correct approach when you need to create a directory dynamically or have multiple hosts that host file shares.