7 Replies Latest reply on May 15, 2013 2:58 PM by lake

    Java Beans in 11g !

    bhatt t
      Hi everyone,

      We are using 11gr2 Forms/Reports 64-bit on Windows Server 2008 64-bit.

      Now we want to use JAVA BEANS in our application.

      Suggest me link and steps for installing/using JAVA BEANS compatible for 11gr2 Forms/Reports.

      Kindly tell me benefits of using JAVA BEANS in our applications.

      Thanks vth Regards.
        • 1. Re: Java Beans in 11g !
          François Degrelle

          Now we want to use JAVA BEANS in our application.
          Kindly tell me benefits of using JAVA BEANS in our applications.

          So, you want to use Java Beans, but you don't know why ?

          • 2. Re: Java Beans in 11g !
            bhatt t
            Hello Sir,

            Yes, I don't know JAVA BEANS, but on Google I came to know a little bit uses of JAVA BEANS like Graphs, Look and feel project, web service etc., these are new and interested for us. Secondly, many suggested us to use JAVA and we never used JAVA before.

            That's why, I want details about JAVA BEANS.

            So, please guide me about its usages and installation.

            Thanks with Regards.
            • 3. Re: Java Beans in 11g !
              François Degrelle
              A Java Bean is intended to do something the standard cannot do. In the Forms environment, it can extend the behaviour of a standard widget like a TextField or a Push Button. It can also add a component that does not exist in the standard.
              Generally speaking, installation is as simple as copying the JAR file in the /forms/java folder, add its name to the archive tags of the /forms/server/formsweb.cfg file, then, in the Forms Builder module set the Implementation Class property to the corresponding full Java class name.
              And, as the name indicates, Java Bean is full Java code, so that you also have to learn that great language.

              1 person found this helpful
              • 4. Re: Java Beans in 11g !
                bhatt t
                Thanks Masters,

                Suggest me from where to start to learn JAVA BEANS, as I have a little knowledge of JAVA.

                Kind Regards.
                • 5. Re: Java Beans in 11g !
                  François Degrelle
                  <p>Java tutorials</p>
                  1 person found this helpful
                  • 6. Re: Java Beans in 11g !
                    bhatt t
                    Thanks again.
                    • 7. Re: Java Beans in 11g !
                      Advantage of java beans is you can enhance the behavior of forms. Forms is as you know applet based running on the client. (There is a different technology associated with inserting your own java code into the loop on the application server, should you want to do that.) So with beans in theory you can get more code to run on the client and do things like read and write files on the client, communicate with devices on the client, etc.

                      Regarding doing that I think the executive summary is mostly look up Fbean in forms builder help.

                      How I came to that tentative conclusion (I haven't gotten mybean to work yet! What do I know?) follows.

                      Home of much forms info:

                      Java beans are java obviously one has to acquire a certain level of expertise in java to deal with them but more importantly how to understand how to communicate between forms and the bean? It's hard for formists, living their lives at the outside of forms, who come up with an idea of something exceptional they want to do in forms, to translate that into the bean world. Then you have to think like a form and that's unknown territory.

                      One problem is terminology: what is a PJC and what is a bean? Is a bean a PJC? I have yet to definitely figure that out. The paper below says: "A javabean is a pjc which is of an unspecialized type". However after that was written seems like in many cases when people are referring to "pjc"'s they are thinking the pjc is a specialized type.
                      "Oracle9i Forms provides two mechanisms for extending the client with Java. The
                      Pluggable Java Component (PJC) mechanism, which was introduced with Forms
                      6i, and the newer Oracle9i Forms specific, enhanced JavaBean support
                      mechanism." (paper 2 below).

                      I was reading this document from 2000 which is interesting:
                      Paper 1:

                      It's talking about handlers and views and it's quickly getting over my head as I don't know enough forms internals to make much of this. For example I would like to write a bean that can print a small form. I have a proof of concept in java (6) that can print text to the default printer. So next step, create a bean that can get the data out of the form. From my formist perspective here I am in a bean how do I access some fields in a record in a block in forms? It's tough going. What does that mean in this handler/view world? Or do I have to be in the form and think of sending data to the bean and telling it to print it?

                      Paper 2:
                      Starts out with more on the handler/view thing. Unfortunately I am totally mvc or handler-view impaired. It escapes me totally.
                      "The Handler class is responsible for both maintaining the current value of any data and controlling the visual representation of the data."....vs.... "The View class is singularly responsible for presenting the data to the user in some
                      manner and handling user input. The View class may allow the data to be changed
                      by the user.". What? I am lost I have no idea what the handler does and what the view does. How about a discussion that is strictly goal oriented? If you want to do this, you have to talk to the (Handler| View)? Don't leave it to me to understand the handler/view thing and then figure it out from that. (This mvc thing is precisely what repels me about jdeveloper. You can't embrace jdev if you haven't drunk the mvc koolaid.)

                      Further on in the paper they bring up fbean:
                      "So in Oracle9i Forms a new simpler mechanism was introduced to allow you to integrate JavaBeans and Java
                      Applets as custom components without writing any Java Code at all. This is all handled using a PL/SQL package in Forms called FBean.
                      "FBean provides a full PL/SQL API to allow interaction with any public methods,
                      properties and events that a JavaBean or Applet exposes."

                      Now you're talking! This is more like it!:

                      "Executing Methods
                      Methods on the JavaBean are executed using one of the variety of
                      FBean.Invoke methods. Like the property getters and setters there are various
                      versions of this method which handle calling methods on the JavaBean that return
                      different datatypes (or return void):
                      • FBean.Invoke_Char()
                      • FBean.Invoke_Bool()
                      • FBean.Invoke_Num()
                      • FBean.Invoke()
                      Ok now that we know about the fbean thing we can find fbean in the forms builder help system. Looking good. I am pretty sure that somewhere in there you have to get your bean in a jar file and sign it (not a trivial proposition) and
                      change the forms server configuration to include your jar file. I also think that the bean has to import frmall.jar and some of the packages regarding that view stuff. A tutorial about fbean and all these details from start to finish would be super!
                      So you can talk to another applet? Really? Can this still be done considering all the security concerns in current browsers?
                      1 person found this helpful