Welcome Guest! Log in
×

Notice

The forum is in read only mode.
Stambia versions 2.x, 3.x, S17, S18, S19 and S20 are reaching End of Support January, 15th, 2024. Please consider upgrading to the supported Semarchy xDI versions. See Global Policy Support and the Semarchy Documentation.

The Stambia User Community is moving to Semarchy! All the applicable resources have already been moved or are currently being moved to their new location. Read more…

Topic-icon Solved How to retrieve the name of an extracted Base64 file?

More
24 Aug 2016 11:37 #1 by Josserand BRINON
Hi,

We are using the parameters "Extract Base64Binary To File" and "Base64Binaries Extract Directory", in the template "Action Process Load Xml to Rdbms".
It works well: a file is generated.
The name of this file looks like that: "base64Binary_665ea145-83b7-4f33-9e41-2091d0115fd2.data".

My questions are :
- how to retrieve its name? The aim is to rename and move it.
- how to manage the different .data files when there 2 or 3 base64 strings to extract from the same XML file?

Thanks.
More
24 Aug 2016 18:25 #2 by Thomas BLETON
Replied by Thomas BLETON on topic How to retrieve the name of an extracted Base64 file?
Hi,

These file names are random names.
If you map the Binary64 element to a VARCHAR column, then this column will contain the path to the ".data" file.
Once this is done, the idea is to SELECT the file list from the table, and process each file using a Bind link.

We can prepare an example if you want.
More
24 Aug 2016 18:32 #3 by Josserand BRINON
Replied by Josserand BRINON on topic How to retrieve the name of an extracted Base64 file?
Ok, I see the idea.

I'll try this solution:
- update my mapping,
- add a SqlToParameters to get the filename,
- add a moveFiles and use the parameter.

I keep you up to date.
More
24 Aug 2016 18:34 #4 by Thomas BLETON
Replied by Thomas BLETON on topic How to retrieve the name of an extracted Base64 file?
I would use SqlOperation
(bind)
> MoveFile

... but maybe you have specific reasons for using SqlToParameters which I don't know.
Anyway let us know what you come up with :)
More
24 Aug 2016 18:38 #5 by Josserand BRINON
Replied by Josserand BRINON on topic How to retrieve the name of an extracted Base64 file?
No, you are right, your method is better :)
I will focus my test with yours.
Thank you.
More
25 Aug 2016 16:23 #6 by Josserand BRINON
Replied by Josserand BRINON on topic How to retrieve the name of an extracted Base64 file?
Ok, I've tried to manage the process, it works perfectly.



I still have a question.
To get the path and the name of my result file("File To File" parameter), I use two substitution methods :
%x{$FILE_BASE64/tech:path()}x%\%x{$CONTRAT_PDF/tech:physicalName()}x%
Is there a method which allows me to get the full path+name, based on the metadata "CONTRAT_PDF"?

Attachments:
More
25 Aug 2016 16:35 #7 by Thomas BLETON
Replied by Thomas BLETON on topic How to retrieve the name of an extracted Base64 file?
Good news :)
For the full file path, try: %x{$CONTRAT_PDF/tech:filePath()}x%
More
25 Aug 2016 18:05 - 25 Aug 2016 18:06 #8 by Josserand BRINON
Replied by Josserand BRINON on topic How to retrieve the name of an extracted Base64 file?
Thank you Thomas.
Last edit: 25 Aug 2016 18:06 by Josserand BRINON.
More
26 Aug 2016 11:42 #9 by Josserand BRINON
Replied by Josserand BRINON on topic How to retrieve the name of an extracted Base64 file?
A last question please...
In the "Base64Binaries Extract Directory" paramater of the template, I want to get the path as defined in the metadata.
What is the method?

I tried
%x{$PATH_BASE64/tech:physicalPath()}x%
%x{$PATH_BASE64/tech:path()}x%
but it doesn't compile.
What is the correct syntax or correct method?

Thanks again.
More
26 Aug 2016 12:57 #10 by Thomas BLETON
Replied by Thomas BLETON on topic How to retrieve the name of an extracted Base64 file?
What is $PATH_BASE64?
I assume it is a File metadata, dragged on the "Rename file" action.
- Make sure this metadata link has the property "visibility" set to "parent", so that the whole process can use it (not only the current action).
- Create a parameter on the main process, named "extractdir", value "%x{$PATH_BASE64/ref:directory()/tech:path()}x%"
- Then in your template property, use ${~/extractdir}$