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

📄 constants.java

📁 Java开的发文件管理系统,可以管理整个服务器的文件,并按要求进行处理!
💻 JAVA
字号:
package com.ibm.gbsc.cte.sample;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import javax.faces.context.FacesContext;
import javax.faces.model.SelectItem;
import javax.servlet.http.HttpServletRequest;

public class Constants {
	public static final String EXT_FACES = ".faces";

	public static final String EXT_JSP = ".jsp";

	public static final String CUSTOM_PROP_HTM_TYPE = "htmType";

	public static final String HTM_TYPE_APPROVAL = "approval";

	public static final String HTM_TYPE_VIEW = "view";

	public static final int READ_ONLY = 1;

	public static final int WRITEABLE = 2;

	public static final int GLOBAL = 3;

//	public static void writeToFile(String tkiid, String content) {
//		File write = new File(((HttpServletRequest) FacesContext
//				.getCurrentInstance().getExternalContext().getRequest())
//				.getRealPath("/article/" + tkiid.substring(5) +".txt"));
//		try {
//			BufferedWriter bw = new BufferedWriter(new FileWriter(write));
//			bw.write(content+"\r\n");
//			bw.close();
//		} catch (IOException e) {
//			e.printStackTrace();
//		}
//
//	}
//
//	public static String readFromFile(String tkiid){
//		return "";
//	}
	
	public static HumanTaskInstruction getViewType() {
		// construct a variable
		Variable var1 = new Variable();
		var1.setName("评审意见");
		var1.setType(READ_ONLY);
		var1.setSource(GLOBAL);
		// construct a human task instruction
		HumanTaskInstruction hti = new HumanTaskInstruction();
		hti.setTaskName("检查并准备提交文档");
		hti.setInstruction("1. 检查新闻稿是否完整并且内容准确;2. 确认无误后点击完成任务按钮提交评审。");
		List varList = new ArrayList();
		varList.add(var1);
		hti.setVars(varList);
		hti.setRoute(null);
		//
		return hti;
	}

	public static HumanTaskInstruction getApprovalType() {
		// construct a variable
		Variable var1 = new Variable();
		var1.setName("评审意见");
		var1.setType(WRITEABLE);
		var1.setSource(GLOBAL);
		// construct a route
		Routing routing = new Routing();
		SelectItem pass = new SelectItem();
		pass.setLabel("通过");
		pass.setValue("1");
		SelectItem deny = new SelectItem();
		deny.setLabel("拒绝");
		deny.setValue("2");
		List list = new ArrayList();
		list.add(pass);
		list.add(deny);
		routing.setChocies(list);
		routing.setName("评审结果");
		// construct a human task instruction
		HumanTaskInstruction hti = new HumanTaskInstruction();
		hti.setTaskName("审批");
		hti
				.setInstruction("1. 详细阅读提交的新闻稿;2. 在评审意见一栏里输入您的评审意见;3. 确定是否批准该稿件;4. 完成上述事项后点击完成任务。");
		List varList = new ArrayList();
		varList.add(var1);
		hti.setVars(varList);
		hti.setRoute(routing);
		//
		return hti;
	}
}

⌨️ 快捷键说明

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