cancel
Showing results for 
Search instead for 
Did you mean: 

How to open files ?

S0019300750
Contributor
0 Kudos

Hi all KM Experts

I am developing an application in WebDynpro for displaying search results.

Now in search results I can show the documents links.

But my requirement is, when user clicks on the link, that document should get opened. I mean if it is doc file then in MS Word, if it pdf then in Adobe acrobat Reader etc.

Please tell me how to code this.

Points will be awarded for helpful answers.

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Hi,

If you use KM Document IView in your link to access your documents then they will be opened in respective applications (acrobat Reader / MS Word).

The mime types are all registered in Mime Handler Service and by default doc and pdf are already registered there.

http://help.sap.com/saphelp_erp2005vp/helpdata/en/07/b6b0d706fb44caab64750a0bdaba09/frameset.htm

So your link should look like:

https://portal.server/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/myfile.pdf

So if some one clicks on the above link, a pdf file is opened in Acrobat Reader.

Greetings,

Praveen Gudapati

S0019300750
Contributor
0 Kudos

Hi Praveen

Thanks for reply.

But I want to add this functionality into my custom iView.

Can I call the standard iView from my custom iView?

0 Kudos

Hi,

You should just build the path with KM Docs component in your custom IView.

Some thing like this will generate the required URL:

IURLGeneratorService urlGenService =
                (IURLGeneratorService) ServiceFactory.getInstance().getService(IServiceTypesConst.URLGENERATOR_SERVICE);
//Path to KM doc IView
String docsURI= urlGenService.getRelativeUri(PathKey.CONTENT_ACCESS_PATH).toExternalForm();
String urlPath = docsURI + pathToKMDocument

So show this urlPath as link in your search result.

Greetings,

Praveen Gudapati

[Points are always welcome for helpful answers]

Former Member
0 Kudos

Hi praveen,

I wrote the same code, but i am getting the error on IURLGeneratorService .

because the respective jar file is missing.

In which jar file it is avaialable.

I have added prtapi.jar

But even in this it is not avaialable.

Regards,

Bala