views:

3

answers:

0

Hello,

I'm fairly new to Jetspeed and I'm having some problems getting everything to work correctly. I'll list off what I consider to be the relevant code snippets for reference and then explain the problem.

Portlet.xml snippet:

<portlet-app id="Fake" version="1.0">
    <portlet id="MyPortletID">
        <portlet-name>MyPortletName</portlet-name>
        <display-name>My Portlet Name</display-name>
        <description>My Portlet Description</description>
        <portlet-class>org.fake.MyClass</portlet-class>
        <expiration-cache>-1</expiration-cache>
        <supports>
            <mime-type>text/html</mime-type>
            <portlet-mode>EDIT</portlet-mode>
            <portlet-mode>VIEW</portlet-mode>
            <portlet-mode>HELP</portlet-mode>
        </supports>
        <supported-locale>en</supported-locale>
        <portlet-info>
            <title>My Portlet Title</title>
            <short-title>My Portlet Title</short-title>
            <keywords>My Portlet Title</keywords>
        </portlet-info>
    </portlet>
</portlet-app>

PSML Snippet:

<?xml version="1.0" encoding="UTF-8"?>
<page id="/administrator/MyPortlet.psml" hidden="false">
    <title>MyPortletPage</title>
    <short-title>MyPortletPage</short-title>
    <defaults skin="orange"
              layout-decorator="pagelayout"
              portlet-decorator="portletlayout"/>
    <fragment id="0685683554585891"
              type="layout"
              name="jetspeed-layouts::VelocityOneColumn">
        <fragment id="04487633864220224"
                  type="portlet"
                  name="Fake::MyPortletID">
            <property name="row" value="0"/>
        </fragment>
    </fragment>
</page>

Snippet from decorations/portlet/portletlayout/decorator.vm:

#set($decoration = $f.decoration)
#set($actions = $decoration.actions)

<!-- Begin: Fragment: ${f.id} Decoration: ${decoratorId} -->
<table width="100%">
  <tr>
    <td>
      <div id="${f.id}" class="portletlayout">
        <div class="PTitle">
        #if( $!jetspeed.getTitle($jetspeed.getPortletEntity($f), $f).length() <= 40)
          <div class="PTitleContent">
            $!jetspeed.getTitle($jetspeed.getPortletEntity($f), $f)
          </div>
        #else
          #if( $!jetspeed.getTitle($jetspeed.getPortletEntity($f), $f).length() > 40)
            #set($header1 = $!jetspeed.getTitle($jetspeed.getPortletEntity($f), $f).substring(0,40))
            #set($header2 = $!jetspeed.getTitle($jetspeed.getPortletEntity($f), $f).substring(40, $!jetspeed.getTitle($jetspeed.getPortletEntity($f), $f).length()))
          <div class="PTitleContent">
            $header1 </br> $header2
          </div>
          #end
        #end
        #PortletActionBar($decoration)  ##<-- NOTICE THIS LINE
        </div>

        #if (!$jetspeed.isHidden($f) || $jetspeed.WindowState != "minimized")
        <div class="PContent">
          <span style="line-height:0.005px;">&nbsp;</span>
          $f.renderedContent
        </div>
        #end
      </div>
    </td>
  </tr>
</table>
<br/>
<!-- END: Fragment: ${f.id} Decoration: ${decoratorId} -->

Definition of PortletActionBar:

#macro(PortletActionBar $_decoration)
  #set($_actions = $_decoration.actions)

  <div class="PActionBar">
    #foreach ($_action in $_actions)
      <a href="${_action.Action}"
         title="${_action.Name}"
         class="action portlet-action"
         #if($_action.target)
           target="$_action.target"
         #end
      >
        <img src="$request.contextPath/${_action.link}"
             alt="${_action.Alt}"
             border="0" />
      </a>
    #end    
  </div>
#end

Alright, so my problem is that when I load the page, the portlets don't have an edit icon.

I've put a "<portlet-mode>EDIT</portlet-mode>" statement in the portlet.xml, and org.Fake.MyClass extends GenericPortlet and overrides the doEdit function. All the PortletActionBar macro does is print out all the portlets actions. However, the edit action isn't showing up, and I don't know why.

I'm using Jetspeed 2.1.3. (Also, this is part of an upgrade process from 2.0 to 2.1.3)

Any help or advice would be much appreciated.

Thanks, B.J.