Download files from object storage in visual app of Oracle Visual Builder. How to use data from ATP Database to get dinamically the name of the files - oracle-cloud-infrastructure

I am trying to download specific files from the Object Storage in the Oracle Cloud in my Oracle Visual Builder App (my visual builder is inside OIC, Oracle Integration Cloud).
I'd like to use the name of the "File URL" column (see the picture above) as the file name of the file to download from the Object storage, but this file name should be different from every download button (again in the picture above, you can see that every download button should download the file that has the name of the value of the "File URL" column). The File URL column is the field of a business object which is linked to the SDP variable and the data arrives from an ATP database that is inside the Oracle Cloud Infrastructure. The column "First File" contains the Download buttons. In the properties of this button there is an ojAction event which is linked to an action chain (see picture below).
I followed this guide (Download from OCI Storage section) to download one file, but I mapped the "filename" input parameter with a fixed value (the name of an existing files inside the object storage). Now, I'd like to make the filename value dynamic, but I don't know how to create a variable that gathers all the values of the specific column (File URL) in the DB and how to pass the single value of this column to the filename parameter. I have tried to create an SDP type variable that gets only the File URL values, but it's not getting the values of the file names. Do you have suggestions or have you seen a guide that is maybe useful to solve this issue?

If I understood the problem correctly, you can't retrive the specific file URL linked to the row button the user click in order to download the right file.
If that's the case, then instead of using a button, you could use the "first-selected-row" event linked to the table itself; that will pass all the values of the selected row as parameter, and will allow you to link "$variables.rowData.fileURL" or whatever the field is called to the REST call.

Related

How to take "access token" value inside an output json file and pass the same "access token" to another REST GET request in Azure Data Factory?

I have got access token and expiry time as two columns in a JSON file after doing a POST request and stored the file in Blob storage.
Now I need to look inside the JSON file the I stored before and take the value of Access token and use it as a parameter to another REST request.
Please help...
Depending on your scenario, there are a couple ways you can do this. I assume that you need the access token for a completely different pipeline since you are storing the Get access token output to a file in Blob.
So in order to reference the values within the json Blob file, you can just use a lookup activity in Azure Data Factory. Within this Lookup Activity you will use a dataset for a json file referencing a linked service connection to your Azure Blob Storage.
Here is an illustration with a json file in my Blob container:
The above screenshot uses a lookup using the Json File dataset on a Blob Storage Linked service to get the contents of the file. It then saves the outputted contents of the file to variables, one for access token, and another for expiration time. You don't have to save them to variables, and instead can call the output of the activity directly in the subsequent web activity. Here are the details of the outputs and settings:
Hopefully this helps, and let me know if you need clarification on anything.
EDIT:
I forgot to mention, if you need to get the access token using a web activity, then just need to use it again for another web activity in the same pipeline, then you can just get the AccessToken Value in the first web activity, and call that output in the next web activity. Just like I showed in the Lookup Activity, but instead you'd be using the response from the first web activity that retrieves the Access Token. Apologies if that's hard to follow, so here is an illustration of what I mean:
A simple way to read JSON files into a pipeline is to use the Lookup activity.
Here is a test JSON file loaded into Blob Storage in a container named json:
Create a JSON Dataset that just points to the container, you won't need to configure or parameterize the Folder or file name values, although you certainly can if that suits your purpose:
Use a Lookup activity that references the Dataset. Populate the Wildcard folder and file name fields. [This example leaves the "Wildcard folder path" blank, because the file is in the container root.] To read a single JSON file, leave "First row only" checked.
This will load the file contents into the Lookup Activity's output:
The Lookup activity's output.firstRow property will become your JSON root. Process the object as you would any other JSON structure:
NOTE: the Lookup activity has a limit of 5,000 rows and 4MB.

PDFPrinter driver with ability for custom file name

Does anyone know of a PDF printer driver that allows you to programatically set the file name for printing/saving.
Im not sure if its possible with PDFCreator, but Im unable to figure it out.
So I am creating HTML Reports and have a print button to print it to PDF.
But now I have to automate it more so that it will be able to generate the PDF with a certain name. This without human interaction.
Win2PDF has several ways to do this.
The Auto-name feature can automatically name the PDF file, and can use the document title to name the files along with configurable date/time stamps. This can be configured with no changes to your program.
The file name can also be set by your program using the Windows API or by setting a string value in the registry named PDFDefaultFileName.

How to open a doc or pdf document from Odoo website?

How can we open a word document or pdf file by clicking on any link in Odoo? What are the steps need to be done?
1) Install module Document Management System (document).
2) Create directory (knowledge menu unit) or use existing one. Attach to this category required file (button "Attachments" above the form)
3) Since it was downloaded, it would generate an url. To access it: mouse right click on downloaded file - save url
4) Add the url to the website. Pressing it will download the file (publically available).
Note : Above Functionlity Work on odoo 8.
Document Management System module Remove in odoo 9 community and enterprice so this all file store in ir.attachment model.
So. Programatically, it is pretty much the same. The module 'document' allows to attach files to any object, including product.product (or product.template). So you have to find it:
attachment_ids = self.env['ir.attachment'].search([('res_model','=','product.product'),('res_id','=',product.id)]).
Where product.id - is id of needed product. E.g. you can store attachment_ids in product.product class as one2many field. After that you can get an url of any attachment. For example, for binary files:
for attach in attachment_ids:
url = 'https://yourcompany.com'+'/web/binary/saveas?model=ir.attachment&field=datas&filename_field=name&id='+str(attach.id)
This url may be easily added to the website product site, using foreach in product.attachment_ids

Iterate Through Rows of CSV File and Assign Particular Row Value to Package Variable

I am currently using SSIS 2008 and am fairly new to it. I have a programming background with some Java, VBA, and VB.NET.
I have a connection to a csv file that contains a list of URLs.
There about a thousand rows in the file and with each row, I want to add the URL to a package variable that will be used to see if the most current link has already been downloaded and updated or not.
I've set up a Foreach Loop Container that is intended to loop through each row of of the csv file.
However, I cannot figure out how to "look at" each row. Once I can do that I know it will be no problem to assign the URL to the variable but I am stuck mid-way. Does anyone have any suggestions?
You want to do something to each row from a given source. That's usually a data flow type of activity. Drop a Data Flow Task onto your Control Flow. Inside that data flow, add a Flat File Source. In the Flat file connection manager, click New and fill out the details for your file. I assume it's just one data element (url) per line. Click OKs and then you should have a working data source.
Great, now all you need to do is that "something" to the data coming in which in your case is "see if the most current link has already been downloaded and updated or not." I'm not sure exactly what that translates to but whatever you attach (look up task, script task, etc) to the output from the Flat File Source will perform that operation for every row flowing through it.

Explore for files in Access

I have a form that a user uses to upload a CSV file. Right now the user has to type the full file path of the file into a text box. How can I get a browse for file popup to allow the user to navigate to the file instead of having to type the whole path? Is the functionality already present and I just don't know how to use it yet?
you can create your own class with API calls. Here you have the code. Or you can add a reference to Microsoft Office xx Object Library and use the FileDialog class.
Here you have an example of usage.
I prefer the first method, because you are not attached to an external library.