留言板
Detecting Control Panel
Hi
I have a portlet which may be instantiated on any page, but should also work in the control panel with a slightly different behavior ?
How can a portlet detect if its instantiated in the control panel ? Is there special flag in the ThemeDisplay or something like that ?
Regards
I have a portlet which may be instantiated on any page, but should also work in the control panel with a slightly different behavior ?
How can a portlet detect if its instantiated in the control panel ? Is there special flag in the ThemeDisplay or something like that ?
Regards
Hi Michael,
This is how it's done in ServicePreAction.java:
You should be able to get the current group from themeDisplay.getScopeGroup()
This is how it's done in ServicePreAction.java:
if (group.getName().equals(GroupConstants.CONTROL_PANEL)) {
You should be able to get the current group from themeDisplay.getScopeGroup()
Thanks,
This seems to work
But you have to retrieve the group from the layout, it is not the scopegroup.
This seems to work
But you have to retrieve the group from the layout, it is not the scopegroup.
if (layout.getGroup().getName().equals(GroupConstants.CONTROL_PANEL)) {
oh right you are correct, my mistake.
Scope group would refer to the community/organization you are administering from the control panel.
Scope group would refer to the community/organization you are administering from the control panel.