Skip to Content

A common request in the portal forums is how to make an iView that contains some straight forward HTML. If KM is being used, then it is possible to create a document in one of the KM folders and point an iView to that document. This is a little difficult to transport through the traditional Development/QA/Production landscape.

Another alternative is to create a portal component for each HTML document, using the NetWeaver Development Studio, which can be complicated to maintain.

The following proposal is based on creating PAR files without the need for building an NDS project for each HTML file. Instead, we create a PAR file through the use of Windows batch scripting.

The prerequistes are that the jar tool be available and that NDS is used once to build our basic Java wrapper. The jar tool is used in the script to build the PAR file.

For each HTML file, we execute the attached script, which creates a par file named as the second parameter based upon the HTML file given as the first parameter. For example, executing:

buildpar test.html fred

would create fred.par with the contents of test.html. It would still be necessary to upload the par file and create any iViews based on the component fred.Page.

The script assumes a folder structure (\temp\buildpar) which is specified in the script file. The folder structure is created the first time the script runs.

The Java wrapper is based on making an NDS portal project called Static that contains a JSP DynPage called Page. Most of the code is generated when we use the wizard. The only piece we really need is the compiled JAR file Staticcode.jar. We move this into a Windows folder shortly…

Here is the code in the portal component:

A copy of the generated jar file is available here until the end of 2006.

The script itself is here. I have called it buildpar.bat.

To report this post you need to login first.

17 Comments

You must be Logged on to comment or reply to a post.

  1. Daniel Wroblewski
    Nice blog and thanks. Just an idea: Wouldn’t it be easy to create a navigation structure based on file structure of your HTML pages, and then just create a link to each page. That way, no PARs at all. Just wondering.

    Thanks again.

    Daniel

    (0) 
    1. Michael Nicholls Post author
      Hi Daniel

      I have assumed that the HTML page to be displayed doesn’t have a web server to deliver it. Are you suggesting there is a way to display HTML pages without putting them in a PAR file?

      Thanks

      (0) 
        1. Michael Nicholls Post author
          Hi Abdul

          The problem which I mentioned in the intro is that it is not easy to transport KM content through Dev/Qa/Prod. With a PAR file, you only need to transport any iViews that use the PAR file..

          Cheers

          (0) 
  2. Sharath Nagendra
    Hi Michael,
    it is a nice blog and I was able to create a par using your tool.

    I deployed the par on our portal and it said deployment successful. The only thing I see is that the Local and Repository versions say undefined.

    I can see the deployed par under Applications, but not under the security zones, so am not able to give permissions.

    When I go to content admin to create an iView using this par, it does not show up in the list of pars.

    I have tried multiple times, have super_admin role.

    If you can point me in the right direction or tell me where I went wrong, it would really help me and I would really appreciate it.
    thanks,
    Sharath

    (0) 
    1. Michael Nicholls Post author
      Strange. In my portal (EP7) I see the other way aroung – it appears in the list of PAR files when I try to create an iView, but it isn’t there in the permission editor under Applications!

      Can you start the component as /irj/servlet/prt/portal/prtroot/PAR.Page?

      Cheers

      (0) 
      1. Michael Nicholls Post author
        OK, I’m replying to myself!

        If the par file starts with a lowercase letter, then it won’t appear in the permission editor under Applications! So, testing.par won’t be there but Testing.par will be.

        Please check that you have at least Read access to the par file under the permission editor for the applications.

        Cheers

        (0) 
        1. Sharath Nagendra
          Michael, thanks for youre response.
          I get an error when I try to call the page directly (/irj/servlet/prt/portal/prtroot/PAR.Page):
            Portal Runtime Error

          An exception occurred while processing a request for :
          iView : N/A
          Component Name : N/A

          iView not found: TestHTML.Page.
          Exception id: 09:05_20/12/06_0003_51863650
          See the details for the exception ID in the log file

          —–

          I have super_admin role, but I still gave my user id, read access to the entire Applications folder and even tried giving Owner access to the application (par) in question.

          Does the undefined version number have anything to do with this problem?

          (0) 
            1. Michael Nicholls Post author
              You may want to use the deployment browser (System admin -> Support -> Portal runtime -> Browse deployment) to browse to ROOT/WEB-INF/portal/portalapps, then find your PAR file. Make sure static.jsp exists under pagelet, Staticcore.jar exists under private/lib and that the portalapp.xml looks OK.

              Cheers and good luck

              (0) 
              1. Sharath Nagendra
                Thanks for your responses Michael.

                When I looked at the location you mentioned, I can see only the portalapp.xml under my app, nothing else. I can see it under ROOT/portalapps/.. and not under WEB-INF, so that might have something to do with it.

                The portalapp.xml that got generated was exactly the same as the one you have posted. I will try to figure out why my app did not get deployed under WEB-INF.

                Thanks for your help and have a nice vacation.

                Sharath

                (0) 
  3. Michael Nicholls Post author
    I have put together a wiki page here that describes a simple method for locating graphic files on the portal server. It extends on this command file to allow for graphics to be included easily in any static pages.

    Cheers

    (0) 

Leave a Reply