<%@page import="com.hanweb.jcms.service.info.generalformat.GeneralFormatBLF"%> <%@page import="com.hanweb.jcms.entity.Jcms_DefEntity"%> <%@page import="com.hanweb.jcms.service.info.CustomizeInfoBLF"%> <%@page import="com.hanweb.jcms.service.info.Jcms_InfoBLF"%> <%@page import="com.hanweb.jcms.entity.Jcms_InfoEntity"%> <%@page import="com.hanweb.common.util.SpringUtil"%> <%@page import="com.hanweb.jcms.service.column.Jcms_CataloginfoBLF"%> <%@page import="com.hanweb.jcms.entity.Jcms_CataloginfoEntity"%> <%@page import="org.apache.commons.logging.LogFactory"%> <%@page import="org.apache.commons.logging.Log"%> <%@page import="com.hanweb.common.util.StringUtil"%> <%@page import="com.hanweb.common.util.mvc.Script"%> <%@page import="com.hanweb.common.util.NumberUtil"%> <%@page import="com.hanweb.jcms.util.AccessUtil"%><%@page contentType="text/html;charset=utf-8"%> <%@page import="com.hanweb.jcms.entity.SearchInfoEntity"%> <%@page import="com.hanweb.jcms.service.info.SearchInfoBLF"%> <%@page import="com.hanweb.jcms.build.service.makepage.MakeArticleMultiPage"%> <%@page import="com.hanweb.jcms.entity.Jcms_WebinfomationEntity"%> <%@page import="com.hanweb.jcms.service.website.Jcms_WebinfomationBLF"%> <%@ include file="config.jsp"%> <% Script script = Script.getInstance(); if(!AccessUtil.checkAccess(request)){ //阻止跨站点请求伪造 out.print(script.addScript("var tt='../../';").getScript()); return; } int type = NumberUtil.getInt(request.getParameter("type"), 0); int i_webid = NumberUtil.getInt(request.getParameter("i_webid")); int i_columnid = NumberUtil.getInt(request.getParameter("i_columnid")); int i_articleid = NumberUtil.getInt(request.getParameter("i_articleid")); Jcms_WebinfomationBLF blf = Jcms_WebinfomationBLF.getInstance(); Jcms_WebinfomationEntity entity = blf.achieveWebEntity(i_webid); String strArtUrl = ""; String strDomain = ""; if( entity != null ){ /*type=1 网站 type=2 栏目 type=3 文章*/ if( entity.getVc_domain().length() > 0 ){ strDomain = "http://"+ entity.getVc_domain(); }else{ strDomain = "/"; } switch( type ){ case 1: strArtUrl = strDomain; break; case 2: strArtUrl = strDomain + "/col/col" + i_columnid + "/index.html"; break; case 3: /*组织文章页的URL地址,域名+地址*/ SearchInfoBLF sinfoblf = SearchInfoBLF.getInstance().init(strAppID, NumberUtil.getInt(strWebID)); SearchInfoEntity en = sinfoblf.getEntity( i_articleid,i_columnid ); if( en != null ){ strArtUrl = strDomain +"/"+ MakeArticleMultiPage.getArtFileName(en.getC_deploytime(), "" + i_columnid, "" + i_articleid); }else{ Jcms_CataloginfoBLF catablf= Jcms_CataloginfoBLF.getInstance(); Jcms_CataloginfoEntity cataen = catablf.getEntity(i_columnid); if(cataen!=null){ String c_deploytime = ""; int style = cataen.getI_style(); if(style==2){ Jcms_InfoBLF infoblf = Jcms_InfoBLF.getInstance().init(strAppID,NumberUtil.getInt(strWebID)); Jcms_InfoEntity infoEntity = infoblf.getEntity(strAppID, i_articleid, "jcms_info"); if(infoEntity!=null){ c_deploytime = infoEntity.getC_deploytime(); } } if(style==3){ String tablename = cataen.getVc_tablename(); CustomizeInfoBLF customizeInfoBlf = CustomizeInfoBLF.getInstance().init(strAppID, NumberUtil.getInt(strWebID)); Jcms_DefEntity defentity = customizeInfoBlf.getEntity(i_articleid, i_columnid, tablename); if(defentity!=null){ c_deploytime = defentity.getC_deploytime(); } } if(style==7){ String tablename = cataen.getVc_tablename(); GeneralFormatBLF generalFormatBlf = GeneralFormatBLF.getInstance().init(strAppID, NumberUtil.getInt(strWebID)); Jcms_DefEntity gfdefEntity = generalFormatBlf.getEntity(i_articleid, i_columnid, tablename); if(gfdefEntity!=null){ c_deploytime = gfdefEntity.getC_deploytime(); } } strArtUrl = strDomain +"/"+ MakeArticleMultiPage.getArtFileName(c_deploytime, "" + i_columnid, "" + i_articleid); } } break; } int b_visit = entity.getB_visit(); String strVisit = entity.getVc_visit(); if( b_visit == 1 && StringUtil.getString(strVisit).length() > 0 ){ String strUrl = strVisit + "?type=" + type + "&i_webid=" + i_webid + "&i_columnid=" + i_columnid + "&i_articleid=" + i_articleid; strUrl += "&url="+strArtUrl; //out.println(script.addScript(" var tt.replace('"+strUrl+"');")); out.println(""); }else{ Log logger = LogFactory.getLog(getClass()); logger.info("[visit.jsp] 网站访问统计服务示开启或访问统计服务器地址为空!"); } } %>