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
Similar Messages
-
Setting Portlet Preference in Backing File for Clipper Portlet
Hi All,
I have a clipper portlet, and I am setting the preferences(for form based authentication & passing application data dynamically) in the backing file which is then associated to the Clipper portlet. I looked up at the clipper constants that are available; and the example they have given is
portlet.setPreference(LOGIN_FORM_EXTRA_PARAMS, "name1=value2&name3=value4")
My question is what is this "portlet"?? is it an instance?? then whose instance/object it is?? how am I suppose to declare it in my Backing File??
Any input on this would be appreciated.
Thanks,
GHi,
I'm guessing here... but I think that the example is referring to a PortletPreferences object, which can be obtained through a PortletBackingContext with the getPortletPreferences() method. To obtain a PortletBackingContext you just use the static method PortletBackingContext.getPortletBackingContext() and pass in the request in the backing file. See also: Using the Preferences API to Access or Modify Preferences
Hope this helps,
Petri -
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
EmmanuelAccording 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 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.3Hello,
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 -
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.
wayneHello 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 -
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 Seabraso 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 -
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 -
Changing shell, look & feel dynamically in desktop backing file
(I apologize if this post is showing up twice - I tried posting with
google groups but it doesn't appear at forums.bea.com, so I wanted to
post again using xnews to make sure it shows up.)
I have a backing file that I am using with my desktop and I need to be
able to change the shell and look & feel dynamically, based on the page
that is currently active. I am doing the following in the preRender()
method:
String newLAF = "myLookAndFeel";
String newShell = "myShell";
// here is where I would determine the appropriate LAF and shell based on the current page
customizationContext = new CustomizationContext(Locale.getDefault(), request);
customizationContext.setVisitorMode(true);
DesktopView desktopView =
PortalBeanManager.getPortalCustomizationManager().getDesktopView(customizationContext, webAppName, new PortalPath(portalPath), new DesktopPath(desktopPath));
DesktopInstanceId dii = desktopView.getDesktopInstanceId();
DesktopInstance di = PortalBeanManager.getPortalCustomizationManager().getDesktopInstance(customizationContext, dii);
LookAndFeelDefinitionId lookAndFeelId = null;
for(int i = 0, n = lookAndFeelDefinitions.length; i < n; i++) {
if(newLAF.equals(lookAndFeelDefinitions.getDefinitionLabel())) {
lookAndFeelId = lookAndFeelDefinitions[i].getLookAndFeelDefinitionId();
break;
di.setLookAndFeelDefinitionId(lookAndFeelId);
ShellDefinitionManager shellManager = PortalBeanManager.getShellDefinitionManager();
ShellDefinitionId shellId = null;
ShellDefinition[] shellDefinitions = getShellDefinitions(webAppName, request.getLocale(), request);
for(int i = 0, n = shellDefinitions.length; i < n; i++) {
String shellName = shellManager.getShellView(customizationContext, shellDefinitions[i].getShellDefinitionId()).getMarkupView().getMarkupDefinition().getName();
if(newShell.equals(shellName)) {
shellId = shellDefinitions[i].getShellDefinitionId();
break;
di.setShellDefinitionId(shellId);
PortalBeanManager.getPortalCustomizationManager().updateDesktopInstance(customizationContext, di);
This works just fine, but I once the portal renders itself in my
browser, I usually have to refresh the page before the changes to the
shell and look & feel are visible. I would like to do this in the
init() method of the backing file but I do not know how to determine
the current active page from within init.
I would appreciate any help you all could give me in finding a solution
so I do not have to refresh the page in order to see the shell and look
& feel changes. Thanks in advance!
AndyWe essentially have 2 "portals" running inside 1 .portal file. We'd
like to be able to use single sign on and entitlements to allow/restrict
access to various parts of the 2 portals (where certain books are
consider part of portal "A" and others part of portal "B"). If you are
logged in as a super-user, you will be able to access everything. If
you are logged in as user type "A" you can only access portal "A," and
similarly for user type "B" and portal "B."
Portals A and B have each have a distinct header, footer (i.e. shell),
and look and feel (skeleton and skin). If a super-user is looking at
portal A, the portal should have portal A's header, footer, and look and
feel, and similarly for portal B.
How would you recommend we accomplish this? Would it make more sense
(and is it possible) to have the header and footer jsps determine what
content to render based on the current book or page, and then use the
code you suggested below to change the look and feel dynamically?
Thanks,
Andy
jolleyc wrote:
in order to pick up the changes for that request you will need to do a redirect back to the server (our login examples shwo you how to do this). this is because the control tree has already been retrieved from the database (so you need to go back and get a new version).
I quick note: If you plan on doing this a lot this is quite a heavy process. if you just need to change the lookAndFeel on the fly you can look at the following ( i t think this is in the tutorial portal)
A) Modify the shell to include a jsp and backing file
<netuix:header>
<netuix:jspContent backingFile="com.acme.DynamicLookAndFeelHeaderBacking" contentUri="/portlets/lookAndFeel/dynamicLookAndFeelHeader/dynamicLookAndFeelHeader.jsp"/>
</netuix:header>
B) backing file looks like
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)
session.setAttribute("skin", "default");
if (request.getParameter("textButton") != null)
session.setAttribute("skin", "text");
if (request.getParameter("classicButton") != null)
session.setAttribute("skin", "classic");
String selectedSkin = (String) session.getAttribute("skin");
if (selectedSkin != null)
lookAndFeel.setSkin(selectedSkin);
lookAndFeel.setSkeleton(selectedSkin);
lookAndFeel.reinit(); -
I am not able to use two backing files in same portal page
hi to all
i am using backing files in remote portlet.
but i have two portlets in my portal page and in both i need to use backing files. i used seperate backing files for both the portlets but only one works at a time.
please help me out frnds..
did this happening because of same object MarkupRequestState.KEY..... following is code that i am using. similar code used for another portlet, just a change of state varible and parameter variable
am i missing something?
package backempno;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.bea.netuix.servlets.controls.content.backing.AbstractJspBacking;
import com.bea.wsrp.ext.holders.MarkupRequestState;
import com.bea.wsrp.ext.holders.SimpleStateHolder;
public class sendempno extends AbstractJspBacking
public boolean preRender(HttpServletRequest request,HttpServletResponse response)
SimpleStateHolder state2 = new SimpleStateHolder();
String empno=request.getParameter("empno");
state2.addParameter("empno",empno);
request.setAttribute(MarkupRequestState.KEY, state2);
return true;
}Hi Susan,
In that case I will recommend that you consult a local technician/IT team and see if there is some network connectivity issue with your machine.
- Abhishek Maurya -
Backing file???
Hi,
Is their any place where i can found more detailed documentation of the "Backing
File"? Specifically the significance of the methods of the Backing file.
I know that the backing file is called before the JSP is called but in my case
the method "isRequestTargeted(request)" always returns false when i tried using
the backing file from the Portlet tutorial (portlet/login/LoginBacking.java).
When is the "handlePostbackData" method called? Why is it called more than once?
My JSP has 2 fields username and password.
Any help/info will be appreciated.
RaghuCorrection:
Put the class name for the Backing File:
backing.test
So, the class name is test and the filename is test.java. However, it is recommended that uppercase letter should be used for a class name. Like it should be Test.java instead.
I hope this makes sense.
Mansoor -
Prerender() in backing file... setting desktop titles dynamically
I have a link in page1 (with pageflow1 and portlet1), clicking on which the user is taken to page2 (with pageflow2 and portlet2) and the begin action method gets called in pageflow2. The begin action forwards to another another action (say, action2). action2 sets some request attributes, then finally forwards to the JSP that needs to be rendered. I have a backing file for portlet2 that has the prerender method implemented. The prerender() checks the request attribute set in action2() and accordingly sets the desktop title.
Now my problem is, the prerender is getting called BEFORE begin action is invoked. Shouldn't the prerender get invoked just beofre the JSP is rendered? If not, then how can I set the desktop title dynamically based on some data in an action?
Thanks in advance!There are two backing files you can give for a portlet.
1. Backing file for a portlet
2. Backing file for a JSP
Try giving the backing file reference in JSP instead of portlet.
-sampath -
Hello,
I have problems with remote portlets, events and page flow.
I have a remote portlet in the consumer. This portlet is generate from a pageflow. The portlet have a backing file with a customer method & the methods associated with the life cycle of the baking file.
Also the portlet have an event that it is thrown when a specific action in the page flow is executed.
The process is:
1- In the form the action is thrown
2- The Page Flow event is executed and it invoke a specific customer method on the backing file
3- This method is executed
4- The portlet goes to the next page.
In local mode this process is sucess but when I make a remote portlet the specific customer method in the backing file is never called.
I am looking for inside wsrp:
http://dev2dev.bea.com/pub/a/2005/03/inside_wsrp.html?page=5
However I have got others portlets that are not generated from page Flow with its associate backing file, specific customer method and it is sucess process.
I suppose the problem is I can´t asociate correctly the method of the backing file with the portlet in the producer.
Can someone help me with this problem?Correction:
Put the class name for the Backing File:
backing.test
So, the class name is test and the filename is test.java. However, it is recommended that uppercase letter should be used for a class name. Like it should be Test.java instead.
I hope this makes sense.
Mansoor -
I have just started using BEA portal. JPF has controller that handles all the action processings. Backing file has callback handlers to perform the same. Is the backing file concept prior to JPF's were introduced or they still go hand in hand? When does a JPF based portlet need to have a backing file as well?
Any clarifications will be apprecieted.
Thanks
-SDDNo, you don't need backing files to write portlets. The primary purpose
of backing files is to let you interact with the portal's aggregation
framework directly. You can think of backing files as an intermediary
between the framework and your JPF.
Subbu
Shiv Dhondiyal wrote:
I have just started using BEA portal. JPF has controller that handles all the action processings. Backing file has callback handlers to perform the same. Is the backing file concept prior to JPF's were introduced or they still go hand in hand? When does a JPF based portlet need to have a backing file as well?
Any clarifications will be apprecieted.
Thanks
-SDD -
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 -
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 DeveloperHello,
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
Maybe you are looking for
-
Problem printing output statements using c:out tag
Hello All, I am new to JSTL. For some reason <c:out >is not printlng "HelloWorld!" instead it is printing "{hello}" <c:set var="hello" value="Hello World!"/> <p/> <c:out value="${hello}"/> Here is how I have setup my jstl 1.I downloaded jakarta-tagli
-
Hi there! When I try to login to skype it says sorry , we didnt recognize your sign-in details.Please check your skype-name and password and try again. I know my username and password is fine I try on my other PC too , tried to uninstall and install
-
How to bring up camera raw in photoshop elements 13
How to use camera raw in photo shop elements 13. I see it's not available like in Photoshop cc. What to do?
-
Encore CS3 not burning to disc?
Hi all, I am using CS3 Encore and up to now have been very successful when creating a Blu-Ray DVD. Most of my footage has been around 1-11/2 hours long so I have always left it on Auto transcode and its been fine. However, I have created a project at
-
New to Java at University and we are currently modelling flags to learn graphics. One of the flags has a wavy line/band across the middle. I know that the wavelength is 120 the amplitude is 6 and it is 48 wide. Just not sure what command to use and h