Tuesday, March 29, 2016

Programmatic PPR af:outputText refresh issues - no PPR-capable ID found for elements of: RichOutputText [UIXFacesBeanImpl, id=ot05]

We sometimes see the below issue on doing a programmatic refresh of af:outputText Component

The error message

PprResponseWriter$PPRTag> <finish> no PPR-capable ID found for elements of: RichOutputText[UIXFacesBeanImpl, id=ot05]

Why do we see this issue?

By default, the framework does not generate the ids for the components unless and absolutely required to optimize the page performance but we need id to be present at the client side to do PPR and thus we see the issue in doing a programmatic PPR of af:outputText. This issue can be solved in 2 methods described below.

Solution 1

Set the clientComponent="true" for the output text, sample is as below

              <af:outputText value="Test" id="ot5" styleClass="share-error"
                             binding="#{backingBeanScope.MB.message}"
                             clientComponent="true"/>

Refer to <af:outputText> documentation for more details on the clientComponent attribute

Solution 2

Add the following in web.xml

<context-param>
    <param-name>
      oracle.adf.view.rich.SUPPRESS_IDS
    </param-name>
    <param-value>auto</param-value>
</context-param>

Tuesday, March 22, 2016

oracle.jsp.parse.JavaCodeException - Root cause and solution

Sometimes we see the following exception after doing a webcenter portal deployment

Error details

OracleJSP error: oracle.jsp.parse.JavaCodeException: Line # 13, oracle.jsp.parse.JspParseTagScriptlet@5cefd96
Error: Java code in jsp source files is not allowed in ojsp.next mode.

Solution

Make sure that the web.xml in the Deployer project is empty, it should not have any adf library references.

It should looks as below.

<?xml version = '1.0' encoding = 'windows-1252'?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         version="2.5" xmlns="http://java.sun.com/xml/ns/javaee">
</web-app>

Do we need to restart the managed server after webcenter deployments?

Yes, we need to restart the managed server after Webcenter deployments

Many developers are wondered why the changes made to the Webcenter are not dynamically obtain the changes?

An excerpt from the Webcenter portal documentation is as below

Most WebCenter application configuration changes that you make, through Fusion Middleware Control or using WLST, are not dynamic; you must restart the managed server on which the application is deployed for your changes to take effect. For example, when you add or modify connection details for WebCenter services such as Announcements, Discussions, Documents, Mail, and so on, you must restart the application's managed server.
There are several exceptions; portlet producer and external application registration is dynamic. Any new portlet producers and external applications that you register are immediately available in your WebCenter application and any changes that you make to existing connections take effect immediately too.

Wednesday, March 16, 2016

Sample code to get the user profile information in the WebCenter Portal

The sample code to get the currently logged in user profile information is as below


import oracle.webcenter.peopleconnections.profile.WCUserProfile;

String currentUserId = ADFContext.getCurrent().getSecurityContext().getUserName();
WCUserProfile currentProfile = ProfileFactory.getProfileManager().getProfile(currentUserId);
currentProfile.getDisplayName();


The complete documentation for WCUserProfile is here

Some other supported methods are as below

  1. currentProfile.getBusinessCity()
  2. currentProfile.getBusinessCountry()
  3. currentProfile.getBusinessEmail()
  4. currentProfile.getBusinessFax()
  5. currentProfile.getBusinessLocationMapURL()
  6. currentProfile.getBusinessMobile()
  7. currentProfile.getBusinessPOBox()
  8. currentProfile.getBusinessPager()
  9. currentProfile.getBusinessPhone()
  10. currentProfile.getBusinessPostalCode()
  11. currentProfile.getBusinessState()
  12. currentProfile.getBusinessStreet()
  13. currentProfile.getDateofBirth()
  14. currentProfile.getDateofHire()
  15. currentProfile.getDefaultGroup()
  16. currentProfile.getDepartment()
  17. currentProfile.getDescription()
  18. currentProfile.getDisplayName()
  19. currentProfile.getEmployeeNumber()
  20. currentProfile.getEmployeeType()
  21. currentProfile.getExpertise()
  22. currentProfile.getFirstName()
  23. currentProfile.getGuid()
  24. currentProfile.getHomeAddress()
  25. currentProfile.getHomePhone()
  26. currentProfile.getID()
  27. currentProfile.getInitials()
  28. currentProfile.getLastName()
  29. currentProfile.getLocalizedDisplayNames()
  30. currentProfile.getMaidenName()
  31. currentProfile.getManager()
  32. currentProfile.getManagerDisplayName()
  33. currentProfile.getMiddleName()
  34. currentProfile.getName()
  35. currentProfile.getNameSuffix()
  36. currentProfile.getOrganization()
  37. currentProfile.getOrganizationalUnit()
  38. currentProfile.getOriginalPhoto()
  39. currentProfile.getPersonalStatusNote()
  40. currentProfile.getPhoto(WCUserProfile.PhotoSize size)
  41. currentProfile.getPhotoUID()
  42. currentProfile.getPreferredLanguage()
  43. currentProfile.getReporteeDisplayNames()
  44. currentProfile.getReporteeList()
  45. currentProfile.getReporteeProfiles()
  46. currentProfile.getReportees()
  47. currentProfile.getTimeZone()
  48. currentProfile.getTimeZoneAsObject()
  49. currentProfile.getTitle()
  50. currentProfile.getUpdateDate()
  51. currentProfile.getUserName()
  52. currentProfile.getWirelessAcctNumber()

Tuesday, March 15, 2016