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

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.

Related

How to cache firestore documents in flutter?

I want to store documents that I download from firestore. Each document has a unique id so I was thinking of a way I can store that document in json format or in database table (so I can access its fields) and if that id is not present in the memory than just simply download it from firestore and save it. I also want these documents to be deleted if they are not used/called for a long time. I found this cache manager but was unable to understand how to use it.
you can download the content by using any of the flutter downloadmanager and keep the path of the downloaded content in sqllite and load the data from local storage rather than url if the data is already saved.
Following pseudo-code may help you:
if(isDownloaded(id)){
//show from local;
} else {
// show from remote
}
you can manually check whether the resources are being used or not by keeping a timestam of it and update the timestamp only when it is shown. and you can run a service which looks for the unused resources and delete it from storage and the databse too.

Retrieve product_template images stored in database odoo 13

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

Store gif in Core Data - Swift 3

How can I store a GIF image fetched from HTTP request in Core Data?
I already store my still images with UIImagePNGRepresentation as NSData in a Binary data attribute, but I have how to proceed with a gif?
Edit: What I've done so far is getting the data from the request, then storing it in the BinaryData using UIImagePNGRepresentation. But when I try to create a UIImage with SwiftyGif, an error message shows up saying Could not determine delay times for GIF. So I guess the PNG representation mess with the frames of the GIF.
I also tried to directly store the data from the http request but then the UIView throw me this error: Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN
A gif is a file format, and files are data and data can be stored in core data. Nevertheless it s a bad practice to store large amount of binary data in any database, and a filesystem is often a better choice. I would recommend storing the files in the file system and keeping relative file path in the database (make sure it is relative, because the app's container directory can change). If these are images that are retrieve from a server and can be refetched they should be stored in the tmp directory (or should just be managed separately with something like SDWebImage). If they are not retrievable later then they should be stored in the documents directory.
If that seems to hard then you can still store them in core-data. Core-data does has an option to allow it to store property as files outside of the database file ("Allows External Storage").
When you call UIImagePNGRepresentation, you're converting PNG data to a Swift Data structure. If you save it in Core Data, you'll be using a binary attribute.
You didn't mention how you're storing your GIFs. If you have them in Data instances then you do it exactly as with the PNGs-- with a Core Data binary attribute. If you have something other than a Data, please explain what kind of object or struct you're using to hold the GIF data.

how to match server database in our local database table in iphone

hi friend
can any one tell me that i have web server there i have create the database for store some value for registration form the value was save in webserver this is working good
but now that data coming in json format and now i have fetch json value and save in to the local database which is same as the webserverdata base both the side ssame table and same colume name is there how can i do this
and how to writ the query for this sitution help me
Various JSON parsers exist for objective c. You'll have to pass the data to a library or to javascript in a webview to extract it. Here is a google library:
http://code.google.com/p/json-framework/
If you need help with saving the data, I say with no snideness whatsoever that you should read the manual:
http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CoreData/Articles/cdUsingMOM.html
In

Fetching data from webservice and caching on iphone

I want to access a webservice to fetch alot of data (e.g. product lists/details/search results) and display this.
Are there any best practices for this type of operations?
Performance-wise, is there any better way than retrieving, parsing and displaying text data on each request and maybe load images in the background? Are there any wise caching policies which may be applied?
If I were doing something like this from the ground-up, here's what I'd do:
Have the web site post all the data in XML. Except for maybe the pictures - just have an XML field specify a URL for each picture. So, for example, say I was doing a product list.
Use NSXMLParser to both fetch and parse the XML data.
Use a separate NSData dataWithContentsOfURL: call to fetch the contents of each image, with the URL from the XML data
Write the XML data, (and the NSData image) to a database table with CoreData. Add a indexed timestamp field to the table.
You can now use the timestamp field to keep the newest "x" records in the database - and can purge the older ones if/when you need to.
Use the contents of the database table to populate a UITableView - or however else you want to present.
Make some sort of "next", "prev" or "update" fields in the UITableView to get more data from the web, if you need to display more data than is what is cached - or you want to update the data in the cache.