package xin.glue.ui.common.component; import java.util.List; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import com.posdata.glue.context.PosContext; import com.posdata.glue.dao.PosGenericDao; import com.posdata.glue.dao.manager.PosQueryDefinition; import com.posdata.glue.dao.manager.PosQueryManagerImpl; import com.posdata.glue.dao.vo.PosParameter; public class PosSiteLog { public static boolean writeLog(PosContext ctx, PosGenericDao dao, String queryId, List params) { if (!PosSiteConfig.isWriteLog()) return true; try { PosParameter param = new PosParameter(); PosQueryManagerImpl queryManager = (PosQueryManagerImpl)PosContext.getBeanFactory().getBeanObject("queryManager"); PosQueryDefinition query = queryManager.getQueryDefinition(queryId); if (query == null) { param.setValueParamter(0, "³ÌÐòÄÚǶÓï¾ä"); param.setValueParamter(1, queryId); } else { param.setValueParamter(0, queryId); param.setValueParamter(1, query.getQueryStatement().replaceAll("&", "&")); } String paramValue = ""; int count = params.size(); for (int i=0; i