在SharePoint 2013 中使用文件庫Scheduling (計劃發布功能)

來源:互聯網
上載者:User

標籤:sharepoint   2013   文件庫   scheduling   計劃發布功能   

本文講述在SharePoint2013 中使用文件庫Scheduling (計劃發布功能)的步驟和注意的事項。

文件庫Scheduling (計劃發布功能)用於設定當文檔通過審批後特定的時間區間內才可以被普通用(非管理員,審批人員和作者)戶看到。也就是說要啟用Scheduling,必須先啟用文件庫的內容審批和小版本控制。這是官方文檔的說法,但是筆者注意到除此之外Draft Item Security要設定成Only users who can approveitems (and the author of the item) 才行:


另外,當在系統文件庫上啟用Scheduling時,SharePoint會自動加列PublishingExpirationDate(Scheduling End Date) 和 PublishingStartDate (Scheduling Start Date)




但是當重新建立一個文件庫時,啟用Scheduling時上面兩列不會自動添加,可以有兩個方法解決

1. 使用系統文件庫模板

a.      將系統文件庫存為模板,如果看不到另存模板的串連可以直接使用/_layouts/15/savetmpl.aspx?List=ListID可以從文件庫設定中找到,或者直接把listedit.aspx換成savetmpl.aspx: /_layouts/15/listedit.aspx?List=%7B465AD054%2DD81B%2D495F%2DAA9F%2D6E44053A3B63%7D

 

b.     再使用a步得到的文件庫模板建立文件庫,這樣建立出來的文件庫啟用Scheduling時上面兩列就會自動添加了 

 

2.   啟用Scheduling後從Site column中添加這兩列PublishingExpirationDate(Scheduling End Date)和 PublishingStartDate(Scheduling Start Date)

用PowerShell的話可以這樣寫:

Param(    [parameter(Mandatory=$true)]    [alias("web")]    $webUrl,    [parameter(Mandatory=$true)]    [alias("DocumentLib")]    $documentLibTitle  )  $webSite = get-SPWeb $webUrl $documentLib = $webSite.Lists[$documentLibTitle] Write-host "Enable content approval"  $documentLib.EnableModeration = $true Write-host "Enable minor version"  $documentLib.EnableMinorVersions = $true $documentLib.DraftVersionVisibility = 2;  # Only users who can approve items (and the author of the item), lib.DraftVersionVisibility = DraftVisibilityType.Approver $documentLib.Update() [Microsoft.SharePoint.Publishing.PublishingWeb]::EnableScheduling($documentLib); # Check if the list have the two column "Scheduling Start Date" and "Scheduling End Date" ## refresh the document library  $documentLib = $webSite.Lists[$documentLibTitle]  if(-Not($documentLib.Fields.ContainsFieldWithStaticName("PublishingStartDate"))) {            Write-host "Adding column Scheduling Start Date"             $listField=$webSite.Site.RootWeb.Fields["Scheduling Start Date"]$documentLib.Fields.AddFieldAsXml($listField.SchemaXml, $true, 4) # SPAddFieldOptions.AddToAllContentTypes = 4$documentLib.Update() }  if(-Not($documentLib.Fields.ContainsFieldWithStaticName("PublishingExpirationDate"))) {      Write-host "Adding column Scheduling Start Date"      $listField=$webSite.Site.RootWeb.Fields["Scheduling End Date"]     $documentLib.Fields.AddFieldAsXml($listField.SchemaXml, $true, 4) $documentLib.Update() }   $webSite.Dispose(); Write-host "Done!" -foregroundcolor green




聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.