cancel
Showing results for 
Search instead for 
Did you mean: 

Calling a specific folder in standard KM navigation iview

Former Member
0 Kudos

Dear developers,

I'm trying to make an iview call a specific km folder of another iview (standard KM navigation iview).

I believe I should use the "EPCM.doNavigate" method, setting the "Navigation context URL" argument to point to the folder I need to open.

(folder = "documents/documents/Mediabank/Products/GB")

But I only get to the default 'root'-folder of the KM.

Here's my DynPage code:



response.write("<SCRIPT langugage = 
'JavaScript'>EPCM.doNavigate('ROLES://portal_content/Flexit/flexpage/KM_Nav')</SCRIPT>");

String url = "ROLES://portal_content/Flexit/KM_Nav";
String navigationAction = "EPCM.doNavigate('" + url + "' ,0, , , , '/documents/documents/Mediabank/Products/GB')";
link.setOnClick(navigationAction);
			

Do you have any suggestions?

Best Regards

Olof Tronnberg

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I dont think that you can navigate to a KM folder through doNavigate. By doNavigate Function you can only navigate to an iView.

Its showing the root folder because the in the KM navigation iview you created is pointing to the root of the KM repository.

So make it targeted to the desired folder and then call the doNavigate funtion for that folder.

Cheers

gEorgE

Former Member
0 Kudos

Hi Georg,

by "targeting the desired folder", you mean that I have to set the desired KM folder manually by entering the property "path to root folder for navigation" (StartUri) in the km navigation iview?

Or is there some "java-way" of setting the target?

I'm asking because I need to be able to change the document folder path at run-time.

Olof

Former Member
0 Kudos

If that is the case then you have to capture the property of the iview at run time and edit the path. Thats how you can set it at the run time.

cheers

gEorgE

detlev_beutner
Active Contributor
0 Kudos

Hi Olof,

> is there some "java-way" of setting the target?

To capture this, you could write a proxy iView, which has the same properties as the original KM.CM.Navigation iView, and which then redirects to the Navigation iView with the parameters changed on the logic you are thinking of.

I have proposed a session on such techniques for TechEd, see http://www.sapteched.com/speakers/sdn/details3.htm?SID=717 for details. If you like it, you can vote for it, see https://www.sdn.sap.com/sdn/teched.sdn

Hope it helps

Detlev

PS: Please consider rewarding point for people giving helpful answers on SDN. Thanks in advance!

Former Member
0 Kudos

Hi Detlev,

I haven't used proxy.iviews before, but I'll search the relevant documentation on this topic.

Sounds like the thing I'm looking for.

Regards

Olof Tronnberg

detlev_beutner
Active Contributor
0 Kudos

Hi Olof,

there is no special doc about it, it's just my name for such a feature, which would have to be implemented by yours.

Maybe there will be some doc some time if this topic is chosen for TechEd... knick-knack...

Best regards

Detlev

Former Member
0 Kudos

hai Olof

If you are not familiar with proxy iviews i can suggest you to develop a dynamic navigation component using pdk or webdynpro using KM APIs. There is also a recent weblog "Uploading files to KM repository using Webdynpro APIs" that will helps you a lot.

regards

geogi

Former Member
0 Kudos

Hi Detlev,

After having read other posts by you on this forum I get the impression I should use the request.redirect(KM Folder URL) of the "doOnNodeReady in the AbstractPortalComponent.

Let's say I wanted my proxy-iview to receive this redirect URL from another Iview? To get hold of the URL it seems I would have to include an EPCF.Eventing script in the doOnReady method, which subscribes to an event in the other iview that sends the URL?

Do you think this would be possible, or is there an another way of accomplishing this?

Regards

Olof

detlev_beutner
Active Contributor
0 Kudos

Hi Olof,

> I get the impression I should use the request.redirect

> (KM Folder URL) of the "doOnNodeReady in the

> AbstractPortalComponent.

To be a bit more exact : use the request.redirect (KM.CM.Navigation-Komponent-URL with the KM Folder added and the corresponding parameters) in the "doOnNodeReady" in the AbstractPortalComponent. Yeah, totally right (this would need URL isolation!).

> EPCF.Eventing script in the doOnReady

If you want to print some JS, you can do this directly within doContent(...).

> which subscribes to an event in the other iview that

> sends the URL? Do you think this would be possible

Yes, of course. In this case, if the iView is called, it would be empty, reacting on the EPCF event by reloading itself with a new URL (KM.CM.Navigation...). Also in this case URL isolation is needed.

> is there an another way of accomplishing this

Maybe, but no other idee at the moment.

Hope it helps

Detlev

Former Member
0 Kudos

Hi Detlev!

Yes it helps alot and I really appreciate it.

I put in a javaScript in the doContent method that cathes the "KM_CM_Navigation_Komponent_URL" in an eventparameter. Still, I'm having trouble passing this parameter on to the "doOnReady" for the redirect. What should I do to trigger the doOnReady?

My code:



 
public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
    {

IPageContext myContext = PageContextFactory.createPageContext(request, response);
Form myForm = myContext.createFormDocument("myForm");
		
myForm.addRawText("<script language ='JavaScript'>" +
"function processEPCFEvent( eventObj ) {" +
"location.search = " + "'<b>eventParameter</b>='+eventObj.dataObject;}" + "EPCM.subscribeEvent(" + 
"'urn:com.myNamespace'," +
"'myEvent', processEPCFEvent);"+
"</script>");
					
}

protected void doOnNodeReady (IPortalComponentRequest request, IEvent arg1) {

String KM_CM_Navigation_Komponent_URL = request.getParameter("<b>eventParameter</b>");	

//nothing happens
request.redirect(KM_CM_Navigation_Komponent_URL );

}

Olof

detlev_beutner
Active Contributor
0 Kudos

Hi Olof,

1.) doOnNodeReady is called before doContent. Ther should be some check if the parameter does exist before redirecting.

2.) To get it working, the corresponding iView must have URL isolation. Is this the case?

3.) The code fragment which creates the eventParamater value isn't printed in here. Did you check what it produces?

Use some logging etc. to check which code is called and which parameters with which values are passed. On client side, you can use alert(...) to chech this quite easy.

Hope it helps

Detlev

Former Member
0 Kudos

Hi Detlev,

I followed your instructions and found that the URL was received by the doOnReadyNode correctly. The KM navigation content, just wouldn't be displayed to the screen until I added:

myContext.render();

...at the end of the doContent method.

Thanks!

Olof

Former Member
0 Kudos

hi Olof/Detlev,

i have a similar requirement.

In KM we have two folders one for english and the other German.

/documents/news/en

/documents/news/de

Based on the a portal user attribute region the user should be redirected to either /document/news/en or /document/news/de.

when i tried the same code, i got PRT error:

Portal Runtime Error

An exception occurred while processing a request for :
iView : pcd:portal_content/kanthFolder/role1/workset1/page_differentLanguages/MyProxyiView
Component Name : null

Page could not create the iView.

See the details for the exception ID in the log file

Plz help. Can you share me your code

If i understand correctly,

the control gets redirected from proxy iview to the navig. iView >> In the proxy iView.. we have to get the properties of the navig. iView and change them accordingly ???? Am i correct??

Regards,

Kanth.

detlev_beutner
Active Contributor
0 Kudos

See /thread/190600 [original link is broken]

AddOn:

> In the proxy iView.. we have to get the properties of

> the navig. iView and change them accordingly

In the proxy iView, you have to set all properties (within the portalapp.xml) which also the nav component have, maybe some addtionals for your functionality. But you have to provide them and then to pass them as URL parameters to the original Nav component (component! Not: iView).

Please discuss the rest in the thread referred to above.

Hope it helps

Detlev

Answers (0)