<%@page language="java" import="java.net.*,java.io.*,java.util.*,oracle.br.afrodite.parser.TemplateParser,java.util.Calendar,rbs.vinagreti.FrontPageUtil" contentType="text/html;charset=ISO-8859-1" %> <% response.setHeader("Surrogate-Control", "content=\"ESI/1.0\""); %> <% //################# VARIAVEIS COM VALORES FIXOS ########################### // ### NOME DO PRODUTO EX: cidadeeletrica ### String produto = "educaretudo"; // ### NOME DO XML DA CAPA EX: cidade_eletrica ### String homeName = "educaretudo"; // ### CANAL_ID DO PRODUTO EX: 57 ### String canal_id = "60"; // ### TAB DO PRODUTO EX: 00056 ### String tab = "00061"; // ### TEMPLATE DA MOLDURA EX: 2197.dwt ### String moldura = "2373.dwt"; // ### TEMPLATE DE MATERIA EX: 2503.dwt ### String template_materia = "0.dwt"; String oPage = null; //parametro pSection para capa de seção if(request.getParameter("pSection") != null && request.getParameter("pSection").length() >0){ oPage = FrontPageUtil.getLastSectionFrontPage(Integer.parseInt(request.getParameter("pSection"))); } //################# VARIAVEIS COM VALORES FIXOS ########################### Cookie[] cookiesTemp = request.getCookies(); String cookieValueTemp = null; String userRegionNameTemp = null; String userRegionIdTemp = null; String userStateNameTemp = null; String userStateIdTemp = null; boolean cookieFind = false; String semBarra = request.getParameter("b"); String template = request.getParameter("template"); String newsId = request.getParameter( "newsID" ); if( newsId == null ) newsId = "0"; String naviBarInclude = "http://www.clicrbs.com.br/jsp/novabarra.jsp?product="+produto+"&uf="; String uf = ""; String local = ""; String sigla = ""; String userName = ""; String parmName = ""; String source = ""; if ( cookiesTemp != null ) { for(int i=0;i 0 ) { naviBarInclude = naviBarInclude.concat(sigla); } // COLOCA TODOS PARAMETROS DA URL NA HASHTABLE Hashtable oParms = new Hashtable(); Enumeration e = request.getParameterNames(); if( e != null ){ while( e.hasMoreElements() ){ parmName = (String)e.nextElement(); oParms.put(parmName,request.getParameter(parmName)); } } // TESTA SE NEWSID = 0 ( CAPA ) if( newsId.equals( "0" ) ){ if ( request.getParameter("source") == null ) { source = "STATIC,/shared/html/"+homeName+"RS.xml"; }else{ source = request.getParameter("source"); } }else{ int news = 0; try{news = Integer.parseInt( newsId.substring( 1, newsId.indexOf( "." ) ) );} catch( Exception nfe ){news = -1;} // TESTA SE NEWSID = STATIC if( !newsId.startsWith("DYNAMIC,") ){ if( newsId.startsWith( "a" ) && ( news != -1 ) && newsId.trim().endsWith( ".htm" ) ){ newsId = newsId.substring( 0, newsId.indexOf( "." ) ) + ".xml"; }else if( newsId.startsWith( "col" ) ){ newsId = newsId.substring( 0, newsId.indexOf( "." ) ) + ".xml"; } File fileTest = new File( "/shared/html/" + newsId ); if( fileTest.exists() ){ if( newsId.endsWith( ".xml" ) ){ source = "STATIC,/shared/html/" + newsId; if ( ((template!=null)&&(template.trim().length()==0)) || (template==null) ){ template = template_materia; } } }else{ source = null; if( newsId.endsWith( ".dwt" ) ){ template = newsId; } } // TESTA SE NEWSID = DYNAMIC }else{ source = newsId; } } //String que será utilizada no copyright do rodape Calendar hoje = Calendar.getInstance(); int year = hoje.get(Calendar.YEAR); String strYear = Integer.toString(year); // PARAMETROS DA HASHTABLE oParms.put("rootdir","/shared"); oParms.put("uf",uf); oParms.put("local",local); oParms.put("tab",tab); oParms.put("l",moldura); oParms.put("username",userName); oParms.put("canalid",canal_id); oParms.put("canal_id",canal_id); oParms.put("chanid",canal_id); oParms.put("channel",canal_id); oParms.put("channel_id",canal_id); oParms.put("strYear",strYear); if ( request.getParameter("mnit") == null) { oParms.put("mnit", "0"); } // TESTA SE É PARA COLOCAR OU NÃO NAVIBAR if (semBarra == null) { oParms.put("navibar",naviBarInclude); } try{ TemplateParser oParser; if(oPage != null){ oParser = new TemplateParser("STATIC,/shared/html/" + oPage,null,oParms); } else{ oParser = new TemplateParser(source,template,oParms); } out.print(oParser.getStream()); }catch(Exception oParserException){ oParserException.printStackTrace(); } %>