<%@page language="java" import="java.net.URLEncoder,oracle.br.afrodite.parser.TemplateParser,java.util.Hashtable,java.util.Enumeration,java.util.StringTokenizer,java.util.Calendar,java.io.File,oracle.br.cdm.*, oracle.br.sessionPersistence.*" contentType="text/html;charset=ISO-8859-1" errorPage="error.jsp" %> <% response.setHeader("Surrogate-Control", "content=\"ESI/1.0\""); String sUF = request.getParameter("uf"); %> <% boolean colunista = false; // pega os cookies enviados pela requisicao Cookie[] cookiesTemp = request.getCookies(); String sCookieValueTemp = null; String sUserRegionNameTemp = null; String sUserRegionIdTemp = null; String sUserStateNameTemp = null; String sUserStateIdTemp = null; boolean bFind = false; String oUsername = ""; String semBarra=null; semBarra = request.getParameter("b"); // procura nos cookies enviados se existe algum que se chama clicRBS.prefs // Se encontrar bFind = true e sCookieValueTemp recebe o valor desse cookie for(int i=0;i 0 ) oTemplate = request.getParameter("template"); if( oNewsId == null ) oNewsId = "0"; if( sUF != null ) state = Integer.parseInt( sUF ); String oTab = request.getParameter("tab"); if( oTab == null ) oTab = "0"; int oChannelId = Integer.parseInt(oTab); if( oChannelId > 0 ) oChannelId--; // este eh o nome do canal, o nome do xml gerado eh "especial_anos_de_chumboRS.xml" String oHomeName = "especial_anos_de_chumbo"; if( oChannelId == 0 ) oHomeName = "especial_anos_de_chumbo"; if( oNewsId.equals( "0" ) ){ if (request.getParameter("source") == null) { switch( state ) { case 1: oSource = "STATIC,/shared/html/"+oHomeName+"RS.xml"; break; case 2: oSource = "STATIC,/shared/html/"+oHomeName+"RS.xml"; break; } } else { oSource = request.getParameter("source"); } } else{ // no caso de passar o id de um news na url int news = 0; try{ news = Integer.parseInt( oNewsId.substring( 1, oNewsId.indexOf( "." ) ) ); }catch( Exception nfe ){ news = -1; } if( !oNewsId.startsWith("DYNAMIC,") ){ colunista = true; if( oNewsId.startsWith( "a" ) && ( news != -1 ) && oNewsId.trim().endsWith( ".htm" ) ){ oNewsId = oNewsId.substring( 0, oNewsId.indexOf( "." ) ) + ".xml"; }else if( oNewsId.startsWith( "col" ) ){ oNewsId = oNewsId.substring( 0, oNewsId.indexOf( "." ) ) + ".xml"; } /* File oFileTest = new File( "/shared/html/" + oNewsId ); if( oFileTest.exists() ){*/ if( oNewsId.trim().endsWith( ".xml" ) ){ oTemplate = null; oSource = "STATIC,/shared/html/" + oNewsId; } // } else{ oSource = null; if( oNewsId.endsWith( ".dwt" ) ){ oTemplate = oNewsId; } } }else{ oSource = oNewsId; } } String l = request.getParameter("l"); if (l == null) l = "1"; //menu String mnit = request.getParameter("mnit"); if (mnit == null) mnit = "1"; oParms.put("sectid",sectid); oParms.put("rootdir","/shared"); oParms.put("uf",sUF); oParms.put("local",sLocal); oParms.put("username",oUsername); oParms.put("mnit",mnit); oParms.put("channel","46"); if (request.getParameter("url")!=null){ oParms.put("url",URLEncoder.encode(request.getParameter("url"))); } if (request.getParameter("previousurl")!=null){ oParms.put("previousurl",URLEncoder.encode(request.getParameter("previousurl"))); } // Tag do CDM String user = null; boolean logged = false; session = (HttpSession) SessionManager.getSession(request,response); if (session.getAttribute("username") != null) { user= "" + session.getAttribute("username"); logged = true; } try{ TemplateParser oParser = new TemplateParser(oSource,oTemplate,oParms); out.print(oParser.getStream()); }catch(Exception oParserException){ oParserException.printStackTrace(); } %>