Small project <800

Posted on

2013-03-21 19:50:58.0



This project has expired

Why don't you register anyway? We are sure that you will find many similar projects out of the thousands waiting for you!

Post similar project now


Admin Note:

Dear Service Providers,

the selected budget is being discussed with the client. This is to inform that twago is currently in contact with the client to see if the budget is negotiable.



Project Skills Required: Java, Liferay, Eclipse For my Liferay system, I have the requirement to display an additional navigation in the footer of the page. This navigation should always and only display the navigation of one particular site (i.e. Base). This is contrary to the default navigation (as it comes shipped) which always shows the navigation for the current site. In order to realize this, a Hook needs to be created. During my research I came across a number of posts concerning such implementation but they all appear to be only relevant for Liferay 6.1.0 or lower. Based on the information found, I have already started to build a Hook but got stuck at the "RequestVars" function. The "RequestVars" function has been changed between Liferay 6.1.0 and 6.1.1. With the latter, it now takes an additional parameter, called "TemplateContext". Below links show the differences of the "RequestVars" function between those Liferay versions... Liferay 6.1.0 Liferay 6.1.0 As of the current insight, you would only need to use the code below and then figure out how to retrieve the "TemplateContext" object and then provide it as RequestVars parameter. Steps Required by the Developer 1. Set up a Liferay development environment 2. Create a Hook 3. Use the code below and apply missing logic

Note: Alternatively I can provide you with the current Liferay Hook. ------------------------------------- package; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import; import; import; import com.liferay.portal.kernel.templateparser.TemplateContext; import com.liferay.portal.kernel.templateparser.TemplateNode; import com.liferay.portal.model.Group; import com.liferay.portal.model.Layout; import com.liferay.portal.service.GroupLocalServiceUtil; import com.liferay.portal.service.LayoutLocalServiceUtil; import com.liferay.portal.theme.NavItem; import com.liferay.portal.theme.RequestVars; import com.liferay.portal.theme.ThemeDisplay; import com.liferay.portal.util.WebKeys; import com.liferay.portal.kernel.templateparser.BaseTemplateParser; import com.liferay.portal.kernel.xml.Element; public class StickyBaseNavigation extends Action {         @Override     public void run(HttpServletRequest request, HttpServletResponse respones)             throws ActionException {         ThemeDisplay myThemeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);         Group myBaseCommunity = GroupLocalServiceUtil.getGroup(myThemeDisplay.getCompanyId(), "BASE");         long myDefaultLayoutId = LayoutLocalServiceUtil.getDefaultPlid(myBaseCommunity.getGroupId());         Layout myDefaultLayout = LayoutLocalServiceUtil.getLayout(myDefaultLayoutId);         List myLayoutSet = LayoutLocalServiceUtil.getLayouts(myBaseCommunity.getGroupId(), false);         RequestVars myRequestVars = new RequestVars(request, myThemeDisplay, myDefaultLayout.getAncestorPlid(), myDefaultLayout.getAncestorLayoutId(), TemplateContext);         List myNavItems = NavItem.fromLayouts(myRequestVars,myLayoutSet);         Map vmVariables = new HashMap();         vmVariables.put("baseNavItems", myNavItems);         request.setAttribute(WebKeys.VM_VARIABLES, vmVariables);     } } -------------------------------- 4. Deploy hook 5. Within the Default Liferay theme, change the "portal_normal.vm" accordingly  to incorporate the second menu. See following URL for generic instructions Success Requirements: 1. The modified "portal_normal.vm" shows two navigations (I don't need this file, you only require it in order to test the created Hook) 2. When users navigates to an other site than the base site, the Hook causes to the second menu to still show the base site navigation. The first (i.e. unchanged navigation) however, will show the navigation for the site you are currently on. 3. This Hook has to work theme/ layout independently. Delivery: Source Code of Liferay Hook as Eclipse project


Additonal Note:

Over the next couple of month more complexe project will be posted