Professional Documents
Culture Documents
com/message/2197822#2197822
Hi,
Is there a way that an Image stored in the database column be shown on the OA Fwk Page ??
We want to show the photo of the employee in a particular report.The images are stored in the per_images tables.
It tried creating a VO on per_images and map the attribute Image of the same to an item on the Page.
But dint work. :(
Regards
Jujaar
1 of 12 12/4/2019 5:02 PM
Displaying an Image stored in the Database as B... | Oracle Community https://community.oracle.com/message/2197822#2197822
(0 ratings)
What is the item type u have created and what is the datatype associated with it?
Thanks
Babu
2 of 12 12/4/2019 5:02 PM
Displaying an Image stored in the Database as B... | Oracle Community https://community.oracle.com/message/2197822#2197822
Hi,
Can u tell me what shuld be the Item Type and Data type shuld be associted with it??
Regards
Jujaar
3 of 12 12/4/2019 5:02 PM
Displaying an Image stored in the Database as B... | Oracle Community https://community.oracle.com/message/2197822#2197822
Jugaar,
One way of doing it through urlinclude is see this link:
http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=50&t=014273
I haven't tried the approach mentioned in this link, but looks perfect with urlinlcude and an additional jsp with jdbc code to get the
image.
I remember this discussion in many old threads, it wouold not be possible to show image from Db column of blob type. The only work
around is keep all the employee images in OA_MEDIA folder, with a unique indentifier say employee id as name.
In your VO get the employee_id of the corresponding employee and display image from the media folder.
--Mukul
Hi Mukul,
Gareth
4 of 12 12/4/2019 5:02 PM
Displaying an Image stored in the Database as B... | Oracle Community https://community.oracle.com/message/2197822#2197822
Gareth,
I agree Oracle should come up for a solution on this, but as of now, i don't see any solution for this.In fact UIX engine which is the
view layer of OAF, takes all pics of icons, buttons etc, from OA_MEDIA.
I have worked in ADF Faces,there u surely have solutions. So, as of now, the approach I mentioned above, i see no other approach
other than this working.
--Mukul
Jujjar,
did u tried the approach?
--Mukul
Cheers to all the people who are active on this forum helping others.
Hey Mukul,
5 of 12 12/4/2019 5:02 PM
Displaying an Image stored in the Database as B... | Oracle Community https://community.oracle.com/message/2197822#2197822
The basic concept we all know that Image should be there in the application tier for the OA Fwk page to display it.
But in our case the issue was User can change their photos anytime which will be saved in the database.So in order to get the latest
photo ,it was required that we take the photo always from the database.
We got reference from one of the Oracle Seeded page in Oracle HR (Self Service) which is used for uploading and viewing the
photos.
Page: /oracle/apps/per/selfservice/empdir/webui/EmpDetailPG
We created a VO with one dummy column in the VO and in the Controller we get the temporary location for the file which is returned
by OAPageContext on the application tier.
pageContext.getTemporaryImageLocation();
Then a method is called to create a file at the location got in the step mentioned above with the name of image.(Name of image
which is stored in the database,one of the VO attribute).
The dummy column of the VO is set the value which contains the path and Image name created on the application tier in the step
mentioned above.
In the controller we bind this column name with the Item(of type Image) on the page.
6 of 12 12/4/2019 5:02 PM
Displaying an Image stored in the Database as B... | Oracle Community https://community.oracle.com/message/2197822#2197822
pageContext.getApplicationModule(webBean).invokeMethod("initImg",param);
OAImageBean oaimagebean = (OAImageBean)webBean.findIndexedChildRecursive("item1");
if(oaimagebean != null)
{
oaimagebean.setAttributeValue(UIConstants.SOURCE_ATTR, new OADataBoundValueViewObject(oaimagebean, "ImageSource"));
oaimagebean.setWidth(100);
oaimagebean.setHeight(110);
oaimagebean.setBorderWidth(2);
}
if(pageContext.isLoggingEnabled(1))
pageContext.writeDiagnostics(this, "Leaving processRequest..", 1);
}
********************************AM Methods***************************************
public void initImg(String s2)
{
OAViewObjectImpl oaviewobjectimpl = getImageEOVO1();
oaviewobjectimpl.executeQuery();
if(oaviewobjectimpl.first() != null)
{
OARow oarow = (OARow)oaviewobjectimpl.first();
BlobDomain blobdomain = (BlobDomain)oarow.getAttribute("Image");
if(blobdomain != null)
{
String s3 = createFile(s2, blobdomain, (String)oarow.getAttribute("ImageName"));
oarow.setAttribute("ImageSource", s3);
}
}
}
7 of 12 12/4/2019 5:02 PM
Displaying an Image stored in the Database as B... | Oracle Community https://community.oracle.com/message/2197822#2197822
outputstream.close();
inputstream.close();
}
8 of 12 12/4/2019 5:02 PM
Displaying an Image stored in the Database as B... | Oracle Community https://community.oracle.com/message/2197822#2197822
PerEmpdirImagesEO.IMAGE_NAME,
PerEmpdirImagesEO.CONTENT_TYPE,
PerEmpdirImagesEO.IMAGE,
PerEmpdirImagesEO.OBJECT_VERSION_NUMBER,
PerEmpdirImagesEO.LAST_UPDATE_DATE,
PerEmpdirImagesEO.LAST_UPDATED_BY,
PerEmpdirImagesEO.LAST_UPDATE_LOGIN,
PerEmpdirImagesEO.CREATED_BY,
PerEmpdirImagesEO.CREATION_DATE,
Null Image_Source
FROM Per_Empdir_Images PerEmpdirImagesEO
WHERE Orig_System = 'PER'
And Orig_System_Id = 162676
--------------------------------------------------------------------------------------
Cheers
Jujaar
Jujjar,
But the apporach remains the same ur not writing image directly to the page, but getting it from DB blob column at a temperory place
, rite..... And then based on the location you are getting it in image item on page.
The same is done by UIX engine, for page item images like button etc, where there path is set to OA_MEDIA.
The jsp approach I told is where u don't have to store image anywhere, but directly will be put on the page.
--Mukul
9 of 12 12/4/2019 5:02 PM
Displaying an Image stored in the Database as B... | Oracle Community https://community.oracle.com/message/2197822#2197822
Hi Mukul,
Yeah,thats the basic constraint,we have to have that Image in the application tier but I feel this approach is better than the JSP
approach cause we can handle it with the very basic and common compoenents of OA Fwk like VO,few methods in AM and
Controller Object and need not create a sepearate component like JSP or Servlet for it.
Regards
Jujaar
Jujjar,
But just think ur page CO will retrieve the images for employees every time that page has been viewed in the application layer. So,
you will either write a concurrent program or manually clear this location occassionaly, on the other hand, the approach I am telling u,
everything would be dynamic, so , there will be no file created on application layer.
I guess you can visualise what I am trying to say.Moreoever creating servelet/jsp is not a problem, if its suffice ur requirement.
--Mukul
10 of 12 12/4/2019 5:02 PM
Displaying an Image stored in the Database as B... | Oracle Community https://community.oracle.com/message/2197822#2197822
11 of 12 12/4/2019 5:02 PM
Displaying an Image stored in the Database as B... | Oracle Community https://community.oracle.com/message/2197822#2197822
Oracle Community
Site Map Legal Notices Terms of Use Privacy Cookie Preferences Ad Choices
12 of 12 12/4/2019 5:02 PM