日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

深入浅出InfoPath——让管理员来部署InfoPath表单

發布時間:2023/12/20 编程问答 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 深入浅出InfoPath——让管理员来部署InfoPath表单 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

應用場景

我們(乙方)在給客戶提供基于InfoPath表單(尤其是包含托管代碼的)的工作流解決方案的時候,常常需要客戶(甲方)的SharePoint管理員來幫忙在安裝SharePoint Server的服務器上部署,而管理員不需要知道需要哪些步驟來完成InfoPath Service的部署,更不愿意看到通過繁瑣的操作來完成預定的任務。大家都知道企業軟件有個特點:盡可能少的Code。要想問題少的最好辦法就使用盡可能少的代碼。所以我們使用命令來部署InfoPath Service自動化部署InfoPath表單是最好的辦法。

基本原理:

使用bat命令或者PowerShell來執行SharePoint管理命令。SharePoint為管理員提供了以下部署InfoPath表單的命令:
%STSADM% -o RemoveFormTemplate -filename

%STSADM% -o uploadformtemplate -filename

%STSADM% -o deactivateformtemplate -url %SITEURL% -filename

%STSADM% -o activateformtemplate -url %SITEURL% -filename

參考方案

我們現在需要客戶的SharePoint管理員來重新部署我們提供的出差申請流程。

1 文件結構如下放置

2 bat腳本

@SET STSADM="%programfiles%\Common Files\Microsoft Shared\web server extensions\12\BIN\STSADM.EXE"
@
SET SITEURL="https://www.cnblogs.com/sites/mingle"

%STSADM% -o RemoveFormTemplate -filename
"Mingle.FormTemplates\BusinessTripRequest.xsn"
%STSADM% -o execadmsvcjobs

%STSADM% -o uploadformtemplate -filename
"Mingle.FormTemplates\BusinessTripRequest.xsn"
%STSADM% -o execadmsvcjobs

%STSADM% -o deactivateformtemplate -url %SITEURL% -filename
"Mingle.FormTemplates\BusinessTripRequest.xsn"
%STSADM% -o execadmsvcjobs

%STSADM% -o activateformtemplate -url %SITEURL% -filename
"Mingle.FormTemplates\BusinessTripRequest.xsn"
%STSADM% -o execadmsvcjobs

pause

如果我們第一次部署InfoPath表單,可以僅使用uploadformtemplate和activateformtemplate即可。

補充說明

a、execadmsvcjobs此命令可以保證下達的任務馬上執行。我們在實際部署中經常遇到部署后10多個小時,新的InfoPath設計才生效。

b、為什么我們重新部署的時候需要先反激活InfoPath表單,然后再重新激活呢?因為InfoPath表單新的設計使用的站點不重新激活的話,新的設計信息將不生效。

以上問題在我們手工部署InfoPath表單的時候也常常碰到同樣的問題。

?

?

擴展閱讀

在SharePoint2010中可以通過Feature來部署沙箱的InfoPath表單,以下命令可供使用

Uninstall the existing solution?(based on the from file name):
Uninstall-SPInfoPathFormTemplate -Identity Exampleform.xsn
Install the new solution (based on the from file name):
Install-SPInfoPathFormTemplate -Path C:\Form.xsn
Disable feature on site collection level
Disable-SPInfoPathFormTemplate -Identity "Form.xsn" -Site http://SPSite?
Enable feature on site collection level
Enable-SPInfoPathFormTemplate -Identity "Form.xsn" -Site "http://SPSite"?

?

轉載于:https://www.cnblogs.com/mingle/archive/2011/01/30/1947930.html

總結

以上是生活随笔為你收集整理的深入浅出InfoPath——让管理员来部署InfoPath表单的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。