Hennig, Ronald
2015-04-29 07:25:11 UTC
Hello dev-cocoon,
first I want to describe the scenario:
We have an old portal based on cocoon 2.1.11 and now we want to develop a feature which requires to reload/rerendering the layout for navigation. In detail, the logged in user can switch to another identity, which may be have less or more navigation points on navigation bar. That is why the portal must re-rendering the layout for displaying the current (navigation rights of the identity) navigation.
The navigation is based on composite layouts:
<composite-layout name="tab" id="maintab">
<!-- Startmenü -->
<named-item name="Allgemein">
<composite-layout name="linktab">
<named-item name="Startseite">
<coplet-layout name="coplet">
<coplet-instance-data>homepage-1</coplet-instance-data>
</coplet-layout>
</named-item>
...
The composite-layout which describe the role profile for navigation will be filtered by permissions.
I have found a solution for re-rendering by trial and error and I don't understand why it works.
On flow.js I've the following code:
function loadSkin( reload) {
var toolManager = cocoon.getComponent("org.apache.cocoon.portal.tools.PortalToolManager");
// the following line seem to be triggering the rendering?
var portalObjects = toolManager.getPortalObjects();
var portalService = portalObjects.getPortalService();
var portalLayout = portalObjects.getPortalLayout();
// TODO: reload needed for changing the layout profile - but how?
if (reload) {
/**
* This method is invoked when the user logs out of the portal
*
*/
//portalService.getComponentManager().getProfileManager().logout();
portalObjects.getProfileManager().logout();
}
}
I don't understand why the method logout() from class ProfileManager invoke the re-rendering due to the fact that the comment of this method (interface ProfileManager) say it logs user out of the portal. But the user is stay logged in and the navigation bar was updated in the right way. Where is the relation between this method call and the re-rendering of the portal layout? Does anybody know which implementation was used by the ProfileManager or knows the relation?
* The version of Cocoon: 2.1.11
* The servlet container: build in Jetty on local and Tomcat 6 for testing and production.
* Platform details: JDK 1.6.0_26 on Win7
Thanks.
Mit freundlichen Grüßen
Ronald Hennig
Softwareentwickler
Portaltechnologie
Standort Hannover
2. OG, weiß, Wabe 2
Tel. +49 511 9020-5732
Swiss Life Deutschland Operations GmbH
Rechtsform: GmbH, Sitz der Gesellschaft: Hannover, Registergericht: AG Hannover, Registernummer: HRB 210245
Geschäftsführer: Thorsten Geier, Jürgen Rössler, Holger Torner
Die Swiss Life Deutschland Operations GmbH ist eine Servicegesellschaft der Swiss Life Gruppe in Deutschland. Sie ist damit beauftragt für die Vertriebsgesellschaften Swiss Life Select Deutschland GmbH, tecis Finanzdienstleistungen AG, HORBACH Wirtschaftsberatung GmbH und Deutsche Proventus AG Dienstleistungen sowohl im Innen- als auch im Außenverhältnis zu erbringen. Die Swiss Life Deutschland Operations GmbH ist in diesem Zusammenhang berechtigt, Willenserklärungen für die jeweiligen Vertriebsgesellschaften abzugeben und entgegenzunehmen.
Diese E-Mail sowie alle mit ihr verbundenen Dateien sind möglicherweise vertraulich. Wenn Sie diese E-Mail irrtümlicherweise erhalten haben, bitte ich Sie, diese Mitteilung nicht weiter zu verbreiten, zu kopieren, weiterzuleiten oder auf andere Weise davon Gebrauch zu machen. Bitte informieren Sie mich umgehend per E-Mail, falls Sie diese Mitteilung fälschlicherweise erhalten haben und löschen Sie diese E-Mail endgültig aus Ihrem System. Vielen Dank.
first I want to describe the scenario:
We have an old portal based on cocoon 2.1.11 and now we want to develop a feature which requires to reload/rerendering the layout for navigation. In detail, the logged in user can switch to another identity, which may be have less or more navigation points on navigation bar. That is why the portal must re-rendering the layout for displaying the current (navigation rights of the identity) navigation.
The navigation is based on composite layouts:
<composite-layout name="tab" id="maintab">
<!-- Startmenü -->
<named-item name="Allgemein">
<composite-layout name="linktab">
<named-item name="Startseite">
<coplet-layout name="coplet">
<coplet-instance-data>homepage-1</coplet-instance-data>
</coplet-layout>
</named-item>
...
The composite-layout which describe the role profile for navigation will be filtered by permissions.
I have found a solution for re-rendering by trial and error and I don't understand why it works.
On flow.js I've the following code:
function loadSkin( reload) {
var toolManager = cocoon.getComponent("org.apache.cocoon.portal.tools.PortalToolManager");
// the following line seem to be triggering the rendering?
var portalObjects = toolManager.getPortalObjects();
var portalService = portalObjects.getPortalService();
var portalLayout = portalObjects.getPortalLayout();
// TODO: reload needed for changing the layout profile - but how?
if (reload) {
/**
* This method is invoked when the user logs out of the portal
*
*/
//portalService.getComponentManager().getProfileManager().logout();
portalObjects.getProfileManager().logout();
}
}
I don't understand why the method logout() from class ProfileManager invoke the re-rendering due to the fact that the comment of this method (interface ProfileManager) say it logs user out of the portal. But the user is stay logged in and the navigation bar was updated in the right way. Where is the relation between this method call and the re-rendering of the portal layout? Does anybody know which implementation was used by the ProfileManager or knows the relation?
* The version of Cocoon: 2.1.11
* The servlet container: build in Jetty on local and Tomcat 6 for testing and production.
* Platform details: JDK 1.6.0_26 on Win7
Thanks.
Mit freundlichen Grüßen
Ronald Hennig
Softwareentwickler
Portaltechnologie
Standort Hannover
2. OG, weiß, Wabe 2
Tel. +49 511 9020-5732
Swiss Life Deutschland Operations GmbH
Rechtsform: GmbH, Sitz der Gesellschaft: Hannover, Registergericht: AG Hannover, Registernummer: HRB 210245
Geschäftsführer: Thorsten Geier, Jürgen Rössler, Holger Torner
Die Swiss Life Deutschland Operations GmbH ist eine Servicegesellschaft der Swiss Life Gruppe in Deutschland. Sie ist damit beauftragt für die Vertriebsgesellschaften Swiss Life Select Deutschland GmbH, tecis Finanzdienstleistungen AG, HORBACH Wirtschaftsberatung GmbH und Deutsche Proventus AG Dienstleistungen sowohl im Innen- als auch im Außenverhältnis zu erbringen. Die Swiss Life Deutschland Operations GmbH ist in diesem Zusammenhang berechtigt, Willenserklärungen für die jeweiligen Vertriebsgesellschaften abzugeben und entgegenzunehmen.
Diese E-Mail sowie alle mit ihr verbundenen Dateien sind möglicherweise vertraulich. Wenn Sie diese E-Mail irrtümlicherweise erhalten haben, bitte ich Sie, diese Mitteilung nicht weiter zu verbreiten, zu kopieren, weiterzuleiten oder auf andere Weise davon Gebrauch zu machen. Bitte informieren Sie mich umgehend per E-Mail, falls Sie diese Mitteilung fälschlicherweise erhalten haben und löschen Sie diese E-Mail endgültig aus Ihrem System. Vielen Dank.