Creating a simple image application in Apex

select
"IMAGE_ID",
<img src="#OWNER#.deliver_thumbnail?p_image_id='||IMAGE_ID||'"/> thumbnail,
"FILENAME" from "ORDIMAGE_IMAGES"
where
instr(upper("FILENAME"),upper(nvl(:P1_REPORT_SEARCH,"FILENAME"))) >
Its is showing an error
showing only the coding part when i run the application instead of showing image....
can you please help me rectify the error
Edited by: 880021 on 17-Aug-2011 20:58

Creating a simple image application in Apex
Create a new application from scratch. Name it ORDImages_images.
Add a Report and Form Page based on your ORDImage_images table. Ensure that you select a Classic Report (i.e. not Interactive, which is the default). As expected, two pages are created.
Continue to create the application and then run it.
After the login page, there will be spurious entries for image and thumbnail.
This is expected because of the ORDImage columns in the images table.
Edit Page 1 and open the Images Region
The Source entry is
select
"IMAGE_ID",
"IMAGE",
"THUMBNAIL",
"FILENAME"
from "ORDIMAGE_IMAGES"
where
instr(upper("FILENAME"),upper(nvl(:P1_REPORT_SEARCH,"FILENAME"))) > 0
In SQL Developer, create the deliver_images_thumb procedure
CREATE OR REPLACE PROCEDURE deliver_thumbnail(p_image_id IN NUMBER) IS
l_thumbnail ORDSYS.ORDImage;
BEGIN
-- Fetch the thumbnail from the database
SELECT thumbnail
INTO l_thumbnail
FROM ORDImage_images
WHERE image_id = p_image_id;
-- Check update time if browser sent If-Modified-Since header
IF ordplsgwyutil.cache_is_valid( l_thumbnail.getUpdateTime() )THEN
owa_util.status_line( ordplsgwyutil.http_status_not_modified );
RETURN;
END IF;
-- Set the MIME type and deliver the image to the browser.
owa_util.mime_header( l_thumbnail.mimeType, FALSE );
ordplsgwyutil.set_last_modified( l_thumbnail.getUpdateTime() );
owa_util.http_header_close();
IF owa_util.get_cgi_env( 'REQUEST_METHOD' ) <> 'HEAD' THEN
wpg_docload.download_file( l_thumbnail.source.localData );
END IF;
END;
Then
GRANT EXECUTE ON deliver_thumbnail TO PUBLIC;
Return to Apex and change the Source entry to
select
"IMAGE_ID",
'<img src="#OWNER#.deliver_thumbnail?p_image_id='||IMAGE_ID||'"/>' thumbnail,
"FILENAME" from "ORDIMAGE_IMAGES"
where
instr(upper("FILENAME"),upper(nvl(:P1_REPORT_SEARCH,"FILENAME"))) > 0
Apply changes and run the application
You can now search on substrings of filenames. Note that the image_ID is not shown. To rectify this, Edit Page 1 and open Report in Regions.
Edit the image_id and under Column Link, change the Link Text to #IMAGE_ID#. Also change the Heading in the Column Attributes to Image ID.
Apply the changes and re-run.
Clicking on the image_id link takes you to Page 2 – the form for that image.
Page 2 is sparse so reveal the image_id by Editing Page 2 and opening the P2_IMAGE_ID Page Item. Change Display as Hidden to Text Field. Apply changes and re-run.
In Page Items, open and delete the P2_THUMBNAIL item.
Open the P2_IMAGE item.
Under Name, change the Display As entry to Display Image (from the select list).
Under Settings, change the Based On entry to BLOB Column returned by SQL Statement
Enter
SELECT i.image.source.localdata
FROM ORDimage_images i
WHERE image_id = :P2_IMAGE_ID
as the SQL Statement
Apply changes and re-run the application
Making an image clickable
Edit Page 1 and open Report in Regions. Edit THUMBNAIL and under Column Link, insert
<img src="#OWNER#.deliver_thumbnail?p_image_id=#IMAGE_ID#"/>
as Link Text.
Select Page 2 as the Target Page in this Application.
Finally, set Item 1's name to P2_IMAGE_ID and its Value to #IMAGE_ID#
Removing the Spreadsheet link
Under Report Attributes, set Enable CSV Output to No

Similar Messages

  • Help needed in creating a simple paint application

    I want to create a simple paint application using swings in java, i am able to draw different shapes using mouse but the problem is when i select some other shape it simply replaces the already drawn object with the new one but i want the already drawn object also, like appending, what should be done for this, any logic missing here or i should use some other approach?
    Please help me
    package test;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class bmp extends JFrame implements MouseListener, MouseMotionListener,
              ActionListener {
         int w, h;
         int xstart, ystart, xend, yend;
         JButton elipse = new JButton("--Elipse--");
         JButton rect = new JButton  ("Rectangle");
         JPanel mainframe = new JPanel();
         JPanel buttons = new JPanel();
         String selected="no";
         public void init() {
              //super("Bitmap Functions");
              // display.setLayout(new FlowLayout());
              buttons.setLayout(new BoxLayout(buttons,BoxLayout.Y_AXIS));
              buttons.add(Box.createRigidArea(new Dimension(15,15)));
              buttons.add(elipse);
              buttons.add(Box.createRigidArea(new Dimension(0,15)));
              buttons.add(rect);
              Container contentpane = getContentPane();
              contentpane.add(buttons, BorderLayout.WEST);
              //getContentPane().add(display, BorderLayout.WEST);
              addMouseListener(this); // listens for own mouse and
              addMouseMotionListener(this); // mouse-motion events
              setSize(1152, 834);
              elipse.addActionListener(this);
              rect.addActionListener(this);
              setVisible(true);
         public void mousePressed(MouseEvent event) {
              xstart = event.getX();
              ystart = event.getY();
         public void mouseReleased(MouseEvent event) {
              xend = event.getX();
              yend = event.getY();
              repaint();
         public void mouseEntered(MouseEvent event) {
              //repaint();
         public void mouseExited(MouseEvent event) {
              //repaint();
         public void mouseDragged(MouseEvent event) {
              xend = event.getX();
              yend = event.getY();
              repaint();
         public void mouseMoved(MouseEvent event) {
              //repaint();
         public static void main(String args[]) {
              bmp application = new bmp();
              application.init();
              application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         public void mouseClicked(MouseEvent arg0) {
         public void actionPerformed(ActionEvent event) {
              if (event.getSource() == elipse) {
                   selected = "elipse";
                   repaint();
              else if(event.getSource() == rect)
                   selected = "rectangle";
                   repaint();
         public void paint(Graphics g) {
              System.out.println(selected);
              super.paint(g); // clear the frame surface
              bmp b=new bmp();
              if (selected.equals("elipse"))
                   w = xend - xstart;
                   h = yend - ystart;
                   if (w < 0)
                        w = w * -1;
                   if (h < 0)
                        h = h * -1;
                   g.drawOval(xstart, ystart, w, h);
              if (selected.equals("rectangle"))
                   w = xend - xstart;
              h = yend - ystart;
              if (w < 0)
                   w = w * -1;
              if (h < 0)
                   h = h * -1;
              g.drawRect(xstart, ystart, w, h);
    }

    bvivek wrote:
    ..With this code, when i draw an elipse or line the image doesnt start from the point where i click the mouse. It added the MouseListener to the wrong thing.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.BufferedImage;
    import javax.swing.*;
    public class test_bmp extends JPanel implements MouseListener,MouseMotionListener,ActionListener
           static BufferedImage image;
           Color color;
           Point start=new Point();
           Point end =new Point();
           JButton elipse=new JButton("Elipse");
           JButton rectangle=new JButton("Rectangle");
           JButton line=new JButton("Line");
           String selected;
           public test_bmp()
                   color = Color.black;
                   setBorder(BorderFactory.createLineBorder(Color.black));
           public void paintComponent(Graphics g)
                   //super.paintComponent(g);
                   g.drawImage(image, 0, 0, this);
                   Graphics2D g2 = (Graphics2D)g;
                   g2.setPaint(Color.black);
           if(selected=="elipse")
                   g2.drawOval(start.x, start.y, (end.x-start.x),(end.y-start.y));
                   System.out.println("paintComponent() "+start.getX()+","+start.getY()+","+(end.getX()-start.getX())+","+(end.getY()-start.getY()));
                   System.out.println("Start : "+start.x+","+start.y);
                   System.out.println("End   : "+end.x+","+end.y);
           if(selected=="line")
                   g2.drawLine(start.x,start.y,end.x,end.y);
           //Draw on Buffered image
           public void draw()
           Graphics2D g2 = image.createGraphics();
           g2.setPaint(color);
                   System.out.println("draw");
           if(selected=="line")
                   g2.drawLine(start.x, start.y, end.x, end.y);
           if(selected=="elipse")
                   g2.drawOval(start.x, start.y, (end.x-start.x),(end.y-start.y));
                   System.out.println("draw() "+start.getX()+","+start.getY()+","+(end.getX()-start.getX())+","+(end.getY()-start.getY()));
                   System.out.println("Start : "+start.x+","+start.y);
                   System.out.println("End   : "+end.x+","+end.y);
           repaint();
           g2.dispose();
           public JPanel addButtons()
                   JPanel buttonpanel=new JPanel();
                   buttonpanel.setBackground(color.lightGray);
                   buttonpanel.setLayout(new BoxLayout(buttonpanel,BoxLayout.Y_AXIS));
                   elipse.addActionListener(this);
                   rectangle.addActionListener(this);
                   line.addActionListener(this);
                   buttonpanel.add(elipse);
                   buttonpanel.add(Box.createRigidArea(new Dimension(15,15)));
                   buttonpanel.add(rectangle);
                   buttonpanel.add(Box.createRigidArea(new Dimension(15,15)));
                   buttonpanel.add(line);
                   return buttonpanel;
           public static void main(String args[])
                    test_bmp application=new test_bmp();
                    //Main window
                    JFrame frame=new JFrame("Whiteboard");
                    frame.setLayout(new BorderLayout());
                    frame.add(application.addButtons(),BorderLayout.WEST);
                    frame.add(application);
                    application.addMouseListener(application);
                    application.addMouseMotionListener(application);
                    //size of the window
                    frame.setSize(600,400);
                    frame.setLocation(0,0);
                    frame.setVisible(true);
                    int w = frame.getWidth();
                int h = frame.getHeight();
                image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
                Graphics2D g2 = image.createGraphics();
                g2.setPaint(Color.white);
                g2.fillRect(0,0,w,h);
                g2.dispose();
                    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
           @Override
           public void mouseClicked(MouseEvent arg0) {
                   // TODO Auto-generated method stub
           @Override
           public void mouseEntered(MouseEvent arg0) {
                   // TODO Auto-generated method stub
           @Override
           public void mouseExited(MouseEvent arg0) {
                   // TODO Auto-generated method stub
           @Override
           public void mousePressed(MouseEvent event)
                   start = event.getPoint();
           @Override
           public void mouseReleased(MouseEvent event)
                   end = event.getPoint();
                   draw();
           @Override
           public void mouseDragged(MouseEvent e)
                   end=e.getPoint();
                   repaint();
           @Override
           public void mouseMoved(MouseEvent arg0) {
                   // TODO Auto-generated method stub
           @Override
           public void actionPerformed(ActionEvent e)
                   if(e.getSource()==elipse)
                           selected="elipse";
                   if(e.getSource()==line)
                           selected="line";
                   draw();
    }

  • Step by step instructions to create a Simple PCUI Application

    I am very new to PCUI and have been trying to get a simple application up and running for the last few days. There always seems to be some problem or the other. At times it gives a dump, at times it gives me a screen without the search request or search result area and when i get all of these done, my application just does not invoke the Query method.
    I would appreciate it if you could give me Step by Step instructions to create a simple PCUI application to search for some data from an existing database table and display it.
    Thanks in advance!!!

    Hi Mithun
    You can also download the PCUI Cookbook from:
    http://service.sap.com/instguides -> my SAP Business Suite Solutions -> my SAP CRM -> my SAP 2005. The title is PCUI Book for CRM 2005.
    The direct link is (which may change so I recommend that you follow the menu path) https://websmp209.sap-ag.de/~sapidb/011000358700001093962006E/PCUIBook50_06.pdf
    Refer the following weblog
    /people/vijaya.kumar/blog/2005/06/10/people-centric-user-interface-pcui--getting-started
    Hope this will help
    Regards,
    Rekha Dadwal
    <b>You gain a point for every point that you reward. So reward helpful answers generously</b>

  • How to create the simple EJB Applications.

    Hi
    I have asked about the what are the necessary softwares required for creating the Simple EJB Applications.
    I have
    Jdk 1.6,
    Netbeans 5.5,
    J2EE5 ,
    Apache Tomcat 5.5
    what are other necessary softwares?please tell me From where i get the source code samples?
    Please Tell me it is necessary for me..

    Hi U,
    Tomcat is only JSP/Servlet container -- no EJB support.
    Easiest is to download the Netbeans 6.1 bundle including Glassfish and JavaDB, thats all you need + JDK and Java EE of course.
    Glassfish has both web/JSP/Servlet-container and EJB-container, so Tomcat is not needed then.
    ( If for some reason you really want to use Tomcat, you can use it together with OpenEJB for example, to add EJB-support. )

  • How to create a New database application in APEX

    Hi everyone..
    Greetings!!!
    I am a beginner to Oracle APEX, i want to develop a new database application(upload my own data) and wants to perform validations, LOV's, Regions etc..
    Can you guide me to handle this....
    Thanks,
    suresh

    Suresh,
    The forum can help ... but maybe "guide" is asking a lot. There are tons of suggestions here (in the forum).
    Have you read? https://forums.oracle.com/forums/ann.jspa?annID=1324 It's a good place to start.
    There are a wealth of APEX books if you have access to Safari, Books 24 or something like those.
    There are on-line courses: See http://www.oracle.com/technetwork/tutorials/index.html
    Specifically: http://apex.oracle.com/pls/apex/f?p=44785:24:87555121473::NO::P24_CONTENT_ID,P24_PREV_PAGE:6268,1 is "Building an Application using Oracle Application Express: Part 1"
    I'm certain you can find many more by Google'ing.
    If you're like me, you need to see (and do) many examples before you launch off into something non-trivial.
    Best wishes,
    Howard

  • Urgent: need help in creation of a simple PCUI application

    Hi Experts,
        I am new to this PCUI. i need the help of urs.
    My requirement is
    >>>>To create a simple PCUI application.This contains a Search and Result list.
    >>>>Then i have to find the BSP coding or the HTML coding for the the PCUI
      application.
    >>>Can anyone please tell me the detailed steps for creating a simple PCUI application that displays the search and a result list???
    >>>Then how can i find the BSP coding or script(such as HTML,XML..) coding used for the  application.
    Pls help me , its urgent.... If anyone have any kind of useful documents pls mail me in my id <b>[email protected]</b>
    Thanks & Regards
    Sudhansu

    Hi Experts,
    I am new to this PCUI. i need the help of urs.
    My requirement is
    To create a simple PCUI application.This contains a Search and Result list.
    Then i have to find the BSP coding or the HTML coding for the the PCUI
    application.
    Can anyone please tell me the detailed steps for creating a simple PCUI application that displays the search and a result list???
    Then how can i find the BSP coding or script(such as HTML,XML..) coding used for the application.
    Pls help me , its urgent.... If anyone have any kind of useful documents pls mail me in my id [email protected]
    Thanks & Regards
    Preethika

  • HOW DO I CREATE A PLAIN IMAGE ON A PANEL

    I want to create a simple image with text on it it and display it on a JPanel. Does anybody know how to do this?
    Thanks in Advance
    Colin

    Image i = createImage(w,h);
    i.getGraphics().drawString(string,x,y);
    panelgraphics.drawImage(i,x2,y2,null)

  • How to ceate simple SCM application for Hardware shopee in oracle 10g forms

    Hi all,
    I want to create a simple SCM application for hardware shopee.
    I want to know all idea behind it, want to clear all concepts,required tables, etc

    Will that be a web-application like oracle.com or ebay? in this case, i would re-think the idea of using forms. Or is it an application which will be used "in-house" in a company over the intranet?
    Anyway, before deciding the tool to implemnet something, wouldn't it be better to get the requirements right (functionaltity, data-objects)?

  • Building a simple JXME application

    Hi,
    I have created a simple JXME application. I am using netbeans 5.5 beta and I get following error:
    Error preverifying class net.jxta.j2me.tools.Jad
    java/lang/NoClassDefFoundError: org/apache/tools/ant/Task
    ant.jat is in the classpath, but still I'm not sure where this error is coming from. any help will be much appreciated.
    Thanks,
    S.

    Hi there
    I'm having the same problem. I'm using Netbeans 5.0 with the mobility pack. My version of JDK is 1.5.0_02.
    I include the jxme-cdc.jar file to the project but when I try to run the application I get:
    Error preverifying class net.jxta.id.ID
    java/lang/NoClassDefFoundError: java/io/Serializable
    Have you figured out how to resolve this???

  • How can i create a simple netweaver portal page that shows text and images?

    Hi,
    i have a simple question or maybe it's not so simple.
    I am completly new to SAP Netweaver 2004s Portal. At the moment i'm trying to understand the struture of the whole thing. I already know how to create roles, worksets and pages and i know how to combine the different elements so a user can acces them.
    And now i want to create a simple portal page that shows text and images. Is it possible to create such a simple page with the portal content studio? What iView do i have to use?
    (I just want to create a start page with a welcome text on it.)

    Marc
    Considering that you would any ways go ahead with complex development from this simple start page I recommend create a Web dynpro Iview for your start page (include the Iview in your page).
    For putting the contents use Netweaver Developer studio to build a simple start page application and put your static text on that Iview.
    Please go through the following log after your NWDS development is over - This will make you comfortable for further challenging work.
    http://help.sap.com/saphelp_erp2005/helpdata/en/b7/ca934257a5c96ae10000000a155106/frameset.htm
    Do reward points if this helps and let me know of you want anything more.

  • Creating an image gallery in apex....

    Hi,
    Im using Apex version 4.2.6... I followed the instructions in a blog to create an image gallery in apex applications....
    http://apex-notes.blogspot.com/2008/12/build-image-gallery-using-apex.html
    I have created all process by following that blog... But the pikachoose plugin is not available to download....
    Is there is any other plugin or any other alternate way to create an image gallery in apex???
    Thanks
    Infant raj

    HI,
    Is there is any example for creating an image gallery... Went through on your link, i want to use the images that are stored in the table.....
    Please advise me on application where i need to use this scripts...
    jQuery plugin setup
    The blueimp Gallery jQuery plugin registers a global click handler to open links with data-gallery attribute in the Gallery lightbox.
    To use it, follow the lightbox setup guide, but replace the minified Gallery script with the jQuery plugin version and include it after including jQuery:
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="js/jquery.blueimp-gallery.min.js"></script>
    Next, add the attribute data-gallery to your Gallery links:
    <div id="links"> <a href="images/banana.jpg" title="Banana" data-gallery> <img src="images/thumbnails/banana.jpg" alt="Banana"> </a> <a href="images/apple.jpg" title="Apple" data-gallery> <img src="images/thumbnails/apple.jpg" alt="Apple"> </a> <a href="images/orange.jpg" title="Orange" data-gallery> <img src="images/thumbnails/orange.jpg" alt="Orange"> </a> </div>
    Thanks...
    INFANT

  • Creating a simple HelloWorld! Application with NWDS 7.3

    Good morning experts!
    I have got a problem:
    I would like to create a simple "Hello World!" Application (JSP i think) with SAP NWDS (NetWeaver Developer Studio) 7.3.
    Then, I want to deploy it on SAP NetWeaver Portal 7.3.
    First of all, I have set up in the "Preferences" in the NWDS under "SAP AS Java" my NetWeaver Portal 7.3 System.
    So: Can you give me a link to a Tutorial, where I can develop such a JSP-HelloWorld-Site, which I can deploy on the J2EE of NW Portal 7.3 ?
    I have tried out several Tutorials in the past, but noone I could build, because there were always errors on the Deployment-Descriptor

    Hello together!
    After searching for 5 hours I have found such a Tutorial.
    There you have the link, maybe somebody has the same problem:
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/503193d9-f586-2b10-4eb6-e8b46dc096db
    Best Regards.

  • Can Touch be used to create a simple slideshow of images?

    Can Touch be used to create a simple slideshow of images?

    No, sorry, but you can, of course, produce a series of images for use in a slideshow.

  • Need to create simple image as byte stream...

    I am looking for a simple and efficient mechanism (supported in Java 1.4.x and later) that would allow me to create a simple raster image byte stream (in .png, .gif or .jpeg encoding) given an RGB + Alpha value (Paint?) and x and y dimensions in pixels.
    I know it sounds unbelievably trivial, but I haven't played with the image stuff in Java in a long time and I am looking for an easy (read "handed to me on a silver platter") solution.
    TIA,
    Chuck

    I guess I should have looked for myself, but it being Friday and I being lazy I didn't want to bother...
    The answer to this question is best rendered in the Java Almanac: http://javaalmanac.com/egs/javax.imageio/Graphic2File.html

  • Can anyone provide a simple css file for Apex Application

    Hi,
    Can anyone provide a simple css file for Apex Application please don't mention W3schools link to learn...
    Regards,
    Pavan

    in each item have ..HTML Form Element CSS Classes .e.g style="color:red",  you can change whatever you want!
    or using CSS at page header level.
    check the page: http://apex.oracle.com/pls/otn/f?p=25110:3:0:::::
    more css and JS file in Google drive(If my application/js/css breaks your computer, your database, your car's transmission anything it's your fault not mine, I have nothing to do with it and will deny all responsibility.)

Maybe you are looking for

  • How to display the output of a reports called from forms in the same window

    Hi all. I have installed Forms / Reports 11g Rel2 developer only installation on my windows 7 box. I can successfully call a reports from forms using RUN_REPORT_OBJECT and WEB_SHOW.document, but the report is opened in a new window. I'd like to open

  • COLOUR MANAGEMENT IN PHOTOSHOP CS2 AND COLOUR SAMPLE POINTS

    I always place colour sample points on my images in order to monitor colour changes as I adjust. When I soft proof (using using Perceptual rendering),I go to the Information pallette and right click on the colour sample points.I then choose Proof opt

  • OpenLDAP and Octet String.

    Hi all, I had a new problem with my jsp's applications that must connect to a openLDAP server. I resolve the connection and the search problems, as I said in other post. Now the problem is that I must use the connection for authenticate the simple us

  • READ_TEXT showing problem in smart-forms

    Hi All, I am using the FM READ_TEXT in Smartforms.I have a text like M & M.When passed in the FM i get the output as M<(>&<)>M. Symbol & is displayed as junk. I debugged the FM and i can find it is getting converted at if rt_header-tdtexttype is init

  • JSP requests hang in HTTPs

    Hi, friends, I need an ergent help ! We are using Weblogic 6.0 without service pack, and using some third-party tag library in our JSPs. Without HTTPs, everything works fine. After we install SSL with Weblogic demo certificates, some JSPs hang when t