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,得到文档对象
COMMENTS