Use UIX demo 2.1.7 in my application

Hello,
I have download uix-demo-2.1.7.zip and run Shopping Cart Demo.
It work very well. I would like to also have a preference page in my application, as in the demonstration.
I recovered the two files Preferences.java and Preferences.uix. I modified them to integrate them in my project.
The page is posted correctly, with value in the choice. But UIX does not react to any modificatin of appearance. Why?
It I miss what which is not documented.
Thanks, for your help.
Nathanael

Schmied -
I noticed one problem with the 2.1.7 version of the DemoUIFactory class - the Customization objects that it creates do not wrap the current Configuration instance. Instead, each Customization object delegates to the Configuration instance returned by Configuration.sharedInstance(). This means that you will lose any configuration settings specified in uix-config.xml.
Here is an updated version of the DemoUIFactory class which corrects this problem. Instead of callling Configuration.sharedInstance(), the Customization instances now wrap the current Configuration instance as returned by RenderingContext.getConfiguration():
** Copyright (c) Oracle Corporation 2000-2003. All Rights Reserved.
**34567890123456789012345678901234567890123456789012345678901234567890123456789
package oracle.cabo.servlet.demo;
import java.io.PrintWriter;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionBindingEvent;
import javax.servlet.http.HttpSessionBindingListener;
import oracle.cabo.share.config.Configuration;
import oracle.cabo.share.config.ConfigurationImpl;
import oracle.cabo.share.config.Customization;
import oracle.cabo.ui.RenderingContext;
import oracle.cabo.ui.ServletRenderingContext;
import oracle.cabo.ui.UIConstants;
import oracle.cabo.servlet.BajaContext;
import oracle.cabo.servlet.Page;
import oracle.cabo.servlet.ui.BajaRenderingContext;
import oracle.cabo.servlet.ui.DefaultUIFactory;
import oracle.cabo.servlet.demo.shopcart.Preferences;
import oracle.cabo.style.StyleConstants;
import oracle.cabo.style.UserStyleSheet;
public class DemoUIFactory extends DefaultUIFactory
  public RenderingContext createRenderingContext(
    BajaContext context,
    PrintWriter out,
    Page        page,
    String      mimeType)
    BajaRenderingContext rContext =
      new BajaRenderingContext(context, out, page, mimeType);
    Customization customization = null;
    // Check to see if we are using user-specific styles
    UserStyleSheet userStyleSheet = Preferences.getUserStyleSheet(context);
    if (userStyleSheet != null)
      // Get the Customization object, creating it if necessary
      customization = _getCustomization(context, rContext);
      // Store the UserStyleSheet
      if (customization != null)
        customization.putProperty(customization.USER_STYLE_SHEET,
                                  userStyleSheet);
        rContext.setConfiguration(customization);
    return rContext;
  // Creates and registers the Customization object
  // for the current user
  private Customization _getCustomization(
    BajaContext      bajaContext,
    RenderingContext renderingContext
    // First, check to see if we've already got a Customization
    // instance for this user.
    HttpSession session = bajaContext.getServletRequest().getSession(true);
    // If we can't get an HttpSession, we can't create
    // user-specific customizations.
    if (session == null)
      return null;
    // Each Customization has a unique id.  Normally, this might
    // be some some user-specific identifer, such as the user's
    // login id.  Here, we don't have a login id, so instead we
    // just combine the HttpSession id with the name of the
    // Configuration object that we are wrapping to form a
    // unique id.
    Configuration config = renderingContext.getConfiguration();
    String id = _getCustomizationId(session, config);
    // Check to see if we have already registered a Customization
    // for this combination of HttpSession/Configuration
    ServletContext servletContext = _getServletContext(renderingContext);
    Customization customization = _getCustomization(servletContext, id);
    // If we already have a Customization, we're done!
    if (customization != null)
      return customization;
    // We don't have a Customization yet, so create it now
    customization = new Customization(id, config);
    // Register the customization to make sure that
    // it is available for subsequent requests
    customization.register(servletContext);
    // Finally, we store the Customization object on the
    // HttpSession.  We don't actually need to access the
    // Customization object via the HttpSession (we use
    // Configuration.getConfiguration()).  However, we
    // do want to unregister the Customization when the
    // HttpSession expires.  So, we wrap the Customization
    // object in an HttpSessionBindingListener which will
    // get called back when the sesssion expires - at which
    // point we can unregister the Customization object.
    CustomizationValue value = new CustomizationValue(customization);
    session.putValue(_CUSTOMIZATION_PROPERTY, value);
    return customization;
  // Returns the Customization object with the specified id
  private static Customization _getCustomization(
    ServletContext servletContext,
    String         id
    return (Customization)Configuration.getConfiguration(servletContext, id);
  // Creates the id for the Customization object for
  // the specified HttpSession/Configuration
  private static String _getCustomizationId(
    HttpSession   session,
    Configuration config
    // Just combine the ids for these two objects
    String sessionId = session.getId();
    String configName = config.getName();
    if (configName == null)
      configName = "null";
    return sessionId + configName;
  // Utility method for retrieving the ServletContext
  private static ServletContext _getServletContext(
    RenderingContext renderingContext
    return ServletRenderingContext.getServletContext(renderingContext);
  // An HttpSessionBindingListener that we use for storing our Customization
  // instance on the HttpSession.  It automatically unregisters the
  // Customization when the session times out
  private static class CustomizationValue implements HttpSessionBindingListener
    public CustomizationValue(Customization customization)
      _customization = customization;
    public Customization getCustomization()
      return _customization;
    public void valueUnbound(HttpSessionBindingEvent event)
      Customization customization = _customization;
      _customization = null;
      customization.unregister();
    // Who cares
    public void valueBound(HttpSessionBindingEvent event) {}
    private Customization _customization;
  private static final String _CUSTOMIZATION_PROPERTY = "customization";
}Andy

Similar Messages

  • Oracle.cabo.doc in UIX Demos - question to oracle support

    Hallo,
    Where can i found the oracle.cabo.doc.* classes used in the UIX Demo Bundle ?
    ( download link : http://technet.oracle.com/sample_code/products/jdev/uix/uixdemos.zip )
    regards, Manolis

    Manolis: The UIX demo class files are not currently available --we have not completed the work required to externalize this.
    Thanks,
    Ken

  • Errors of using uix template?

    I just copied the example from the Help Documentation "UIX Includes and templating" for a test. But I always get two error message:
    I wonder what has caused these two errors?
    <?xml version="1.0" encoding="UTF-8"?>
    <templateDefinition xmlns="http://xmlns.oracle.com/uix/ui"
              xmlns:ui="http://xmlns.oracle.com/uix/ui"
              xmlns:data="http://xmlns.oracle.com/uix/ui"
              targetNamespace="http://www.example.org/demo/templates"
              localName="demoPageLayout">
    <!-- define the template's type information -->
    <type base="ui:pageLayout">
       <namedChild name="topHead"/>
       <attribute name="selectedTab" javaType="int"/>
    </type>
    <!-- define the content of the page -->
    <content>
       <pageLayout>
         <!-- magic incantation to be explained below -->
         <attributeMap><rootAttributeMap/></attributeMap>
         <!-- another magic incantation -->
         <childMap><rootChildMap/></childMap>
         <!-- set up a default set of tabs -->
         <tabs>
           <tabBar data:selectedIndex="selectedTab@ui:rootAttr">
             <contents>
               <link text="Tab 1"/>
               <link text="Tab 2"/>
               <link text="Tab 3"/>
               <link text="Tab 4"/>
               <link text="Tab 5"/>
             </contents>
           </tabBar>
         </tabs>
         <!-- set up a default set of global buttons -->
         <globalButtons>
           <globalButtonBar><!-- ... --></globalButtonBar>
         </globalButtons>
         <!-- now, the content of the pageLayout -->
         <contents>
           <!-- Start with the "topHead" child at the top -->
           <rootChild name="topHead"/>
           <!-- Then add the indexed children -->
           <rootChild name="contents"/>
         </contents>
       </pageLayout>
    </content>
    </templateDefinition>
    <page xmlns="http://xmlns.oracle.com/uix/controller"
               xmlns:demoTmps="http://www.example.org/demo/templates">
        <templates xmlns="http://xmlns.oracle.com/uix/ui">
          <templateImport source="demo_PageLayout.uit"/>
        </templates>
        <content>
          <demoTmps:demoPageLayout xmlns="http://xmlns.oracle.com/uix/ui"
                                       selectedTab="3">
            <start>
              <sideNav></sideNav>
            </start>
            <demoTmps:topHead>
              <header text="A first header">
              </header>
            </demoTmps:topHead>
            <contents>
              <header text="A second header">
              </header>
            </contents>
          </demoTmps:demoPageLayout>
        </content>
    </page>
    ===>
    1. Error(9,52): <Line 9, Column 52>: XSD-2034: (Error) Element 'demoPageLayout' not expected.
    2. Error(26,15): <Line 26, Column 15>: XSD-2021: (Error) Element not completed: 'content'.Best Regards
    Yong

    please do not cross post on the UIX and JDeveloper
    forums. I will reply as soon as I can on the UIX
    forum:
    Error of using UIX Template?

  • Using UIX 2.2 in Jdeveloper 10.1.3.2

    Jdeveloper 10.1.2 was released with UIX support built-in.
    I have been working on 10.1.3.2 for a while and i am required to work on an old application that was build in 10.1.2 using UIX and Struts. How can integrate the UIX enviornment to 10.1.3.2. and most probably i will be requierd to build new pages for the same application modules and i am of course, going to choose to build the new pages in JSF while keeping the older pages (UIX pages). both will have BC4J model
    I am aware of the migration tool, but not ready to go into a migration process, the application if for a GSM operator and been used by some 400 + users
    regards
    Ammar Sajdi
    Amman - Jordan

    There is no more UIX support in 10.1.3 and greater. Oracle dropped UIX like a hot potato.
    People tried to get UIX running on top of a 10.1.3 binding/model stack but failed.
    So, mixing JSF and UIX on top of the very same model layer is probably impossible. Running JSF and UIX pages in unison sounds pretty hairy to me. Both will need their model layer versions and controllers.
    I am not from Oracle. I had some email conversations with Steve Muench about the UIX/10.1.3 problem, but he couldn't help either. My impression is: If you are waiting for Oracle to provide UIX support in 10.1.3 and later .... don't hold your breath! UIX is as dead as a rusty doornail.
    So my advice is: Stick to UIX until you can migrate the project completely to JSF and hang on to your copy of 10.1.2. That's what we do.
    Sascha

  • Using UIX with Jdeveloper 10.1.3.2

    Jdeveloper 10.1.2 was released with UIX support built-in.
    I have been working on 10.1.3.2 for a while and i am required to work on an old application that was build in 10.1.2 using UIX and Struts. How can integrate the UIX enviornment to 10.1.3.2. and most probably i will be requierd to build new pages for the same application modules and i am of course, going to choose to build the new pages in JSF while keeping the older pages (UIX pages). both will have BC4J model
    I am aware of the migration tool, but not ready to go into a migration process, the application if for a GSM operator and been used by some 400 + users
    regards
    Ammar Sajdi
    Amman - Jordan

    Hi!
    Please repost in the JDeveloper forum.
    cu
    Andreas

  • Can't find UIX Demos

    it seems that there has been a zip-File with UIX-demos but I can't locate it. Or is the UIX-framework no longer supported ?

    With a suggestion from Metalink this one was solved. It turns out the Application server needed a parm change inthe httpd.conf file.
    Change "UseCanonicalNames on"
    to "UseCanonicalNames off"

  • Show message using uix:pageLayout

    In UIX forums,"Oracle Technology Network > Forums " is shown on the pageLayout.
    Can I show some message on the same position using <uix:pageLayout>?

    I believe you can put a breadCrumbs inside the location
    named children of pageLayout to get this positioning.

  • When will new ADF UIX demo be released?

    Are there any one can tell me when the new ADF UIX demo based on uix 2.2 be released?
    I want to know if we can get databind uix tree component (or other ui components) from ADF data action control which return dataobject and something else.
    Thanks a lot.

    Hi Daniel,
    Are there any one can tell me when the new ADF UIX
    demo based on uix 2.2 be released?I'm not sure when any sample applications will be released, but there is an ADF UIX tutorial available here:
    http://otn.oracle.com/products/jdev/collateral/tutorials/9050/adfuix_tut.html
    I want to know if we can get databind uix tree
    component (or other ui components) from ADF data
    action control which return dataobject and something
    else.I'm not sure about the tree component - I'll try to find out whether that is/will be supported. Once your data controls are available in the Data Control Palette, you can bind them to components in your UIX page by:
    1. Selecting the data control that you want to bind.
    2. Selecting a component type from the "Drop As" choice.
    3. Dragging the data control onto the UIX page.
    This process is illustrated in the tutorial above.
    Andy

  • UIX demo 2.1.7

    Hi,
    Could can one please tell me from where i can download UIX demo 2.1.7 application.
    Thanks

    Please go to
    http://otn.oracle.com/products/ids/uix/content.html

  • Error using uix wizard for bc4j connection

    I have been trying for days to get a connection to the database using uix and bc4j. When I use the wizard to create one I get this error:
    Servlet error: Renderer failed: oracle.jbo.common.ampool.ApplicationPoolException: JBO-30003: The application pool (rola2.Rola2Module.Rola2ModuleLocal) failed to checkout an application module due to the following exception:
    this is all it says.. nothing else..
    how can I get it to work? what module is having the problem?
    the bc4j seems to look correct, I see the views it created.
    send me an email if you read this and know what the error means. I don' seem to be able to find my posts after a day or too.
    [email protected]

    Are you working with UIX XML or UIX JSP?

  • UIX Demos

    hello,
    I want to run the UIX Demos under Linux but cannot get it right. The problem is actually how to install UIX under Linux in order to access the demos. I could only get directions on how this is done in Windows OS but found nothing on how it could be done in Linux. Can someone help me out????

    Unfortunately, the file that you are looking for was not included with the samples files. We are hoping to update the samples soon (hopefully in conjunction with the 9.0.3 release).

  • head Title in browser window using UIX

    I have an application that is using UIX. I was wondering if anyone knew a way to add a variable value to the header of the webpage, meaning to top bar where the minimize maximize and close button are for each web page window.
    Currently I have it saying a title but I want to add a functionality where it will post a value that I am storing in a bean.
    Thanks

    Sorry I just got it.

  • I just tried to install the 11.4 update (or whichever one is the most recent update as of 1/26/2014) and when it failed i tried to install manually and now whenever i try to use it, i get the following error: the application has failed to start because MS

    i just tried to install the 11.4 update (or whichever one is the most recent update as of 1/26/2014) and when it failed i tried to install manually and now whenever i try to use it, i get the following error: "The application has failed to start because MSVCR80.dll was not found. Re-installing the application may fix this problem." Right after i click ok i then get this error: "Itunes was not installed correctly. Please reinstall Itunes. Error 7 (Windows error 126)." I tried to uninstall Itunes and then reinstall the 11.03 version but that didnt work either. I want to know if i copy all of the music in my itunes folder to an external without consolidating can i still transfer all my itunes music from my current windows xp pc to a brand new one and have my current itunes library in my new pc? Basically i just want to know 3 things: What exactly does consolidating the itunes library do? Can i copy, paste, and transfer my itunes library to an external and from there to a new pc? Will i be able to transfer my itunes library without consolidating the files?

    I have found a temporary solution, allowing the previous version of iTunes (v. 11.1.3 (x64) in my case) to be re-installed.  It will allow you to re-establish use of iTunes until the Apple software engineers fix the most recent disasterous upgrade (v. 11.1.4).  Please see and follow the procedure in the following article:http://smallbusiness.chron.com/reverting-previous-version-itunes-32590.html   The previous version works beautifully.

  • Using Team Foundation Server 2013 for Embedded windows application development

    Can I use Team Foundation Server 2013 to develop an application for an Embedded Board with WEC7 or WEC2013? Does it have all the features of the ultimate edition? For example, can I debug the application when it is running on the embedded board?

    Hi Davidlsar,
    If the source code of your project is created and managed by Visual Studio or Eclipse, then you can work with TFS 2013 since you can connect to team project in TFS via Team Explorer and then do the management. If you want to develop an application with a
    client machine which OS is WEC2013, you have to confirm whether you can install Visual Studio and use corresponding features on WEC2013.
    For the debugging problem, you might open a new thread in embedded forums for a better response. Thanks for your understanding.
    Best regards, 
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • I can't seem to get my iMac (late 2009 model) into automatic sleep mode.  If I manually put it into sleep I don't have any issues.  I used to solve the issue by running "PleaseSleep" application but that doesn't work anymore since Lion.

    I can't seem to get my iMac (late 2009 model) into automatic sleep mode.  If I manually put it into sleep I don't have any issues.
    I used to solve the issue by running "PleaseSleep" application but that doesn't work anymore since Lion. I now want to fix the underlying problem.
    I'm not running any weird background processes and in my energy saver settings I've tagged "put the hard disk to sleep when possible:, "allow power button to put computer to sleep" and "automatically reduce brigthness". All pretty standard.
    Is there anyone who can give me some pointers ?

    Today I solved the same problem for my iMac running Snow Leopard. See https://discussions.apple.com/thread/3008791#15947706. The method may help you, too.
    For me it was the DynDNS Updater preventing my iMac from automatically entering sleep mode.
    To my knowledge the cause of this sleep problem can only be a peripheral device or a process. So I suggest to first unplug all peripherals and test whether that's the cause. If not, I suggest to terminate one process after another and to test automatic entering of sleep mode after each. Start with user processes; continue with system process if necessary.
    At least that's the way I found the offending process. Fortunately, I was able to change the configuration of that process to allow again automatic entering of sleep mode.
    Good luck!

Maybe you are looking for