Using domain object instead of generated ones?

I'm using NetBeans, and I'm curious if there's a way that we can use our domain objects with the web service calls rather than the empty stubs generated by wsgen?
wsgen creates the skeletal client classes, as well as an ObjectFactory that returns instances of those classes. I imagine I could modify ObjectFactory to return our domain objects instead, but then we'd be breaking with wsgen.
Is there a better solution to this?
Thanx!

You can associate a Virtual Host to the loopback IP address 127.0.0.1 read about Virtual Hosts here: http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html
But with the above configuration alone you can access your app via http://somedomainname.com only on your local machine, no one else on the internet will see it.

Similar Messages

  • Use domain constraint does not generate a constraint name

    Hello,
    I am using a domain for which I specified a check constraint. In the naming standard template I defined a template for the column check constraint.
    Now, if I am modelling a table in the relational model (not derived from logical model) and specify a column with the given domain, having checked "Use Domain Constraints" I will not get a named check constraint generated. The check constraint is generated in the DDL as inline check constraint.
    Any hint, or who does the template for the column check constraint work?
    Thanks in advance,
    puchtec
    Operating System: Windows XP 32-bit
    Product Version: 2.0.0.584

    Hello puchtec,
    In the naming standard template I defined a template for the column check constraintyou also need to apply templates - you can do it for one table in table dialog or for whole relational model - use pop-up menu for relational model in browser.
    Philip

  • Using domain name instead of ip address

    I have a tomcat server installed on machine1(server). I can access this server from other computer on intranet using http://ipAddressOfServer/. Now, I want to access the server using a domain name, for example http://domainName.com. Can we do that in Tomcat or does it require to install any third party software.

    You can associate a Virtual Host to the loopback IP address 127.0.0.1 read about Virtual Hosts here: http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html
    But with the above configuration alone you can access your app via http://somedomainname.com only on your local machine, no one else on the internet will see it.

  • Is it a good idea to use ABAP objects for reports?

    Hello Experts,
    Is it a good idea to use ABAP objects instead of the traditional ABAP for coding reports?

    Hi,
    Go throught Document it will Give you eight Reasons why OOABAP Should be used.
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/37c5db90-0201-0010-3a9b-d0a5288f3c15
    Must go through
    Regards,
    Gurpreet

  • OBIEE presentation url to use domain name

    Experts,
    I would like to make OBIEE presentation url to use domain name instead of ip address.  What and where is the change required for this?
    Currently the url is like this - http://10.20.123.456:9704/analytics/saw.dll?Dashboard and we want something like this http://myobiee.com:9704/analytics/saw.dll?Dashboard
    OBIEE : 10.1.3.4
    Regards,
    Sarvan

    Hi Vamsy,
    Thanks for your response.  I tried your suggestion in my local installation, but no luck.
    Network Error (dns_server_failure) 
    Your request could not be processed because an error occurred contacting the DNS server.......
    Am I missing something here.  Do you think it is this simple to achieve?
    Regards,
    Sarvan

  • What are Parameters? How are they differenet from Variables? Why can't we use variables for passing data from one sequnece to another? What is the advantage of using Parameters instead of Variables?

    Hi All,
    I am new to TestStand. Still in the process of learning it.
    What are Parameters? How are they differenet from Variables? Why can't we use variables for passing data from one sequnece to another? What is the advantage of using Parameters instead of Variables?
    Thanks in advance,
    LaVIEWan
    Solved!
    Go to Solution.

    Hi,
    Using the Parameters is the correct method to pass data into and out of a sub sequence. You assign your data to be passed into or out of a Sequence when you are in the Edit Sequence Call dialog and in the Sequence Parameter list.
    Regards
    Ray Farmer

  • 802.1x using authentication from NT Domain Controller instead of Radius

    I would like to know if it's possible to configure 802.1x using authentication from NT Domain Controller, instead of using Radius or Tacacs.

    It is possible to use MS AD, generic LDAP, Novell NDS for authentication, it's fairly common.
    The issue is "How do get the device to talk to the authentication source ... (AD, DC, NDS, LDAP)?"
    The answer is RADIUS.
    You can configure RADIUS to pull authentication from a variety of source (depending on the RADIUS - many/most can use any of the LDAP-based systems).
    So, yes, certainly you can use the Microsoft AD, but you need RADIUS to connect the two systems (the 802.1x device and the AD server).
    If cost is the issue, try freeRADIUS (www.freeradius.org) - it's fully featured (can use LDAP, AD, NDS, Certificates, etc), it's free, and configuration is much easier than it looks ....
    Good Luck
    Scott

  • I got a new computer. can i install itunes on it and use that instead of the one on my old computer?

    I got a new computer. i want to install itunes on it and use that instead of the one on my old computer?

    See Recover your iTunes library from your iPod or iOS device.
    tt2

  • Dreamweaver CC generates one of 3 error messages when using find and replace on Win 8.1 64 bit.

    Dreamweaver CC generates one of 3 error messages when using find and replace is used more than twice in succession. "While executing onLoad in bc_afterSave.htm, the following JavaScript error(s) occurred: At line 188 of file C:\Program Files (x86)\Adobe|Adobe DreamweaverCC|Configuration|Shared|BC\JS\bc_sites.js": out of memory"
    or
    While executing runCommand in File_Save.htm, a JavaScript erroroccurred.
    or
    While exciting getDynamicContent inAdressURL.htm, a Javascript erroroccirred.
    Any thoughts - I end up closing DWCC and reopening. Will work for two additional Find and Replace before the error messaged\s popup again.

    bkaufman43 wrote:
    Thanks Jon. I tried all of those solutions before posting. Same problem. It seems that the problem is tied to DWCC. Do not have the problem when using DW6 on Win8.1. When running DWCC on a Win7 pc, we get the same error message. When running DW6 on Win 7, f&c works fine. It seems to be a bug in DWCC. DWCC works flawlessly on our Macs.
    The same steps apply to DWCC, you just need to choose the CC folders rather than the DWCS4-6 versions that the page talks about. The layout of CC's folders hasn't changed from the older versions which is why, I think, Adobe hasn't updated the troubleshooting page as of yet.
    As Nancy mentions, a 38,500 page site is sort of ridiculously large for a static website, that could be part of the problem, but your response quoted above leads me to think you may have tried the troubleshooting steps in the wrong version of the program. Could you confirm that?

  • Changing Workspace Loads Last-Used Sequence Instead of Current One

    Since the update to 8.2.0 (65) build, when switching between workspaces, Premiere will load the last-opened sequence used in that workspace instead of the one currently being worked on.
    For example: I finish my edit of Sequence A. Taking it from my Custom workspace for editing, to the Audio workspace for audio lock, and finally the Color Correction workspace. Then I'm on to Sequence B. I finish my general edit in my Custom workspace and open the Audio workspace to do sound. But now, instead of opening Sequence B in the Audio workspace, Sequence A shows up (having been the last one worked on in that workspace) and I have to manually hunt down Sequence B to load it up.
    Very frustrating. I'll submit a bug report now.
    I tried importing this project into a new project, just in case the issue was the way the update was handling projects created before it, but that didn't solve the problem. I'm on a Mac.

    hello, the desktop is usually not the right place to store the program files. you might want to uninstall firefox from the windows control panel in order to clean up your desktop & install it again. during the setup it's best to keep the installation directory at the default location (usually c:\program files\mozilla firefox) and only create a shortcut to the program.
    [[Install Firefox on Windows]]

  • Whether could I generate one AC signal and acquire one DC signal and one AC signal together using NI myDAQ?

    Dear Sir:
    I would like to know whether I can generate one AC signal and acquire one DC signal and one AC signal together using NI myDAQ? If I can, could you please tell me the easiest way to achieve the goal? If I cannot, please tell me whether I can use both white box to do this because I have got another white box USB-6008. Cheers
    Kind Regards
    Jeff 

    duplicate post
    Don't create a new thread. In the thread above, you asked for someone to review your code but you did not post a modified VI. Your original one is obviously wrong as I noted.

  • Automatic generation of domain objects and database population framework

    Hi, I've been working on my own project for a while now, having a good picture of what my business model should be and what domain should back it up I've run across an issue which I guess is very common in the community: What happens with all this objects in the domain?
    To test them against a database I've to generate some of them, persist them and then run various operations to see if they work properly. The problem is that generating them and then populating your local database can be tedious at times. So I came up with this idea (maybe not a original one, it never is) to create a tool (a framework maybe) capable of feeding on POJOs inside JARs or some other class resource, creating mappings to generators (which are, of course, generic and use reflection to do their work) and then run all those generators a number of times placing their output into several sets and then persist the objects inside those sets using an EntityManager. All the dependencies must be provided at runtime, the tool does not have to know which are those classes it has to generate instances for.
    Generating them through reflection shouldn't be much of a problem if I do it straightforward, the key of the matter is that it cannot be as straightforward as I would like it to be, for every class in the provided JARs I've to match them with configuration properties defined somewhere (XML maybe or Annotations which this object should already have) because not every field on the instance can be initialized the same way, and I don't mean their type either since I can know it through reflection, but many of these objects have database constraints declared, for example, and I've to take that into account when initializing the fields that are constrained.
    Also on occasion I would like to have a class generated with data extracted from another source and not hardcoded into the generators (an XLS for example) which can be very practical for my production environment. Taking all of these into consideration I can see how my development time has increased tenfold.
    Anyway, my question is simple. Do any of you know an utility or framework which could at least facilitate some of these tasks?

    I think the usual way to test items is via JUnit. There are also other test suites based on JUnit such as JSUnit (for javascript testing), cactus, etc.
    For testing, I try to test each object in isolation. For testing DAO objects, in each test, I write some test data to the development database (not production database), perform my test, then remove the test data (cleanup). I put the cleanup in a finally block to ensure it always runs (in case an exception is thrown). An alternative is to use mock objects (search google for something like 'java mock objects database junit'). Also in each test, I do the asserts that exercise the object as they would normally work first, followed by abnormal conditions, followed by conditions that may throw exceptions (if you want to test to that degree). You also might want to add code to automatically block the JUnit tests if it detects its running against production instead of development.

  • Re: [SunONE-JATO] Re: Using an object to store and display data

    Personally, I think there is little or no value to creating a "domain"
    object that itself relies on a JATO QueryModel internally, but hides that
    fact and requires use of BeanAdapterModel.
    It would be more appropriate (and much less work, and more scalable) to just
    derive a QueryModel subclass and add the domain-specific behavior to the
    model. In other words, what's the point of creating an object that hides
    JATO inside it when you're running in JATO to begin with? Now if the domain
    object were doing plain JDBC, and thus trying to be JATO independent, that
    would be different. However, you could still implement the Model interface
    on the object (or use BeanAdapterModel) to integrate it seamlessly with the
    View tier.
    Todd
    ----- Original Message -----
    From: "grschroeder" <grschroeder@y...>
    Sent: Wednesday, July 31, 2002 12:00 PM
    Subject: [SunONE-JATO] Re: Using an object to store and display data
    Craig,
    I think it all finally makes sense. First, your assumption is
    correct regarding the process flow. The ViewBean will interact with
    a custom Javabean which will then in turn interact with a SQL Model
    to access the database. So now let me make sure I understand what I
    need to do. Basically the custom Javabean will have a method to get
    the SQLModel. I would then invoke the setValue method on the
    SQLModel and call the appropriate execute method( e.g.,
    executeUpdate, etc. ) just like I would do from a ViewBean. Does
    this sound correct?
    Thanks,
    Greg
    --- In SunONE-JATO@y..., "Craig V. Conover" <craig.conover@s...>
    wrote:
    Greg,
    see below...
    grschroeder wrote:
    Thanks for the help Craig. I looked at the sample code that makes
    use of the BeanAdapterModel. Basically it looks like it allows a
    view to interact with a bean the same way it would interact with
    any
    other model. That part I think I understand.
    This is correct.
    The part I'm a little
    unclear on still is how to interface this BeanAdapterModel( which
    is
    a very basic model ) that I now have with a query model toactually
    interact with the database.
    Not sure what you mean by "interface this BeanAdapterModel ... witha
    query model". Does this mean that you have a ViewBean the interactswith
    a custom JavaBean via the BeanAdpterModel wrapper, and from the
    JavaBean you are interacting with the SQL Model?
    So it looks like this: ViewBean > BeanAdapterModel(Custom JavaBean)
    SQL Model > RDBMS
    That's what I am reading anyway. Please explain this to me.
    Would I need to make direct JDBC calls
    from my custom model instead of letting JATO dynamically create
    the
    calls for me?
    If my assumptions above are correct, then the custom JavaBean cansimply
    use the SQL Model in exactly the same manner as the ViewBean,otherwise,
    if no SQL Model is involved, then yes, you need to handle JDBCdirectly,
    which is fine, if you do it "right" (connection pooling, result set
    handling, etc.).
    Thanks,
    Greg
    --- In SunONE-JATO@y..., "Craig V. Conover" <craig.conover@s...>
    wrote:
    I think the best approach would be to treat your Domain Objects
    (DO) as
    the Database (the enterprise tier) from JATO's perspective. You
    could
    create custom models that interface with our DO's and then the
    JATO
    Views could easily bind to the custom DO models just like anyother
    model. This should eliminate the need for pushing data/objectsfrom
    >
    view
    to model to database.
    There is a JATO class called BeanAdapterModel that might be just
    what
    you need, however, I am not experienced with using it. Maybe
    someone
    else on my team or in the community could better explain how to
    use
    >
    this
    class.
    craig
    grschroeder wrote:
    Venki,
    Thanks for the response. Actually, I'm not sure if I can answer
    all
    of your questions because those are some of the same questions
    that
    we're trying to answer ourselves. Basically, what we're trying
    to
    >do
    is incorporate our domain object model into the JATO framework.
    My
    thinking was that one way we could accomplish this was by
    storing
    >a
    Javabean object in the HTTPSession to represent an object in the
    domain model, and that the Viewbean and JATO Model could get and
    set
    data from there. If you have a better suggestion of how to
    accomplish this, I'm definitely open to hearing it.
    Thanks,
    Greg
    --- In SunONE-JATO@y..., Venki <heyvenki@y...> wrote:
    OK grschroeder , first let me get this straight:
    0. Are you going to pass this object to the model, or are u
    going
    >
    to pass the session object to the model?
    1. Is there any specific reason for this approach you are
    taking?
    2. Will there be a notification from the object u havementioned
    >to
    have the model persist the data?
    3. What about the reverse case, when the model refreshes the
    data,
    how are you going to refresh you object?
    4. The JavaBean Object that u are talking about, is it your own
    object or is it implementation of an existing JATO interface?
    ~Venki
    grschroeder wrote:I'm fairly new to JATO, but I think I now
    have
    >a
    basic understanding
    of how Viewbeans and Models interact. However, I want to
    incorporate
    the use of a Javabean object that will be stored in the HTTP
    session
    and will act as the connection between the Viewbean and Model
    instead
    of having the Viewbean and Model interact directly with each
    other.
    Basically I would like to have the Model set data in the object
    stored in the session so that the Viewbean can pull it out to
    display
    it. And vice versa, once the user modifies the data and is
    ready
    >
    to
    persist it, I would like to have the Viewbean set data in the
    object
    stored in the session so that the Model can pull it out to
    store
    >it
    in the database. I'm not sure what the best approach would be
    to
    accomplish this. Any help you could give would be greatly
    appreciated.
    Thanks,
    Greg
    To download the latest version of JATO, please visit:
    http://www.sun.com/software/download/developer/5102.html
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    Service.
    Venki
    IT Solutions
    #6, Pycrofts Garden Road, Nugambakkam, Chennai - 600 006
    91-44-4925740(Home) 91-44-8212877(Work)
    * Luck is what happens when Preparation meets Opportunity.
    To download the latest version of JATO, please visit:
    http://www.sun.com/software/download/developer/5102.html
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    >To download the latest version of JATO, please visit:
    http://www.sun.com/software/download/developer/5102.html
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    To download the latest version of JATO, please visit:
    http://www.sun.com/software/download/developer/5102.html
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp

    Personally, I think there is little or no value to creating a "domain"
    object that itself relies on a JATO QueryModel internally, but hides that
    fact and requires use of BeanAdapterModel.
    It would be more appropriate (and much less work, and more scalable) to just
    derive a QueryModel subclass and add the domain-specific behavior to the
    model. In other words, what's the point of creating an object that hides
    JATO inside it when you're running in JATO to begin with? Now if the domain
    object were doing plain JDBC, and thus trying to be JATO independent, that
    would be different. However, you could still implement the Model interface
    on the object (or use BeanAdapterModel) to integrate it seamlessly with the
    View tier.
    Todd
    ----- Original Message -----
    From: "grschroeder" <grschroeder@y...>
    Sent: Wednesday, July 31, 2002 12:00 PM
    Subject: [SunONE-JATO] Re: Using an object to store and display data
    Craig,
    I think it all finally makes sense. First, your assumption is
    correct regarding the process flow. The ViewBean will interact with
    a custom Javabean which will then in turn interact with a SQL Model
    to access the database. So now let me make sure I understand what I
    need to do. Basically the custom Javabean will have a method to get
    the SQLModel. I would then invoke the setValue method on the
    SQLModel and call the appropriate execute method( e.g.,
    executeUpdate, etc. ) just like I would do from a ViewBean. Does
    this sound correct?
    Thanks,
    Greg
    --- In SunONE-JATO@y..., "Craig V. Conover" <craig.conover@s...>
    wrote:
    Greg,
    see below...
    grschroeder wrote:
    Thanks for the help Craig. I looked at the sample code that makes
    use of the BeanAdapterModel. Basically it looks like it allows a
    view to interact with a bean the same way it would interact with
    any
    other model. That part I think I understand.
    This is correct.
    The part I'm a little
    unclear on still is how to interface this BeanAdapterModel( which
    is
    a very basic model ) that I now have with a query model toactually
    interact with the database.
    Not sure what you mean by "interface this BeanAdapterModel ... witha
    query model". Does this mean that you have a ViewBean the interactswith
    a custom JavaBean via the BeanAdpterModel wrapper, and from the
    JavaBean you are interacting with the SQL Model?
    So it looks like this: ViewBean > BeanAdapterModel(Custom JavaBean)
    SQL Model > RDBMS
    That's what I am reading anyway. Please explain this to me.
    Would I need to make direct JDBC calls
    from my custom model instead of letting JATO dynamically create
    the
    calls for me?
    If my assumptions above are correct, then the custom JavaBean cansimply
    use the SQL Model in exactly the same manner as the ViewBean,otherwise,
    if no SQL Model is involved, then yes, you need to handle JDBCdirectly,
    which is fine, if you do it "right" (connection pooling, result set
    handling, etc.).
    Thanks,
    Greg
    --- In SunONE-JATO@y..., "Craig V. Conover" <craig.conover@s...>
    wrote:
    I think the best approach would be to treat your Domain Objects
    (DO) as
    the Database (the enterprise tier) from JATO's perspective. You
    could
    create custom models that interface with our DO's and then the
    JATO
    Views could easily bind to the custom DO models just like anyother
    model. This should eliminate the need for pushing data/objectsfrom
    >
    view
    to model to database.
    There is a JATO class called BeanAdapterModel that might be just
    what
    you need, however, I am not experienced with using it. Maybe
    someone
    else on my team or in the community could better explain how to
    use
    >
    this
    class.
    craig
    grschroeder wrote:
    Venki,
    Thanks for the response. Actually, I'm not sure if I can answer
    all
    of your questions because those are some of the same questions
    that
    we're trying to answer ourselves. Basically, what we're trying
    to
    >do
    is incorporate our domain object model into the JATO framework.
    My
    thinking was that one way we could accomplish this was by
    storing
    >a
    Javabean object in the HTTPSession to represent an object in the
    domain model, and that the Viewbean and JATO Model could get and
    set
    data from there. If you have a better suggestion of how to
    accomplish this, I'm definitely open to hearing it.
    Thanks,
    Greg
    --- In SunONE-JATO@y..., Venki <heyvenki@y...> wrote:
    OK grschroeder , first let me get this straight:
    0. Are you going to pass this object to the model, or are u
    going
    >
    to pass the session object to the model?
    1. Is there any specific reason for this approach you are
    taking?
    2. Will there be a notification from the object u havementioned
    >to
    have the model persist the data?
    3. What about the reverse case, when the model refreshes the
    data,
    how are you going to refresh you object?
    4. The JavaBean Object that u are talking about, is it your own
    object or is it implementation of an existing JATO interface?
    ~Venki
    grschroeder wrote:I'm fairly new to JATO, but I think I now
    have
    >a
    basic understanding
    of how Viewbeans and Models interact. However, I want to
    incorporate
    the use of a Javabean object that will be stored in the HTTP
    session
    and will act as the connection between the Viewbean and Model
    instead
    of having the Viewbean and Model interact directly with each
    other.
    Basically I would like to have the Model set data in the object
    stored in the session so that the Viewbean can pull it out to
    display
    it. And vice versa, once the user modifies the data and is
    ready
    >
    to
    persist it, I would like to have the Viewbean set data in the
    object
    stored in the session so that the Model can pull it out to
    store
    >it
    in the database. I'm not sure what the best approach would be
    to
    accomplish this. Any help you could give would be greatly
    appreciated.
    Thanks,
    Greg
    To download the latest version of JATO, please visit:
    http://www.sun.com/software/download/developer/5102.html
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    Service.
    Venki
    IT Solutions
    #6, Pycrofts Garden Road, Nugambakkam, Chennai - 600 006
    91-44-4925740(Home) 91-44-8212877(Work)
    * Luck is what happens when Preparation meets Opportunity.
    To download the latest version of JATO, please visit:
    http://www.sun.com/software/download/developer/5102.html
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    >To download the latest version of JATO, please visit:
    http://www.sun.com/software/download/developer/5102.html
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    To download the latest version of JATO, please visit:
    http://www.sun.com/software/download/developer/5102.html
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp

  • Recent loss of embedded QT movies on many page for IE7 using ActiveX object

    I have many pages that allow you to select from 4 video formats including QT .mov. An example is at http://www.cwdjr.net/video4/cancanL.php . The QT object uses ActiveX when on IE only(I use Windows conditional comments) and an ordinary object for most other browsers. Until sometime very recently all of these pages worked when you select the QT file. Now QT works on none of them. I suspected the problem might be due to a very recent Windows XP update which is a large one including .NET updates and other things(K8951847) X 86. I was able to restore to a day before this update, but this did not solve the problem. Of course some portions of some updates can not be removed be restoring to an earlier time, so the result does not prove the update was not at fault.
    The involved pages are mostly written in php on the server, so you will not be able to see very much by viewing the source code. To make the problem more simple to view, I made a test page for QT only and with the ActiveX object only. Thus this test page can not be viewed on most browsers that do not support ActiveX. The test page is at http://www.cwdjr.info/broadbandMedia/formatsAX/qtmovtest2.php . Since I serve pages as valid xhtml 1.1 using the correct mime type application xhtml+xml, no IE browser can view the page, since no IE browser can support xhtml served properly. Thus I have a php include at the very top for header exchange between the browser and server. If this says the page does not support the mime type for xhtml, then php using regular expressions, etc is used to rewrite the page as html 4.01 strict for the outmoded browser. Thus don't be surprised if you find some pages in xhtml and others in html when you check properties.
    The ActiveX object used for QT on the test page is below:
    QT MOV
    (CLICK ABOVE LINK IF NO PLAYER)
    <object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="400" height="295" codebase="http://www.apple.com/qtactivex/qtplugin.cab">
    <param name="autoplay" value="true" />
    <param name="controller" value="true" />
    <param name="kioskmode" value="true" />
    <param name="src" value="http://www.cwdjr.info/movie/cancan.mov" />
    </object>
    Once the page comes up on IE7, it is rather slow to respond. Then it gives:
    "Web site wants to install the following ActiveX control: 'Quick Time' from 'Apple Inc'".
    If you do try to install, nothing happens. In contrast to my regular pages, I added the code show above just before the start of the object. Clicking this on will bring up the QT video, but of course it is not embedded on the desired page. This may work as a temporary fix for IE. I likely can hide it from other browsers by enclosing it in Microsoft conditional comments.
    I would be interested if anyone else has had such a problem recently or any ideas concerning this strange response on IE7. I am talking about viewing the page on the server. Since this is a php page it can be viewed locally only if you have a server installed on your computer and I do not. The pages with the first url example given above have operated well on IE7, Firefox, Opera, Safari for Windows, Flock, K-Meleon, Google Chrome and SeaMonkey. There are a few players that have some issues with some of the formats, but this and the fact that some players may not be installed is the reason for offering the video in 4 formats. I sometimes offer high broadband versions as well as low broadband versions.
    It seems I spend more time correcting IE issues than for all of the other mentioned browsers combined.

    Thanks for the reference. I use nearly no JS anymore, since it often causes problems with true xhtml served properly even when you use external script files. Often one can use php script on the server and avoid these problems. When one serves as true xhtml using the correct mime type of application/xhtml+xml, the page is parsed with a very strict xml parser rather than a loose-as-a-goose html parser. (If one serves a page written in xhtml code as mime text/html, as is incorrectly done perhaps 99% of the time, you are using only html, not xhtml, and are fooling only yourself. The page is parsed as html instead of xhtml.) The xml parser has to be very strict to account for any possible xml content. Even a single, or even several, errors often will not prevent a html page from showing, but even a single error on an xhtml page served properly will often get an error report from the xml parser rather than a view of the page. One of the most laughable examples of misunderstanding of this issue is the home page of Microsoft. It claims to be xhtml. However it is served as text/html and thus would be better written in html 4.01 in the first place. Moreover, if you validate the page as xhtml at w3c, you find hundreds of xhtml errors. If Microsoft served their home page properly as application/xhtml+xml it of course would not work on any IE browser, at least through IE7, since none of these IE browsers can handle true xhtml. In addition the page likely would not show up on any browser if served as true xhtml until all of the hundreds of xml and other errors on the page were corrected. Instead, one likely would get a very long error report rather than a view of the page.
    Back to JS, document.write will not work in properly served xhtml, because it easily could produce code with XML errors. For instance it might produce code that contains an unclosed tag, which is a major xml error that can cause an xml device to malfunction. The xml parser thus rightly finds document.write as an error and prevents viewing of the page. However one often can generate the same code as document.write would produce on a browser with php on the server. The finished code is what gets downloaded to the browser, so the xml parser can check everything in the finished code rather than quess what a JS document.write might produce. And don't think you can sweep document.write under the rug by using an external JS file. The very strict xml parser finds it.
    Of course embed has never been a w3c tag, but rather is a bad hangover from the browser war era, a gift of Netscape. No page that includes embed can validate as w3c xhtml or xml of any flavor, at least through xhtml 1.1. However the page may work, despite the error, if server as text/html.
    All I know is that something has happened recently that has caused my problem to surface. It likely has to do with some change in the XP OS or IE browser. I have tried viewing several pages written by others that use many types of code for .mov, and all of them I have viewed that use an ActiveX embed for the benefit of IE now have the problem I mentioned. If anyone else with XP and nearly all updates, including the very recent one I mentioned, and the most recent version of QT has had this problem, I could be more confident that the problem comes from an external source. If not, it is still possible the sudden change could be something concerning a specific issue that has developed in my computer.
    Again, thanks for the JS reference. Some of this likely can translate into php so I can compare how the JS and php server script I am using relate.

  • How to bind Hibernate domain objects to the UI layer

    Dear All,
    I am trying to bind FX UI controls to properties of a Hibernate Domain object. Is there any good example to refer to for this purpose?
    Thanks & Regards,
    Nitin Gupta

    Assuming you do not formulate your hibernate objects as pojos with javafx properties directly, if the hibernate object is a pojo with or without PCL, you can convert the properties of the pojo to observable values (or properties) directly. These are used in a bind statement.
    Check out what jgoodies does with BeanAdapter or PresentationModel. You need the same concept. I've attached a class that does this for a pojo already (its an incomplete port of jgoodies PresentationModel). It will work for any pojo. It does not have setter support as it was just a demonstration. Its efficient for a pojo with a large number of properties. You could also write a very short property connector to produce one observable value per property. The value of the class below is to be able to swap out the bean being observed without having to change or reset the property observable values each time. Bind once and then just reset the bean (think master detail).
    package scenegraphdemo;
    import java.beans.PropertyChangeEvent;
    import java.beans.PropertyChangeListener;
    import java.lang.reflect.Method;
    import java.util.HashMap;
    import java.util.Map;
    import javafx.beans.property.ObjectProperty;
    import javafx.beans.property.ObjectPropertyBase;
    import javafx.beans.property.Property;
    import javafx.beans.property.StringProperty;
    import javafx.beans.value.ChangeListener;
    import javafx.beans.value.ObservableValue;
    import javafx.beans.value.WritableValue;
    * An object binding object that creates object bindings based on property names
    * specified as strings. This is a convenience class to avoid having observable
    * values directly dependent on the underlying bean. The actual bean the
    * properties connect can be changed dynamically using the channel or
    * <code>setBean</code>. This allows you to setup binding when you don't have
    * the bean to bind to or the bean to bind to will change as in the detail part
    * of a master-detail screen. Generally, the return values from
    * <code>getProperty()</code> should be used for binding not the factory itself.
    * The object should be a domain object bean with bean methods to get or set the
    * value using java bean naming conventions OR it should use javafx property
    * definition conventions. The factory will automatically listen for standard
    * java bean changes using <code>PropertyChangeListener</code> approaches unless
    * you indicate to not to.
    * <p>
    * When the bean itself changes, the properties fire to indicate that their
    * values may have changed and the observing object should update itself. This
    * object allows you to integrate your javafx/POJOs into the binding
    * infrastructure without being dependent on the actual underlying bean. If you
    * are familiar with jgoodies <code>BindingAdapter</code> this is a similar
    * class.
    * <p>
    * This only handles reading bean properties. Need to add set() logic.
    * <p>
    * TODO: Make this work better. Many corner cases to cover.
    * <p>
    * TODO: Instead of just method calls on POJOs, also check for PCL. Note that
    * javafx properties won't work easily they are always tied to the underlying
    * object so I would have to write another CaptiveObjectProperty object that is
    * essentially a delegator.
    public class BeanPropertyFactory<T> extends ObjectProperty<T> {
         ObservableValue<T> channel;
         Map<String, CaptiveObjectProperty> properties = new HashMap<String, CaptiveObjectProperty>();
         boolean listenForBeanPCLEvents = true;
         public boolean isListenForBeanPCLEvents() {
              return listenForBeanPCLEvents;
         public void setListenForBeanPCLEvents(boolean listenForBeanPCLEvents) {
              this.listenForBeanPCLEvents = listenForBeanPCLEvents;
              if (getBean() != null)
                   removeBeanPCLListener(getBean());
          * The bean channel where the bean is obtained.
          * @return
         public ObservableValue<T> getChannel() {
              return channel;
         public BeanPropertyFactory() {
              setChannel(new ObjectProperty());
         public BeanPropertyFactory(ObservableValue<T> channel) {
              if (channel == null)
                   setChannel(new ObjectProperty());
              else
                   setChannel(channel);
         protected void setChannel(ObservableValue<T> channel) {
              if (this.channel != null) {
                   removeBeanChangeListener(this.channel);
              this.channel = channel;
              if (this.channel != null) {
                   addBeanChangeListener(this.channel);
                   updateStringProperty(getBean());
              invalidateProperties();
              fireValueChangedEvent();
         protected StringProperty stringProperty = new StringProperty();
          * The string property is an observable toString property. It cannot be set.
          * @return
         public StringProperty beanStringProperty() {
              return stringProperty;
         public String getBeanString() {
              return beanStringProperty().getValue();
          * A listener that listens to changes in the bean channel. This only fires
          * when the bean changes not when the properties on the bean change. The
          * default actions updates the "string" property representation of this
          * object as well as attaches property change listeners.
          * @author Mr. Java
         protected class BeanChangeListener implements ChangeListener {
              @Override
              public void changed(ObservableValue arg0, Object arg1, Object arg2) {
                   if (arg1 != null) {
                        BeanPropertyFactory.this.removeBeanPCLListener(arg1);
                   if (arg2 != null) {
                        BeanPropertyFactory.this.addBeanPCLListener(arg2);
                   updateStringProperty(arg2);
         protected void updateStringProperty(Object obj) {
              if (obj != null)
                   beanStringProperty().setValue(obj.toString());
              else
                   beanStringProperty().setValue("null");
         protected void removeBeanChangeListener(ObservableValue<T> obj) {
              if (beanChangeListener == null)
                   beanChangeListener = createBeanChangeListener();
              if (obj != null) {
                   obj.addListener(beanChangeListener);
         protected void addBeanChangeListener(ObservableValue<T> obj) {
              if (beanChangeListener == null)
                   beanChangeListener = createBeanChangeListener();
              if (obj != null)
                   obj.removeListener(beanChangeListener);
          * The instance of a change listener for detecting when the bean in the bean
          * channel changes.
         ChangeListener beanChangeListener = new BeanChangeListener();
          * Subclass can override to create their bean change listener.
          * @return
         protected ChangeListener createBeanChangeListener() {
              return new BeanChangeListener();
         public BeanPropertyFactory(T bean) {
              setChannel(new ObjectProperty(bean));
         public Property getProperty(String property) {
              if (property == null || property.isEmpty())
                   throw new IllegalArgumentException("Property cannot be null");
              if (properties.containsKey(property))
                   return properties.get(property);
              CaptiveObjectProperty p = new CaptiveObjectProperty(this, property);
              properties.put(property, p);
              return p;
         @Override
         public T getValue() {
              return getBean();
          * A listener that listens for property change events on the bean. When the
          * bean changes, the listener must be removed then attached to the new bean
          * but can use the same instance of this class. The action is to inform any
          * existing property objects that the property has changed. The detection of
          * property changes is centralized in the factory class for efficiency.
         protected class BeanPropertyListener implements PropertyChangeListener {
              @Override
              public void propertyChange(PropertyChangeEvent evt) {
                   if (properties.containsKey(evt.getPropertyName())) {
                        CaptiveObjectProperty p = properties.get(evt.getPropertyName());
                        p.propertyChanged();
                   updateStringProperty(getBean());
          * The cached listener instance to listen to the bean (in the bean channel)
          * property change events if it supports PCL.
         PropertyChangeListener beanPropertyListener;
          * Subclasses can override to implement their own behavior. Its best to
          * extend from <code>BeanPropertyListiner</code> to include the default
          * behavior.
          * @return
         protected PropertyChangeListener createBeanPropertyListener() {
              return new BeanPropertyListener();
          * Add a listener only if the PCL methods exist. This listens for property
          * changes on the bean's property not changes in the actually bean held by
          * the bean channel.
         protected void addBeanPCLListener(Object obj) {
              if (!isListenForBeanPCLEvents())
                   return;
              if (obj != null) {
                   if (BeanPropertyUtils.hasPCL(obj.getClass())) {
                        if (beanPropertyListener == null)
                             beanPropertyListener = createBeanPropertyListener();
                        BeanPropertyUtils.addPCL(obj, beanPropertyListener, null);
          * Remove a listener only if the PCL methods exist.
          * @see #attachBeanPCLListener
         protected void removeBeanPCLListener(Object obj) {
              if (obj != null) {
                   if (BeanPropertyUtils.hasPCL(obj.getClass())) {
                        if (beanPropertyListener == null)
                             beanPropertyListener = createBeanPropertyListener();
                        BeanPropertyUtils.removePCL(obj, beanPropertyListener, null);
          * Invalidate the properties in the property cache. Then changed the bean in
          * the bean channel. Then fire a value changed event.
          * @param bean
         public void setBean(T bean) {
              invalidateProperties();
              if (getChannel() instanceof WritableValue) {
                   ((WritableValue) getChannel()).setValue(bean);
              } else {
                   throw new IllegalArgumentException(
                             "Could not set bean value into a non-writable bean channel");
              fireValueChangedEvent();
          * Called to indicate that the underlying bean changed.
         protected void invalidateProperties() {
              for (CaptiveObjectProperty p : properties.values()) {
                   p.invalidate();
         public T getBean() {
              return getChannel().getValue();
          * Lazily get the method representing the property prior to getting or
          * setting. Because this is a property, it can also be bound to.
          * @author Mr. Java
          * @param <T>
         protected static class CaptiveObjectProperty<T> extends
                   ObjectPropertyBase<T> {
               * The string name of the property.
              String readPropertyName, writePropertyName;
               * If the property is really a javafx property, it is stored here.
              Property<T> enhancedProperty;
               * Used if the property is not an enhanced property.
              Method readMethod, writeMethod;
               * The factory that holds the bean we obtain values against.
              BeanPropertyFactory factory;
              public CaptiveObjectProperty(BeanPropertyFactory factory,
                        String property) {
                   this.readPropertyName = property;
                   this.factory = factory;
              public CaptiveObjectProperty(BeanPropertyFactory factory,
                        String property, String writePropertyName) {
                   this.readPropertyName = property;
                   this.writePropertyName = writePropertyName;
                   this.factory = factory;
              @Override
              public Object getBean() {
                   if (factory == null || factory.getBean() == null)
                        return null;
                   return factory.getBean();
              @Override
              public void store(T value) {
                   if (writeMethod == null && enhancedProperty == null) {
                        getWriteMethod(value.getClass());
                   if (writeMethod == null && enhancedProperty == null) {
                        return;
                   try {
                        if (enhancedProperty != null) {
                             enhancedProperty.setValue(value);
                             return;
                        if (getBean() == null)
                             return;
                        writeMethod.invoke(getBean(), value);
                        return;
                   } catch (Exception e) {
                        e.printStackTrace();
              @Override
              public T getValue() {
                   if (readMethod == null && enhancedProperty == null) {
                        getReadMethod();
                   if (readMethod == null && enhancedProperty == null)
                        return null;
                   try {
                        if (enhancedProperty != null)
                             return enhancedProperty.getValue();
                        if (factory.getBean() == null)
                             return null;
                        Object rval = readMethod.invoke(getBean());
                        return (T) rval;
                   } catch (Exception e) {
                        e.printStackTrace();
                   return null;
              @Override
              public String getName() {
                   return readPropertyName;
               * Invalidate the method. Perhaps the bean changed to another object and
               * we should find the method on the new object. This is called prior to
               * the <code>getBean()</code> being changed.
              public void invalidate() {
                   readMethod = null;
                   fireValueChangedEvent();
               * This is used to externally signal that the property has changed. It
               * is quite possible that this object does not detect those changes and
               * hence, an external object (in all cases the BeanPropertyFactory) will
               * signal when a change occurs. Property change detection is centralized
               * in the factory for efficiency reasons.
              public void propertyChanged() {
                   fireValueChangedEvent();
              protected Property getJavaFXReadProperty(String propertyName) {
                   if (factory.getBean() == null)
                        return null;
                   String methodName = getName() + "Property";
                   try {
                        Method mtmp = factory.getBean().getClass()
                                  .getMethod(methodName, new Class<?>[0]);
                        enhancedProperty = (Property) mtmp.invoke(factory.getBean(),
                                  new Object[0]);
                        return enhancedProperty;
                   } catch (Exception e) {
                        // e.printStackTrace();
                        // silently fail here
                   return null;
              protected void getWriteMethod(Class<?> argType) {
                   if (factory == null || factory.getBean() == null)
                        return;
                   if (enhancedProperty == null)
                        enhancedProperty = getJavaFXReadProperty(getName());
                   if (enhancedProperty != null)
                        return;
                   writeMethod = getPojoWriteMethod(getName(), argType);
               * Sets the method, either an enhanced property or the POJO method via
               * reflection.
               * @return
              protected void getReadMethod() {
                   if (factory == null || factory.getBean() == null)
                        return;
                   enhancedProperty = getJavaFXReadProperty(getName());
                   if (enhancedProperty != null)
                        return;
                   // Look for standard pojo method.
                   readMethod = getPOJOReadMethod(getName());
               * Return a get method using reflection.
               * @param propertyName
               * @return
              protected Method getPOJOReadMethod(String propertyName) {
                   if (factory.getBean() == null)
                        return null;
                   // Look for standard pojo method.
                   String methodName = getGetMethodName();
                   try {
                        Method mtmp = factory.getBean().getClass()
                                  .getMethod(methodName, new Class<?>[0]);
                        return mtmp;
                   } catch (Exception e) {
                        // silently fail here
                        // e.printStackTrace();
                   return null;
              protected String getGetMethodName() {
                   String methodName = "get"
                             + Character.toUpperCase(getName().charAt(0));
                   if (getName().length() > 1)
                        methodName += getName().substring(1);
                   return methodName;
               * Return a set method using reflection.
               * @param propertyName
               * @param argType
               * @return
              protected Method getPojoWriteMethod(String propertyName,
                        Class<?> argType) {
                   if (factory.getBean() == null)
                        return null;
                   String methodName = getSetMethodName();
                   try {
                        Method mtmp = factory.getBean().getClass()
                                  .getMethod(methodName, argType);
                        return mtmp;
                   } catch (Exception e) {
                        // silently fail here
                        // e.printStackTrace();
                   return null;
              protected String getSetMethodName() {
                   String methodName = "set"
                             + Character.toUpperCase(getName().charAt(0));
                   if (getName().length() > 1)
                        methodName += getName().substring(1);
                   return methodName;
          * Obtain a property using the binding path. The binding path should be
          * simple property names separated by a dot. The bean has to specified
          * because the return value is a property that can be used directly for
          * binding. The first property specified in the binding path should be a
          * property on the bean.
          * <p>
          * The difference between this and <code>Bindings.select()</code> is not
          * much other that it uses the bean factory machinery and the path can be
          * specified as a string. Of course, the bean can be a plain pojo.
          * @param bindingPath
          * @return
         public static Property propertyFromBindingPath(Object bean,
                   String bindingPath) {
              if (bindingPath == null || bindingPath.isEmpty())
                   return null;
              BeanPropertyFactory lastFactory = null;
              Property lastProperty = null;
              String[] parts = bindingPath.split("\\.");
              if (parts.length > 0) {
                   for (int i = 0; i < parts.length; i++) {
                        if (parts.length() <= 0 || parts[i].isEmpty()) {
                             throw new IllegalArgumentException("Binding path part " + i
                                       + " has no length");
                        BeanPropertyFactory newFactory;
                        if (i == 0)
                             newFactory = new BeanPropertyFactory(bean);
                        else
                             newFactory = new BeanPropertyFactory(
                                       (WritableValue) lastProperty);
                        lastProperty = newFactory.getProperty(parts[i].trim());
                        lastFactory = newFactory;
              return lastProperty;
         * Alot like <code>Bindings.select</code> but also handles pojos.
         * @param bean
         * @param path
         * @return
         public static Property propertyFromBindingPath(Object bean, String... path) {
              String tmp = "";
              for (int i = 0; i < path.length; i++) {
                   tmp += path[i];
                   if (i <= path.length - 1)
                        tmp += ".";
              return propertyFromBindingPath(bean, tmp);
    and a supporting classpackage scenegraphdemo;
    import java.beans.PropertyChangeListener;
    * Static methods for manipulating PCL for standard java beans.
    * @author Mr. Java
    public class BeanPropertyUtils {
         protected final static Class<?>[] NO_ARGS = new Class<?>[] { PropertyChangeListener.class };
         protected final static Class<?>[] ARGS = new Class<?>[] { String.class,
                   PropertyChangeListener.class };
         protected final static String pclAddMethodName = "addPropertyChangeListener";
         protected final static String pclRemoveMethodName = "removePropertyChangeListener";
         * Return true if the class has PCL methods. Does not check for remove.
         * <p>
         * addPropertyChangeListener(PropertyChangeListener)
         * <p>
         * addPropertyChangeListener(String, PropertyChangeListener)
         * @param bean
         * @return
         public static boolean hasPCL(Class<?> clazz) {
              try {
                   if (clazz.getMethod(pclAddMethodName, NO_ARGS) != null) {
                        return true;
              } catch (Exception e) {
                   // silently fail
              try {
                   if (clazz.getMethod(pclAddMethodName, ARGS) != null) {
                        return true;
              } catch (Exception e) {
                   // silently fail
              return false;
         * Add a listener.
         * @param bean
         * @param listener
         * @param propertyName
         public static void addPCL(Object bean, PropertyChangeListener listener,
                   String propertyName) {
              try {
                   if (propertyName == null) {
                        bean.getClass().getMethod(pclAddMethodName, NO_ARGS)
                                  .invoke(bean, new Object[] { listener });
                   } else {
                        bean.getClass()
                                  .getMethod(pclAddMethodName, ARGS)
                                  .invoke(bean,
                                            new Object[] { propertyName, listener });
              } catch (Exception e) {
                   e.printStackTrace();
         * Remove a listener.
         * @param bean
         * @param listener
         * @param propertyName
         public static void removePCL(Object bean, PropertyChangeListener listener,
                   String propertyName) {
              try {
                   if (propertyName == null) {
                        bean.getClass().getMethod(pclRemoveMethodName, NO_ARGS)
                                  .invoke(bean, new Object[] { listener });
                   } else {
                        bean.getClass()
                                  .getMethod(pclRemoveMethodName, ARGS)
                                  .invoke(bean,
                                            new Object[] { propertyName, listener });
              } catch (Exception e) {
                   e.printStackTrace();
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              

Maybe you are looking for