0 Replies Latest reply on Jun 23, 2008 7:12 PM by Gyanendra Hyoju

    supported-modes explanation

    Gyanendra Hyoju Newbie

      Hi,
      It seems we can have supported-modes option with portal-objects.xml. As per document if supported-modes is not declared, by default it uses view,edit,help.

      The question I have is if a portle.xml has declared a porlet which supports VIEW, EDIT and HELP capability, can the portal-object.xml override one of these option by using supported-modes option.

      I want to hide the edit option so that users cannot change the preferences.

      portlet.xml

      <?xml version="1.0" encoding="UTF-8"?>
      <portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd /opt/SUNWps/dtd/portlet.xsd"
       version="1.0">
       <portlet>
       <portlet-name>MyPortlet</portlet-name>
       <portlet-class>org.jboss.portlet.hello.MyPortlet</portlet-class>
       <supports>
       <mime-type>text/html</mime-type>
       <portlet-mode>VIEW</portlet-mode>
       <portlet-mode>EDIT</portlet-mode>
       <portlet-mode>HELP</portlet-mode>
       </supports>
       <portlet-info>
       <title>MyPortlet</title>
       </portlet-info>
       </portlet>
      </portlet-app>
      


      portal-object.xml
      <?xml version="1.0" encoding="UTF-8"?>
      <deployments>
       <deployment>
       <parent-ref/>
       <if-exists>overwrite</if-exists>
       <portal>
       <portal-name>HelloPortal</portal-name>
       <properties>
       <!-- Set the layout for the default portal -->
       <!-- see also portal-layouts.xml -->
       <property>
       <name>layout.id</name>
       <value>generic</value>
       </property>
       <!-- Set the theme for the default portal -->
       <!-- see also portal-themes.xml -->
       <property>
       <name>theme.id</name>
       <value>Nphalanx</value>
       </property>
       <!-- set the default render set name (used by the render tag in layouts) -->
       <!-- see also portal-renderSet.xml -->
       <property>
       <name>theme.renderSetId</name>
       <value>divRenderer</value>
       </property>
       <!-- set the default strategy name (used by the strategy interceptor) -->
       <!-- see also portal-strategies.xml -->
       <property>
       <name>layout.strategyId</name>
       <value>maximizedRegion</value>
       </property>
       </properties>
       <supported-modes>
       <mode>view</mode>
       <mode>view</mode>
       <mode>help</mode>
       </supported-modes>
       <supported-window-states>
       <window-state>normal</window-state>
       <window-state>minimized</window-state>
       <window-state>maximized</window-state>
       </supported-window-states>
       <security-constraint>
       <policy-permission>
       <role-name>User</role-name>
       <action-name>viewrecursive</action-name>
       </policy-permission>
       <policy-permission>
       <role-name>Admin</role-name>
       <action-name>viewrecursive</action-name>
       </policy-permission>
       </security-constraint>
       <page>
       <page-name>default</page-name>
       <properties/>
       <window>
       <window-name>MyPortletWindow</window-name>
       <instance-ref>MyPortletInstance</instance-ref>
       <region>center</region>
       <height>0</height>
       </window>
       </page>
       </portal>
       </deployment>
      </deployments>