WAT编程方式简单的例子
By:Roy.LiuLast updated:2009-10-20
前面介绍过了WAT的一些基础,今天来个简单的例子。
模仿着看看怎么用,并跳转到自己处理的页面,如何和SERVLET结合,基本上什么事情都能做了。
<%@ page import="filenet.vw.api.*"%>
<%@ page errorPage="/WcmError.jsp"
import="com.filenet.wcm.apps.server.util.*,com.filenet.wcm.toolkit.server.base.*,com.filenet.wcm.toolkit.server.util.WcmServerCredentials,com.filenet.wcm.toolkit.server.util.WcmDataStore,java.util.*"%>
class="com.filenet.wcm.apps.server.controller.WcmWorkplaceController"
scope="request">
<%@page import="com.filenet.wcm.toolkit.util.WcmEncodingUtil"%>
<%@page import="java.net.URLEncoder"%>
Form Region Sample Code
<%
controller.configurePage(application, request, WcmController.NO_WINDOW_ID);
WcmDataStore dataStore = controller.getDataStore();
WcmServerCredentials credentials = dataStore.getServerCredentials();
String username = credentials.getUserId();
String password = credentials.getPassword();
VWSession vwSession = credentials.getVWSession();
//We can't name this variable session because JSP's have a variable named session already.
com.filenet.wcm.api.Session ceSession = credentials.getSession();
%>
<%
// See http://localhost:9080/ecm_help/nav/dev_wp_start.htm?../developer_help/workplace/guide/aeuis_cmd_ref.htm#1420
String baseUrl = controller.getWebappRootURL();
String commandId = "1420";
String responseUrl = URLEncoder.encode(baseUrl);
String windowTitle = WcmEncodingUtil.encodeLabel("Sample Code");
String objectStoreName = WcmEncodingUtil.encodeLabel("ObjectStoreName");
String vsId = "{3DEC23E4-03C2-4728-809A-B77A38DA78C7}";
String mimeType = WcmEncodingUtil.encodeURL("application/x-filenet-documentpolicy");
String op = "add";
String prefill = URLEncoder.encode("field1=1&field2=2&field3=3");
String displayForm = "true";
String showConfirm = "true";
String mergeData = "true";
String linkText = "Click here";
String url= baseUrl + "/integrationWebBasedCommand"
+ "?_commandId=" + commandId
+ "&_responseURL=" + responseUrl
+ "&_windowTitle=" + windowTitle
+ "&objectStoreName=" + objectStoreName
+ "&vsId=" + vsId
+ "&mimeType=" + mimeType
+ "&op=" + op
+ "&" + prefill
+ "&showConfirm=" + showConfirm
+ "&mergeData=" + mergeData ;
%>
');"><%=linkText%>
模仿着看看怎么用,并跳转到自己处理的页面,如何和SERVLET结合,基本上什么事情都能做了。
<%@ page import="filenet.vw.api.*"%>
<%@ page errorPage="/WcmError.jsp"
import="com.filenet.wcm.apps.server.util.*,com.filenet.wcm.toolkit.server.base.*,com.filenet.wcm.toolkit.server.util.WcmServerCredentials,com.filenet.wcm.toolkit.server.util.WcmDataStore,java.util.*"%>
scope="request">
<%@page import="com.filenet.wcm.toolkit.util.WcmEncodingUtil"%>
<%@page import="java.net.URLEncoder"%>
<%
controller.configurePage(application, request, WcmController.NO_WINDOW_ID);
WcmDataStore dataStore = controller.getDataStore();
WcmServerCredentials credentials = dataStore.getServerCredentials();
String username = credentials.getUserId();
String password = credentials.getPassword();
VWSession vwSession = credentials.getVWSession();
//We can't name this variable session because JSP's have a variable named session already.
com.filenet.wcm.api.Session ceSession = credentials.getSession();
%>
<%
// See http://localhost:9080/ecm_help/nav/dev_wp_start.htm?../developer_help/workplace/guide/aeuis_cmd_ref.htm#1420
String baseUrl = controller.getWebappRootURL();
String commandId = "1420";
String responseUrl = URLEncoder.encode(baseUrl);
String windowTitle = WcmEncodingUtil.encodeLabel("Sample Code");
String objectStoreName = WcmEncodingUtil.encodeLabel("ObjectStoreName");
String vsId = "{3DEC23E4-03C2-4728-809A-B77A38DA78C7}";
String mimeType = WcmEncodingUtil.encodeURL("application/x-filenet-documentpolicy");
String op = "add";
String prefill = URLEncoder.encode("field1=1&field2=2&field3=3");
String displayForm = "true";
String showConfirm = "true";
String mergeData = "true";
String linkText = "Click here";
String url= baseUrl + "/integrationWebBasedCommand"
+ "?_commandId=" + commandId
+ "&_responseURL=" + responseUrl
+ "&_windowTitle=" + windowTitle
+ "&objectStoreName=" + objectStoreName
+ "&vsId=" + vsId
+ "&mimeType=" + mimeType
+ "&op=" + op
+ "&" + prefill
+ "&showConfirm=" + showConfirm
+ "&mergeData=" + mergeData ;
%>
');"><%=linkText%>
From:一号门
Previous:Filenet实现报销流程二
Next:根据文档版本VSID,得到文档对象
RELATED ARTICLES
- java获取文件扩展名的误区
- java航空订票系统
- JAVA性能监控与调优参考文档链接
- google authenticator 一次性验证码TOTP java 代码实现
- JAVA https ssl 连接验证服务端证书
- Java里各种路径的区别:getPath(), getCanonicalPath()
- java编译的包兼容性问题Unsupported Major.Minor Version 51.0
- Java 根据年号和第几周得到开始时间和结束时间
- 分享一个定制 ibm case manager widget 的ppt 文档
- Java8来了,回顾一下Java7的一些特性.
- java执行命令行或者shell脚本,批处理的基本方法
- java正则表达式匹配多行文本
- Eclipse下OutOfMemoryError:Java Heap Space问题解决方法
- java 与富文本编辑器 fckeditor 结合的例子(源码下载)
- java RSA公钥加密,私钥解密算法例子.
- spring datasource 密码加密后运行时解密的解决办法
- java web应用防止sql 注入的常规方法
- java 防止 XSS 攻击的常用方法总结.
- java网页程序采用 spring 防止 csrf 攻击.
- java 任意两个时间差,天数,小时数,分钟数,秒数
COMMENTS