IsUserInRole from WC Portal to consumed JSF Portlet

Hi experts,
I'm trying to retrieve, the J2EE Roles [ Enterprise Roles a.k.a  Security Realm "Groups" of a logged in user ]
from from consumer Webcenter Portal Application into a Producer JSF Portlet.I have seen there were many posts mentioning that this isUserInRole method always return false. I'm also facing the same problem.
My configurations are following -
Portlet Producer App
web.xml
<security-role>
<description>RelationManager</description>
<role-name>RM</role-name>
</security-role>
<security-role>
<description>Team Leader</description>
<role-name>TL</role-name>
</security-role>
portlet.xml
<security-role-ref>
<role-name>RM</role-name>
<role-link>RM</role-link>
</security-role-ref>
weblogic.xml /* Have tried with & without creating this descriptor, but no luck */
<security-role-assignment>
<role-name>RM</role-name>
<principal-name>RM</principal-name> /* I have defined a weblogic group by the name "RM" within defaultAuthenticator and assigned testUser to it. */
</security-role-assignment>
WC Consumer PortalApp
web.xml
<security-role>
<role-name>RM</role-name>
</security-role>
weblogic.xml
<security-role-assignment>
<role-name>RM</role-name>
<principal-name>RM</principal-name> /* Since its the same WLS Server the same group as above will hold good */
</security-role-assignment>
+ I have done the mapping of UserGroups of the Portlets to J2EE Roles of Webcenter Portal consumer during Portlet Registration process.
I have a requestScoped managedBean within my JSFPortlet where I'm retrieving the user Principal and Roles -
public String getLoggedInUser() {
FacesContext facesContext = FacesContext.
getCurrentInstance();
ExternalContext ectx = facesContext.getExternalContext();
PortletRequest portletRequest = (PortletRequest)ectx.getRequest();
return ( portletRequest.getUserPrincipal().getName());
public String getPortletUserRole(){
FacesContext facesContext = FacesContext. getCurrentInstance();
ExternalContext externalContext = facesContext.getExternalContext();
PortletRequest portletRequest = (PortletRequest)externalContext.getRequest();
if ( portletRequest.isUserInRole ("RM") == true ) return "RM" ;
else return "";
Results :
The getLoggedInUser returns ""
And so does the getPortletUserRole method.
What am I missing and whether this is the correct approach to get the userRoles from PortalApp to Portlet.
Env: JDEV 11.1.1.5 , Integrated WLS
Note: I haven't done any configuration related to WS-Security between Portal App and Portlet App,_ since both are deployed to the same integrated Server.
-Reju

If you haven't already you have to perform user category mapping between the portal roles to portlet roles.
This can be achieved using WLST scripts.
Thanks.
Micah C.

Similar Messages

  • Studio 3.1 & Portal 9.2 - JSF portlet problem

    Hi, first time here.
    Let say I have create a simple jsf navigation application using Studio 3.1 like this:
    // inside faces-config.xml
    <navigation-rule>
    <from-view-id>/pages/inputname.jsp</from-view-id>
    <navigation-case>
    <from-outcome>greeting</from-outcome>
    <to-view-id>/pages/greeting.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    I have done all beans config and resources bundling. After all I run it successfully in server.My next step is to create a portlet, holding the first jsp page. Oh, well, Studio can't do it and I have to do it in Portal 9.2
    What should I do now? I have try many method to import my project into it and of course it is not working.
    To my knowledge, portal support PageFlow (Controller.java) but i dunno about MyFace (faces-config.xml).

    Hi Rene,
    When you found out that you misread the instrucition and you already ran the script, what did you do next? Did you restore the db and redo over? Or did you continue on? I have the same problem with you too but I'm not sure what to do next.
    Trina :)
    [email protected]

  • Announcing: Developing JSF Portlets with WebLogic Portal Whitepaper

    Just Released: Developing JSF Portlets with WebLogic Portal Whitepaper
    A supplemental developer's guide has been published to help guide WLP 10.x customers that wish to use JSF as the web framework for building portlets on WebLogic Portal. This is a sizable document (150 pages) that covers a large number of topics. It also coaches developers on best practices and common pitfalls.
    Important: It also clarifies the supported configuration of JSF within Portal Web Projects. Workshop for WebLogic by default configures a web project in a configuration that is not supported by WebLogic Portal. The guide explains how to address this:
    * Change from the unsupported MyFaces JSF implementation to the supported Sun Reference Implementation (RI)
    * Change from the unsupported "client" STATE_SAVING_METHOD to the supported "server"
    The guide can be downloaded here:
    http://download.oracle.com/technology/products/weblogic/portal/weblogic-portal-jsf-whitepaper.pdf
    To help internet searches locate this document, the table of contents is reproduced below:
    Introduction
    1.1. Prerequisites...................................................................... 8
    1.2. Applicable Versions............................................................ 8
    1.3. Native Portlet Bridges and Standard Portlet Bridges .......... 8
    1.4. JSF Portlet Support Roadmap ........................................... 9
    1.5. Whitepaper Structure ....................................................... 10
    1.6. Look Before You Leap ..................................................... 10
    1.7. For More Information........................................................ 10
    Part 1: Converting JSF Applications into Portlets
    2. IDE Support for JSF Portlets Chapter ...................................... 12
    2.1. Workshop for WebLogic – WebLogic Portal's Supported IDE 12
    2.2. Workshop Features for JSF Support in WebLogic Portal.. 12
    3. Introduction to JSF Portlets Chapter ........................................ 18
    3.1. Creating Your First JSF Portlet......................................... 18
    3.2. Essentials of JSF Portlet Views........................................ 21
    3.3. WebLogic Portal Artifacts................................................. 22
    4. Configuring JSF within WebLogic Portal Chapter..................... 24
    4.1. JSF Library Modules in WebLogic Server ........................ 24
    4.2. Installing the JSF Libraries into a Portal Web Project ....... 25
    4.3. JSF Configuration Settings............................................... 27
    4.4. Configuring JSF 1.2 ......................................................... 29
    4.5. Building an Unsupported JSF Implementation Library Module 31
    4.6. Faces Configuration is Web Application Scoped.............. 31
    5. Navigation within a JSF Portlet Chapter................................... 33
    5.1. Navigating within a Portlet with the JSF Controller ........... 33
    5.2. Redirects.......................................................................... 34
    6. Namespacing Chapter ............................................................. 35
    6.1. Namespacing Managed Bean Names.............................. 35
    6.2. Client ID Namespacing with the View and Subview Components 35
    6.3. Client ID Namespacing with the WLP NamingContainer .. 36
    7. Logging, Iterative Development, and Debugging Chapter ........ 39
    7.1. Logging............................................................................ 39
    7.2. Iterative Development ...................................................... 39
    7.3. Debugging ....................................................................... 40
    8. Custom JavaScript Chapter ..................................................... 42
    8.1. DOM Manipulation within a JSF ....................................... 42
    8.2. Form Validation within a JSF Portlet ................................ 45
    9. Preparing JSF Portlets for Production Chapter ........................ 46
    9.1. Configuration.................................................................... 46
    9.2. Performance and Scalability............................................. 47
    9.3. Security............................................................................ 49
    9.4. Localization...................................................................... 50
    Part 2: Interacting with the Portal Environment
    10. Native Bridge Architecture Chapter ...................................... 54
    10.1. Container Architecture Overview.................................. 54
    10.2. Container Architecture.................................................. 54
    10.3. Container Interactions .................................................. 55
    11. Interportlet Communication Chapter .................................... 56
    11.1. Using Session and Request Attributes for IPC (Anti-pattern) 56
    11.2. Using the WLP Event Facility for IPC with JSF Portlets 56
    11.3. Notifications ................................................................. 60
    11.4. Comparison of the IPC Approaches ............................. 60
    12. Scopes Chapter ................................................................... 62
    12.1. Conceptual Scopes for Standard JSF Applications ...... 62
    12.2. Conceptual Scopes for Portal Applications................... 63
    12.3. Implementation Patterns for Portal Scopes .................. 63
    13. State Sharing Patterns Chapter ........................................... 66
    13.1. State Sharing Concepts ............................................... 66
    13.2. HttpSession Versus HttpServletRequest ...................... 66
    13.3. Base Code for HttpSession Patterns ............................ 67
    13.4. Single Portlet Pattern ................................................... 68
    13.5. Multiple Portlet Patterns ............................................... 69
    14. Rendering Lifecycles Chapter .............................................. 77
    14.1. WLP and JSF Lifecycles .............................................. 77
    14.2. Invocation Order of WLP and JSF Lifecycle Methods... 77
    14.3. Accessing WLP Context Objects from JSF Managed Beans 78
    15. Portal Navigation Chapter .................................................... 80
    15.1. Programmatically Constructing JSF Portlet URLs ........ 80
    15.2. Changing the Active Portal Page.................................. 80
    15.3. Redirects within a Portal............................................... 83
    16. Ajax Enablement Chapter .................................................... 85
    16.1. Ajax in JSF Portlets...................................................... 85
    16.2. Partial Page Rendering Pattern.................................... 85
    16.3. Stateless API Request Pattern ..................................... 86
    16.4. Portlet Aware API Request Pattern .............................. 87
    16.5. Controlling the WLP Ajax Framework........................... 91
    17. Additional WLP Features Chapter........................................ 93
    17.2. Portlet Container Features ........................................... 93
    17.3. Portal Container Features ............................................ 98
    18. Example: Implementing a Login Portlet Chapter .................. 99
    18.1. Login Portlet Motivation................................................ 99
    18.2. Login Portlet Design..................................................... 99
    18.3. Login Portlet Implementation...................................... 101
    Part 3: Integrating Third Party Libraries
    19. Integration Overview Chapter............................................. 111
    19.1. Types of Libraries....................................................... 111
    19.2. Roadmap for MyFaces Trinidad and ADF Faces Rich Client 111
    20. Using the Facelets View Technology Chapter.................... 113
    20.1. Introduction to Facelets .............................................. 113
    20.2. Configuring Facelets Support ..................................... 113
    21. Using the Apache MyFaces Tomahawk Component Library Chapter 115
    21.1. What is Apache MyFaces Tomahawk? ...................... 115
    21.2. Support for Tomahawk in WLP................................... 115
    21.3. Tomahawk Component List........................................ 116
    21.4. Installing and Configuring Tomahawk......................... 119
    21.5. Resolving the Duplicate ID Issue................................ 120
    21.6. Referring to Resources .............................................. 120
    21.7. forceId Attribute.......................................................... 124
    21.8. File Upload................................................................. 125
    22. Using the Apache Beehive Navigation Controller Chapter . 126
    22.1. Apache Beehive Page Flow ....................................... 126
    22.2. JSF and Page Flows .................................................. 126
    22.3. Configuring the JSF Integration with Page Flows ....... 127
    Appendices
    23. Appendix 1: Consolidated List of Best Practices ................ 130
    24. Appendix 2: Known Issues and Workarounds.................... 132
    24.1. CR383659, CR383662 Inconsistent failures with JSF portlets 132
    24.2. CR342124: IllegalStateException due to duplicate client-id 132
    24.3. CR384916: IllegalStateException due to duplicate client-id when using certain components such as Tomahawk and Trinidad...... 133
    24.4. CR361477 Problems with the integration of JSF portlets with Apache Beehive Page Flows.................................................................. 133
    24.5. CR377945 JSF 1.2 suffers from a memory leak during iterative development .............................................................................. 134
    25. Appendix 3: The JSFPortletHelper Class ........................... 135
    26. Appendix 4: The CleanupPhaseListener Class .................. 147

    Hi Peter!
    First, I wish to thank you for the great work.
    We followed your whitepaper and managed to deploy a JSF portlet on WLS.
    But we are not able to register it (consume it) as remote portlet in Oracle Portal 10.1.4. The error log is as follows:
    An error occurred while trying to refresh the provider. (WWC-43190)
    An error occurred during the call to the WSRP Provider:
    java.rmi.RemoteException: serialization error: serialization error:
    unexpected null value for literal data; nested exception is:
    serialization error: serialization error: unexpected null value for literal data
    com.sun.xml.rpc.encoding.SerializationException: serialization error:
    serialization error: unexpected null value for literal data
    com.sun.xml.rpc.encoding.SerializationException: serialization error:
    unexpected null value for literal data
    Java stack trace from root exception:
    unexpected null value for literal data
    at
    oracle.webdb.wsrp.RegistrationContext_LiteralSerializer.doSerialize(RegistrationContext_LiteralSerializer.java:107)
    at
    com.sun.xml.rpc.encoding.literal.LiteralObjectSerializerBase.internalSerialize(LiteralObjectSerializerBase.java:119)
    at
    com.sun.xml.rpc.encoding.literal.LiteralObjectSerializerBase.serialize(LiteralObjectSerializerBase.java:70)
    at
    oracle.webdb.wsrp.GetServiceDescription_LiteralSerializer.doSerialize(GetServiceDescription_LiteralSerializer.java:88)
    at
    com.sun.xml.rpc.encoding.literal.LiteralObjectSerializerBase.internalSerialize(LiteralObjectSerializerBase.java:119)
    at
    com.sun.xml.rpc.encoding.literal.LiteralObjectSerializerBase.serialize(LiteralObjectSerializerBase.java:70)
    at
    com.sun.xml.rpc.client.StreamingSender._writeRequest(StreamingSender.java:473)
    at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:62)
    at
    oracle.webdb.wsrp.WSRP_v1_ServiceDescription_PortType_Stub.getServiceDescription(WSRP_v1_ServiceDescription_PortType_Stub.java:63)
    at
    oracle.webdb.wsrp.client.design.v1.OraWSRP_v1_ServiceDescription_PortType.getServiceDescription(Unknown
    Source)Do you have any idea why this happens? Or you can provide some useful links to WLP -Oracle Portal federation?
    Thank you and best regards,
    PaKo

  • Query- IPC using JSF Portlets in WebLogic Portal

    The question is how to pass data when doing InterPortlet Communication using Local JSF portlets in Weblogic Portal.
    I will eloborate on the particular scenario we have below.
    Two JSF portlets are build (both are not using Java Page Flows). The first porltet has a table of data. When the user clicks on one of the items in the table (which is coded using <h:commandLink/> option), the second portlet should show some details on the item clicked.
    For example:
    If there is a list of books in first portlet, when clicking on one of the book name, the details of book should come up in the second portlet.
    To achieve this, faces event was enabled in first portlet with requestAttrPersistence option set to session.
    For example :
    <netuix:content>
    <netuix:facesContent contentUri="/bookList.faces" requestAttrPersistence="session">
    <netuix:facesEvents>
    <netuix:facesEvent action="/bookDetails.faces" eventName="bookDetailEvent"/>
    </netuix:facesEvents>
    </netuix:facesContent>
    </netuix:content>
    The second portlet was configured to handle faces events, particularly the bookDetailEvent.
    Example:
    <netuix:handleFacesEvent eventLabel="handleFacesEvent1" eventName="bookDetailEvent" fromSelfInstanceOnly="false" onlyIfDisplayed="true" sourceDefinitionLabels="JSFPortlet_1" sourceDefinitionWildcard="this">
    <netuix:invokeFacesAction action="/bookDetails.faces"/>
    </netuix:handleFacesEvent>
    Going by this method, how can we find the particular book whose detail has to be shown? As in JSF, we dont directly access the request attributes, what is the ideal way to pass data from one page to other?
    Please help on this.

    i am also having the same problem.I tried by passing _nfls=false but it didn't work.Can you suuggest where do i need to set this or any other parametrs such as this programmatically?                                                                                                                                                                                                                                                                                                                                                                           

  • Developing JSF Portlets with WebLogic Portal (Oracle White paper May 2009)

    I have created a simple JSF Portlet following the steps delineated in paragraph 3.1.1 Creating a JSF Enabled WLP Web Project of the white paper mentioned above. I used Workshop for Weblogic 10gR3. When I tried to deploy that very simple portlet and portal I got this error message :
    "!MESSAGE Unable to register J2EE shared library C:\bea\wlportal_10.3\samples\lib\j2ee-modules\wlp-sample-lookandfeel-web-lib.war".
    Clearly the folder and file "samples\lib\j2ee-modules\wlp-sample-lookandfeel-web-lib.war" are not under my "C:\bea\wlportal_10.3". My question is where do I download it? Where does it come from?
    Thanks in advance.

    Maybe you did not include the samples when you installed Oracle WebLogic Portal? Now that this is an Oracle product, samples are not installed or configured by default. This is a change in policy from when WebLogic Portal was a BEA thing, so it takes some getting used to and there are probably plenty of places where documentation and papers could be enhanced to emphasize this.
    In addition, it looks like there might be an error in the white paper with respect to configuring your web app to include samples. I don't see any mention of taking an extra step to include the sample facets in your portal app. This oversight may have been caused by the author working with a pre-release of Oracle WebLogic Portal that had not yet been "Oracle-ized" enough to get the default samples out of there. In the old days, I think the samples were automatically included in your portal web app.
    To get the samples in a new portal web app while you are creating it with the IDE you can click the "Modify..." button on the first dialog. It is next to the "Configuration" text area. This pops up a dialog that lets you select the "Weblogic Portal Samples" facet for your web app.
    To get the samples in an existing portal web app after it has been created, right click the app in the IDE, click "Properties...", click "Project Facets", and select the "Weblogic Portal Samples".
    Sorry, I'm not sure what the remedy is for getting samples into an installed product that was not installed with the samples. Unfortunately, I think that is the problem that you need solved. Sorry about that. Hopefully you are working in a test or dev environment that makes it easy to blow away old installations and start over? If not, then maybe install it with samples someplace else and copy the samples/... dir over to your other install?

  • Consuming JSF & ADF Faces Components in Portal Page

    I am totally new to Oracle Portal environment and doing some analysis of using Portal in our application.
    I was reading that we can create JSP Portlets like adding scriptlets, expression and other JSP & HTML elements.
    Is it possible to consume JSF & ADF Faces components in Portal page? I mean, is it possible to create JSF Portlets?

    The WSRP provider, which is shipped with Portal 10.1.4, would provide this functionality through the JSF bridge. You need to install Webcenter to get the bridge. This makes me think whether you should use Oracle Portal or rather decide to go for Webcenter as development platform, especially if you have a J2EE background already.

  • Need to add as a WSRP Connection in JDev for Weblogic Portal JSF Portlets.

    I am trying to register WLP 10.3.4 JSF Portlets as a WSRP connection in JDev Webcenter 11.1.1.6 Portal Framework application . The below are steps:
    -Created Simple WLP Application with JSF Portlets and deployed them on WLS 10.3.4 domain.
    -The WSDL url available is http://localhost:7003/TEST_WEB_PORTAL/producer?wsdl
    -Now Open JDev and created WCP Framwork app
    -Under Application Resource, right click on Connections -> New Connection -> WSRP Producer.
    -Click Next on step1 -> Enter WSDL URL on Step 2 and then click next on next 3 screens.
    -It tries to register but ended up with below exception:
    3-Dec-2012 12:48:03 oracle.adfdtinternal.model.portlet.wizards.registration.wsrp.WSRPProducerRegUtil registerProducer
    WARNING:
    oracle.portlet.client.persistence.PersistenceException: oracle.mds.core.ConcurrentMOChangeException: MDS-00165: metadata Object "/oracle/adf/portlet/WsrpPortletProducer0/portletDefs/portletPortletproducer/markupTypes/markupType0_texthtml.pxml" has changed
    MDS-00512: failure to create document /oracle/adf/portlet/WsrpPortletProducer0/portletDefs/portletPortletproducer/markupTypes/markupType0_texthtml.pxml because file C:\Oracle\PS5\mywork\testSR3-6514764665\mds\oracle\adf\portlet\WsrpPortletProducer0\portletDefs\portletPortletproducer\markupTypes\markupType0_texthtml.pxml already exists
         at oracle.portlet.client.persistenceimpl.mds.MDSPersistenceContext.commit(MDSPersistenceContext.java:473)
         at oracle.portlet.client.beanimpl.persistence.PersistenceBeanContext.commit(PersistenceBeanContext.java:128)
         at oracle.portlet.client.adapter.simple.SimpleAdapter.commit(SimpleAdapter.java:465)
         at oracle.adfinternal.model.portlet.manager.PortletProviderManager.commit(PortletProviderManager.java:1487)
         at oracle.adfinternal.model.portlet.manager.PortletProviderManager.registerPortletProvider(PortletProviderManager.java:1647)
         at oracle.adfinternal.model.portlet.manager.PortletProviderManager.registerPortletProvider(PortletProviderManager.java:597)
         at oracle.adfdtinternal.model.portlet.wizards.registration.wsrp.WSRPProducerRegUtil.registerProducer(WSRPProducerRegUtil.java:308)
         at oracle.adfdtinternal.model.portlet.wizards.registration.wsrp.WSRPProducerRegistrationWizard$1.doWork(WSRPProducerRegistrationWizard.java:863)
         at oracle.ide.dialogs.ProgressRunnable.run(ProgressRunnable.java:161)
         at oracle.ide.dialogs.ProgressBar.run(ProgressBar.java:655)
         at java.lang.Thread.run(Thread.java:662)
    Caused by: oracle.mds.core.ConcurrentMOChangeException: MDS-00165: metadata Object "/oracle/adf/portlet/WsrpPortletProducer0/portletDefs/portletPortletproducer/markupTypes/markupType0_texthtml.pxml" has changed
    MDS-00512: failure to create document /oracle/adf/portlet/WsrpPortletProducer0/portletDefs/portletPortletproducer/markupTypes/markupType0_texthtml.pxml because file C:\Oracle\PS5\mywork\testSR3-6514764665\mds\oracle\adf\portlet\WsrpPortletProducer0\portletDefs\portletPortletproducer\markupTypes\markupType0_texthtml.pxml already exists
         at oracle.mds.core.UpdateableMOContent.constructConcurrentMOChangeException(UpdateableMOContent.java:1376)
         at oracle.mds.core.UpdateableMOContent.saveMOContent(UpdateableMOContent.java:1143)
         at oracle.mds.core.MDSTransaction.flushChangesToPTrans(MDSTransaction.java:851)
         at oracle.mds.core.MDSTransaction.internalCommit(MDSTransaction.java:2928)
         at oracle.mds.core.MDSSession.flushChanges(MDSSession.java:1022)
         at oracle.mds.core.MDSSession.flushChanges(MDSSession.java:850)
         at oracle.portlet.client.persistenceimpl.mds.MDSSessionWrapper.flushChanges(MDSSessionWrapper.java:61)
         at oracle.portlet.client.persistenceimpl.mds.MDSPersistenceContext.commit(MDSPersistenceContext.java:456)
         ... 10 more
    Caused by: oracle.mds.persistence.DocumentExistsException: MDS-00512: failure to create document /oracle/adf/portlet/WsrpPortletProducer0/portletDefs/portletPortletproducer/markupTypes/markupType0_texthtml.pxml because file C:\Oracle\PS5\mywork\testSR3-6514764665\mds\oracle\adf\portlet\WsrpPortletProducer0\portletDefs\portletPortletproducer\markupTypes\markupType0_texthtml.pxml already exists
         at oracle.mds.internal.persistence.file.Fil
    I have followed the steps given in the http://docs.oracle.com/cd/E26806_01/wlp.1034/e14235/chap_webcenter_interop.htm#BABGIIIJ for preventing User Authentication error by creating user of PortalSystemAdministrator group but did not help.
    Please let me know if anyone have faced this exception or any pointers.
    Thanks
    Kamal Gulati

    Hi,
    I tried creating a simple JSF portlet and I can able to register and it is working Fine, but my teammet got the same issue like you :) . While Analyzing what I found is , the location where we created the portlet in weblogic portal. If you created your portlet directly under WebContent folder then this issue is coming up, so try to create the portlet in a folder inside the WebContent folder, say create a folder with name portlets under webcontent and create the JSF portlet inside that portlets folder.
    Now start the server and register the same in WebCenter, you will not get that exception. I am going to raise a ticket with Oracle about this issue and get the root cause.
    Thanks
    Karthikeyan

  • How to reset the JSF Portlet session state in weblogic portal 10.3

    Hi All,
    We are implementing our application with the jsf1.2 with 10.3.0 portal framework.
    in a tab i placed my jsf portlet, it will navigate up to 4 pages. We do have some other tabs too in our application. So when i navigate to other tabs and when i comeback to the jsf portlet tab i am resetting the portlet state to first page by onDeactivation portal event.
    But the problem when the user within the tab and navigate to pages if he clicks again the tab it is not redirecting to start page.
    I know we do have refresh action in our pageflows .. but how to reset the jsf portlet to start page when it is not deactivating. Please do help me..
    Thanks in advance...
    Edited by: Siddu4u on Oct 10, 2011 8:33 PM

    Hello,
    This documentation should help you to use the import tool in the Portal Admin Console:
    http://download.oracle.com/docs/cd/E15919_01/wlp.1032/e14245/deployment.htm#i1047336
    Kevin

  • Resetting the JSF Portlet State in weblogic portal 10.3 and JSF1.2

    Hi ,
    I have a Registration JSF Portlet. It has two pages, “Registration home Page" and " Registration confirm Page". After I,enter the Registration details on " Registration home Page" and click submit, I will get a " Registration confirm Page". Add this JSF Portlet on a page in weblogic portal 10.3. Now visit some other page and comeback to the page on which I added the JSF Portlet, I will see that it is showing " Registration confirm Page", i.e the state is retained.
    My problem is... I want to see " Registration home Page " everytime you visit the page. how can be achieved in weblogic portal 10.3.
    Can any one help me out with this problem ..
    Thanks,
    Ram

    My approach was to programmatically redirect to the page again with _nfpb=false. I do this in the handlePostbackData() method in the portlet's backing file.
    redirectUrl = redirectUrl.replaceAll("_nfpb=true", "_nfpb=false");          
    PortletBackingContext.getPortletBackingContext(request).sendRedirect(redirectUrl);
    Matthias Rohe
    [email protected]
    Edited by: user7964913 on 29.09.2010 04:06

  • Question accessing a h:outputText element from Javascript from JSF portlet

    I have a <h:outputText element that I'd like to update the value from javascript.
    However the element is not found in the form. I can access all the other form elements,
    just not <h:outputText elements. Does anyone know how to get around this?
    The code is running in a JSF portlet on WLP 10.3.2, Code snippets below:
    JSP
    <f:view>
    <h:form id="updaterForm">
    <h:panelGroup layout="block" id="pg_geoWrapper">
    <table id="t_geoFields">
    <tr><td><h:outputText id="ot_geoStatus" value="Status:"/></td></tr>
    </table>
    </h:panelGroup>
    </h:form>
    </f:view>
    When a button is clicked the javascript is called
    JAVASCRIPT
    function displayProperComponents(myForm) {
    var statusLabelId = null;
    for(i=0; i<myForm.elements.length; i++) {
    if (myForm.elements.id.indexOf("ot_geoStatus")>=0){
    statusLabelId = myForm.elements[i].id;
    if (document.getElementById(statusLabelId) != null){
    document.getElementById(statusLabelId).innerHTML = '';

    There are more possibilities as well. If you depend it on for example the User's rights/groups, then you can also do for example:
    rendered="#{user.admin}" // getter = public boolean isAdmin()
    rendered="#{user.groupName == 'admin'}" // getter = public String getGroupName()
    rendered="#{user.groupId > 1}" // getter = public int getGroupId()
    rendered="#{fn:contains(user.groups, 'admin')}" // getter = public String[] getGroups() or public List<String> getGroups()
    etc..I think it's after all just a matter of learning about the capabilities of EL a bit more.

  • I aHow do you execute a Kornshell from a portal portlet?

    I am trying to figure out what I have to do to execute a Kornshell from a portal page. The Kornshell runs and does a variety of things not related to portal or its pages. I just what to be able to have users go into portal and launch the kornshell. Can any body get me started?
    Thanks
    M

    Hi,
    I can think of your requirement in the lines of J2EE.
    I would probably write a Servlet, convert it into a Portlet ( or use JDevleoper & the PDK Wizard to do it ). I could then use the Runtime class in Java & try to call my Shell Script:-
    // Declare the Objects
    Runtime objRuntime;
    Process objProcess;
    // Let's get an access to the Runtime Environment
    objRuntime = Runtime.getRuntime();
    // Let's execute some process.
    objProcess = objRuntime.exec(" sh /usr/bin/test.sh");You might need to configure the Security Policy of your JVM on the server to allow this kind of access to a Servlet.
    I haven't tried ti - but, I guess with the right docs & tweaks, it would work..:)
    Regards,
    Sandeep

  • Example JSF Portlet Project for WebLogic Portal 10.3.2

    Hi,
    does anyone have an example JSF Portlet Project for WebLogic 10.3.2 using the default JSF implementation 1.2.
    I tried to implement the example of the document "Developing JSF Portlets with WebLogic" but I always get a ClassCastException.
    java.lang.ClassCastException: com.bea.portlet.container.RenderRequestImpl
    Thx in advance
    Edmund

    My approach was to programmatically redirect to the page again with _nfpb=false. I do this in the handlePostbackData() method in the portlet's backing file.
    redirectUrl = redirectUrl.replaceAll("_nfpb=true", "_nfpb=false");          
    PortletBackingContext.getPortletBackingContext(request).sendRedirect(redirectUrl);
    Matthias Rohe
    [email protected]
    Edited by: user7964913 on 29.09.2010 04:06

  • IPC in JSF portlet 1.2 weblogic portal 10.3.2

    Hi,
    I'm using weblogic potal 10.3.2 JSF Portlet (Portlet 2.0 - JSR 329).
    i implement inter portlet communication through event handling.
    a Portlet A fire custom event, portlet B listen to event.
    how can portlet B listen to event and call other jsf page or invoke face an action?
    (i use Invoke Face Action but it isn't allowable in JSF 1.2 Portlet - JSR 329)
    many thanks!

    hi, i have resolved my problem. i'm using IPC to pass parameter form portlet A to portlet B. In Portlet B, i'm using PhaseListener to manage RESTORE_VIEW phase. And in this phase, i create ViewRoot.

  • Java.lang.IllegalStateException error when consuming a portlet

    When attempting to consume a portlet within a Webcenter portlet the portlet briefly displays and then constantly refreshes. On each refresh the following error is being logged (the PPR number increments each time the portlet refreshes):
    *<XmlErrorHandler> <handleError> ADF_FACES-60096:Server Exception during PPR, #35*
    java.lang.IllegalStateException: The expected request type is not the same as the current request type.
         at org.apache.myfaces.trinidadinternal.config.GlobalConfiguratorImpl.getExternalContext(GlobalConfiguratorImpl.java:333)
         at org.apache.myfaces.trinidadinternal.context.FacesContextFactoryImpl$CacheRenderKit.<init>(FacesContextFactoryImpl.java:86)
         at org.apache.myfaces.trinidadinternal.context.FacesContextFactoryImpl.getFacesContext(FacesContextFactoryImpl.java:64)
    We are using JDeveloper 11.1.1.6, WebCenter Portal - Framework 11.1.1.6.0.111214.0952
    The portlet being included includes a farily simple ADF Query and Table component. It was included as a ADF Rich Portlet.
    There was an earlier thread that seemed to have the same issue: consuming portlet get error <ADF_FACES-60096:Server Exception during PPR>
    It is marked as answered but the answer was a series of steps including stopping the portal, server, redeploying the portlet, and restarting. It also suggested deleting any unused bindings from the Executable section of the page. These steps failed to fix my issue.
    Has anyone else seen this issue and found a concrete fix for it?
    Thanks in advance.

    Hello again,
    I solved the problem.
    In Control Panel -> JInitiator administration console , the option "Use browser settings" has to be unchecked.
    daniela

  • JSF Portlet keeps last navigated page

    I have a small JSF application where there is a simple navigation from first displayed JSP pageA to JSP pageB:
    (of course with a managed bean
    <navigation-rule>
    <from-view-id>/portlets/pageA.jsp</from-view-id>
    <navigation-case>
    <from-outcome>success</from-outcome>
    <to-view-id>/portlets/pageB.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    As a standalone Web app the first pageA is always redisplayed with the main app url.
    However configured as a JSF portlet, after navigating to pageB, the portlet will always redisplay pageB!
    What configuration am i missing to reset to first pageA when redisplay main portal page?
    thanks.

    on a second thought the behavior i see might be valid due to the fact that i specify in my navigation rule a <from-view-id>, which as soon as i'm on pageB no longer applies, meaning there is no rule from pageB for same outcome, so pageB is still displayed.
    I added an extra rule for pageB and a "Back" button on pageB and now i can go back to initial page.
    for me it is a bit unexpected, due to this view "statefulness", but does make sense, need to better master JSF ...

Maybe you are looking for