Daryl Gerlach a écrit :
I'm running Jahia 5 and working through the Hello servlet sample in
the "Web Application Developer Guide". I've figured out how to create
a WEB-INF/jahia.xml (see below). Now I am able to deploy the WAR and
register it in Jahia so that it can be selected from the "Add Portlet"
link. It even works!
However, I now have this View tab thing that displays in the upper
right corner of the portlet section. How do I get rid of it? I also
noticed that the demo:: HelloPortlet does a similar thing but in
addition to the View there is a Edit and Help tab.
Jahia 5 supports portlet JSR168 (Java specification) and JahiaWebApp.
In order to convert your JahiaWebApp, you need to add jahia.xml (as you
did...). You can also convert your JahiaWebapp to a portletJSR168
(rewriting).
Portlet JSR168 defines a concept of "Window View". There are 3 different
views: view, edit and help (3 different tabs). From a JahiaWebApp you
CAN'T control these tabs.There is only View tab. From a
portletJSR168, you can control these tabs in portlet.xml.
Here is an example of portlet.xml:
<?xml version="1.0" encoding="UTF-8"?>
<portlet-app version="1.0">
<portlet>
<description>Jahia WebApp Portlet Bridge</description>
<portlet-name>Infonews</portlet-name>
<portlet-class>org.jahia.portlet.JahiaWebAppPortletBridge</portlet-class>
<supports>
<mime-type>text/html</mime-type>
*<portlet-mode>view</portlet-mode>
<portlet-mode>edit</portlet-mode>*
</supports>
<expiration-cache>-1</expiration-cache>
<portlet-info>
<title>Infonews</title>
</portlet-info>
<!-- jahia webapp securityrole-->
<security-role-ref>
<role-name>manager</role-name>
<role-link>manager</role-link>
</security-role-ref>
</portlet>
</portlet-app>
More details about portlet JSR168:
Spec.: http://jcp.org/en/jsr/detail?id=168
What is controlling the visibility of these tabs?
<?xml version="1.0" encoding="ISO-8859-1"?>
<jahia>
<entrypoints>
<entrypoint>
<name>Hello</name>
<display-name>Hello</display-name>
<description></description>
<target type="servlet-name">hello</target>
</entrypoint>
</entrypoints> </jahia>