Foros de discusión

Modifying the dockbar

thumbnail
William Gosse, modificado hace 9 años.

Modifying the dockbar

Liferay Master Mensajes: 533 Fecha de incorporación: 4/07/10 Mensajes recientes
How do a modify the dockbar for a custom theme. I don't see a template for it. I only see the following reference in the portal_normal.vm file:
#if ($is_signed_in)
#dockbar()
#end

Where's #dockbar()?
thumbnail
David H Nebinger, modificado hace 9 años.

RE: Modifying the dockbar

Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
Dockbar is a separate portlet. What you're seeing is effectively a placeholder for the dockbar at render time.

To modify the dockbar you use a JSP hook.
Michael Mikuta, modificado hace 8 años.

RE: Modifying the dockbar

New Member Mensajes: 9 Fecha de incorporación: 9/10/14 Mensajes recientes
So the Dockbar is something I really need to customize. I have done a lot of searching but haven't found any real good information on how to do this except to write a hook for it. Is there any more in depth information available on how to do this? For example which JSP needs to be "hooked", I assume one in the html/portlet/dockbar... What I am really looking to do is remove / change the My Sites menu. Extracted below from Sublime searches across webapps/Root shows alot of related "stuff", view_my_sites.jspf looks promising...

Searching 16 files for "Sites"

/Users/mmikuta/Sites/liferay-portal-6.2-ce-ga3/tomcat-7.0.42/webapps/ROOT/html/portlet/dockbar/view.jsp:
143 iconCssClass = "icon-cog";
144 }
145: else if (curCategory.equals(PortletCategoryKeys.SITES)) {
146: cssClass = "control-panel-sites";
147 iconCssClass = "icon-globe";
148 }

/Users/mmikuta/Sites/liferay-portal-6.2-ce-ga3/tomcat-7.0.42/webapps/ROOT/html/portlet/dockbar/view_my_sites.jspf:
15 --%>
16
17: <c:if test="<%= user.hasMySites() %>">
18: <aui:nav-item cssClass="my-sites" dropdown="<%= true %>" id="mySites" label="my-sites" wrapDropDownMenu="<%= false %>">
19: <liferay-ui:my-sites classNames="<%= new String[] {Group.class.getName(), Organization.class.getName()} %>" cssClass="dropdown-menu my-sites-menu" />
20 </aui:nav-item>
21 </c:if>

/Users/mmikuta/Sites/liferay-portal-6.2-ce-ga3/tomcat-7.0.42/webapps/ROOT/html/portlet/dockbar/view_page_customization_bar.jspf:
17 <%
18 boolean customizableLayout = !(group.isLayoutPrototype() || group.isLayoutSetPrototype() || group.isUserGroup()) && layoutTypePortlet.isCustomizable() && LayoutPermissionUtil.containsWithoutViewableGroup(permissionChecker, layout, false, ActionKeys.CUSTOMIZE);
19: boolean linkedLayout = (!SitesUtil.isLayoutUpdateable(layout) || (layout.isLayoutPrototypeLinkActive() && !group.hasStagingGroup())) && LayoutPermissionUtil.containsWithoutViewableGroup(themeDisplay.getPermissionChecker(), layout, false, ActionKeys.UPDATE);
20: boolean modifiedLayout = (layoutSet != null) && layoutSet.isLayoutSetPrototypeLinkActive() && SitesUtil.isLayoutModifiedSinceLastMerge(layout) && hasLayoutUpdatePermission;
21 %>
22

/Users/mmikuta/Sites/liferay-portal-6.2-ce-ga3/tomcat-7.0.42/webapps/ROOT/html/portlet/dockbar/view_user_account.jspf:
85 PortletURL myProfileURL = new PortletURLImpl(request, PortletKeys.SITE_REDIRECTOR, plid, PortletRequest.ACTION_PHASE);
86
87: myProfileURL.setParameter("struts_action", "/my_sites/view");
88 myProfileURL.setParameter("groupId", String.valueOf(mySiteGroup.getGroupId()));
89 myProfileURL.setParameter("privateLayout", Boolean.FALSE.toString());
..
92 %>
93
94: <li class="my-sites-menu public-site">
95 <a href="<%= myProfileURL.toString() %>">
96 <span class="site-name"><liferay-ui:message key="my-profile" /></span>
..
106 PortletURL myDashboardURL = new PortletURLImpl(request, PortletKeys.SITE_REDIRECTOR, plid, PortletRequest.ACTION_PHASE);
107
108: myDashboardURL.setParameter("struts_action", "/my_sites/view");
109 myDashboardURL.setParameter("groupId", String.valueOf(mySiteGroup.getGroupId()));
110 myDashboardURL.setParameter("privateLayout", Boolean.TRUE.toString());
...
113 %>
114
115: <li class="my-sites-menu private-site">
116 <a href="<%= myDashboardURL %>">
117 <span class="site-name"><liferay-ui:message key="my-dashboard" /></span>

/Users/mmikuta/Sites/liferay-portal-6.2-ce-ga3/tomcat-7.0.42/webapps/ROOT/html/portlet/dockbar/view_user_panel.jspf:
27 <%@ include file="/html/portlet/dockbar/view_admin_links.jspf" %>
28
29: <%@ include file="/html/portlet/dockbar/view_my_sites.jspf" %>
30 </c:if>
31

15 matches across 5 files


Searching 9745 files for "My Sites"

/Users/mmikuta/Sites/liferay-portal-6.2-ce-ga3/tomcat-7.0.42/webapps/ROOT/html/themes/_unstyled/templates/init.ftl:
354 </#if>
355
356: <#-- ---------- My sites ---------- -->
357
358 <#assign show_my_sites = user.hasMySites() />

/Users/mmikuta/Sites/liferay-portal-6.2-ce-ga3/tomcat-7.0.42/webapps/ROOT/html/themes/_unstyled/templates/init.vm:
347 #end
348
349: ## ---------- My sites ---------- ##
350
351 #set ($show_my_sites = $user.hasMySites())

/Users/mmikuta/Sites/liferay-portal-6.2-ce-ga3/tomcat-7.0.42/webapps/ROOT/WEB-INF/portlet-custom.xml:
403 <portlet>
404 <portlet-name>29</portlet-name>
405: <display-name>My Sites</display-name>
406 <portlet-class>com.liferay.portlet.StrutsPortlet</portlet-class>
407 <init-param>
...
3243 <portlet>
3244 <portlet-name>188</portlet-name>
3245: <display-name>My Sites Directory</display-name>
3246 <portlet-class>com.liferay.portlet.StrutsPortlet</portlet-class>
3247 <init-param>

/Users/mmikuta/Sites/liferay-portal-6.2-ce-ga3/tomcat-7.0.42/webapps/ROOT/WEB-INF/struts-config.xml:
1400 </action>
1401
1402: <!-- My Sites -->
1403
1404 <action path="/my_sites/edit_layouts" type="com.liferay.portlet.myplaces.action.EditPagesAction" />

/Users/mmikuta/Sites/liferay-portal-6.2-ce-ga3/tomcat-7.0.42/webapps/ROOT/WEB-INF/tiles-defs.xml:
1043 </definition>
1044
1045: <!-- My Sites -->
1046
1047 <definition name="portlet.my_sites" extends="portlet" />
Mark Fitzgerald, modificado hace 8 años.

RE: Modifying the dockbar

Regular Member Mensajes: 108 Fecha de incorporación: 15/10/10 Mensajes recientes
Michael,

You're on the right path. 'view_my_sites.jspf' will get you started, but the actual files that you need to hook will depend upon what you want to change. Removing the 'My Sites' section should be straight-forward, but your changes could be complex
Michael Mikuta, modificado hace 8 años.

RE: Modifying the dockbar

New Member Mensajes: 9 Fecha de incorporación: 9/10/14 Mensajes recientes
So based on further exploration I ended up writing hooks for:

view_my_sites.jspf
view_page_customization_bar.jspf
view_user_account.jspf
view_user_account.portal.jspf
view_user_panel.jspf

which exist in the ROOT/html/portlet/dockbar directory

Basically I gutted these files using the Eclipse IDE where they were generating elements I did not want displayed. Not really ideal as this is not turning off the generation of the pages, more like just disabling access from one portion of the UI. I wish Liferay had an easier way to fully disable elements like "My Sites", and "My Dashboard" and the like. In parallel offer some type of overall navigation configuration where the dockbar and the other site navigation could be more integrated and easily controlled. Liferay really needs something that just provides a lightweight container, stripped of all CMS, marketplace, social, calendar, blah.... I know there are ways to do this but they are over the place. Some from "control panel UI", XML file edits, hook writing, un-deploying stuff. Hell I think just having their security container, directory integration and base control panel around this would make for an interesting product by itself.
thumbnail
Miroslav Ligas, modificado hace 8 años.

RE: Modifying the dockbar

Regular Member Mensajes: 152 Fecha de incorporación: 29/07/14 Mensajes recientes
Why are you trying to remove the my sites? Can't it be handled trough permissions or via CSS? Do you really need to remove the HTML code fragment?