package com.buildhtml;
import java.util.*;
import tools.util.FileIO;
import com.saas.sys.tag.*;
import com.saas.intf.*;
import com.saas.biz.commen.ConfigurationMgr;
import tools.util.StrReplace;
import tools.util.StringUtil;
import com.saas.biz.commen.config;
import com.saas.biz.commen.commMethodMgr;
import com.saas.sys.exp.SaasApplicationException;
import com.saas.sys.log.Logger;
import com.saas.biz.infoClassMgr.CalalogInfo;
import com.saas.biz.custMgr.Custinfo;
import com.saas.biz.attachMgr.Attachinfo;
import java.text.SimpleDateFormat;
public class ParseLoop
{
Logger log;
Config config;
commMethodMgr comm;
CalalogInfo calalogInfo;
private String ecms_path;
private String default_img;
private String cache_file_path;
private String logolink;
PriceRankIntf priceIntf;
public ParseLoop()
{
log = new Logger(this);
config = new Config();
comm = new commMethodMgr();
calalogInfo = new CalalogInfo();
ecms_path=config.ecms_path;
default_img = config.default_img;
logolink = config.logolink;
cache_file_path = "";
priceIntf = new PriceRankIntf();
}
public void setCacheFile(String cache_file)
{
this.cache_file_path = cache_file;
}
/**
解析"top频道导航"标签
**/
public String buildChannel(String cstr,HashMap thismap)throws SaasApplicationException
{
try
{
cstr = buildLoop(cstr,thismap,"ecms","channel","{","}","{/","}");
}
catch (SaasApplicationException e) {}
return cstr;
}
/**
解析热门竞价关键字标签
**/
public String buildHotKey(String cstr,HashMap thismap)throws SaasApplicationException
{
try
{
cstr = buildLoop(cstr,thismap,"ecms","hotkey","{","}","{/","}");
}
catch (SaasApplicationException e) {}
return cstr;
}
/**
解析bottom链接标签
**/
public String buildLink(String cstr,HashMap thismap)throws SaasApplicationException
{
try
{
cstr = buildLoop(cstr,thismap,"ecms","friendlink","{","}","{/","}");
}
catch (SaasApplicationException e) {}
return cstr;
}
/**
解析"栏目资讯列表"标签
**/
public String buildArticleList(String cstr,HashMap thismap)throws SaasApplicationException
{
try
{
cstr = buildLoop(cstr,thismap,"ecms","articlelist","{","}","{/","}");
}
catch (SaasApplicationException e) {}
return cstr;
}
/**
解析模板"综合分类"标签{ecms:classlist type="2" row="30" orderby="user" cmodel="supply"}...{/ecms:classlist}
**/
public String buildClass(String cstr,HashMap thismap)throws SaasApplicationException
{
try
{
cstr = buildLoop(cstr,thismap,"ecms","classlist","{","}","{/","}");
}
catch (SaasApplicationException e){}
return cstr;
}
/**
* 解析模板"综合拼音分类"标签{ecms:pinyinclass row="3" cmodel="supply"}...{/ecms:classlist}
* 解析指定cmodel类型的汉字拼音分类标签 其中row为指定首字符拼音取多少条分类记录 如 {ecms:pinyinclass row="2" cmodel="supply"}...{/ecms:classlist}
* 表示supply栏目中每个拼音取三条分类 如(c 齿轮 充电器 )
**/
public String buildClassChinaPY(String cstr,HashMap thismap){
try
{
cstr = buildLoop(cstr,thismap,"ecms","pinyinclass","{","}","{/","}");
}
catch (SaasApplicationException e){}
return cstr;
}
/**
解析模板"综合分类下级分类"标签{ecms:smallclasslist type="2" row="30" orderby="user" cmodel="supply"}...{/ecms:classlist}
**/
public String buildSmallClass(String cstr,HashMap thismap)throws SaasApplicationException
{
try
{
cstr = buildLoop(cstr,thismap,"ecms","smallclasslist","{","}","{/","}");
}
catch (SaasApplicationException e) {}
return cstr;
}
/**
解析模板"地区列表"标签{ecms: arealist type =”0” row=”10” orderby =”indate”}......{ /ecms: arealist}
**/
public String buildArea(String cstr,HashMap thismap)throws SaasApplicationException
{
try
{
cstr = buildLoop(cstr,thismap,"ecms","arealist","{","}","{/","}");
}
catch (SaasApplicationException e){}
return cstr;
}
/**
解析模板循环标签 {ecms:tagname type="2" row="30" orderby="user" cmodel="supply"}...{/ecms:tagname}
**/
public String buildLoop(String inStr,HashMap thismap,String namespace,String tagname,String start_word_start,String start_word_end,String end_word_start,String end_word_end)throws SaasApplicationException
{
Loopbase loopbase = new Loopbase();
loopbase.setNameSpace(namespace,tagname,start_word_start,start_word_end,end_word_start,end_word_end);
//String inStr = FileIO.LoadFile(this.cache_file_path);
loopbase.setInstr(inStr);
ArrayList classlist = loopbase.getLoopList();
if (classlist== null) return inStr;
for (Iterator it = classlist.iterator(); it.hasNext();)
{
HashMap classmap = (HashMap) it.next();
String endtag = "";
String content = "";
String outcontent = "";
String tagAttr = "";
String recontent = "";
String tagstrings = "";
if (classmap.get("endtag") != null) endtag = classmap.get("endtag").toString();
if (classmap.get("content") != null) content = classmap.get("content").toString();
if (classmap.get("tagstrings") != null) tagstrings = classmap.get("tagstrings").toString();
tagstrings = tagstrings.trim();
tagAttr = loopbase.getLoopAttr(content);
outcontent = loopbase.getLoopContent(content);
if (tagname.equals("friendlink"))
{
try
{
recontent = buildLinkContent(thismap,tagAttr,outcontent);
}
catch (SaasApplicationException e)
{
}
inStr = inStr.substring(0,inStr.indexOf(start_word_start+namespace+":"+tagname))+recontent+inStr.substring(inStr.indexOf(end_word_start+namespace+":"+tagname)+end_word_start.length()+namespace.length()+2+tagname.length(),inStr.length());
}
if (tagname.equals("hotkey"))
{
try
{
recontent = buildHotKeyContent(thismap,tagAttr,outcontent);
}
catch (SaasApplicationException e)
{
}
inStr = inStr.substring(0,inStr.indexOf(start_word_start+namespace+":"+tagname))+recontent+inStr.substring(inStr.indexOf(end_word_start+namespace+":"+tagname)+end_word_start.length()+namespace.length()+2+tagname.length(),inStr.length());
}
if (tagname.equals("classlist"))
{
try
{
recontent = buildClassContent(thismap,tagAttr,outcontent);
}
catch (SaasApplicationException e)
{
}
inStr = inStr.substring(0,inStr.indexOf(start_word_start+namespace+":"+tagname))+recontent+inStr.substring(inStr.indexOf(end_word_start+namespace+":"+tagname)+end_word_start.length()+namespace.length()+2+tagname.length(),inStr.length());
}
if (tagname.equals("pinyinclass")) //汉字拼音分类
{
try
{
recontent = buildPinyinClassContent(thismap,tagAttr,outcontent);
}
catch (SaasApplicationException e)
{
}
inStr = inStr.substring(0,inStr.indexOf(start_word_start+namespace+":"+tagname))+recontent+inStr.substring(inStr.indexOf(end_word_start+namespace+":"+tagname)+end_word_start.length()+namespace.length()+2+tagname.length(),inStr.length());
}
if (tagname.equals("smallclasslist"))
{
try
{
recontent = buildSmallClassContent(thismap,tagAttr,outcontent);
}
catch (SaasApplicationException e)
{
}
inStr = in
没有合适的资源?快使用搜索试试~ 我知道了~
资源详情
资源评论
资源推荐
收起资源包目录
[电子商务]同徽B2B电子商务软件 v4.3_ith-b2b.zip (1979个子文件)
SaasQuery.xml.bak 527KB
.classpath 6KB
chinajc315.css 140KB
webjs.css 17KB
desktop.css 13KB
aiwen.css 10KB
b2b_css.css 10KB
css.css 10KB
cn-b2b.css 10KB
style.css 10KB
book.css 10KB
addr.css 8KB
layout.css 8KB
css_layout.css 7KB
nav.css 7KB
layout.css 7KB
wood.css 7KB
manager.css 7KB
new_layout.css 7KB
job.css 6KB
daohang.css 6KB
compressed.css 6KB
news.css 6KB
b2c.css 6KB
jiameng.css 6KB
shadowbox.css 5KB
shadowbox-light.css 5KB
member.css 5KB
member.css 5KB
distest.css 5KB
login.css 4KB
ui.tabs.css 4KB
news_list.css 3KB
homepage.css 3KB
bookstore.css 3KB
product_list.css 3KB
taodi.css 2KB
marker.css 2KB
tablecss.css 2KB
b2c_css.css 2KB
b2_blogin.css 2KB
head.css 2KB
master.css 2KB
login.css 2KB
supply.css 2KB
logIndex.css 2KB
css.css 2KB
new.css 1KB
css.css 1KB
product.css 1KB
product_content.css 1KB
stylevista.css 1KB
enterprise.css 1KB
left.css 1KB
kbuzi.css 980B
help.css 980B
help.css 978B
b2b_top.css 860B
b2b_login.css 753B
jdNewsScroll.css 720B
footer.css 707B
top.css 645B
common.css 405B
mg.css 163B
.cvsignore 11B
Thumbs.db 5KB
saas.flds 22KB
LogoMaker.gif 46KB
in_10.gif 40KB
in_10.gif 40KB
login_11.gif 35KB
login_11.gif 35KB
login_14.gif 18KB
login_14.gif 18KB
login_10.gif 12KB
login_10.gif 12KB
login_05.gif 9KB
login_05.gif 9KB
logo.gif 9KB
192x96_070719_anquan.gif 8KB
192x96_070719_anquan.gif 8KB
192x96_070719_mingqi.gif 7KB
192x96_070719_mingqi.gif 7KB
192x96_070719_jingjiapaimin.gif 7KB
192x96_070719_jingjiapaimin.gif 7KB
192x96_070719_shangbiao.gif 7KB
192x96_070719_shangbiao.gif 7KB
Regist.gif 3KB
Regist.gif 3KB
Regist0.gif 3KB
Regist0.gif 3KB
mid-06.gif 3KB
mid-06.gif 3KB
yzm.gif 2KB
yzm.gif 2KB
Login.gif 2KB
Login.gif 2KB
bg.gif 2KB
bg.gif 2KB
loading.gif 2KB
共 1979 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
芝麻粒儿
- 粉丝: 5w+
- 资源: 2万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0