⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 doctemplateimpl.java~37~

📁 云网论坛CWBBS 源码,内容丰富,学习,参考,教学的好资料,具体见内说明,
💻 JAVA~37~
字号:
package cn.js.fan.module.cms;

import com.cloudwebsoft.framework.template.VarPart;
import com.cloudwebsoft.framework.util.BeanUtil;
import cn.js.fan.util.ParamUtil;
import com.cloudwebsoft.framework.util.LogUtil;
import cn.js.fan.util.StrUtil;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 * $doc.dirCode(code).summary 提取文章的摘要
 * $doc.id(id).title 提取文章的标题
 * <p>Copyright: Copyright (c) 2005</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class DocTemplateImpl extends VarPart {
    public DocTemplateImpl() {

    }

    public String write(Document doc) {

    }

    public String toString() {
        if (keyName.equalsIgnoreCase("id")) {
            LogUtil.getLog(getClass()).info("toString:keyValue=" + keyValue);
            int id = Integer.parseInt(keyValue);
            Document doc = new Document();
            doc = doc.getDocument(id);
            BeanUtil bu = new BeanUtil();
            if (field.equalsIgnoreCase("content")) {
                String page = (String)props.get("page");
                if (!StrUtil.isNumeric(page)) {
                    page = "1";
                }
                return doc.getContent(Integer.parseInt(page));
            }
            else {
                return "" + bu.getProperty(doc, field);
            }
        }
        else if (keyName.equalsIgnoreCase("dirCode")) {
            Leaf lf = new Leaf();
            lf = lf.getLeaf(keyValue);
            int id = lf.getDocID();
            Document doc = new Document();
            doc = doc.getDocument(id);
            BeanUtil bu = new BeanUtil();
            if (field.equalsIgnoreCase("content")) {
                String page = (String)props.get("page");
                if (!StrUtil.isNumeric(page)) {
                    page = "1";
                }
                return doc.getContent(Integer.parseInt(page));
            }
            else {
                return "" + bu.getProperty(doc, field);
            }
        }
        else
            return "Key " + keyName + " is invalid!";
    }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -