cms标签问题

标哥,请教下cms标签的问题:
我在标签库定义中加了下属性start(表示取数据的起始位置),我想在数据加加载器中获取start这个outline标签属性值,标签库代码如下:
<tag>
<name>outline</name>
<tagclass>com.frameworkset.common.tag.html.CMSListTag</tagclass>
<teiclass>com.frameworkset.common.tag.pager.tags.PagerDataSetExtraInfo</teiclass>
<bodycontent>JSP</bodycontent>
<!--
列表标识
-->
<attribute>
<name>id</name>
<rtexprvalue>true</rtexprvalue>
</attribute>
<!--
rss种子生成开关
-->
<attribute>
<name>rss</name>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>type</name>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>colName</name>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>property</name>
<rtexprvalue>true</rtexprvalue>
</attribute>
<!--指定缺省的排序关键字-->
<attribute>
<name>sortKey</name>
<rtexprvalue>true</rtexprvalue>
</attribute>
<!--
查找祖先(list)索引
-->
<attribute>
<name>index</name>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>sessionKey</name>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>requestKey</name>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>pageContextKey</name>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>needClear</name>
<rtexprvalue>true</rtexprvalue>
</attribute>
<!--
是否声明外部变量
true:声明,缺省值
false:不声明
-->
<attribute>
<name>declare</name>
<rtexprvalue>true</rtexprvalue>
</attribute>
<!--指定缺省的排序顺序-->
<attribute>
<name>desc</name>
<rtexprvalue>true</rtexprvalue>
</attribute>
<!--
指定数据库查询语句,或者存储过程,
Added on 2007.2.1 by biaoping.yin
-->
<attribute>
<name>statement</name>
<rtexprvalue>true</rtexprvalue>
</attribute>
<!--
指定数据库链接池的名称
Added on 2007.2.1 PM by biaoping.yin
-->
<attribute>
<name>dbname</name>
<rtexprvalue>true</rtexprvalue>
</attribute>
<!--
为list添加分页功能的相关属性定义开始 标识是否是wap网页 true:是wap网页 false:不是wap网页,缺省值
-->
<attribute>
<name>wapflag</name>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>url</name>
<rtexprvalue>true</rtexprvalue>
</attribute>
<!-- 标签做分页时,用来指定每页显示的最大条目 -->
<attribute>
<name>maxPageItems</name>
<rtexprvalue>true</rtexprvalue>
</attribute>
<!--
控制分页/列表开关
true:为列表
false:为分页

缺省:false
-->
<attribute>
<name>isList</name>
<rtexprvalue>true</rtexprvalue>
</attribute>
<!--
分页标签页面导航时提交的form表单名称
-->
<attribute>
<name>form</name>
<rtexprvalue>true</rtexprvalue>
</attribute>
<!--
分页导航form提交前的提示信息
-->
<attribute>
<name>promotion</name>
<rtexprvalue>true</rtexprvalue>
</attribute>
<!--以逗号分隔的字段属性集合-->
<attribute>
<name>field</name>
<rtexprvalue>true</rtexprvalue>
</attribute>
<!--以逗号分隔的字段属性对应的标题集合-->
<attribute>
<name>title</name>
<rtexprvalue>true</rtexprvalue>
</attribute>
<!--以逗号分隔的字段属性对应的标题显示的宽度集合-->
<attribute>
<name>width</name>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>site</name>
<rtexprvalue>true</rtexprvalue>
</attribute>
<!-- 频道显示名称-->
<attribute>
<name>channel</name>
<rtexprvalue>true</rtexprvalue>
</attribute>
<!-- 文档id-->
<attribute>
<name>document</name>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>count</name>
<rtexprvalue>true</rtexprvalue>
</attribute>
<!-- 指定概览类型 channel document-->
<attribute>
<name>datatype</name>
<rtexprvalue>true</rtexprvalue>
</attribute>
<!--为outline添加分页功能的相关属性定义结束
指定list标签内部变量dataSet的变量名称,缺省为dataSet-->
<attribute>
<name>dataSetName</name>
<rtexprvalue>true</rtexprvalue>
</attribute>
<!--指定list标签内部变量rowid的变量名称,缺省为"rowid"-->
<attribute>
<name>rowidName</name>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>count</name>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>


数据加载器类代码:
package com.chinacreator.cms.driver.dataloader;

import java.util.List;

import com.chinacreator.creatorcms.sitemanage.bean.SiteBean;
import com.chinacreator.creatorcms.util.CMSUtil;
import com.frameworkset.util.ListInfo;
/**
* 根据频道显示名称取直接子频道,该频道必须有首页
* <p>Title: CMSNaviChannelListData.java</p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2006</p>
*
* <p>Company: 长沙科创计算机系统集成有限公司</p>
* @Date 2007-9-13 9:16:57
* @author ge.tao
* @version 1.0
*/
public class CMSNaviChannelListData extends CMSBaseListData implements java.io.Serializable {
protected ListInfo getDataList(String arg0, boolean arg1, long arg2,
int arg3) {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
try {
if(channel != null && !this.channel.equals(""))
{
/**
* 如果存在发布上下文,则表示为发布过程中调用本方法
*/
if(context != null)
{
if(this.site == null)
{
ListInfo lstifo = CMSUtil.getCMSDriverConfiguration()
.getCMSService()
.getSiteChannelDao()
.getDirectSubNaviChannels(super.context.getSiteID(),channel,arg2,arg3);
return lstifo;
}
else
{
SiteBean siteinfo = CMSUtil.getCMSDriverConfiguration().getCMSService().getSiteDao().getSiteByEname(site);
ListInfo lstifo = CMSUtil.getCMSDriverConfiguration()
.getCMSService()
.getSiteChannelDao()
.getDirectSubNaviChannels(siteinfo.getSiteId()+"",channel,arg2,arg3);
return lstifo;
}
}
else
{
if(this.channel == null || this.channel.equals("") || this.site == null || this.site.equals(""))
throw new IllegalArgumentException("没有指定站点的名称和频道名称");

SiteBean siteinfo = CMSUtil.getCMSDriverConfiguration().getCMSService().getSiteDao().getSiteByEname(site);
ListInfo lstifo = CMSUtil.getCMSDriverConfiguration()
.getCMSService()
.getSiteChannelDao()
.getDirectSubNaviChannels(siteinfo.getSiteId()+"",channel,arg2,arg3);
return lstifo;


}
}
else
return new ListInfo();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return new ListInfo();
}

protected ListInfo getDataList(String arg0, boolean arg1) {
// TODO Auto-generated method stub
try {
if(this.channel != null && !this.channel.equals(""))
{
/**
* 如果存在发布上下文,则表示为发布过程中调用本方法
*/
if(context != null)
{
if(this.site == null)
{
List published = CMSUtil.getCMSDriverConfiguration()
.getCMSService()
.getSiteChannelDao()
.getDirectSubNaviChannels(context.getSiteID(),channel,count,0);
ListInfo listInfo = new ListInfo();
listInfo.setDatas(published);
return listInfo;
}
else
{
SiteBean siteinfo = CMSUtil.getCMSDriverConfiguration().getCMSService().getSiteDao().getSiteByEname(site);

List published = CMSUtil.getCMSDriverConfiguration()
.getCMSService()
.getSiteChannelDao()
.getDirectSubNaviChannels(siteinfo.getSiteId() + "",channel,count,0);
ListInfo listInfo = new ListInfo();
listInfo.setDatas(published);
return listInfo;
}
}
else
{
SiteBean siteinfo = CMSUtil.getCMSDriverConfiguration().getCMSService().getSiteDao().getSiteByEname(site);
List published = CMSUtil.getCMSDriverConfiguration()
.getCMSService()
.getSiteChannelDao()
.getDirectSubNaviChannels(siteinfo.getSiteId() + "",channel,count,0);
ListInfo listInfo = new ListInfo();
listInfo.setDatas(published);
return listInfo;
}
}
else
{
return new ListInfo();
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return new ListInfo();
}

}
数据加载器基础类:
package com.chinacreator.cms.driver.dataloader;

import javax.servlet.http.HttpServletRequest;

import com.chinacreator.cms.driver.context.Context;
import com.chinacreator.cms.driver.jsp.CMSServletRequest;
import com.chinacreator.cms.driver.jsp.InternalImplConverter;
import com.chinacreator.creatorcms.util.CMSUtil;
import com.frameworkset.common.tag.pager.DataInfoImpl;

/**
* 概览模版数据获取接口
* <p>Title: CMSBaseListData</p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2006</p>
*
* <p>Company: 长沙科创计算机系统集成有限公司</p>
* @Date 2007-4-13 9:47:46
* @author biaoping.yin
* @version 1.0
*/
public abstract class CMSBaseListData extends DataInfoImpl implements java.io.Serializable {
protected Context context;
protected CMSServletRequest cmsrequest;
protected String channel;
protected int count = -1;
protected int start = 0;
public int getStart() {
return start;
}

public void setStart(int start) {
this.start = start;
}

/**
* 外部指定的站点名称,适合于多站点的情况
*/
protected String site;
protected String documentid;
// protected CMSServletResponse cmsresponse;
/**
* 初始化获取分页/列表数据的必要参数
* @param sortKey 排序字段
* @param desc 排序顺序,true表示降序,false表示升序
* @param offSet 获取分页数据时,用该参数设置获取数据的起点
* @param pageItemsize 获取分页数据时,用该参数设置获取数据的条数
*/
public void initial(String sortKey,
boolean desc,
long offSet,
int pageItemsize,
boolean listMode,
HttpServletRequest request)
{
super.initial(sortKey,
desc,
offSet,
pageItemsize,
listMode,
request);
cmsrequest = InternalImplConverter.getInternalRequest(this.request);
// cmsresponse = InternalImplConverter.getInternalResponse(this.response);
if(cmsrequest != null)
{
this.context = this.cmsrequest.getContext();
}


}

/**
* 初时化频道信息
* @param channel
* @param count
*/
public void setOutlineInfo(String channel,int count)
{
this.channel = channel;
this.count = count;
}

/**
* 初时化频道信息
* @param site
* @param channel
* @param count
*/
public void setOutlineInfo(String site,String channel,int count)
{
this.site = site;
this.channel = channel;
this.count = count;
}

/**
* 初时化文档信息
* @param site
* @param channel
* @param count
*/
public void setDocumentid(String documentid)
{
this.documentid = documentid;
}


/**
* 获取频道信息
* @return
*/
public String getChannel()
{
if(this.channel != null)
return channel;
else if(this.context != null)
{
return CMSUtil.getChannelDispalyName(context);

}
else
{
return null;
}
}

/**
* 获取当前的频道的文档显示条目数
* @return
*/
public int getCount()
{
return this.count;
}

// /**
// * 获取原始的频道路径链接
// * @param context
// * @return
// */
// public static String getChannelDispalyName(Context context)
// {
//
// if(context instanceof ContentContext)
// {
// ContentContext contentContext = (ContentContext)context;
//
// return contentContext.getChannel().getDisplayName();
// }
// else if(context instanceof com.chinacreator.cms.driver.context.PageContext)
// {
// return "";
// }
// else if(context instanceof CMSContext)
// {
// return "";
// }
// else if(context instanceof ChannelContext)
// {
//
// return ((ChannelContext)context).getChannel().getDisplayName();
//
// }
// else
// {
// return "";
// }
//
// }

public String getSite() {
return site;
}

public void setSite(String site) {
this.site = site;
}

}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值