简体   繁体   English

Sharepoint托管的App 2013如何在自定义列表上启用评级

[英]Sharepoint-hosted App 2013 How to I enable ratings on a custom list

Before i posted this question i have done some research to find the solution...with no luck 在我发布此问题之前,我已经进行了一些研究以找到解决方案……没有运气

Here are some links to items i found 这是我找到的物品的一些链接

document rating in SharePoint 2013 hosted app SharePoint 2013托管应用程序中的文档评级

http://www.wictorwilen.se/Post/How-to-provision-SharePoint-2010-Rating-columns-in-Content-Types.aspx http://www.wictorwilen.se/Post/How-to-provision-SharePoint-2010-Rating-columns-in-Content-Types.aspx

The issue i have here is that i have a custom list that is part of the sharepoint app and need to add the sharepoint ratings system 我这里的问题是我有一个自定义列表,该列表是sharepoint应用程序的一部分,需要添加sharepoint评分系统

When i add the columns as suggested in wictorwilen's to the list schema.xml, I get nothing more than a couple of number fields in the list. 当我按照wictorwilen的建议将列添加到列表schema.xml中时,列表中只有几个数字字段。

How do i enable the "Ratings" feature in the app site collection and/or on the list instance? 如何在应用网站集和/或列表实例中启用“评级”功能?

this is the listInstance schema xml 这是listInstance模式xml

<ContentTypes>
  <ContentType ID="0x0100BE18ADD378B44660BBA9D7BDA8D445DC" Name="StoryBoard" Group="Custom Content Types" Description="StoryBoard Content Type" Inherits="False" Version="0">
    <FieldRefs>
      <FieldRef ID="{10aee775-aefb-4cf6-9bbc-5012504b929e}" DisplayName="Story Title" Required="TRUE" Name="StoryTitle" />
      <FieldRef ID="{7DF0EBE6-D778-42C1-9687-C5058E5F09AA}" DisplayName="Story Image" Required="FALSE" Name="StoryImage" />
      <FieldRef ID="{FCA44B87-91A7-4B19-B920-A28B2190DCDA}" DisplayName="Publish Date" Required="TRUE" Name="PublishDate" />
      <FieldRef ID="{D36C06FE-0242-48EC-AE60-0910D759EAA0}" DisplayName="On Behalf Of" Required="TRUE" Name="OnBehalfOf" />
      <FieldRef ID="{C56AABCD-03A9-4572-A716-125414AEEB6D}" DisplayName="Story" Required="TRUE" Name="Story" />
      <FieldRef ID="{5a14d1ab-1513-48c7-97b3-657a5ba6c742}" Name="AverageRating" />
      <FieldRef ID="{b1996002-9167-45e5-a4df-b2c41c6723c7}" Name="RatingCount" />
    </FieldRefs>
  </ContentType>
</ContentTypes>
<Fields>
  <Field ID="{10aee775-aefb-4cf6-9bbc-5012504b929e}" Name="StoryTitle" DisplayName="Story Title" Type="Text" Required="TRUE" Group="Custom Site Columns"></Field>
  <Field ID="{7DF0EBE6-D778-42C1-9687-C5058E5F09AA}" Name="StoryImage" DisplayName="Story Image" Type="URL" Required="FALSE" Group="Custom Site Columns"></Field>
  <Field ID="{FCA44B87-91A7-4B19-B920-A28B2190DCDA}" Name="PublishDate" DisplayName="Publish Date" Type="DateTime" Required="TRUE" Group="Custom Site Columns"></Field>
  <Field ID="{D36C06FE-0242-48EC-AE60-0910D759EAA0}" Name="OnBehalfOf" DisplayName="On Behalf Of" Type="User" Required="FALSE" Group="Custom Site Columns"></Field>
  <Field ID="{C56AABCD-03A9-4572-A716-125414AEEB6D}" Name="Story" DisplayName="Story" Type="Note" Required="FALSE" RichText="TRUE" RichTextMode="FullHtml" Group="Custom Site Columns"></Field>
  <Field ID="{5a14d1ab-1513-48c7-97b3-657a5ba6c742}" Name="AverageRating" Type="Number"></Field>
  <Field ID="{b1996002-9167-45e5-a4df-b2c41c6723c7}" Name="RatingCount" Type="Number"></Field>
</Fields>

Along the fields, the list root folder needs to have a property, "Ratings_VotingExperience" set to "Ratings" or "Likes". 在这些字段中,列表根文件夹需要将属性“ Ratings_VotingExperience”设置为“ Ratings”或“ Likes”。 Here is the code using C# CSOM. 这是使用C#CSOM的代码。

list.RootFolder.Properties["Ratings_VotingExperience"] = "Ratings";

Another option, would be to use CSOM entirely, without a custom Schema.xml. 另一种选择是完全使用CSOM,而无需自定义Schema.xml。 Here is a tested approach on enabling ratings on a list. 是在列表上启用评级的一种经过验证的方法。 You would have to convert the code from C# to Javascript, but this is trivial. 您必须将代码从C#转换为Javascript,但这很简单。

The basic steps are: 基本步骤是:

  1. Add the Rating fields 添加评分字段
  2. Set the property on the root folder (Ratings/Likes) 在根文件夹上设置属性(评分/喜欢)
  3. Add the View fields for Ratings or Likes. 添加“评分”或“喜欢”的“查看”字段。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何以编程方式在SharePoint列表中创建自定义内容类型实例? - How to create a Custom Content Type instance within a SharePoint List programmatically? 使用 VBA 从 Excel 将数据添加到 Sharepoint 2013 列表 - Add data to Sharepoint 2013 list from Excel with VBA 如何从SharePoint 2010中的数据库中找到SharePoint列表的字段? - How could I find the fields of a SharePoint list from database in SharePoint 2010? 如何在 android web 应用程序中启用放大和缩小? - How can I enable zoom in & zoom out in android web app? 如何在Sharepoint 2013中调整/扩展内容编辑器Web部件 - How to adjust/extend the Content Editor Web Part in Sharepoint 2013 访问sharepoint 2013 / office365列表时出现“DTD被禁止”错误(但未公开了解使用XML) - “DTD is prohibited” error when accessing sharepoint 2013/office365 list (but not openly aware of using XML) 如何从共享点列表中检索 json 对象 - How to retrieve a json object from a sharepoint list 将URL变量传递到SharePoint 2013中的xsl中 - Passing a URL variable into xsl in sharepoint 2013 Sharepoint 2013:评估ajax GET请求(XML) - Sharepoint 2013: Evaluation of ajax GET Requests (XML) Sharepoint Foundation 2013 XML owssvr.dll - Sharepoint Foundation 2013 XML owssvr.dll
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM