cancel
Showing results for 
Search instead for 
Did you mean: 

How to read resource having slash("/").

vikas_saxena3
Participant
0 Kudos

Hi,

I am reading all the collections inside <b>/documents</b>..

One of my collection structure is like <b>AA/BB</b>.. mean this folder contain slash("/")..

While reading this resource I am getting error.. since RID of this look like <b>/documents/AA/BB</b>..thats why its looking AA and BB seperately but actually its one resource only.

Any anybody help me to overcome this problem and suggest how can I read AA/BB.

Regards,

Vikas

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

If you see the id of the collection AA/BB would be AA_BB. So when you are trying to read content from KM with special reserved characters, you should note that it would be converted to something else.

Try reading the collection as AA_BB and it will work.

Pradeep.

vikas_saxena3
Participant
0 Kudos

Thanks a lot Pradeep.. it is working now!!!!!

Giving u full rewards points...

vikas_saxena3
Participant
0 Kudos

Hi Pradeep,

Could you please clear my one more doubt..

I have some folders like

2&^%_1été

or

#$@()_1E~

.. and am trying to set contents of these into the IFRAME.

But while doing this .. getting URL exception...

I checked the ID of these..its same like folder name..

Do u have any idea .. how to read the folders with special characters.

Thanks a lot!!!!!!!

Regards,

Vikas

Former Member
0 Kudos

Go to details of the resource > properties > access links. There you will find "Explorer URL" which tells you how to access the resource using the browser.

Pradeep.

vikas_saxena3
Participant
0 Kudos

Hello Pradeep,

The created URL having the same name whatever folder name is..mean URL also containing these special chars.

I think problem is while setting this URL to IFRAME... any idea on it?

Thanks,

Vikas

Former Member
0 Kudos

In your case when you are setting the URL, you will be doing it by providing the URL within either Single or double quotes. So if your URL has either of them then while setting the src property of the iframe, the url will be set incorrectly. To rectify it, you might have to translate them using URL encoding. For example, " is depicted by %22. So whenever you come across double quote in your url, you might have to replace it with %22.

Similar process can be done for other characters as well. Once that is done, the problem will not occur and you should be able to set the src attribute of the iframe without a problem.

Find documentation on Url Encoding <a href="http://www.w3schools.com/tags/ref_urlencode.asp">here</a>.

Hope this helps. If it works, I need 10 more points

Pradeep.

vikas_saxena3
Participant
0 Kudos

You are absolutely right Pradeep...

I thought about it..but problem is .. there are thousands of characters exist that require translation...

So is there any other fisible way to get the solution...or translate with easy way.

'll surely provide you anther reward points for the same too..:)

Regards,

Vikas

Former Member
0 Kudos

Note that the link you provided gives bad advice for URL-encoding non-ASCII characters.

So better use something like https://help.sap.com/javadocs/NW04S/SPS09/km/com/sapportals/wcm/util/uri/URICodec.html.

vikas_saxena3
Participant
0 Kudos

Hi Julian,

Thanks for the suggestion!!!

Could you please let me know .. how would I use this encode/decode.

I hv imported com.sapportals.wcm.util.uri.URICodec and calling Encode or Decode method with URICodec class.

but while calling these am getting

com.sap.engine.frame.core.load.SAPClassNotFoundException

exception.

Actually I have to encode this URL http://server:50100/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fevery_user!2fgeneral!2feu_...;%_1été&SelectedSearchFromHere=/documents/de/2&%_1été&StartUri=/documents/de/2&^%_1été&rndLayoutSet=nv_ndemand_faq_SearchResultLayoutSet&EnableFurtherSearch=False&QueryString=*

but cause of special char

2&^%_1été

in it, am not able to set in IFRAME.

Thanks,

Vikas

Answers (1)

Answers (1)

Former Member
0 Kudos

That's an invalid name in KM. You simply can't do that.

Where does it come from?

Best regards, Julian

vikas_saxena3
Participant
0 Kudos

Hi Julian,

This in my custom folder.. I have created this folder with "/".

As per you.. We can't have folder like <b>AAA/BBB</b>..mean with slash.

Regards,

Vikas

Former Member
0 Kudos

You shouldn't be able to create names like this.

Maybe you are mixing up the resource identifier (RID) and the displayname property (as displayed in the UI)?