Search code examples
javawebsphere-portal

render(Node aNode) method not available in WebSphere Portal v8.5


My coode is there is WPS v7 presently , now I need to migrate to WPS8.5. But we are using the following method

void render(Node aNode)

and this method is not available in WebSphere Portal v8.5.

Full Code:

<%@ page session="false" buffer="none" %>
<%@ page   import="com.ibm.portal.*,com.ibm.portal.content.*,com.ibm.portal.navigation.*,com.ibm.wps.model.*" %>
<%@ page import="java.util.Iterator" %>




<% 


    ModelUtil modelUtil = ModelUtil.from(request);
    ContentNode currentNode =  ((NavigationNode)modelUtil.getNavigationSelectionModel().getSelectedNode( )).getContentNode();
    CompositionModel model = modelUtil.getCompositionModel(currentNode.getObjectID());
    CompositionNode currentElement =  CompositionNodeHelper.getCurrentNode(pageContext.getRequest ());

    int counter=0;

    String div = null;
boolean divRender = false;

for (Iterator iterator = model.getChildren(currentElement);iterator.hasNext();) {

    CompositionNode child = (CompositionNode) iterator.next();



    if(false && counter == 0 && model.hasChildren(child)){

        div = "<div id=\"main-content-portlet\">";
        divRender = true;
    }else if (counter == 1){
        div = "<div id=\"ibm-content-sidebar\">";
        divRender = true;
    }

    if(divRender){
        out.println(div);
    }

    model.render(child); **** ISSUE IS HERE WITH THE RENDER METHOD

    if(divRender){
        if(div.indexOf("ibm-content-sidebar") > 0){
            out.println("<div id=\"ibm-contact-module\"></div>");
            out.println("<div id=\"ibm-merchandising-module\"></div>");
            out.println("</div><!-- ibm-content-sidebar end -->");
        }else {

        }
    }

    counter++;
}

%>

This render() method is not available in the model call in WPS v8.5... Is there any alternative method with which i can proceed or what is the way out.

An early answer will be highly helpful and appreciated. Thanks in Advance


Solution

  • it appears you are trying to render the portlets by using the old skin code, you need to migrate your skins to work with 8.5 your best use of time is to create a new 8.5 theme and skin and marge in the look and feel instead of trying to migrate your old code.

    You can grab the 8.0 skins and drop them in place and then modify them it uses the <portal-skin:layoutNodeRender/> to render the nodes and it comes from this taglib <%@ taglib uri="http://www.ibm.com/xmlns/prod/websphere/portal/v8.0/portal-skin" prefix="portal-skin" %>