Skip to Content
Author's profile photo Ibrahim GUNDUZ

Use Documents in KM as Portal Help Pages

<p>During your portal implementation, you have many optios to provide help for your end users. You can,</p><ul><li>[customize help link of the Portal in the MastHead |]</li><li>use “URL to Help Topic” property for your iViews</li></ul><p>Another option, which is the way shown in this blog, creating help documents in a KM folder and developing a small java iView which will generate links dynamically to these documents. For this, simply you need to create a Portal Application Project, create a JSP page in your project and do some coding. After building and deploying your application, you have to create an iView based on your application and put your iView in the Portal Default Framework Page. That’s it! Now you have a dynamic help link for your portal.<br/>You have to be familiar to the SAP Netweaver Developer Studio and PDK installed for this task.</p><p> </p><ul><li>h5. Create a Portal Application Project
</li></ul><p>Open SAP Netweaver Developer Studio and create a new project. Select Portal Application –> Create a Portal Application Project and give a name (eg. PortalHelpLink).</p><p>!|height=154|alt=Portal Application Project|align=middle|width=315|src=|border=1!</p><p> </p><ul><li>h5. Create Portal Application Object (JSPDynPage) in your Project
</li></ul><p>Right click on your newly created project and select New –> Other –> Portal Application –> Create a new Portal Application Object. In the second step, select the project that you created in previous step. Select JSPDynPage as a template and fill necessary details. Make sure that “Do not generate any bean statements” is selected in the next step.</p><p>!|height=149|alt=Portal Application Object|align=middle|width=248|src=|border=1!</p><p> </p><ul><li>h5. Do Coding
</li></ul><p>Make sure that you are in the Enterprise Portal Perspective and Package Explorer of Netweaver Developer Studio and open the JSP page by going through dist –> PORTAL-INF –> pagelet. Switch to the Source view and put the following code.</p><p> </p><p><%@ page language=”java” %><br/><html><br/><head><br/><script language=javascript><br/> EPCM.relaxDocumentDomain();<br/> function navigationEvent( eventObj ) {<br/>  var rootPath = ‘/irj/servlet/prt/portal/prtroot/’;<br/>  var fileextension = ‘.txt’;<br/>  var page = unescape(eventObj.dataObject.title);<br/>  document.helpForm.helpPath.value = rootPath + page + fileextension;<br/>  document.helpForm.submit();<br/> }<br/> EPCM.subscribeEvent( ‘urn:com.sapportals:navigation’, ‘AddNavTargetAllowDuplicate’, navigationEvent );<br/></script><br/></head><br/><form name=”helpForm”><br/> <input name=”helpPath” type=”hidden” value=”<%= request.getParameter(“helpPath”) %>”><br/></form><br/><p style=’font-size:8.0pt;font-family:”Arial”;text-align:right’><br/>[” target=”_blank”>Help | <%= request.getParameter(]<br /></html></p><p> </p><p>Save your coding.</p><p> </p><ul><li>h5. Build and Deploy Your Application
</li></ul><p>Use menu item Project –> Rebuild Project to compile. Befor deployment, you have to configure your server connection. Right click on your project and select “Quick PAR Upload”. Select “Deploy PAR” and deploy your application onto the portal.</p><p>!|height=160|alt=Deployment|align=middle|width=325|src=|border=1!</p><p> </p><ul><li>h5. Create an iView Based on Your Application
</li></ul><p>Log on to your portal and create a new iView (Content Administration –> Portal Content) based on your newly deployed application. In the first step, you have to select “Portal component” as the Source Type. You will see your project (PortalHelpLink) in the next step. Select your project and go next, here you will see the JSP class name (HelpLink) as the Portal Component. Select the Portal Component and give a name to your iView (eg. Help).</p><p>!|height=123|alt=iView Summary|align=middle|width=361|src=|border=1!</p><p> </p><ul><li>h5. Edit iView Properties
Set the +Isolation Method+ to URL.
Set the Show Tray to No.
Set the Fixed Height to 18 pixels.


    Edit Default Framework Page of your portal and add newly created iView to it. You can place your iView just below of the Top Level Navigation.
    Navigate to Content Administration –> Portal Content –> Portal Users –> Standard Portal Users. Right click on Default Framework Page and choose Open –> Object.
    Navigate to your iView, right click on it and choose Add iView to Page –> Delta link.
    Swith to page layout, drag Help iView and drop it just below Top Level Navigation.
    Save and close Default Framework Page.


      1. h5. Create Folder and Help Documents in KM

    Now, you can start to write your help documents. In our case, we have to create a folder under Public Documents of KM, with the name Help (see coding).
    Go to Content Administration ‘ KM Content. Open root –> documents –> Public Documents and create Help folder. You have to maintain Permissions to your new folder.
    Select your Help folder and choose Folder –> New –> Text File.
    Create a file with a page name in your portal, in our case “News.txt” for the News page.

    !|height=130|alt=Help File in KM|align=middle|width=377|src=|border=1!


      1. h5. Check The Result

    Refresh your browser. The help link will appear just below of the Top Level Navigation. Make sure that you opened the page that has help file, in our case it is News page. Click on the Help link which is generated in your new iView and check the result.

    !|height=147|alt=Navigate to Your Page|align=middle|width=226|src=|border=1!…!|height=137|alt=Help Link|align=middle|width=202|src=|border=1!



      1. h5. Go Beyond

    You can extend your application with new features, and of course share with us.

    You can check this article and embed your link to the MastHead.

      1. You can extend your development with “Business Logic” and check the KM document, if present display the link.
      2. You can add “Configuration” options to your development for the URL and document type (.doc, .pdf, .html etc.) to be generated.
      3. Although, documents displayed according to the page name, you can generate the URL according to the Portal Logon Language and display documents in different languages.

    You can generate URL according to another parameter passed from the event, like eventObj.dataObject.URL (short URL info ) or eventObj.dataObject.pathIndexes (like “0,0,0” for the first page, or “2,1” for the second link of the third place on top level navigation).

      Enjoy the portal!

      Assigned Tags

          1 Comment
          You must be Logged on to comment or reply to a post.
          Author's profile photo Former Member
          Former Member
          Hy, very compliments for your blog. So i have one question:In this example when doing a link on "Help" is open a file on km folder but is possible to open directly the KM file? I would open on my application the km file and display the content, is possible?
          Thank you!