Additional Blogs by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
0 Kudos

Introduction


Due to popular demand, i have decided to post this weblog which shows you how to create a

sitemap

for your portal.





Jar required:


com.sap.portal.navigation.serviceapi.jar





Step 1:


Create a Dynpage project using NWDS or Eclipse wizard.







Step 2:


Add the following lines of code to your Dynpage component


package com.ust.sitemap;

/* Built By: Prakash Singh

  • Technical Consultant

  • Universal System Technologies, Inc

  • 2500 W. Lake Mary Blvd., Ste 212-A

  • Lake Mary, FL 32746 USA

  • M 407-474-2216

*/

import java.util.Hashtable;

import java.util.Iterator;

import java.util.Locale;

import com.sapportals.htmlb.Form;

import com.sapportals.htmlb.GridLayout;

import com.sapportals.htmlb.GridLayoutCell;

import com.sapportals.htmlb.Group;

import com.sapportals.htmlb.Tree;

import com.sapportals.htmlb.TreeNode;

import com.sapportals.htmlb.enum.CellVAlign;

import com.sapportals.htmlb.enum.GroupDesign;

import com.sapportals.htmlb.page.DynPage;

import com.sapportals.htmlb.page.PageException;

import com.sapportals.portal.htmlb.page.PageProcessorComponent;

import com.sapportals.portal.navigation.INavigationNode;

import com.sapportals.portal.navigation.INavigationService;

import com.sapportals.portal.navigation.NavigationNodes;

import com.sapportals.portal.prt.component.IPortalComponentRequest;

import com.sapportals.portal.prt.component.IPortalComponentResponse;

import com.sapportals.portal.prt.runtime.PortalRuntime;

public class display extends PageProcessorComponent {

     public DynPage getPage() {

          return new displayDynPage();

     }

     public static class displayDynPage extends DynPage {

          /**

          

  • Initialization code executed once per user.

           */

          public void doInitialization() {

          }

          /**

          

  • Input handling code. In general called the first time with the second page request from the user.

           */

          public void doProcessAfterInput() throws PageException {

          }

          /**

          

  • Create output. Called once per request.

           */

          public void doProcessBeforeOutput() throws PageException {

               Form myForm = this.getForm(); // get the form from DynPage

               Group group = new Group();

               group.setDesign(GroupDesign.SAPCOLOR);

               group.setTitle("Site Map");

               myForm.addComponent(group);

               GridLayout gl = new GridLayout();

               group.addComponent(gl);

               IPortalComponentRequest request =

                    (IPortalComponentRequest) this.getRequest();

               IPortalComponentResponse response =

                                   (IPortalComponentResponse) this.getResponse();

            try {

               NavigationNodes rootNodes = getrootnodes();

               int i = 1;

               for(Iterator it = rootNodes.iterator(); it.hasNext();){

                    INavigationNode rootNode = (INavigationNode)it.next();

                    String title =  rootNode.getTitle(Locale.ENGLISH);

                    Tree tree = new Tree(title, "");

                    tree.setRootNodeIsVisible(true);

                    GridLayoutCell cell = new GridLayoutCell(rootNode.getName());

                    String text = "

BAM! you got yourself a nice sitemap


123 Comments