<%--
  Copyright 2003 Sun Microsystems, Inc. All rights reserved 
  Use is subject to license terms.
 --%>
<%-- @(#)portal.jsp --%>
<%@ page import="java.util.*" %>

<%@ taglib uri="/tld/desktop.tld" prefix="dt" %>
<%@ taglib uri="/tld/desktopProviderContext.tld" prefix="dtpc" %>
<%@ taglib uri="/tld/desktopTheme.tld" prefix="dttheme" %>

<dt:obtainChannel channel="$JSPProvider">
    <dtpc:providerContext>
	<!-- set the desktop theme variables -->
	<dttheme:getAttribute name="bgColor" id="tBgColor" scope="request"/>
	<dttheme:getAttribute name="titleBarColor" id="tTitleBarColor" scope="request"/>
	<dttheme:getAttribute name="titleFontColor" id="tTitleFontColor" default="#000000" scope="request"/>
	<dttheme:getAttribute name="tabColor" id="tTabColor" default="#C0C0C0" scope="request"/>
	<dttheme:getAttribute name="tabFontColor" id="tTabFontColor" default="#000000" scope="request"/>
	<dttheme:getAttribute name="channelHighlightColor" id="channelHighlightColor" default="#FFFFFF" scope="request"/>
	<dttheme:getAttribute name="fontColor" id="tFontColor" scope="request"/>
	<dttheme:getAttribute name="borderColor" id="tBorderColor" scope="request"/>
	<dttheme:getAttribute name="fontFace" id="tFontFace" scope="request"/>
	<dttheme:getAttribute name="borderWidth" id="tBorderWidth" scope="request"/>

	<%-- search channel properties --%>
	<dtpc:getIntegerProperty key="viewHits" id="hitNumber" scope="request"/>
	<dtpc:getBooleanProperty key="viewDiscussionWindow" id="vdw" scope="request"/> 
	<dtpc:getStringProperty key="defaultDiscussionDisplay" id="ddd" scope="request"/>
	<dtpc:getStringProperty key="defaultFilter" id="df" scope="request"/>
	<dtpc:getStringProperty key="defaultExpansionThreshold" id="det" scope="request"/>
	<dtpc:getStringProperty key="anonymousAuthor" id="anonymousAuthor" scope="request"/>
	<dtpc:getStringProperty key="dbname" id="dbname" scope="request"/>
	<dtpc:getBooleanProperty key="displaySearch" id="displaySearch" scope="request"/>
	<dtpc:getBooleanProperty key="showDescription" id="showDesc" scope="request"/>
	<dtpc:getStringAttribute key="commonname" id="gn" scope="request"/>
	<dtpc:getStringAttribute key="sn" id="lastname" scope="request"/>
	<dtpc:getSessionID id="accessToken" scope="request"/>
	<dtpc:getUserID id="authorId" scope="request"/>
	<dtpc:getLocale id="locale" scope="request"/>
	<dtpc:getDesktopURL id="desktopUrl" scope="request"/>

	<%
        Map pathInfo = new HashMap();
        pathInfo.put("action", "content");
        pathInfo.put("provider", "JSPDynamicSingleContainer");
        pathInfo.put("JSPDynamicSingleContainer.selectedChannel", "Search");
        pathInfo.put("last", "false");
        pageContext.setAttribute("pathInfo", pathInfo);
	%>
	<dtpc:getDesktopURL id="desktopPathInfo" pathinfo="$pathInfo" scope="request"/>

	<%
        pathInfo.put("JSPDynamicSingleContainer.selectedChannel", "Discussions");
        pageContext.setAttribute("pathInfo2", pathInfo);
	%>
	<dtpc:getDesktopURL id="desktopPathInfo2" pathinfo="$pathInfo2" scope="request"/>

	<% 
	Map desktopArgsMap = new HashMap(); 
	Enumeration params = request.getParameterNames(); 
	while (  params.hasMoreElements() ) { 
	    String paramKey = (String)params.nextElement(); 
	    String paramValue = request.getParameter(paramKey); 
	    // Do not add internal parameters to the path info.
	    if ((!paramKey.equalsIgnoreCase("Discussions_dmode")) && (!paramKey.equalsIgnoreCase("did")) && (!paramKey.equalsIgnoreCase("database")) && (!paramKey.equalsIgnoreCase("ref_id")) && (!paramKey.equalsIgnoreCase("t")) && (!paramKey.equalsIgnoreCase("title")) && (!paramKey.equalsIgnoreCase("desc")) && (!paramKey.equalsIgnoreCase("rtg")) && (!paramKey.equalsIgnoreCase("rid")) && (!paramKey.equalsIgnoreCase("page"))) {
		desktopArgsMap.put(paramKey, paramValue); 
            }
	} 
	pageContext.setAttribute("desktopArgs", desktopArgsMap); 
	%> 
	<dtpc:getDesktopURL id="dpurl" pathinfo="$desktopArgs" scope="request"/>

	<dtpc:getStringProperty key="searchServer" id="searchServer" scope="request"/>
   </dtpc:providerContext>
   <dt:getName id="channelName" scope="request"/>
</dt:obtainChannel>
