Thursday, February 27, 2014

How to create and make a page style available at runtime in webcenter portal?

Page styles are JSPX pages that can be used as templates to create new pages at runtime


Step1: Create a style/jspx document based on which the user can create run time pages.

Step2: Create a portal resource of the jspx document as shown below.



Step3: Once Done, expose that portal resource as a ear file to be uploaded later to the webcenter admin console and made available to create new pages








Step4: Login to the webcenter admin console and click the page styles. Click the upload button and upload the ear file that was exported in step 3, as shown below.




Step5: Select the page style as shown below in the page creation dialog


How to make run time customizations to the webcenter portal application?

Inorder to make the run time customizations, we need to login to the webcenter portal administration console.

We can open the console from the following link

http://hostname:port/Application-Context-Root/admin

For example: http://localhost:7101/PracticeWebcenterOne-Portal-context-root/admin




All the actions that can be performed in the admin console is coming up in the next post.

Wednesday, February 26, 2014

java.lang.IllegalStateException: The expression "#{bindings}" evaluates to "null" exception

Sometimes when using the Webcenter out of the box taskflows, we might drag and drop the them from the resource palette either to page template or page. But when running the page might result in the following error

java.lang.IllegalStateException: The expression "#{bindings.pagemenudefinition1.regionModel}"
(that was specified for the RegionModel "value" attribute of the
region component with id "pt_r2") evaluated to null.
This is typically due to an error in the configuration
of the objects referenced by this expression. If it helps,
the expression "#{bindings.pagemenudefinition1}" evaluates to "null"
If it helps, the expression "#{bindings}" evaluates to "null".
Now using an empty RegionModel instead.




Solution

The reason is that the pagedef doesn't have a reference to the taskflow. or the bindings does not have the reference. Open the page source, you will find the bindings warning as below




Add the page reference binding as below


 Or edit the page def source code as below


Monday, February 24, 2014

Iterate through all the pages using Navigation Context in webcenter portal

Sometimes we might need to iterate through all the pages in the custom or default navigation model in the webcenter portal. For example in order to create the custom header in the portal template etc..

The following code will iterate through all the pages in the navigation context.

<af:forEach var="node" varStatus="vs"
items="#{navigationContext.defaultNavigationModel.listModel['startNode=/, includeStartNode=false']}">
<af:commandLink id="pt_cl1" text="#{node.title}"
actionListener="#{navigationContext.processAction}"
 <f:attribute name="node" value="#{node}"/>
 <af:showPopupBehavior popupId="menuPopup"
align="afterStart"
triggerType="mouseOver"/>
</af:commandLink>
</af:forEach>


In the items section mention the navigation model to be iterated and the startNode specifies the path from root node where the iteration should start.