Retrieve product_template images stored in database odoo 13 - postgresql

I have nodejs server and connected to postgres using pg module. the data binary field in the ir_attachment table is empty. The images might be stored in the windows directory. i can only retrieve the file name and the checksum. how to put things together and generate a url. I am using odoo version 13. please help
I tried to use the odoo url example: http://example.com/web/image?model=pos.category&id=5&field=image_128 but the image does not preview.

Example of permitting public users in the security file. At first I placed base.group_public above base.group_user. But it didn't work.
access_modulename_planned_locations,modulename.planned.locations,model_modulename_planned_locations,base.group_user,1,1,1,1
access_modulename_planned_locations,modulename.planned.locations,model_modulename_planned_locations,base.group_public,1,0,0,0

Related

How to show images from source stored in database in adf 12c

I am developing fusion web app in adf 12c with database 12c.
Here is the code of image showing on .jsf page.
<af:image id="i1" source="#{resource['UplDwn_Data:1.png']}"/>
Now i want to show images from the source stored in database.
I have done successfully uploading images and saving source value in database, not storing image as BLOB type in database.
I am storing full source value in database e.g. "#{resource['UplDwn_Data:1.png']}"
Here is the code of input text field where i am getting data from database.
<af:inputText value="#{bindings.Image.inputValue}"
label="Picture DB" rendered="true" simple="true"
required="#{bindings.Image.hints.mandatory}"
columns="#{bindings.Image.hints.displayWidth}"
maximumLength="#{bindings.Image.hints.precision}"
shortDesc="#{bindings.Image.hints.tooltip}" id="it66"
binding="#{FileManageBean.dbValue}">
<f:validator binding="#{bindings.Image.validator}"/>
</af:inputText>
Here is screen shot of above code after running in browser:
I want to use this data as image source to show on .jsf page.
If you have any other idea will be really appreciable, but remember i don't want to store image as blob type in database.
Just set the source attribute of an af:image to the value coming from the DB.
Note that the value in the DB should be the full URL (or at least a relative URL) to the image.

Replacing Data Source from one Server to Another

We are deploying Tableau for a bank.
We had created 6 test dashboards using dummy data on a staging data base using sql connection and lets say has an ip 10.10.10.10.
Now we need to use the same view we had used with the dummy data on Live data but using a different connection which is again an sql engine & IP lets say as 20.20.20.20. All the variable names and other properties are the same, not difference is that the Live data would not have calculated fields which we can deploy on the Live environment.
The challenge is: the LIVE data being of a bank is highly confidential and cannot be used from outside operations site rather we need to deploy it from an ODC [restricted environment]. Hence we simply cannot do a replace data source.
Hence we are planning to move twbx files and data extracts for each of these views using a shared folder to the ODC. Then the process would be like below:
As the LIVE sql data base is different from the dummy sql we will get error
We will select edit data connection
Will select tableau data extract for each sheet and dashboard
Will then select the option of replace data source and select LIVE SQL database
Will extract the new data
The visualization should work fine
Earlier we had just moved TWBX files hence it failed. Is there a different approach to it.
I did something similar to it
For that, you must have
same schema as of Live database and dummy database
do not change name of any source table or column
create your viz
send it in the .tbw form which is editable HTML format
Now the hard part- open your tbw in notepad and replace all connection details to new one
save and open in the tableau
tell me if it didn't worked
One method would be to modify your hosts file on your local computer, pointing the production server name the staging instance of the database. For example, let's say your production database is prod.url.com and you have a reporting staging db server instance called reportstage.otherurl.com
Open your hosts file. Add an entry for prod.url.com. Point it to reportstage.otherurl.com
Develop the report in Desktop, with the db connection string to prod.url.com.
When you publish the twb file to Server, no connection string changes are needed.
Another easier way is to publish the twb to Server with your staging connection string but edit the connection string in the data source in Server.
Develop the twb file on your local computer against your staging database.
Publish the twb file to Server.
Go to the workbook on Server and instead of looking at the views, click on Data Sources.
Edit the data source(s) connection information. This allows you to edit the server name, port, username, or password.
I've used this second method quite a bit. We have an environment where we can't hit the production db outside of the data center. Our staging environment doesn't have that restriction. We develop against the stage db, deploy, and edit the server name in the data source.

How to set metadata in sys_file_metadata for file id in TYPO3 6.2

I try to update the medatadata informations (EXIF) for images in a folder. Via the StorageRepository I can read the metadata from file system. I now want to put the recieved information into the TYPO3 database. I think I found the corresponding mysql table called sys_file_metadata where the informations are stored for each file id.
My question now is, if there are any functions or methods to put the recieved metadata into the database or do I have to put it in via a mysql query?
Just use the datahandler for this. https://docs.typo3.org/typo3cms/CoreApiReference/ApiOverview/Typo3CoreEngine/UsingDataHandler/Index.html
And indeed it's stored in sys_file_metadata

How to send emails with attachments located on disc using PL/SQL?

I have a ready script which sends email using PL/SQL. It has been stored in a procedure and when it is called by passing proper parameters, it sends email.
Now, I need to pick up a file from the disc and send it as an attachment. I have seen many examples where the data is stored in BLOB and comes from the DB. In my case it is not from DB instead it is a file on the server/disc.
How to achieve this ?
Use UTL_FILE to read data from disk.
You can find a good example of how to use it to load an entire file into a BLOB in the Alexandria PL/SQL Library. Look at (or just copy!) the code from file_util_pkg.get_blob_from_file.
ORACLE DIRECTORIES can be used to achieve this.
link to a full email/smtp example

How to test database behavior?

Dear all, Is there any tool available that can check all databases in a system by sending some sample data to the database to make sure that data transaction is occurring correctly. Moreover, the sample data should be invisible an inaccessible from the outside world. If you have any idea please help.
Update
Thank you for your answer. But I have some questions regarding your given answer.
Is the above solution is applicable to MySQL and SQLite?
If so, then where to open the database.txt file?
By the way, I am using WampServer2 for the system and my database is MySQL
1) create database.txt file and
change file type with name
database.udl
2) open the file
3) select tab provider
4) select Microsoft Ole Db Provider
for ODBC Drivers and press Next
5) write . or (local) in Use data
source name
6) select database name in (Enter the
initial catalog to use)
7) Test Connection