Changing current page from backing file

Using WL 8.1 SP4
I have a User Acceptance Policy page in my portal, and I want to ensure that users have viewed this page before I allow them to view any other content.
When users have viewed the UAP, I set a session variable. I then use the session variable in my entitlements, so there's no problem with them viewing content they shouldn't.
The problem I have is that if users try to access a page directly (or their session has expired), they're left with a blank page (as they're not entitled to see anything), rather than being sent to something helpful (i.e. the UAP).
So I need a backing file. It can either be on every page (except the UAP), or I can put it on the book - whatever is recommended.
I've tried this as a page backing file:
public class UAPCheck extends AbstractJspBacking {
public boolean handlePostbackData(HttpServletRequest request, HttpServletResponse response){
PageBackingContext pbc = PageBackingContext.getPageBackingContext(request);
if (pbc.getLabel().equals("uap_page")
|| request.getSession().getAttribute("UAP Accepted") != null){
return true;
} else {
pbc.setupPageChangeEvent("uap_page");
return true;
I've applied this to pages in my book, however nothing happens - the page change request never fires!
So what's happening here? Am I misunderstanding what setupPageChangeEvent is for?
Help is appreciated.
darren

In the past I have done it as follows:
1. Create a backing file for the book that has these pages.
2. In the preRender of the backing file do the following
BookBackingContext bbc=
BookBackingContext.getBookBackingContext(getRequest());
if( //check to see if page change event is needed)
{PageBackingContext pbc_current =
        bbc.getActivePageBackingContext();
    pbc_default.setActive(false);
    PageBackingContext pbc_pageToBeShown=
        bbc.getPageBackingContextByDefinitionLabel("//  
        def label of page to be shown, in your      
        case 'uap_page'");
    pbc_pageToBeShown.setActive(true);
    return true;
else return true;
3. link the backing file to book
Recommendations:
* Don't use backing files for Portal components if they are not needed. (From your post, if I am not wrong, you are using backing files for all pages in the book which is not necessary and can cause unnecessary complications)
* Read this doc to understand life-cycle methods of portal components http://edocs.bea.com/wlp/docs81/pdf/taxonomy.pdf
Peruse the above document to understand what is going wrong with your code.
* Remember that the life cycle methods for components that are not active will not be rendered if treeOptimizationEnable parameter is set to true ( this parameter can be seen in workshop under property editor)
* When calling one of the setupxxevent methods, it must be done on the backing context that the backing file is tied to. If you do not do this the event may not get fired. For more info click http://e-docs.bea.com/wlp/docs81/whitepapers/netix/body.html
Seenu
Seenu.

Similar Messages

  • How can I remove one page from adobe file

    How can I remove one page from adobe file, when I try to remove the page a dialgue box say "some pages are being used, so they can not be ereased"?

    Tools>Pages>Delete pages

  • How do I change default page from USA  to United Kingdom

    HHow do I change default page from USA to uk

    Click here and follow the instructions to change the iTunes Store country.
    (108603)

  • [solved] How to remove specific pages from PDF file?

    I'm looking for a way to remove few pages from PDF file.
    Last edited by delor (2008-07-04 10:28:22)

    To remove first page I did this:
    pdftk original.pdf cat 2-end output result.pdf
    Any other propositions ?

  • Changing the setting from PDF file to a  JPEG file.

    Is there a way I can change the scan setting on my printer. It is a HP Deskjet F4480. I want to change the setting from PDF file to a JPEG file. I want to scan them so I can see them on my screen saver.

    This has nothing to do with Acrobat. See the documentation for the scanner software that came with your scanner.

  • Insert Pages From another File?

    HI Everyone,
    Is there a way I can insert entire pages from one file into another?
    I'm working on a document and need several pages from another file - is there a way I can import or insert?
    Cheers
    Darryn

    Open your files & show thumbnails. Sections have a yellow border around all of the pages in that section. Now click on the page in the thumbnail pane & copy. If the file is more than one page & you only want one, you'll need to insert a section break to separate the pages. Then go to your other file, click in the thumbnail pane & paste. The whole copied page will be pasted in. Repeat with another section. Styles will copy over with the sections but headers & footers will not.

  • How To Customize displaying  of JSP page From Backing Bean

    I would like to customize the displaying of jsp page from backing bean based on user Roles
    For example
    - if the Role is Admin then backing bean should display Admin.jsp
    - if the Role is Guest then backing bean should display Guest.jsp
    Any pointers/suggestions will be highly appreciated
    Regards
    Bansi

    Thanks to all for providing thoughts
    I wanna make it more Dynamic. In the sense
    "Backing Beans should drive the rendering of first jsp page in the application " and not jsp page driving the backing bean or not to put some kind of hard coding in jsp page to see if its admin user then display certain set of UI Components or certain set of other UI components for other users.
    As we have atleast 10 different Roles and there can be Composite Roles i.e. combination of two roles. In this case how does the Backing Bean drives the rendering of jsp page?
    Regards
    Bansi

  • Can we override the Desktop LAF for Pages using backing Files ?

    Hi
    I have the following Look And Feel related requirement.
    We have an global application level Skin which was applied at the desktop level using the .laf file.
    But some of the pages require a totally different Look and Feel apart from the one defined at the desktop level.
    To put the question in the other way,
    Can we override the skin & skeleton defined at the Desktop level using the backing file (for page or portlet) ?
    The following is the code snippet, which i used in the backing file to achive the above.
    LookAndFeel lookAndFeel = LookAndFeel.getLookAndFeel(request);
    lookAndFeel.setSkin(y_skin);
    lookAndFeel.setSkeleton(y_skeleton);
         lookAndFeel.reinit();
    Here the y_skin & y_skeleton are the new set of skin & skeletion which i have created for the page.
    when i ran the above snippet in the portal framework, i found the desktop level skin is getting applied
    to the pages insted of the y_skin & y_skeleton.
    Any help or directions .... for dynamically changing the skin & skeletion for pages will be appreciated.
    Thanks & Regards
    - Sachi

    What you are doing looks valid.
    this is the code that i have
    public void init(HttpServletRequest request, HttpServletResponse response)
    // Get the session from the request
    HttpSession session = request.getSession();
    // Get the LookAndFeel object from the PrimaryTheme in the request
    LookAndFeel lookAndFeel = LookAndFeel.getLookAndFeel(request);
    if (request.getParameter("defaultButton") != null)
    //System.out.println("default skin selected");
    session.setAttribute("skin", "default");
    if (request.getParameter("textButton") != null)
    //System.out.println("text skin selected");
    session.setAttribute("skin", "text");
    if (request.getParameter("classicButton") != null)
    //System.out.println("classic skin selected");
    session.setAttribute("skin", "classic");
    String selectedSkin = (String) session.getAttribute("skin");
    if (selectedSkin != null)
    //System.out.println("setting skin and skeleton to: '" + selectedSkin + "'");
    lookAndFeel.setSkin(selectedSkin);
    lookAndFeel.setSkeleton(selectedSkin);
    lookAndFeel.reinit();
    }

  • Target Servlet in page from backing bean.

    Hi,
    How do I render a servlet in a page from a backing bean instead of a new page as it currently doing.
    the backing bean consists of...
    String url = "/ScriptOutputServlet?docNum=" + command;
            blog.debug("URL = " + url);
            FacesContext ctxt = FacesContext.getCurrentInstance();
            try
                ctxt.getExternalContext().dispatch(url);
            }catch(Exception e)
                e.printStackTrace();
            }finally{
                ctxt.responseComplete();
            }I suppose my question is how do I add a target into the URL to render back into a frame on the original page for example?
    Thanks in advance

    First off, let me thank you for all your replies, your help is much appreciated.
    What I'm trying to achieve is for the user to be able to click a command link which is a shell script and have the stdout of the script returned to the same page. Please let me know what info/code you need.
    From the jsf page...
    <h:commandLink action="#{executeBean.executeScript}" immediate="true" styleClass="#{t.nodeSelected ? 'documentSelected':'document'}" actionListener="#{t.setNodeSelected}" >
                                                <t:graphicImage value="../images/document.png" border="0"/>
                                                <h:outputText value="#{node.description}"/>
                                                <f:param name="docNum" value="#{node.description}"/>
                                            </h:commandLink>
                                        </h:panelGroup>
                                    </f:facet>
                                </t:tree2>
                                <jsp:include page="/ScriptOutputServlet" />
    public void doExecute(String command)
            String url = "/faces/private/main.jsp?docNum=" + command;
            blog.debug("URL = " + url);
            FacesContext ctxt = FacesContext.getCurrentInstance();
            try
                ctxt.getExternalContext().redirect(url);
            }catch(Exception e)
                e.printStackTrace();
            }finally{
                ctxt.responseComplete();
            }I'm hoping I'm making some more sense...
    Many thanks again,
    nick
    Edited by: nickbeenham on Dec 26, 2007 9:38 AM

  • How to create a Help page from a file

    Hello,
    I have a new APEX application and someone made a nice help document using MS Word.
    How could I inlcude that file into a Help Page, or some ideas on how this could be seen by the users?
    Thanks

    Hi,
    Apex has a facility whereby you can create a context sensitive help page facility.
    see http://download.oracle.com/docs/cd/E23903_01/doc/doc.41/e21674/bldapp_hlp.htm#CHDCDBFB
    With your help document, save the section relevant to a page as a separate document and save it as a filtered web page. Edit this document in a plain text editor and cut and paste this into the help text for the page.
    When you select help from the navigation bar, then this help text will be shown for the current page. To make it even fancier, you can define the link for the navigation bar to show the help page as a popup, so that you don't loose the current context in the application.
    Regards
    Andre

  • Plugin to convert current page from bitonal to grayscale

    I'm scanning pages in which a few percent include a monochrome halftone image. The image quality is not critical, so if I could just convert the page from bitonal to grayscale, the CVision compressor will handle the de-halftoning and produce an acceptable image. I can do this manually with the TouchUp Object tool / Edit Image and convert the mode to grayscale in Photoshop, but that's too tedious. Is there a plugin or some automated way to do this with one click?

    Yes, but I need it to be on a per-page basis, not the whole document. Thus the posting title "convert current page," not convert document. Pdfcompressor's speed is proportional to file size, so making the whole document grayscale defeats the purpose since I want to take advantage of the speed of bitonal and compression of JBIG2, except for those few pages per volume that have halftones. I could also just set the scanner to produce a grayscale file, but that slows down the scanning too. Thank you for trying anyway, and I'm still hoping for a solution.

  • Invoking pageflow action from Backing Files

    Hi,
    I have a requirement to be able to force a pageflow to a particular state by invoking a specific action on the pageflow from the preRender() method of a backing file.
    I.e under certain circumstances i want to force the portlet to return to its 'initial' state by running the begin action. It has to be done programitically and not setting refresh-action on the portlet.
    Is it possible to do this programatically from a backing file ? Is so any sample code would be appreciated !.
    TIA
    Martin

    What do you mean by state of a page flow?
    If you want to set the state of the portlet you can do that easily using the PortletBackingContext.
    If you want to clear the instance variables of a pageflow, you can do that by overriding methods in the parent class of PageFlowController.
    Kunal
    Kunal Mittal

  • How to get total number of pages from .doc file without using Office interop?

    Hi,
    Kindly help me in getting the total number of pages from a .doc file not .docx file using C#. I know how to get by using Office interop but I do not want to use Office interop.
    So, without office automation in C# let me know how to get the total number of pages from a .doc file.
    Regards,
    Ashok

    Hi Ashok,
    >> I know how to get by using Office interop but I do not want to use Office interop
    Could you tell us why you don't want to use Office interop?
    As far as I know, this is the easiest way to achieve.Hmmm,this is my answer
    http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.pagenumbers.startingnumber(v=office.14).aspx
    Best regards,
    Kristin
    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.

  • Extracting pages from PDF file and creating new subfile PDF

    I am a .NET C# developer looking into creating an app that extracts a subset of pages from a PDF document, say, given a start and end page number, and possibly creating a new PDF file with that subset of pages.  Is there a convenient way of doing this ?

    Ok. The Acrobat SDK is not directly going to help, because the Acrobat SDK requires Acrobat, and Acrobat is not for server use.
    Adobe have the Adobe PDF Library for server use. C/C++, there may be a Java interface too from DataLogics, but huge overkill for this task, and many find it rather pricy for a simple task like this. There are third party libraries and tools, but this is not the place to discuss them.

  • Create web pages from xml files using Servets or JSP

    I�m new in this tecnology and I have to create a web pages from information that I get from a XML files. I would like to know if there is a place where I can find examples of code or any book that could help me.

    Two places with loads of information on this:
    http://xml.apache.org
    Look at Xalan or Cocoon.
    Also, there was an article on http://www.javaworld.com on XML with JSP.

Maybe you are looking for

  • Safari will not open after time machine restore

    My old iMac (intel) had a hard disc failure the otehr day so I went out an bought a new one.  Using setup assistant, I restored my old computer from Time Machine to the new computer. The old machine was completely up to date - had all the latest soft

  • Is there a quick, easy way to delete all the "lost" songs from my Library?

    OK, I'm storing all my music in my iTunes folder, which I moved to an external HD. In my iTunes Library (within the application itself), there must be thousands of MP3s listed that I no longer have the MP3 files for. Is there a quick way to update th

  • Statistical data is store in which file as OS level

    Dear all, I had one query Regarding statistics collectors. My query is: The file which contains statistical data at OS level from which the standard job: SAP_COLLECTOR_FOR_PERFMONITOR takes the data and puts into moni table. What is the name of the f

  • Logic Pro, the only host to not support midi out from plugins ?

    it seems that logic is the only host that does not support midi plugin output. something to do with the AU spec, lets hope that apple add support for these type of plugins sometime in the near future.

  • IPod resetting during first charge-up.

    Hello, sorry for potentially reposting this, but I don't beleive it's been addressed. Just this afternoon i picked up a brand new video iPod. I installed the software, restarted my computer, and then connected the iPod to the computer. I've left the