19-Aug-04 (Created: 19-Aug-04) | More in 'Java-Portlets'

How to create a link using jetspeed api


   private String getSelfLink(RunData indata)
         throws TurbineException
   {
      JetspeedRunData data = (JetspeedRunData)indata;
      ProfileLocator baseLocator = Profiler.createLocator();
      baseLocator.createFromPath(data.getProfile().getPath());
      AppObjects.log("action:" + data.getAction());
      JetspeedLink link = JetspeedLinkFactory.getInstance(data);
      DynamicURI uri = link.getLink(JetspeedLink.CURRENT,
                                    "",
                                    baseLocator.getName(),
                                    JetspeedLink.PORTLET_ID,
                                    this.getID(),
                                    "controls.Maximize",
                                    null,
                                    baseLocator.getMediaType(),
                                    baseLocator.getLanguage(),
                                    baseLocator.getCountry());

      String result = uri.toString();
      JetspeedLinkFactory.putInstance(link);
      return result;
   }//eof-function

Demo for Anthony