Create a SITEMAP for your portal
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 = “
Thank you in advance!
areerat.goo@gmail.com
Can u please send me the par file.
my email id is bej.chitta@gmail.com
Can u please send me the par file.
my email id is bej.chitta@gmail.com
Really nice work, can you send the par file to me at dheerendrashukla@gmail.com.
Thanks
My email is rpalotai@ebc.hu.
Many thx.
Richard
I want to use it...
Thanks
Best Regards
Can you send relevant jars to limchan@skcc.com?
Thanks
Best Regards
mail: fatih_koekce@yahoo.de
many thanks in advance,
Fth
Thank you in advance.
My E-mail:andyliu@hjoy.com.tw
Best Regards,Andy
Thank you in advance.
My E-mail:andyliu@hjoy.com.tw
Best Regards,Andy
Can you kindly send me the com.sap.portal.navigation.serviceapi.jar file.
Thanks.
James
ajloren2000@yahoo.com
tirinlosar@hotmail.com
Thank you
Thank you
Good work!!!! Can you please send me the PAR file for this.
My ID is, sushil.aher@gmail.com
Thanks
Please provide me the com.sap.portal.navigation.serviceapi.jar
file at mail id bharatvmistry@gmail.com
Regards,
Bharat Mistry
May I have your com.sap.portal.navigation.serviceapi.jar
file
at mail id kanokon.k@gmail.com
Thank you very much,
Kanok-on K.
System Configuration > Support > Portal Runtime > Browse Deployment > WEB-INF > deployment > pcd > com.sap.portal.navigation.service.par.bak
Download the zip file, extract it and add the com.sap.portal.navigation.api_service_api.jar as an external jar to your Portal Application project
Hi Prakash,
Can you send me the file par to ashvindevil@hotmail.com, please?
Can you also send me the jar com.sap.portal.navigation.serviceapi.jar?
Thank you,
Regards,
Ashvin
Does the code end with String text = " ???
Hello Prakash,
Thanks for great blog.
Sorry, about asking this, but I am not able to locate definition of method 'getrootnodes' in this.
I see in replies that people have found it but I am not able to locate it.
Could you please share?