Calling Portlet Backing File

Hi,
Is it possible to call a method from a backing file during the portlet render phase? That is, call it from within the JSP.
thanks,
Ricardo Seabra

so not sure what your use case is...
you can't call the backing file directly but you can put something in the request and then during the dispose() lifecycle of the backing file you could look for that thing in the request and then call some method.
Chris Jolley
Portal Architect

Similar Messages

  • Portlet backing file vs content backing file

    Hi,
    could someone explain the differences between a "portlet backing file" and a "content backing file". Both are properties available on a portlet.
    Thx
    Emmanuel

    According to the documentation, here is the difference:
    Scoping and Backing Files
    The difference between having a backing file as part of <netuix: portlet backingfile =some_value> or part of <netuix: jspContent backingfile=some_value> is related to scoping.
    For example, if you have the backing file on the portlet itself, you can actually stop the portlet from rendering. If the backing file is at the jspContent level, the portlet portion of the control tree has already run; you use this implementation to run processes that are specifically for the JSP in the portlet.
    See http://download.oracle.com/docs/cd/E13155_01/wlp/docs103/portlets/building.html#wp1077130 for more info.
    Brad

  • Alternative approaches for Portlet backing File

    Hi All,
    What would be the best alternate approach if i need to replace all the portlet backing files?
    Thanks in Advance,
    Mohan

    Hello Mohan,
    Can you describe your issue in more detail? Why would you need to replace the backing files, and what would you be replacing them with?
    Kevin

  • Is it possible to use a portlet backing file on the dvt_enabler portlet?

    We currently have a 9.2 portal with a simple login form portlet that uses a backing file to do much security checking, authentication against ActiveDir, etc. Our requirement is to convert to WLP 10.3 using the DVT enabler portlet or something like it for login (because DVT/DISC is to be turned on for the portal). will it be possible to specify that backing file against the DVT enabler portlet?

    I'm not sure using the DVT enabler portlet will do what you want. It basically just specifies the render dependencies to bring in the dojo and dvt javascript libraries. It doesn't provide any login support itself; the javascript it brings responds to the logged-in state of the user (accessed via DISC), so something else is required to login the user.
    Greg

  • Detection portlet backing file under weblogic portal

    Hi all
    I am try to work out a interportlet communication example under instruction listed below
    http://download.oracle.com/docs/cd/E13218_01/wlp/docs92/portlets/ipc.html#wp1025202
    Everything works fine until add action to a backing file. I cannot find such option under event handler wizard. From the documentation, it mentions that
    "The Invoke BackingFile selection will not appear unless a backing file is detected by WebLogic Portal. "
    Is any way that can trigger weblogic portal to detect particular backing file? or any example that I can refer to setup such action manually?
    Any help would be apprectiate, thanks.
    wayne

    Hello Wayne,
    The WebLogic Portal forum is a better place to ask WLP questions:
    WebLogic Portal
    However, to answer your question, you can add a backing file to the portlet in Workshop, or manually in the .portlet file as described (at the bottom of the section) here:
    http://download.oracle.com/docs/cd/E13218_01/wlp/docs92/portlets/building.html#wp1077130
    Kevin

  • Portlet backing file and include

    If I have a backing file, is there way to include another page in the
    handlePostback() method or preRender() method? Don't want to change the
    whole page, just the contents of the portlet...

    According to the documentation, here is the difference:
    Scoping and Backing Files
    The difference between having a backing file as part of <netuix: portlet backingfile =some_value> or part of <netuix: jspContent backingfile=some_value> is related to scoping.
    For example, if you have the backing file on the portlet itself, you can actually stop the portlet from rendering. If the backing file is at the jspContent level, the portlet portion of the control tree has already run; you use this implementation to run processes that are specifically for the JSP in the portlet.
    See http://download.oracle.com/docs/cd/E13155_01/wlp/docs103/portlets/building.html#wp1077130 for more info.
    Brad

  • How to use portlet backing file if I choose book properties edit table true

    I don't know how to use the property,please tell me!
    thank you

    If you want a backing file to be run while rendering a book, you should specify your file in Backing property of the book. Is that what you are trying to do?

  • How can I have a backing file call a JavaScript function?

    I have a Weblogic portal with a JSP portlet. The portlet has a backing file. How can I get the backing file to call a JavaScript function in my portlet?
    thanks

    Hi
    your questions are not correct because you are mixing up server side operations with client side operations.
    First server side code executes then the page is sent to the browser , then any javascript executes on the browser. So asking for javascript to be called from backing file (server side) doesn't make sense or asking for javascript to read a parameter doesnt exactly work either.
    However in your server code suppose you have a variable action in the request that you want javascript to know then in your JSP you would add something like
    <script type="text/javascript">
    var action = '${requestScope.action}';
    alert(action);//or whatever you want to do
    <c:if test="${requestScope.someOthervariable == ''xyz'}"><%-- this check is done on the server --%>
    callSomeJavascript(); <%--this javascript is only executed when the server side value of someOtherVariable is xyz --%>
    </c:if>
    </script>
    i.e. you can output the javascript that has the variables you need or the function calls you want.
    Like I said understand whats server side and whats client side.

  • Problem with backing file in weblogic portal

    Hi friends,
    Hope all are good. How to call the backing file methods,before begin method of jpf portlet of weblogic.
    Thanks,
    Ramanuja kolla.

    Serge, can you post this in weblogic.servlet.interest.portal? There is a
              chance portal gurus might be able to answer this query
              --Nagesh
              "Serge" <[email protected]> wrote in message
              news:403080b2$[email protected]..
              >
              > Hello.
              >
              > I am developing Portal Web application now using WebLogic Workshop 8.1
              with Service
              > Pack2 and I have a problem with Default Page in Portal.
              >
              > The problem is following: when I click on ANY link (even on Minimize or
              Maximize
              > in Portlet titlebar) on the page that is not default for my application,
              default
              > page is always shown. Why does it happen? Can you help me?
              

  • Backing file init method always called for proxy portlets

    Hello,
    We are currently using Weblogic Portal 10 MP1. Deployed within our Portal EAR is a local proxy portlet and attached to this proxy portlet is a backing file, which currently implements the init() and prerender() methods from the backing interface.
    When this is placed in a page that is within a desktop, the init() method is always invoked no matter which page you access within the desktop. As I understand it from the documentation, if you have "tree optimization" turned on, then the init() method will only be called when rendering the actual page the proxy portlet is in. But this doesn't seem to be the case. However, if I define a standard Java portlet within the EAR and attach a backing file, then the init() follows the rules when tree optimization is turned on or off.
    Does anyone know if this is a defect within the portal framework, or is this expected and proxy portlets do not follow this rule?
    And I guess, if it is a defect or known limitation, is there a possible workaround? I assume the simplest workaround will be to move the logic into the prerender() method.
    Regards,
    Jonathan

    Hello Jonathan,
    Tree optimization is a tricky thing- some portlets may still be initialized even when the page they are on isn't visible. The rules for which get initialized and which don't are very complicated and depend on a number of things, so it is just best to not rely on the init() method not getting called.
    By far the best option for your use-case is to have the proxy portlet listen to the "onRefresh" event, and move the logic from the backing file's init() method into an event-handling method in the backing file, then have this method called when the refresh event is received. Here's a sample portion of the .portlet file for doing this:
    <netuix:handlePortalEvent event="onRefresh" eventLabel="onRefreshEvent">
        <netuix:invokeBackingFileMethod method="handleRefreshEvent"/>
    </netuix:handlePortalEvent>The "onRefresh" event is sent to the portlet only when it is visible on the page, so it should work perfectly for your use-case.
    Kevin

  • How to call a database controller in backing file

    Hello,
    First of all, I'd like to apologize if this question is posted by someone else before. But because I haven't been to find the answer so I just post this question here with hope that someone will have the answer for me.
    I am using weblogic 8.1 SP3. I am trying to build a web portal which requires users to login and logout. Based on the tutorials from BEA and the documents that I read in this forum, I decided to use backing file to check for the username and password. I am using MySQL database and I have a page flow controller which is based on the database control. How can I call that control in the backing file? Or is there anyway to compare the username and password that the user enters to the ones in the MySQL tables? I don't want to create a database connection in that backing file since the page flow controller can do that for me already.
    Any help is appreciated
    Thanks in advance
    TL

    select ename from emp@dblink
    ...lose the double quotes.
    Scott

  • No Backing File in Portlet

    Hi All,
    Is there any possibility of not having a backing file when we are implementing the IPC (Inter-Portlet Communication) in our portal application ??
    Thanks in Advance
    Portal Developer

    Hello,
    A backing file is not needed unless you want to do something "custom" with the events your portlet receives. All the options listed at http://edocs.bea.com/wlp/docs102/portlets/ipc.html#wp1055503 can be specified in your .portlet file, and only "invoke backing file method" actually requires a backing file.
    Kevin

  • How to receive the custom event in the listening portlet (No backing file)

    I have couple of portlets (JPF based). Portlet A is firing an event
         public Forward processAction()
              PortletBackingContext context =PortletBackingContext.getPortletBackingContext(this.getRequest());
              String message = "XXXXX";
              context.fireCustomEvent("customevent", message);
              Forward forward = new Forward("success");
              return forward;
    I have configured the Portlet B's eventhandler to listen for the 'customEvent' and invoke the pageFlowAction 'listenForEvent'
         @Jpf.Action(forwards = { @Jpf.Forward(name = "success", path = "test2.jsp") })
         public Forward listenForEvent() {
              Forward forward = new Forward("success");
              return forward;
    Portlet B's method listenForEvent is indeed getting invoked, but is there a way I can retrieve the 'Event' object (as fired by Portlet A) inside the listenForEvent. I could have done this via the Backing file, but for some reasons i cann't use the backing file. Is there a way i can get the CustomEvent and the associated payload in my listening JPF portlet, without a backing file?
    The WLP version is 10.3

    Hello,
    I originally said:
    All you should need to do is to modify the method signature for your event-receiving method. The method signature should be:
    public void listenforEvent(HttpServletRequest request, HttpServletResponse response, Event event)
    where Event is a com.bea.netuix.events.Event object. You can then cast this to a CustomEvent object.
    But I mis-read your earlier post about catching the custom event and invoking a pageflow action. When you do that, you will lose the custom event's payload (your message), and there is no way to retrieve it from your pageflow action.
    The only way you can actually retrieve the event's payload is using a backing file for the portlet, with a method having the signature I mentioned above. You can then set a request attribute with the event's payload and still have it invoke the pageflow action, at which time you could retrieve the request attribute value-- assuming you don't need to run this portlet over WSRP. Over WSRP, the event-handling and pageflow action-invoking lifecycles will happen with independent request objects, so you would need to store the event payload in session to work over WSRP.
    Kevin
    Edited by: kfrender on Aug 31, 2009 3:34 PM

  • Portlet state in backing file

    I need to check whether the portlet is minimized in the portlet's backing file's
    preRender() method.
    Does anybody know if i can find the current mode (minimized, maximized, normal)
    of the portlet somehow? From the javadocs it looks like i need to get a reference
    to a PortletState object....
    Thanks,
    Oyvind

    How about something like the following?
    PortletBackingContext aContext =
    PortletBackingContext.getPortletBackingContext(
    aRequest
    sLogger.info("current window state is: \t" +
    aContext.getWindowState().getName());
    "Oyvind Johansen" <[email protected]> wrote in message
    news:40617642$[email protected]..
    >
    I need to check whether the portlet is minimized in the portlet's backingfile's
    preRender() method.
    Does anybody know if i can find the current mode (minimized, maximized,normal)
    of the portlet somehow? From the javadocs it looks like i need to get areference
    to a PortletState object....
    Thanks,
    Oyvind

  • Backing File to Header Portlet

    Hi,
    I associated a backing file to the Header Porlet(JPF portlet). I want to fire an event from there. I wrote the logic in preRender of the backing file .
    Nothing is happening. I cant even get the log statements .
    Can anybody help me on this

    Hello,
    Unfortunately, portlets in the header and footer cannot be used to send events. This is because they are rendered "outside" of the normal page and don't get access to the PortletBackingContext needed to send events.
    Kevin

Maybe you are looking for