<% /** list_document_x.jsp * Vesion: WCM 5.0 * Created: 2001/7/17 * Last Modified: 2002/4/23 2002/04/07 * Created by: TRS WCM * Copyright: www.trs.com.cn * Description: * 文檔列表顯示,用于“文檔管理”。 * Parameters: * ChnlId ` —— 指定文檔所在的頻道。若為0,則表示全部頻道。 */ %> <%@ page contentType="text/html;charset=GBK" errorPage="../include/error.jsp"%> <%@ page import="java.lang.*" %> <%@ page import="com.trs.wcmx.jsp.*" %> <%@ page import="com.trs.wcmx.jsp.auth.*" %> <%@ page import="com.trs.wcm.common.*,com.trs.wcm.auth.*,com.trs.util.*" %> <%@ page import="com.trs.wcm.content.*,com.trs.wcm.websites.*"%> <%@include file="include/head.jsp"%> <%@include file="include/data_define.jsp"%> <%@include file="include/get_search.jsp"%> <%! //內部使用的函數 //取當前頁面的導航文字 private String getNavHtml( Channel _currChannel ) throws WCMException{ String sHtml = null; if( _currChannel==null ){ sHtml = " 全部"; } else{ sHtml =""+_currChannel.getName()+""+((sHtml!=null)?">> "+sHtml:"" ); Channel tempChnl = _currChannel.getParent(); while( tempChnl!=null ){ sHtml = ""+tempChnl.getName()+"" + ((sHtml!=null)?">> "+sHtml:"" ); tempChnl = tempChnl.getParent(); } sHtml=""+_currChannel.getSite().getName()+""+">>"+sHtml; }//end if sHtml = "主頁 >>"+sHtml; return sHtml; }//END: getNavHtml %> <% int nChannelId=0; %> <% boolean isDebug = false; //get the channel Id sValue = request.getParameter("ChnlId"); if( sValue==null ){ nChannelId = -1; } else{ try{ nChannelId = Integer.parseInt( sValue.trim()); sBackUrl+="&ChnlId="+nChannelId; } catch( Exception ex ){ throw new WCMException(WCMException.ERR_PARAM_INVALID,"無效的頻道參數!",ex); } } //取當前頻道 Channel currChannel = null; if( nChannelId>0 ){ currChannel = (Channel)app._getObjFromBuffer(Channel.CACHE_INDEX , nChannelId); if( currChannel==null ) throw new WCMException(WCMException.ERR_PARAM_INVALID,"沒有找到指定的頻道!"); if(currChannel.getStatus()==Channel.STATUS_DEL) throw new WCMException(WCMException.ERR_WCMEXCEPTION,"指定的頻道已被刪除!"); }//end if //權限判斷 if(!ChnlAuth.canBrowse(loginUser,currChannel)) throw new WCMException(WCMException.ERR_USER_NORIGHT,"對不起,您沒有權限瀏覽此頻道!"); %> <% //BEGIN: 數據處理 //獲取文檔列表 Documents aDocs = null; Document aDoc = null; CPager pager = null; int nPageCount = 0; int i; String sPageNumHtml = ""; //頁碼鏈接 String sPageNextHtml = ""; //翻頁鏈接 Statuses allStatuses = null; //所有的狀態列表 Status aStatus = null; RightValue chnlRightValue = null; chnlRightValue = currChannel.getRightValue(loginUser); String sTransmitFunc = "transmitDoc(1,el.DocId);"; if(CMyString.showNull(currChannel.getQuery()).trim().length()==0) sTransmitFunc = "transmitDoc(1,el.DocId,"+currChannel.getId()+");"; String sTransmitFunc2 = "transmitDoc(2,el.DocId);"; if(CMyString.showNull(currChannel.getQuery()).trim().length()==0) sTransmitFunc2 = "transmitDoc(2,el.DocId,"+currChannel.getId()+");";; try{ aDocs = new Documents( loginUser, app ); aDocs =currChannel.getDocuments(loginUser,"",sWhere,sOrder,"distinct WCMDocument.DocNo, WCMDocument.DocOrder,WCMDocument.docid,WCMDocument.doctitle,WCMDocument.docstatus,WCMDocument.docchannel,WCMDocument.docauthor,WCMDocument.crtime,WCMDocument.cruser,WCMDocument.RightDefined,WCMDocument.DocType"); if(isDebug){ System.out.println("=============SQL start============"); System.out.println(aDocs.getFilter().toSQL()); System.out.println("=============SQL end============"); } } catch( Exception ex ){ throw new WCMException( WCMException.ERR_WCMEXCEPTION,"獲取文檔列表顯示時出錯",ex ); } pager = new CPager( MAX_ITEM_PERPAGE ); pager.setItemCount( aDocs.size() ); pager.setCurrentPageIndex( nPageIndex ); //取當前集合的總頁數和 nPageCount = pager.getPageCount(); nPageIndex = pager.getCurrentPageIndex(); //獲取分頁鏈接 sPageNumHtml = PageUtil.getPageNumHtml( pager ); sPageNextHtml = PageUtil.getPageNextHtml( pager,"本頻道中沒有文檔" ); %> 四川金7乐下载苹果 >
"> ">
四川金7乐电视走势