<%@page import="org.owasp.esapi.reference.DefaultEncoder"%> <% /* Program Name : contact.jsp Description : Start page of contact application for internet Additional information : |Version |Date |Author |Modification history| 1.0 10.10.2009 Unknown Received as part of take over from IMG 1.1 10.10.2009 Chanchal Jacob IM_204428. Validated coid for XSS. Removed printing coid to screen 1.2 14.06.2010 Chanchal Jacob IM_204428. OWASP implementation for decoding/encoding */ %> <%@page language="java" import="java.util.*, de.wwl.wcm.*, de.wwl.wcm.nav.*, de.wwl.wcm.nav.doc.*, de.wwl.wcm.encode.*, de.gauss.vip.api.lang.ObjectType, de.gauss.lang.StringValue, de.gauss.vip.repository.RepositoryEntry, com.img.gauss.GaussHelper, javax.servlet.http.HttpServletRequest, com.boschrexroth.bridge.template.top.TemplateAdminInternet, java.net.URLDecoder" pageEncoding="utf-8" contentType="text/html;charset=utf-8" %> <%! final static org.apache.log4j.Logger br_logger = org.apache.log4j.Logger.getLogger( "com.boschrexroth.jsp.redirect.jsp"); %> <% // performance long top_pagestarttime = java.lang.System.currentTimeMillis(); com.img.performance.PagePerform top_perform = new com.img.performance.PagePerform(); top_perform.startPage("20539","BoschRexroth"); String top_performId = top_perform.getId(); %> <%@ taglib uri="oscache" prefix="oscache" %> <% // **************************************************************************************** // // INTERNET INTERNET INTERNET INTERNET INTERNET // // // INTERNET INTERNET INTERNET INTERNET INTERNET // // **************************************************************************************** // 2002-03-20 JSE: // All login Stuff for Intranet here: %> <%// begin aw: cr 020903%> <% //end WWL aw%> <% TemplateAdminInternet tempAdmin = TemplateAdminInternet.getInstance("BoschRexroth"); String xgif_location = tempAdmin.pic_x; // Login Handling: // oid of "wand" Seite: String loginWall = "8101"; boolean isAuthorized = false; boolean unreadableOid = false; br_vipObjBean.setRepositoryName("BoschRexroth_b42_prod"); String br_userid = br_sessionBean.getCurrentUserProfile(request).getUid(); topSetLogin(br_sessionBean.isLoggedIn(request)); // get a reference to the current object RepositoryEntry br_currentEntry = br_vipObjBean.getEntry("20539"); // Is the current user allowed to see this page? isAuthorized=false; if (br_currentEntry != null){ if (br_vipObjBean.isOnlineReadable(new StringValue("20539"))) isAuthorized=true; } else { unreadableOid=true; br_logger.debug("top.jsp: trying to get right from NULL entry: 20539, user: "+br_userid); } // until here JSE 2001-12-13 // caching RUl 2005/02/07 %> <%! static int cachingTimeEternal = -1; static int cachingTimeLong = 36000; static int cachingTimeShort = 1800; %> <% java.util.ResourceBundle imgResBundle; try { imgResBundle = java.util.ResourceBundle.getBundle ("img_wcm"); cachingTimeEternal = Integer.parseInt( imgResBundle.getString("img.wcm.oscache.timeEternal")); cachingTimeLong = Integer.parseInt( imgResBundle.getString("img.wcm.oscache.timeLong")); cachingTimeShort = Integer.parseInt( imgResBundle.getString("img.wcm.oscache.timeShort")); } catch( Exception mre) { br_logger.error( mre.getMessage() ); } br_logger.debug("oscache: timeShort="+cachingTimeShort+" timeLong="+cachingTimeLong+" timeEternal="+cachingTimeEternal); String cachingSession; String cachingScope; // for JDK1.4 use: // final String cachingParm = request.getQueryString()==null?"":java.net.URLEncoder.encode(request.getQueryString(),"UTF-8"); final String cachingParm = request.getQueryString()==null?"":java.net.URLEncoder.encode(request.getQueryString()); if( !br_sessionBean.isLoggedIn(request) && request.isRequestedSessionIdFromCookie()) { cachingSession = "cookie-"+cachingParm; cachingScope = "application"; } else { cachingSession = request.getSession(false).getId()+"-"+cachingParm; cachingScope = "session"; } // there are still problems with errorPage-handling after url-rewriting // find another solution outside gauss ... // errorPage="/{VIPSERVER}/{VIPSITE}/WebSite/utilities/error/error.jsp" %> <%! // define all oids we need in the code here, we think it's a good compromise: // easier to handle than property files, much nicer than hard coded ;-) static boolean top_LoggedIn = false; private void topSetLogin(boolean b){ top_LoggedIn = b; } final static String home_oid = "1"; // please never change this ... final static String countries_oid= "303"; static String asia_oid = PropertyFactory.getPropertyString( PropertyFactory.WEBSITE_PROPERTIES+"BoschRexroth", new Locale("en","EN"), "asia_oid" );//6921 static String hide_technology_icons = PropertyFactory.getPropertyString( PropertyFactory.WEBSITE_PROPERTIES+"BoschRexroth", new Locale("en","EN"), "hide_technology_icons" ); static String top_brlink = null; static String top_boschlink = null; static String top_3rdlink = null; static boolean remove_leftnavi = false; //disable objects from cache //used in method equalsExcludeFolder static String top_ex_folder = PropertyFactory.getPropertyString( PropertyFactory.WEBSITE_PROPERTIES+"BoschRexroth", new Locale("en","EN"), "exclude_folders" ); //used in method isCachingEnabled static String top_ex_templ = PropertyFactory.getPropertyString( PropertyFactory.WEBSITE_PROPERTIES+"BoschRexroth", new Locale("en","EN"), "exclude_templates" ); // for news & specials functions final static String news_prod_oid_en = "2227"; final static String news_general_oid_en = "2230"; final static String news_prod_oid_de = "389"; final static String news_general_oid_de = "642"; //final static String news_prod_oid_xx = "yyyy"; // replace xx with the language code, yyyy with the oid //final static String news_general_oid_xx = "yyyy"; // replace xx with the language code, yyyy with the oid // utility pages final static String language_oid = "282"; final static String search_oid = "1389"; final static String extendedSearch_oid = "1390"; final static String searchResult_oid = "1389"; final static String siteMap_oid = "973"; final static String contact_oid = "2401"; final static String contactConfirm_oid = "2403"; final static String contactError_oid = "2404"; //2003-01-08;AK;this string is used in home template for the arrow icon in the location box final static String salesNetwork_oid = "2520"; //cust_end final static String location_oid = "2520"; // images final static String pic_brc_active_oid = "224"; final static String pic_brc_passive_oid = "223"; final static String pic_bri_active_oid = "222"; final static String pic_bri_passive_oid = "221"; final static String pic_brl_active_oid = "226"; final static String pic_brl_passive_oid = "225"; final static String pic_brm_active_oid = "232"; final static String pic_brm_passive_oid = "231"; final static String pic_brp_active_oid = "228"; final static String pic_brp_passive_oid = "227"; final static String pic_brs_active_oid = "230"; final static String pic_brs_passive_oid = "229"; final static String pic_error_left_oid = "2354"; final static String pic_error_logo_oid = "2353"; final static String pic_kachel_oid = "219"; final static String pic_logo_oid = "220"; final static String pic_oben_contact_oid = "233"; final static String pic_oben_sales_oid = "234"; final static String pic_oben_search_oid = "235"; final static String pic_p_links_kl_oid = "236"; final static String pic_p_links_we_oid = "237"; final static String pic_p_rechts_bl_oid = "238"; final static String pic_p_rechts_kl_oid = "239"; final static String pic_p_rechts_kl_b_oid = "2326"; final static String pic_p_rechts_sw_oid = "2207"; final static String pic_p_rechts_we_oid = "240"; final static String pic_p_rechts_we_active_oid = "585"; final static String pic_p_rechts_we_b_oid = "2327"; final static String pic_p_unten_kl_oid = "241"; final static String pic_p_unten_kl_b_oid = "2328"; final static String pic_p_unten_sw_oid = "2208"; final static String pic_p_unten_we_oid = "242"; final static String pic_p_unten_we_b_oid = "2329"; final static String pic_pix_grey_oid = "2524"; final static String pic_print_header_oid = "2516"; final static String pic_top_oid = "514"; final static String pic_trenn_oid = "243"; final static String pic_unten_contact_oid = "244"; final static String pic_unten_sales_oid = "245"; final static String pic_unten_search_oid = "246"; final static String pic_weiss_oid = "247"; final static String pic_x_oid = "248"; // WWL: GSC 20.09.02 - added two images final static String kachel_background1_oid = "23199"; final static String kachel_background2_oid = "24046"; %> <%! // functions for navigation etc. private void printNode( HttpServletResponse response, JspWriter out, FlatContentNavigator nav, Node node, Hashtable previous, Hashtable showNoSitesNavigation, int level ) throws Exception { //aw 020723 performance enhancement - start Object langSelect = node.getAttribute("languageSelect"); Object visibleInNav = node.getAttribute("visibleInNavigation"); Object oid = node.getAttribute("oid"); Object type = node.getAttribute("type"); // check attributes for null if( langSelect == null ) langSelect = ""; if( visibleInNav == null ) visibleInNav = ""; //determine whether node is languageSelection and should be skipped boolean skip= ( ( langSelect.toString().equalsIgnoreCase("yes") ) || ( visibleInNav.toString().equalsIgnoreCase("skip") && !oid.toString().equals("1")) || showNoSitesNavigation.get(oid.toString()) != null ); //determine whether node is active boolean active = previous.get(oid.toString()) != null && ((String)previous.get(oid.toString())).equals("active"); // print only objects of type TJSP, THEME and ignore folders with visibleInNavigation = no String topTypeName = ""; //FIXME;2004-01-22;AK type can be java.lang.string try { topTypeName = (type != null ) ? ((ObjectType)type).getName() : ""; } catch ( Exception ex) { WCM.log("Method printNode in top.jsp" + ex.toString()); } if( ( topTypeName.equals(ObjectType.JSPTOPIC) || topTypeName.equals(ObjectType.TOPIC) ) && !visibleInNav.toString().equalsIgnoreCase("no") ) { //aw 020723 performance enhancement - end // select level if (level == 0 && !skip) { printHomePageLevel(response,out,nav,node); } else if (level == 1 && active && !skip) { printMainLevel(response,out,nav,node); } else if (level == 2 && !skip) { if ( active ) printFirstLevelActive(response,out,nav,node); else printFirstLevelNormal(response,out,nav,node); } else if (level==3 && !skip) { if ( active ) printSecondLevelActive(response,out,nav,node); else printSecondLevelNormal(response,out,nav,node); } else if (level==4 && !skip) { if ( active ) printThirdLevelActive(response,out,nav,node); else printThirdLevelNormal(response,out,nav,node); } Vector top_children = node.getChildren(); if( top_children == null ) top_children = new Vector(); if( active && top_children.size() > 1 || ( active && top_children.size() > 0 && !((ObjectType)((Node)top_children.firstElement()).getAttribute("type")).getName().equalsIgnoreCase(ObjectType.FORM)) ) { // if next level should be printed if( level==2 && !skip && hasDisplayableChildren(node) ) { printSecondLevelStart(out); } else if (level==3 && !skip && hasDisplayableChildren(node) ) { printThirdLevelStart(out); } if (!skip) level++; for( int i=0; i< top_children.size(); i++) { Node child = (Node)top_children.elementAt(i); if (child!=null) printNode(response, out, nav, child, previous, showNoSitesNavigation, level); } if (!skip) level --; if (level==3 && !skip && hasDisplayableChildren(node)) { printThirdLevelEnd(out); } if (level==2 && !skip && hasDisplayableChildren(node)) { printSecondLevelEnd(out); } } } } // print node private boolean hasDisplayableChildren(Node node) { Vector top_children = node.getChildren(); Node top_child = null; Object top_vin = null; Object top_type = null; // check for null or no childs if( top_children == null || top_children.size() == 0 ) { return false; } for( int i=0; i"); //out.println(""); out.println(" "); out.println(" "); out.println(""); } private void printSecondLevelStart(JspWriter out) throws Exception { out.println(""); out.println(" "); out.println(" "); out.println(" " ); } private void printThirdLevelStart(JspWriter out) throws Exception { out.println(" "); out.println(" "); // end aw 020903 out.println(""); // out.println("
"); out.println(" "); } private void printSecondLevelEnd(JspWriter out) throws Exception { // begin aw 020903 out.println("
"); } private void printThirdLevelEnd(JspWriter out) throws Exception { out.println(" "); out.println(" "); out.println(" "); // out.println(" "); } private void printHomePageLevel( HttpServletResponse response, JspWriter out, FlatContentNavigator nav, Node node ) throws Exception { String name = nav.getEncoder().encodeBlock( node.getAttribute("subtitle").toString(), ENCODE_SIMPLETEXT ); // jse 2003-09-29: if (top_boschlink != null) { if (top_boschlink.equals("")) top_boschlink = "www.bosch.com"; } else top_boschlink = "www.bosch.com"; // jse end // begin aw 020903 out.println(""); out.println(" "); out.println(" "); out.println(" "); out.println(" "+top_boschlink+""); out.println(""); out.println(""); out.println(" "); out.println(""); // end aw 020903 out.println(""); out.println(" "); out.println(" "); out.println(" "); // WWL: GSC 18.09.02 - changed css from liNavi to liNaviBold //out.println(" "+ name +""); if (top_brlink!=null && !top_brlink.equals("")) { out.println(" "+top_brlink+""); } else if (top_3rdlink!=null && !top_3rdlink.equals("")){ out.println(""+ name +""); } else { out.println(""+ name +""); } out.println(""); out.println(""); out.println(" "); out.println(""); if (top_3rdlink!=null && !top_3rdlink.equals("")) { String top_3rd_desc = top_3rdlink; String top_3rd_link = top_3rdlink; // parse string java.util.StringTokenizer top_3rdtoken = new java.util.StringTokenizer(top_3rdlink,";"); if (top_3rdtoken.countTokens() == 2){ top_3rd_desc = top_3rdtoken.nextToken(); top_3rd_link = top_3rdtoken.nextToken(); } try { int top_3rd_link_oid = Integer.parseInt(top_3rd_link); // we have a oid Node top_3rd_node = null; top_3rd_node = nav.getNode(String.valueOf(top_3rd_link_oid)); if (top_3rd_node != null) top_3rd_link = getUrl(nav,top_3rd_node); } catch (NumberFormatException e) { // leave it as it is ... } if (!top_3rd_link.startsWith("http://")) top_3rd_link = "http://"+top_3rd_link; out.println(""); out.println(" "); out.println(" "); out.println(" "); out.println(" "+top_3rd_desc+""); out.println(""); out.println(""); out.println(" "); out.println(""); } } private void printMainLevel( HttpServletResponse response, JspWriter out, FlatContentNavigator nav, Node node ) throws Exception { String top_br_img_link = ""; String top_br_img_oid = ""; boolean display_image = false; Object nameOfCompany = node.getAttribute("nameOfCompany"); String name = nav.getEncoder().encodeBlock( node.getAttribute("subtitle").toString(), ENCODE_SIMPLETEXT); //System.out.println("CLASS : " + nameOfCompany.getClass().getName().toString()); if (nameOfCompany!=null && (nameOfCompany instanceof de.gauss.lang.StringValue) && !nameOfCompany.equals("")){ java.util.StringTokenizer top_imgtoken = new java.util.StringTokenizer((String)nameOfCompany.toString(),";"); if (top_imgtoken.countTokens() == 2){ top_imgtoken.nextToken(); top_br_img_oid = top_imgtoken.nextToken(); } try { int tmp_oid = Integer.parseInt(top_br_img_oid); //we have a oid Node top_br_img_node = null; top_br_img_node = nav.getNode(String.valueOf(tmp_oid)); if (top_br_img_node != null) { top_br_img_link = getUrl(nav,top_br_img_node); display_image = true; } } catch (NumberFormatException e) { // leave it as it is ... display_image = false; } } if( nameOfCompany != null && nameOfCompany.toString().trim().length() >0 ) name = nav.getEncoder().encodeBlock(nameOfCompany.toString(), ENCODE_SIMPLETEXT); // begin aw 020903 if ( !display_image ){ out.println(""); out.println(""); out.println(""); } out.println(""); out.println(""); // WWL: GSC 19.09.02 - changed css from liNavi to liNaviBold_13 if (display_image) out.println(""); else out.println(""+ name +""); out.println(""); out.println(""); // WWL: GSC & DW - changed heigth from 9 to 5 out.println(" "); // end aw 020903 out.println(""); } private void printFirstLevelNormal( HttpServletResponse response, JspWriter out, FlatContentNavigator nav, Node node ) throws Exception { String name = nav.getEncoder().encodeBlock( node.getAttribute("subtitle").toString(), ENCODE_SIMPLETEXT); printSpacer(out); out.println(""); out.println(" "); out.println(" "); out.println(" "+ name +""); out.println(""); } private void printFirstLevelActive( HttpServletResponse response, JspWriter out, FlatContentNavigator nav, Node node ) throws Exception { String img = pic_p_rechts_we_active; if( hasDisplayableChildren(node) ) img = pic_p_unten_we; String name = nav.getEncoder().encodeBlock( node.getAttribute("subtitle").toString(), ENCODE_SIMPLETEXT ); printSpacer(out); out.println(""); out.println(" "); out.println(" "); out.println(" "+ name +""); out.println(""); } private void printSecondLevelNormal( HttpServletResponse response, JspWriter out, FlatContentNavigator nav, Node node ) throws Exception { String name = nav.getEncoder().encodeBlock( node.getAttribute("subtitle").toString(), ENCODE_SIMPLETEXT); out.println(" "); out.println(" "); out.println(" "); out.println(" "+name+""); out.println(" "); } private void printSecondLevelActive( HttpServletResponse response, JspWriter out, FlatContentNavigator nav, Node node) throws Exception { String img = pic_p_rechts_kl; if( hasDisplayableChildren(node) ) img = pic_p_unten_kl; String name = nav.getEncoder().encodeBlock( node.getAttribute("subtitle").toString(), ENCODE_SIMPLETEXT); out.println(" "); out.println(" "); out.println(" "); out.println(" "+ name +""); out.println(" "); } private void printThirdLevelNormal( HttpServletResponse response, JspWriter out, FlatContentNavigator nav, Node node ) throws Exception { String name = nav.getEncoder().encodeBlock( node.getAttribute("subtitle").toString(), ENCODE_SIMPLETEXT); out.println(" "); out.println(" "); out.println(" "); out.println(" "); out.println(" "+ name +""); out.println(" "); } private void printThirdLevelActive( HttpServletResponse response, JspWriter out, FlatContentNavigator nav, Node node ) throws Exception { String name = nav.getEncoder().encodeBlock( node.getAttribute("subtitle").toString(), ENCODE_SIMPLETEXT); out.println(" "); out.println(" "); out.println(" "); out.println(" "); out.println(" "+ name +""); out.println(" "); } private void printNavigationFour( HttpServletResponse response, JspWriter out, FlatContentNavigator nav, Node node, int level ) throws Exception { Vector children = null; Node child = null; Object top_type; Object top_vin; if (level==3) { children = node.getChildren(); } if (level==4 && node.getParent()!=null) { children = node.getParent().getChildren(); } if( children == null ) children = new Vector(); //2002-10-18;AK Object oid_n = node.getAttribute("oid"); //cuts_end for( int i=0; i"); out.println("
"); out.println(" "); out.println(" "+name+""); out.println(" "); out.println(""); } private void printFourthLevelActive( HttpServletResponse response, JspWriter out, FlatContentNavigator nav, Node node ) throws Exception { String name = nav.getEncoder().encodeBlock( node.getAttribute("subtitle").toString(), ENCODE_SIMPLETEXT); out.println(""); out.println("
"); out.println(" "); out.println(" "+name+""); out.println(" "); out.println(""); } private String getTarget(Node node) { String target = ""; // if node is a redirect-to-url-or-oid or redirect_to_oid_with_parameter if(node.getAttribute("template").toString().equals("572") || (node.getAttribute("template").toString().equals("5359"))) { try { Integer.parseInt(node.getAttribute("special01").toString()); } catch (NumberFormatException e) { // 2002/02/20 IMG/RUl: added possibility for http-links in internal window if( (node.getAttribute("special02").toString()).equals("")) target = " target=\"extern\" "; } } return target; } private String getUrl(FlatContentNavigator nav, Node node) throws Exception { //return ("/"+nav.getCmsBackend().getVipObjHandlerBean().getRelativeUrl("1",nav.getCmsBackend().getVipObjHandlerBean().getEntry(node.getAttribute("oid").toString()))); //return (nav.getCmsBackend().getVipObjHandlerBean().getUrl(node.getAttribute("oid").toString()); return node.getAttribute("url").toString(); } private String getUrl(FlatContentNavigator nav, Tree tree, String oid) throws Exception { //return ("/"+nav.getCmsBackend().getVipObjHandlerBean().getRelativeUrl("1",nav.getCmsBackend().getVipObjHandlerBean().getEntry(oid))); Node node = tree.getNode(oid); if (node == null) { node = nav.getNode(oid); } return ( (node!=null) ? node.getAttribute("url").toString() : ""); } // 03/05/07 RUl: really ugly workaround since gauss always returns non-SSL urls private String getUrl(FlatContentNavigator nav, Tree tree, String oid, boolean setSecure) throws Exception { String theUrl = getUrl( nav, tree, oid); if (setSecure && theUrl.startsWith("http://")){ theUrl = GaussHelper.getUrlWithoutPort80(theUrl); theUrl = "https"+theUrl.substring(4); } return theUrl; } %> <%! // functions for generation news and specials //function to get the latest news of the whole sub tree private Vector getLatestNews( Node news, Tree tree, FlatContentNavigator nav, String bunit ) throws Exception { Vector news_list = new Vector(); //get oids depending from the Locale String prod_oid = news_prod_oid_en; String general_oid = news_general_oid_en; if( nav.getCurrentLocale().equals(Locale.GERMANY) || nav.getCurrentLocale().equals(Locale.GERMAN)) { prod_oid = news_prod_oid_de; general_oid = news_general_oid_de; } /* add new block when introducing a new language else if (nav.getCurrentLocale().equals(Locale.COUNTRY || nav.getCurrentLocale().equals(Locale.LANGUAGE)) { prod_oid = news_prod_oid_xx; general_oid = news_general_oid_xx; } */ //get all news from my own news area if( news != null ) { news_list = news.getAllChildrenForEditSorted(-1); } //if news_list empty and business unit, get news from the product information (corporate) if( news_list.isEmpty() && bunit != null ) { Node product_node = tree.getNode(prod_oid); if( product_node != null ) { Node bunit_node = product_node.getFirstChild(bunit); if( bunit_node != null ) { news_list = bunit_node.getAllChildrenForEditSorted(1); } //if empty get from general news if( news_list.isEmpty() ) { Node general_node = tree.getNode(general_oid); if (general_node != null) { news_list = general_node.getAllChildrenForEditSorted(1); } } } } return news_list; } // function to get all news of my children, if nothing of my sisters private Vector getMyNews (Node news) throws Exception { Vector news_list = new Vector(); if (news != null) { //get children news_list = news.getAllChildrenForEditSorted(1); //if empty get children of my parent (sisters) if (news_list.isEmpty() && news.getParent() != null) { news_list = news.getParent().getAllChildrenForEditSorted(1); //remove myself if (news_list.contains(news)) { news_list.remove(news); } } } return news_list; } //function to get the latest news of the whole sub tree private Element getFromCorporate( String id, Tree tree, FlatContentNavigator nav ) throws Exception { //try to get corporate area Node cor_node = tree.getRoot().getFirstChild("corporate"); if (cor_node != null) { Node lang_node = cor_node.getFirstChild(nav.getCurrentLocale().getLanguage()); if (lang_node != null) { Node xml_node = lang_node.getFirstXml(); if (xml_node != null) { ContentDocument xml_content = nav.getContent(xml_node.getAttribute("oid").toString()); if (xml_content != null) { return getElement(id, xml_content); } } } } return null; } // function to get the title of a xml file private String getTitle( Node xml_node, FlatContentNavigator nav ) throws Exception { if (xml_node != null) { Object oid = xml_node.getAttribute("oid"); if( oid != null) { ContentDocument xml_content = nav.getContent(oid.toString()); if (xml_content != null) { Element xml_element = getElement("subtitle", xml_content); if ( xml_element != null && xml_element.getItems().size() > 0) { return xml_element.getItem(xml_element.getId() + "_1").getValue(); } } } } return ""; } // date formatter for parsing // since the attribute "special02" should (must) always be given using german date conventions, // we do not have to create a new instance each time we parse "special02" // we use an instance for Locale.GERMAN rather than Locale.GERMANY, // because Austria, Germany and Switzerland all use similar date conventions private static java.text.DateFormat date_format_parse = java.text.DateFormat.getDateInstance(java.text.DateFormat.SHORT, Locale.GERMAN); // function to get the date-released of a node private String getDateReleased( Node cur_node, FlatContentNavigator nav ) throws Exception { // date formatter for printing java.text.DateFormat date_format_print = java.text.DateFormat.getDateInstance(java.text.DateFormat.SHORT, nav.getCurrentLocale()); Date date = new Date(); if( cur_node != null) { //check special02 Object special02 = cur_node.getAttribute("special02"); if( ( special02 != null) && !special02.toString().equals("") ) { try { date = date_format_parse.parse( special02.toString() ); } catch (Exception ex) { WCM.log("Error while parsing date from \"special02\" in top::getDateReleased:\n"); WCM.log(ex.getLocalizedMessage()); } } else { //check date-released Object dateReleased = cur_node.getAttribute("date-released"); if( dateReleased != null && (dateReleased instanceof de.gauss.lang.DateValue) && ((de.gauss.lang.DateValue) dateReleased ).getDate() != null) { date = ((de.gauss.lang.DateValue) dateReleased ).getDate(); } } } return date_format_print.format(date); } //function to get a element with a special id of a content document private Element getElement(String id, ContentDocument content) throws Exception { if (id != null && content != null) { Iterator content_it = content.getElements().iterator(); while ( content_it.hasNext() ) { Object handle = content_it.next(); if (handle.getClass().equals(Element.class)) { Element xml_element = (Element)handle; if (xml_element.getId().equals(id)) { return xml_element; } } } } return null; } private boolean equalsHideTechnologyIcons(String oid) throws Exception { boolean result = false; if ( oid != null ){ java.util.StringTokenizer st = new java.util.StringTokenizer(hide_technology_icons,","); while (st.hasMoreTokens()) { if(st.nextToken().equals(oid)){ result = true; break; } } } return result; } private boolean equalsExcludeFolder(String oid) throws Exception { boolean result = false; if ( oid != null ){ java.util.StringTokenizer ex_folder_token = new java.util.StringTokenizer(top_ex_folder,","); while (ex_folder_token.hasMoreTokens()) { if(ex_folder_token.nextToken().equals(oid)){ result = true; break; } } } return result; } //function to get a the templates which should be not cached, e.g. various private boolean isCachingEnabled(Node node) throws Exception { try { //returns true if node should be cached. boolean result = true; //check whether object is underneath a folder which should not be cached, e.g various boolean top_underneath_folder = false; for (Node i = node; i != null && result; i = i.getParent()) { String top_check_var = i.getAttribute("oid").toString(); if (top_check_var != null && equalsExcludeFolder(top_check_var)) { result = false; break; } } //check whether the object is based on a template which should not be cached, e.g. flex_form if (result) { String oid = node.getAttribute("template").toString(); if (oid != null) { java.util.StringTokenizer ex_templ_token = new java.util.StringTokenizer(top_ex_templ,","); while (ex_templ_token.hasMoreTokens()) { if(ex_templ_token.nextToken().equals(oid)) { result = false; break; } } } } return result; } catch (Exception e) { WCM.log("top.jsp: Error in template top.jsp, method isCachingEnabled \n"); WCM.log(e.getLocalizedMessage()); return false; } } %> <%! // static variables for encoder public final static String ENCODE_SIMPLETEXT = "SIMPLE2HTML"; public final static String ENCODE_CONTINUOUSTEXT = "CONTINUOUS2HTML"; private DefaultEncoder dEncoder = new DefaultEncoder(); %> <% // Determine current position in Gauss VIP String oid = "20539"; String webSite = "BoschRexroth"; String serverTyp = "PortalManager_b42"; String link_oid = oid; if( request.getParameter("oid") != null ) { //aw !! THINK ABOUT CHECKING THE PARAMETER !! link_oid = request.getParameter("oid"); link_oid = dEncoder.canonicalize(link_oid,true); } // get navigator FlatContentNavigator nav = WCM.getFlatContentNavigator( request , "BoschRexroth_b42_prod" ); //get encoder, encoder has two modi: for simple and continuous Text String encodeClass = "de.wwl.wcm.encode.RexrothContentEncoder"; //WWL: GSC & CSZ 01.08.02 - additional Parameter request in call of method //Encoder encoder = WCM.retrieveEncoder(encodeClass); Encoder encoder = WCM.retrieveEncoder(request, encodeClass); nav.setEncoder(encoder); // 020806 RUl/IMG final boolean isProdSystem = nav.getCmsBackend().getServer().equals( de.gauss.vip.api.admin.DeploymentSystem.TYPE_PROD); Tree tree = null; Node node = null; // jse bugfix if (unreadableOid) { // most likely due to missing permissions or bogus input oid = loginWall; link_oid=oid; } tree = nav.getTree(); session.putValue( "staticTree", "true"); node = tree.getNode(oid); // if node is still null, this is for viewing templates only, because they are in a folder visibleInNavigation = no if( node == null ) node = nav.getNode(oid); // if node is still null, eg. deleted Pages if (node == null) { node=tree.getRoot(); response.sendRedirect(response.encodeRedirectUrl(getUrl(nav,tree,home_oid))); } // check if page is underneath various directory //boolean top_underneath_var = false; //for (Node i = node; i != null && !top_underneath_var; i = i.getParent()){ //String top_check_var = i.getAttribute("oid").toString(); //if (top_check_var != null && ( top_check_var.equals("2619") || top_check_var.equals("64929") )){ //2619=various; 64929=business_units/bri/Power_Unit //top_underneath_var = true; //} //} //check if page is based on a flexform template //if(!top_underneath_var) { //String flexform_template_oid = node.getAttribute("template").toString(); //if (flexform_template_oid.equals("7536") || flexform_template_oid.equals("116194")) //tempalte flex_form_internet,flex_form_internet_order //top_underneath_var = true; //} //if (!br_sessionBean.isLoggedIn(request) && !top_underneath_var){ //long now = System.currentTimeMillis(); //response.setDateHeader("Expires", now + 60000); //} boolean isCachingEnabled = isCachingEnabled(node); if (!br_sessionBean.isLoggedIn(request) && isCachingEnabled){ long now = System.currentTimeMillis(); response.setDateHeader("Expires", now + 60000); } //templates are not put in the tree (so there are no parents) because of infinite loops in gauss boolean isTemplate = false; if( node.getParent()==null ) isTemplate = true; // build vector with hashmaps containing the oid and special24 from node // to root /* andrknob, 05.03.2002; modification */ // remember node to switch back after determine-position loop Node remember = node; if( request.getParameter("oid") != null ) { String origin = request.getParameter("oid"); origin = dEncoder.canonicalize(origin,true); Node originNode = tree.getNode(origin); if( originNode != null ) { node = originNode; } isTemplate = false; } //andrknob; end modification // if((node.getAttribute("special19").toString() != null) && node.getAttribute("special19").toString().trim().equals("yes")) remove_leftnavi=true; boolean isInSites = false; boolean isInBri = false; boolean isInBrc = false; boolean isInBrl = false; boolean isInBrm = false; boolean isInBrs = false; boolean isInBrp = false; //2003-01-21;AK; added for GUSS boolean isInBrpb_guss = false; boolean isInAddCountry = false; //AK;cust_end //2005-11-17;AK; added for Asia css boolean isInAsia = false; boolean isInHideTechnologyIcons = false; //AK;cust_end Node parent = node; // find out if page is member of tree "Sites worldwide" or "Bri" or "Brs", others are to be added later // and determine company-Name for title-tag // and determine news area // and determine name of the business unit // and make automatic language-switch String title_tag = ""; Node news = null; String bunit = null; // begin aw 020903 // get path of navconf.xml from navigation.properties - key 'navconf_oid' String navXmlOid = PropertyFactory.getPropertyString( PropertyFactory.WEBSITE_PROPERTIES +nav.getCmsBackend().getWebsite(), nav.getCurrentLocale(), "navconf_oid" ); //2003-02-03;AK;workaround, can be deleted after new property file was deployed and resen restarted if ( (navXmlOid == null) || ( navXmlOid.toString().trim().equals("not defined" ) )) { navXmlOid = "24049"; System.err.println( "########### awnav oid: " + navXmlOid); } //System.err.println( " awnav oid: " + navXmlOid); //get corporate-values for unit-dependent configurable elements - these may be overridden later by cu- and bu-spefic values // RUl/IMG 030219 //Node navXml = tree.getNode(navXmlOid.trim()); //navConfig.init( navXml.getAttribute("pathname").toString(), nav.getCurrentLocale() ); navConfig.init( br_vipObjBean.getAttribute(br_vipObjBean.getEntry(navXmlOid.trim()),new StringValue("pathname")).toString(), nav.getCurrentLocale() ); navConfig.setReturnMode( NavLocalizerBean.RM_NOTFOUND_GENERAL ); List bri_oids = navConfig.getHighlightOids("", NavLocalizerBean.UNIT_TYPE_CORP, NavLocalizerBean.BRI); List brs_oids = navConfig.getHighlightOids("", NavLocalizerBean.UNIT_TYPE_CORP, NavLocalizerBean.BRS); List brp_oids = navConfig.getHighlightOids("", NavLocalizerBean.UNIT_TYPE_CORP, NavLocalizerBean.BRP); List brm_oids = navConfig.getHighlightOids("", NavLocalizerBean.UNIT_TYPE_CORP, NavLocalizerBean.BRM); List brl_oids = navConfig.getHighlightOids("", NavLocalizerBean.UNIT_TYPE_CORP, NavLocalizerBean.BRL); List brc_oids = navConfig.getHighlightOids("", NavLocalizerBean.UNIT_TYPE_CORP, NavLocalizerBean.BRC); List brpb_guss_oids = navConfig.getHighlightOids("", NavLocalizerBean.UNIT_TYPE_CORP, NavLocalizerBean.BRPB_GUSS); String bri_oid = navConfig.getBusinessUnitOid("", NavLocalizerBean.UNIT_TYPE_CORP, NavLocalizerBean.BRI); String brs_oid = navConfig.getBusinessUnitOid("", NavLocalizerBean.UNIT_TYPE_CORP, NavLocalizerBean.BRS); String brm_oid = navConfig.getBusinessUnitOid("", NavLocalizerBean.UNIT_TYPE_CORP, NavLocalizerBean.BRM); String brp_oid = navConfig.getBusinessUnitOid("", NavLocalizerBean.UNIT_TYPE_CORP, NavLocalizerBean.BRP); String brl_oid = navConfig.getBusinessUnitOid("", NavLocalizerBean.UNIT_TYPE_CORP, NavLocalizerBean.BRL); String brc_oid = navConfig.getBusinessUnitOid("", NavLocalizerBean.UNIT_TYPE_CORP, NavLocalizerBean.BRC); String impressum_oid = navConfig.getImpressumOid("", NavLocalizerBean.UNIT_TYPE_CORP); List functions = navConfig.getFunctions("", NavLocalizerBean.UNIT_TYPE_CORP); String help_oid = navConfig.getHelpOid("", NavLocalizerBean.UNIT_TYPE_CORP); String topNavLinkOid = navConfig.getTopnavOid(""); // end aw 020903 // aw 020903 begin String nparentOid=null; String parentName=null; navConfig.setReturnMode(NavLocalizerBean.RM_NOTFOUND_NULL); String theBU = ""; String theCU = ""; String theComeFromCU=""; String theComeFromBU=""; String pageApplication = null; // jse: logout_target is the oid of a CU or BU to redirect to after logout String top_logout_target=""; String top_last_logout_target=""; String skipTopNav = "n"; String theHideTopNav; //yes: hide top navi; no: delete session attribute String theHideLeftNav; //yes: hide left navi; no: delete session attribute ArrayList availableLanguages = new ArrayList(); Object o =request.getSession().getAttribute( GaussHelper.COMEFROM_CU); if( o != null) theComeFromCU=(String)o; o = request.getSession().getAttribute( GaussHelper.COMEFROM_BU); if( o != null) theComeFromBU=(String)o; o = request.getSession().getAttribute("top_logout_target"); if( o != null) top_last_logout_target=(String)o; theHideTopNav = request.getParameter(GaussHelper.SESSION_HIDE_TOPNAVI); theHideTopNav = dEncoder.canonicalize(theHideTopNav,true); if (theHideTopNav == null){ o =request.getSession().getAttribute(GaussHelper.SESSION_HIDE_TOPNAVI); if( o != null){ theHideTopNav=(String)o; theHideTopNav = dEncoder.canonicalize(theHideTopNav,true); } } else if (theHideTopNav.equals("yes")) request.getSession().setAttribute(GaussHelper.SESSION_HIDE_TOPNAVI, "yes"); else if (theHideTopNav.equals("no")) request.getSession().removeAttribute(GaussHelper.SESSION_HIDE_TOPNAVI); theHideLeftNav = request.getParameter(GaussHelper.SESSION_HIDE_LEFTNAVI); theHideLeftNav = dEncoder.canonicalize(theHideLeftNav,true); if (theHideLeftNav == null){ o =request.getSession().getAttribute(GaussHelper.SESSION_HIDE_LEFTNAVI); if( o != null){ theHideLeftNav=(String)o; theHideLeftNav = dEncoder.canonicalize(theHideLeftNav,true); } } else if (theHideLeftNav.equals("yes")) request.getSession().setAttribute(GaussHelper.SESSION_HIDE_LEFTNAVI, "yes"); else if (theHideLeftNav.equals("no")) request.getSession().removeAttribute(GaussHelper.SESSION_HIDE_LEFTNAVI); // overwrite highlight-oids in case there is a unit specific highlight-list Node top_n = node; while (top_n !=null && !top_n.getAttribute("oid").toString().equals(home_oid)) { nparentOid=top_n.getAttribute("oid").toString(); if (navConfig.getHighlightOids(nparentOid, NavLocalizerBean.UNIT_TYPE_CU, NavLocalizerBean.BRI)!=null) { bri_oids=navConfig.getHighlightOids(nparentOid, NavLocalizerBean.UNIT_TYPE_CU, NavLocalizerBean.BRI); } if (navConfig.getHighlightOids(nparentOid, NavLocalizerBean.UNIT_TYPE_CU, NavLocalizerBean.BRS)!=null) { brs_oids=navConfig.getHighlightOids(nparentOid, NavLocalizerBean.UNIT_TYPE_CU, NavLocalizerBean.BRS); } if (navConfig.getHighlightOids(nparentOid, NavLocalizerBean.UNIT_TYPE_CU, NavLocalizerBean.BRM)!=null) { brm_oids=navConfig.getHighlightOids(nparentOid, NavLocalizerBean.UNIT_TYPE_CU, NavLocalizerBean.BRM); } if (navConfig.getHighlightOids(nparentOid, NavLocalizerBean.UNIT_TYPE_CU, NavLocalizerBean.BRP)!=null) { brp_oids=navConfig.getHighlightOids(nparentOid, NavLocalizerBean.UNIT_TYPE_CU, NavLocalizerBean.BRP); } if (navConfig.getHighlightOids(nparentOid, NavLocalizerBean.UNIT_TYPE_CU, NavLocalizerBean.BRL)!=null) { brl_oids=navConfig.getHighlightOids(nparentOid, NavLocalizerBean.UNIT_TYPE_CU, NavLocalizerBean.BRL); } if (navConfig.getHighlightOids(nparentOid, NavLocalizerBean.UNIT_TYPE_CU, NavLocalizerBean.BRC)!=null) { brc_oids=navConfig.getHighlightOids(nparentOid, NavLocalizerBean.UNIT_TYPE_CU, NavLocalizerBean.BRC); } top_n=top_n.getParent(); } while( parent != null && !parent.getAttribute("oid").toString().equals(home_oid) ) { Object _parent_oid = parent.getAttribute("oid"); Object _parent_title = parent.getAttribute("title"); Object _parent_subtitle = parent.getAttribute("subtitle"); Object _parent_langSelect = parent.getAttribute("languageselect"); // is page part of country unit ? if( _parent_oid.toString().equals(countries_oid) ) { isInSites = true; } // is page part of asia country units ? if( _parent_oid.toString().equals(asia_oid) ) { isInAsia = true; } if( equalsHideTechnologyIcons(_parent_oid.toString())) isInHideTechnologyIcons = true; /* BUSINESS UNITS Modification wwl_csz 02.-05.02.2002 */ // overwrite oid of default in case there is a unit specific bu-link if (navConfig.getBusinessUnitOid(_parent_oid.toString(), NavLocalizerBean.UNIT_TYPE_CU, NavLocalizerBean.BRI)!=null) { bri_oid=navConfig.getBusinessUnitOid(_parent_oid.toString(), NavLocalizerBean.UNIT_TYPE_CU, NavLocalizerBean.BRI); } if (navConfig.getBusinessUnitOid(_parent_oid.toString(), NavLocalizerBean.UNIT_TYPE_CU, NavLocalizerBean.BRS)!=null) { brs_oid=navConfig.getBusinessUnitOid(_parent_oid.toString(), NavLocalizerBean.UNIT_TYPE_CU, NavLocalizerBean.BRS); } if (navConfig.getBusinessUnitOid(_parent_oid.toString(), NavLocalizerBean.UNIT_TYPE_CU, NavLocalizerBean.BRM)!=null) { brm_oid=navConfig.getBusinessUnitOid(_parent_oid.toString(), NavLocalizerBean.UNIT_TYPE_CU, NavLocalizerBean.BRM); } if (navConfig.getBusinessUnitOid(_parent_oid.toString(), NavLocalizerBean.UNIT_TYPE_CU, NavLocalizerBean.BRP)!=null) { brp_oid=navConfig.getBusinessUnitOid(_parent_oid.toString(), NavLocalizerBean.UNIT_TYPE_CU, NavLocalizerBean.BRP); } if (navConfig.getBusinessUnitOid(_parent_oid.toString(), NavLocalizerBean.UNIT_TYPE_CU, NavLocalizerBean.BRL)!=null) { brl_oid=navConfig.getBusinessUnitOid(_parent_oid.toString(), NavLocalizerBean.UNIT_TYPE_CU, NavLocalizerBean.BRL); } if (navConfig.getBusinessUnitOid(_parent_oid.toString(), NavLocalizerBean.UNIT_TYPE_CU, NavLocalizerBean.BRC)!=null) { brc_oid=navConfig.getBusinessUnitOid(_parent_oid.toString(), NavLocalizerBean.UNIT_TYPE_CU, NavLocalizerBean.BRC); } if (navConfig.getSpecialTopnavOid(_parent_oid.toString())!=null) topNavLinkOid = navConfig.getSpecialTopnavOid(_parent_oid.toString()); // overwrite help, impressum and functions if there is specific information if (navConfig.getHelpOid(_parent_oid.toString(), NavLocalizerBean.UNIT_TYPE_CU)!=null) { help_oid=navConfig.getHelpOid(_parent_oid.toString(), NavLocalizerBean.UNIT_TYPE_CU); } if (navConfig.getImpressumOid(_parent_oid.toString(), NavLocalizerBean.UNIT_TYPE_CU)!=null) { impressum_oid=navConfig.getImpressumOid(_parent_oid.toString(), NavLocalizerBean.UNIT_TYPE_CU); } if (navConfig.getFunctions(_parent_oid.toString(), NavLocalizerBean.UNIT_TYPE_CORP)!=null) { functions=navConfig.getFunctions(_parent_oid.toString(), NavLocalizerBean.UNIT_TYPE_CU); } // is page part of a business unit ? for (int i=0; i < bri_oids.size(); i++) { if( _parent_oid.toString().equals(bri_oids.get(i))) { isInBri = true; bunit = _parent_title.toString(); theBU = NavLocalizerBean.BRI; top_logout_target = _parent_oid.toString(); } } for (int i=0; i < brs_oids.size(); i++) { if ( _parent_oid.toString().equals(brs_oids.get(i))) { isInBrs = true; bunit = _parent_title.toString(); theBU = NavLocalizerBean.BRS; top_logout_target = _parent_oid.toString(); } } for (int i=0; i < brm_oids.size(); i++) { if ( _parent_oid.toString().equals(brm_oids.get(i))) { isInBrm = true; bunit = _parent_title.toString(); theBU = NavLocalizerBean.BRM; top_logout_target = _parent_oid.toString(); } } for (int i=0; i < brp_oids.size(); i++) { if ( _parent_oid.toString().equals(brp_oids.get(i))) { isInBrp = true; bunit = _parent_title.toString(); theBU = NavLocalizerBean.BRP; top_logout_target = _parent_oid.toString(); } } for (int i=0; i < brl_oids.size(); i++) { if ( _parent_oid.toString().equals(brl_oids.get(i))) { isInBrl = true; bunit = _parent_title.toString(); theBU = NavLocalizerBean.BRL; top_logout_target = _parent_oid.toString(); } } for (int i=0; i < brc_oids.size(); i++) { if ( _parent_oid.toString().equals(brc_oids.get(i))) { isInBrc = true; bunit = _parent_title.toString(); theBU = NavLocalizerBean.BRC; top_logout_target = _parent_oid.toString(); } } //2003-01-21;AK;Guss for (int i=0; i < brpb_guss_oids.size(); i++) { if ( _parent_oid.toString().equals(brpb_guss_oids.get(i))) { isInBrpb_guss = true; bunit = _parent_title.toString(); theBU = NavLocalizerBean.BRPB_GUSS; top_logout_target = _parent_oid.toString(); } } //AK;cust_end /* end of BUSINESS UNITS Modification wwl_csz 02.-05.02.2002 */ // title-tag: find node languageSelect, show subtitle or nameOfCompany of it's parent if( _parent_langSelect != null && _parent_langSelect.toString().equalsIgnoreCase("yes")) { // cu top_logout_target = _parent_oid.toString(); //title_tag final Node theParent = parent.getParent(); Object _parent_parent_nameOfCompany = null; Object _parent_nameOfCompany = parent.getAttribute("nameOfCompany"); if( theParent != null) { title_tag = nav.getEncoder().encodeBlock(theParent.getAttribute("subtitle").toString(), ENCODE_SIMPLETEXT); _parent_parent_nameOfCompany = theParent.getAttribute("nameOfCompany"); } if( title_tag != null) theCU = title_tag.toLowerCase(); java.util.StringTokenizer tmp_top_imgtoken = null; if( ( _parent_parent_nameOfCompany != null && _parent_parent_nameOfCompany.toString().trim().length() >0 ) && ( _parent_nameOfCompany != null && _parent_nameOfCompany.toString().trim().length() >0 )) { tmp_top_imgtoken = new java.util.StringTokenizer((String)_parent_nameOfCompany.toString(),";"); if (tmp_top_imgtoken.countTokens() == 2) title_tag = tmp_top_imgtoken.nextToken(); else title_tag = nav.getEncoder().encodeBlock( _parent_nameOfCompany.toString(), ENCODE_SIMPLETEXT); } else if( ( _parent_parent_nameOfCompany != null && _parent_parent_nameOfCompany.toString().trim().length() >0 ) && ( _parent_nameOfCompany == null || ( (_parent_nameOfCompany != null) &&_parent_nameOfCompany.toString().trim().length()==0 ))) { tmp_top_imgtoken = new java.util.StringTokenizer((String)_parent_parent_nameOfCompany.toString(),";"); if (tmp_top_imgtoken.countTokens() == 2) title_tag = tmp_top_imgtoken.nextToken(); else title_tag = nav.getEncoder().encodeBlock( _parent_parent_nameOfCompany.toString(), ENCODE_SIMPLETEXT); } //news area news = parent.getFirstChild("news"); } else if ( title_tag.length() == 0 ) title_tag = _parent_subtitle.toString(); //2003-01-21;AK;if clause improved if ( _parent_langSelect != null && _parent_langSelect.toString().equalsIgnoreCase("yes") && _parent_title != null ) { // switch navigation-language to de if it's a German Page if ( _parent_title.toString().equalsIgnoreCase("de")) { nav.setCurrentLocale(Locale.GERMANY); } // switch navigation-language to en if it's an English Page else if ( _parent_title.toString().equalsIgnoreCase("en")) { nav.setCurrentLocale(Locale.US); } // languages added 02/02/18 IMG/RUl // switch navigation-language to it if it's an Italian Page else if ( _parent_title.toString().equalsIgnoreCase("it")) { nav.setCurrentLocale(Locale.ITALY); } // switch navigation-language to es if it's an Spanish Page else if ( _parent_title.toString().equalsIgnoreCase("es")) { nav.setCurrentLocale( new Locale("es","ES") ); } // switch navigation-language to es if it's an Polen Page else if ( _parent_title.toString().equalsIgnoreCase("pl")) { nav.setCurrentLocale( new Locale("pl","PL") ); } // switch navigation-language to es if it's an russian Page else if ( _parent_title.toString().equalsIgnoreCase("ru")) { nav.setCurrentLocale( new Locale("ru","RU") ); } // switch navigation-language to es if it's an Tschechien Page else if ( _parent_title.toString().equalsIgnoreCase("cs")) { nav.setCurrentLocale( new Locale("cs","CZ") ); } // switch navigation-language to es if it's an Ungarn Page else if ( _parent_title.toString().equalsIgnoreCase("hu")) { nav.setCurrentLocale( new Locale("hu","HU") ); } // switch navigation-language to es if it's an french Page else if ( _parent_title.toString().equalsIgnoreCase("fr")) { nav.setCurrentLocale( new Locale("fr","FR") ); } // switch navigation-language to es if it's an Japan Page else if ( _parent_title.toString().equalsIgnoreCase("ja")) { nav.setCurrentLocale( new Locale("ja","JP") ); } // switch navigation-language to es if it's an chinese Page else if ( _parent_title.toString().equalsIgnoreCase("zh")) { nav.setCurrentLocale( new Locale("zh","CN") ); } // switch navigation-language to es if it's an Finnland Page else if ( _parent_title.toString().equalsIgnoreCase("fi")) { nav.setCurrentLocale( new Locale("fi","FI") ); } // switch navigation-language to es if it's an Niederlande Page else if ( _parent_title.toString().equalsIgnoreCase("nl")) { nav.setCurrentLocale( new Locale("nl","NL") ); } // switch navigation-language to es if it's an Portugal Page else if ( _parent_title.toString().equalsIgnoreCase("pt")) { nav.setCurrentLocale( new Locale("pt","PT") ); } // switch navigation-language to es if it's an swedish Page else if ( _parent_title.toString().equalsIgnoreCase("sv")) { nav.setCurrentLocale( new Locale("sv","SE") ); } // switch navigation-language to no if it's an norwegian Page else if ( _parent_title.toString().equalsIgnoreCase("no")) { nav.setCurrentLocale( new Locale("no","NO") ); } // switch navigation-language to no if it's an danish Page else if ( _parent_title.toString().equalsIgnoreCase("da")) { nav.setCurrentLocale( new Locale("da","DK") ); } // switch navigation-language to no if it's an greek Page else if ( _parent_title.toString().equalsIgnoreCase("el")) { nav.setCurrentLocale( new Locale("el","GR") ); } // switch navigation-language to no if it's an turkish Page else if ( _parent_title.toString().equalsIgnoreCase("tr")) { nav.setCurrentLocale( new Locale("tr","TR") ); } // switch navigation-language to no if it's an korean Page else if ( _parent_title.toString().equalsIgnoreCase("ko")) { nav.setCurrentLocale( new Locale("ko","KR") ); } // ADD OTHER languages if necessary availableLanguages.add( _parent_title.toString().toLowerCase() ); } //language if clause; cust_end AK if( pageApplication == null) { pageApplication = parent.getAttribute( "special42").toString(); if( pageApplication.length() == 0) pageApplication = null; } final String tempCU = parent.getAttribute( "special44").toString(); if( tempCU != null && tempCU.length()>0) theCU = tempCU; parent=parent.getParent(); } String theOKey = "BoschRexroth-20539-"+cachingSession+"_"+nav.getCurrentLocale().toString()+theHideTopNav+theHideLeftNav+"-t"; br_logger.debug("oscache: scope="+cachingScope+" session="+cachingSession+" key=["+theOKey+"]"); navConfig.setLocale( nav.getCurrentLocale()); /*andrknob; 5.03.2002; modification*/ // this is for utility pages like "help" etc. // after determining position of "origin" : reset node back to "remember" node = remember; //andrknob; end of modification //------------------------------------------------------ //2005-09-23-andrknob; Object _node_subtitle = node.getAttribute("subtitle"); Object _node_langSelect = node.getAttribute("languageselect"); String top_keywords = node.getAttribute("keywords").toString().replace('"',' '); title_tag = title_tag.replaceAll("
",""); if( (_node_langSelect != null) && !_node_langSelect.toString().equalsIgnoreCase("yes") ){ if( (_node_subtitle != null) && (_node_subtitle.toString() != null) ){ title_tag = title_tag + " - " + _node_subtitle.toString(); } } if( (top_keywords != null) && (top_keywords.toString().trim().length() > 0) ) title_tag = title_tag + " - " + top_keywords; //2005-09-23-andrknob; cust_end //------------------------------------------------------ Vector children = node.getChildren(); Node xmlNode = node.getFirstXml(); ContentDocument content = null; // get all URLs of Folder Utilities of Gauss String languageURL = getUrl(nav,tree,language_oid); String helpURL = getUrl(nav,tree,help_oid); String impressumURL = getUrl(nav,tree,impressum_oid); String searchURL = getUrl(nav,tree,search_oid); String extendedSearchURL = getUrl(nav,tree,extendedSearch_oid); String searchResultURL = getUrl(nav,tree,searchResult_oid); String siteMapURL = getUrl(nav,tree,siteMap_oid); String contactURL = getUrl(nav,tree,contact_oid); String contactConfirmURL = getUrl(nav,tree,contactConfirm_oid); String contactErrorURL = getUrl(nav,tree,contactError_oid); String salesNetworkURL = getUrl(nav,tree,salesNetwork_oid); String locationURL = getUrl(nav,tree,location_oid); // define urls of business units used in navigation_top String homeURL = getUrl(nav,tree,home_oid); /* String briURL = getUrl(nav,tree,bri_oid); String brsURL = getUrl(nav,tree,brs_oid); String brpURL = getUrl(nav,tree,brp_oid); String brmURL = getUrl(nav,tree,brm_oid); String brlURL = getUrl(nav,tree,brl_oid); String brcURL = getUrl(nav,tree,brc_oid); */ String briURL = getUrl(nav,tree, topNavLinkOid); String brsURL = briURL; String brpURL = briURL; String brmURL = briURL; String brlURL = briURL; String brcURL = briURL; %> <%! // define pictures as static variables so they can be accessed by functions as well // if there is a change in url, they will be updated automatically ... String blankURL = ""; String pic_brc_active = ""; String pic_brc_passive = ""; String pic_bri_active = ""; String pic_bri_passive = ""; String pic_brl_active = ""; String pic_brl_passive = ""; String pic_brm_active = ""; String pic_brm_passive = ""; String pic_brp_active = ""; String pic_brp_passive = ""; String pic_brs_active = ""; String pic_brs_passive = ""; String pic_error_left = ""; String pic_error_logo = ""; String pic_kachel = ""; String pic_logo = ""; String pic_oben_contact = ""; String pic_oben_sales = ""; String pic_oben_search = ""; String pic_p_links_kl = ""; String pic_p_links_we = ""; String pic_p_rechts_bl = ""; String pic_p_rechts_kl = ""; String pic_p_rechts_kl_b = ""; String pic_p_rechts_sw = ""; String pic_p_rechts_we = ""; String pic_p_rechts_we_active = ""; String pic_p_rechts_we_b = ""; String pic_p_unten_kl = ""; String pic_p_unten_kl_b = ""; String pic_p_unten_sw = ""; String pic_p_unten_we = ""; String pic_p_unten_we_b = ""; String pic_pix_grey = ""; String pic_print_header = ""; String pic_top = ""; String pic_trenn = ""; String pic_unten_contact = ""; String pic_unten_sales = ""; String pic_unten_search = ""; String pic_weiss = ""; String pic_x = ""; // WWL: GSC 20.09.02 - added two images String kachel_background1 = ""; String kachel_background2 = ""; %> <% // fill image-urls with current value from Gauss pic_brc_active = getUrl(nav,tree,pic_brc_active_oid); pic_brc_passive = getUrl(nav,tree,pic_brc_passive_oid); pic_bri_active = getUrl(nav,tree,pic_bri_active_oid); pic_bri_passive = getUrl(nav,tree,pic_bri_passive_oid); pic_brl_active = getUrl(nav,tree,pic_brl_active_oid); pic_brl_passive = getUrl(nav,tree,pic_brl_passive_oid); pic_brm_active = getUrl(nav,tree,pic_brm_active_oid); pic_brm_passive = getUrl(nav,tree,pic_brm_passive_oid); pic_brp_active = getUrl(nav,tree,pic_brp_active_oid); pic_brp_passive = getUrl(nav,tree,pic_brp_passive_oid); pic_brs_active = getUrl(nav,tree,pic_brs_active_oid); pic_brs_passive = getUrl(nav,tree,pic_brs_passive_oid); pic_error_left = getUrl(nav,tree,pic_error_left_oid); pic_error_logo = getUrl(nav,tree,pic_error_logo_oid); pic_kachel = getUrl(nav,tree,pic_kachel_oid); pic_logo = getUrl(nav,tree,pic_logo_oid); pic_oben_contact = getUrl(nav,tree,pic_oben_contact_oid); pic_oben_sales = getUrl(nav,tree,pic_oben_sales_oid); pic_oben_search = getUrl(nav,tree,pic_oben_search_oid); pic_p_links_kl = getUrl(nav,tree,pic_p_links_kl_oid); pic_p_links_we = getUrl(nav,tree,pic_p_links_we_oid); pic_p_rechts_bl = getUrl(nav,tree,pic_p_rechts_bl_oid); pic_p_rechts_kl = getUrl(nav,tree,pic_p_rechts_kl_oid); pic_p_rechts_kl_b = getUrl(nav,tree,pic_p_rechts_kl_b_oid); pic_p_rechts_sw = getUrl(nav,tree,pic_p_rechts_sw_oid); pic_p_rechts_we = getUrl(nav,tree,pic_p_rechts_we_oid); pic_p_rechts_we_active = getUrl(nav,tree,pic_p_rechts_we_active_oid); pic_p_rechts_we_b = getUrl(nav,tree,pic_p_rechts_we_b_oid); pic_p_unten_kl = getUrl(nav,tree,pic_p_unten_kl_oid); pic_p_unten_kl_b = getUrl(nav,tree,pic_p_unten_kl_b_oid); pic_p_unten_sw = getUrl(nav,tree,pic_p_unten_sw_oid); pic_p_unten_we = getUrl(nav,tree,pic_p_unten_we_oid); pic_p_unten_we_b = getUrl(nav,tree,pic_p_unten_we_b_oid); pic_pix_grey = getUrl(nav,tree,pic_pix_grey_oid); pic_print_header = getUrl(nav,tree,pic_print_header_oid); pic_top = getUrl(nav,tree,pic_top_oid); pic_trenn = getUrl(nav,tree,pic_trenn_oid); pic_unten_contact = getUrl(nav,tree,pic_unten_contact_oid); pic_unten_sales = getUrl(nav,tree,pic_unten_sales_oid); pic_unten_search = getUrl(nav,tree,pic_unten_search_oid); pic_weiss = getUrl(nav,tree,pic_weiss_oid); pic_x = getUrl(nav,tree,pic_x_oid); // WWL: GSC 20.09.02 - added two images kachel_background1 = getUrl(nav,tree,kachel_background1_oid); kachel_background2 = getUrl(nav,tree,kachel_background2_oid); request.getSession().setAttribute( GaussHelper.COMEFROM_BU, theBU); request.getSession().setAttribute( GaussHelper.COMEFROM_CU, theCU); request.getSession().setAttribute( "top_logout_target", top_logout_target); %> <% if (!isAuthorized) { br_logger.debug("top.jsp: Not authorized: 20539, user: "+br_userid+" --- "+getUrl(nav,tree,loginWall)); String redirectBaseUrl = getUrl(nav,tree,loginWall); if (redirectBaseUrl!=null) { if (!redirectBaseUrl.equals("")) { // new login: //response.sendRedirect(response.encodeURL(redirectBaseUrl+"?oid=1&continue_to="+"20539")); String temp_redir_url = com.img.util.RequestUtils.getParameterString(request,redirectBaseUrl+"?oid=1&continue_to="+"20539"); response.sendRedirect(response.encodeURL(temp_redir_url)); } else { out.println("RedirectBaseUrl is empty for target , current oid 20539"); br_logger.debug("RedirectBaseUrl is empty for target "+loginWall+", current oid 20539"); } } else{ out.println("RedirectBaseUrl is null for target , current oid 20539"); br_logger.debug("RedirectBaseUrl is null for target "+loginWall+", current oid 20539"); } } else { %> <% String top_meta_forward_oid = node.getAttribute("special18").toString(); String top_meta_forward_url = ""; if ( (top_meta_forward_oid != null) && !top_meta_forward_oid.equals("") ) top_meta_forward_url = getUrl(nav,tree,top_meta_forward_oid); else { top_meta_forward_oid = request.getParameter("autoforward_oid"); top_meta_forward_oid = dEncoder.canonicalize(top_meta_forward_oid,true); if ( (top_meta_forward_oid != null) && !top_meta_forward_oid.equals("") ) top_meta_forward_url = getUrl(nav,tree,top_meta_forward_oid); } %> <% if (!top_meta_forward_url.equals("") ){ %> <% } %> "> "> "> "> <% if( pageApplication != null ) { %> <% } %> <% if ("BoschRexroth_b42_prod" == "BoschRexroth_b28_prod") { %> <% } else if ("BoschRexroth_b42_prod" == "BoschRexroth_b29_prod") { %> <%} %> <% // add other meta tags for search engines here %> <%=title_tag%> <% // choose different stylesheet for netscape, find out first which browser is asking String browser = request.getHeader("user-agent"); double d = 4.0; int browserindex = -1; if( browser != null) browserindex = browser.indexOf("Mozilla/"); if (browserindex!=-1) { browser = browser.substring(browserindex+8,browserindex+12); try { d = Double.parseDouble(browser); } catch (Exception e) {} } if(isInAsia) { %> <% } else if(d>4.0 && d<5.0) { /* netscape 4.x */ %> <% } else { /* all other browsers */ %> <% } %> <% // page loaded functionality: String top_loaded_oid = top_perform.getPageloadedOid("BoschRexroth"); out.println(top_perform.getJavascriptFunction(getUrl(nav,tree,top_loaded_oid),"20539",top_performId)); %> <%@include file = "/templates_intern/05_admin/server_id_include.jsp"%> <% //--- START Added by Thejas for webletter changes...%> <%@ page import = "java.sql.Connection"%> <%@ page import = "java.sql.Statement"%> <%@ page import = "java.sql.SQLException"%> <%@ page import = "com.bosch.in.reuse.db.RbinDBConnector"%> <%@ page import = "com.boschrexroth.bridge.template.util.TemplateUtil"%> <%@ page import = "com.img.eoutputs.TextResourceManager"%> <% TextResourceManager b_trm = TextResourceManager.getInstance(pageContext.getServletContext()); %> <%-- <% if (nav.getCurrentLocale().getLanguage().equals("de")) { %> <% } %> --%> <% Vector vParams = new Vector(); String linkparams = ""; String redirect_oid = ""; String errorMessage = ""; try{ if(request.getParameterNames()!=null){ for(Enumeration params = request.getParameterNames(); params.hasMoreElements(); ) vParams.add((String)params.nextElement()); String[] arrParams = (String[])vParams.toArray(new String[0]); Arrays.sort(arrParams); vParams.clear(); for(int i=0; i <% } %> <% } // from login else %> <% // performance Hashtable top_perfht = new Hashtable(); top_perfht.put("IP",request.getRemoteAddr()); top_perfht.put("DEPLOYMENT","BoschRexroth_b42_prod"); top_perform.endPage(top_perfht); %>