public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException { Context context = getContext(request); context.put( "enableContents", PortalConfig.getInstance() .getBoolean("portal.enable.search.ext.env.area.contents", Boolean.TRUE)); context.put( "enableSources", PortalConfig.getInstance() .getBoolean("portal.enable.search.ext.env.area.sources", Boolean.TRUE)); context.put( "enablePartner", PortalConfig.getInstance() .getBoolean("portal.enable.search.ext.env.area.partner", Boolean.TRUE)); // set positions in main and sub tab context.put(VAR_MAIN_TAB, PARAMV_TAB_AREA); context.put(VAR_SUB_TAB, PARAMV_TAB_PARTNER); UtilsSearch.doViewForPartnerPortlet(request, context); super.doView(request, response); }
/** * @see * org.apache.portals.bridges.velocity.GenericVelocityPortlet#processAction(javax.portlet.ActionRequest, * javax.portlet.ActionResponse) */ public void processAction(ActionRequest request, ActionResponse actionResponse) throws PortletException, IOException { String action = request.getParameter(Settings.PARAM_ACTION); if (action == null) { action = ""; } PortletSession session = request.getPortletSession(); if (action.equalsIgnoreCase("doOpenPartner")) { DisplayTreeNode partnerRoot = (DisplayTreeNode) session.getAttribute("partnerRoot"); if (partnerRoot != null) { DisplayTreeNode node = partnerRoot.getChild(request.getParameter("id")); node.setOpen(true); if (node.get("checked") != null) { Iterator it = node.getChildren().iterator(); while (it.hasNext()) { DisplayTreeNode child = (DisplayTreeNode) it.next(); child.put("checked", "true"); } } } } else if (action.equalsIgnoreCase("doClosePartner")) { DisplayTreeNode partnerRoot = (DisplayTreeNode) session.getAttribute("partnerRoot"); if (partnerRoot != null) { DisplayTreeNode node = partnerRoot.getChild(request.getParameter("id")); node.setOpen(false); } } else if (action.equalsIgnoreCase("doOriginalSettings")) { Principal principal = request.getUserPrincipal(); IngridPersistencePrefs.setPref( principal.getName(), IngridPersistencePrefs.SEARCH_PARTNER, ""); DisplayTreeNode partnerRoot = (DisplayTreeNode) session.getAttribute("partnerRoot"); Iterator it = partnerRoot.getChildren().iterator(); while (it.hasNext()) { DisplayTreeNode partnerNode = (DisplayTreeNode) it.next(); partnerNode.setOpen(false); Iterator it2 = partnerNode.getChildren().iterator(); while (it2.hasNext()) { DisplayTreeNode providerNode = (DisplayTreeNode) it2.next(); providerNode.remove("checked"); } } } else { // Zur Suchanfrage hinzufuegen DisplayTreeNode partnerRoot = (DisplayTreeNode) session.getAttribute("partnerRoot"); String resultQuery = UtilsSearch.processSearchPartner("", partnerRoot, request); Principal principal = request.getUserPrincipal(); IngridPersistencePrefs.setPref( principal.getName(), IngridPersistencePrefs.SEARCH_PARTNER, resultQuery); } }
/** * @see * org.apache.portals.bridges.velocity.GenericVelocityPortlet#doView(javax.portlet.RenderRequest, * javax.portlet.RenderResponse) */ public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException { Context context = getContext(request); IngridResourceBundle messages = new IngridResourceBundle( getPortletConfig().getResourceBundle(request.getLocale()), request.getLocale()); context.put("MESSAGES", messages); PortletPreferences prefs = request.getPreferences(); String titleKey = prefs.getValue("titleKey", "searchSettings.title.rankingAndGrouping"); response.setTitle(messages.getString(titleKey)); UtilsSearch.doViewForPartnerPortlet(request, context); Principal principal = request.getUserPrincipal(); String partnerStr = (String) IngridPersistencePrefs.getPref( principal.getName(), IngridPersistencePrefs.SEARCH_PARTNER); if (partnerStr != null) { PortletSession session = request.getPortletSession(); DisplayTreeNode partnerRoot = (DisplayTreeNode) session.getAttribute("partnerRoot"); Iterator it = partnerRoot.getChildren().iterator(); while (it.hasNext()) { DisplayTreeNode partnerNode = (DisplayTreeNode) it.next(); if (partnerStr.indexOf(Settings.QFIELD_PARTNER.concat(":").concat(partnerNode.getId())) != -1 || partnerNode.get("checked") != null) { partnerNode.put("checked", "true"); } else { partnerNode.remove("checked"); } Iterator it2 = partnerNode.getChildren().iterator(); while (it2.hasNext()) { DisplayTreeNode providerNode = (DisplayTreeNode) it2.next(); if (partnerStr.indexOf(Settings.QFIELD_PROVIDER.concat(":").concat(providerNode.getId())) != -1) { providerNode.put("checked", "true"); partnerNode.setOpen(true); } else { providerNode.remove("checked"); } } } } super.doView(request, response); }
public void processAction(ActionRequest request, ActionResponse response) throws PortletException, IOException { String action = request.getParameter(Settings.PARAM_ACTION); if (action == null) { action = ""; } if (action.equalsIgnoreCase(Settings.PARAMV_ACTION_CHANGE_TAB)) { String newTab = request.getParameter(Settings.PARAM_TAB); processTab(response, newTab); } else { UtilsSearch.processActionForPartnerPortlet(request, response, PAGE_PARTNER); } }