• 在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
    




  • 相关阅读:
    霓虹灯牌 V0.3已发布
    ACSL比赛的鸡肋解释器???
    Linux和Aix系统shell获取IP地址
    openWrt编译环境feeds update a
    openWrt(LEDE)下载包目录dl目录新旧差异脚本备份,阿里百度更新下载连接
    20年5月面试汇总
    Redis++:(雪崩、击穿、穿透) 那点事
    Redis++:为什么Redis 是单线程却能支撑高并发?
    Java++:HikariCP连接池参数解释
    我来谈谈“人工智能”这个词给我带来了哪些想法
  • 原文地址:https://www.cnblogs.com/mfrbuaa/p/3900563.html
Copyright © 2020-2023  润新知