안녕하십니까 StackOverflow 회원!Sharepoint 2010 - 사용자에게 샘플 데이터 추가하기 필드 유형
Visual Studio (trough XML)에서 사용자 지정 목록을 개발하고 있습니다. 나는 목록 정의 (내용 유형 포함)를 작성하고 목록 인스턴스를 추가했다.
<?xml version="1.0" encoding="utf-8"?>
<List xmlns:ows="Microsoft SharePoint" Title="Teams" EnableContentTypes="TRUE" FolderCreation="FALSE" Direction="$Resources:Direction;" Url="Lists/Teams" BaseType="0" xmlns="http://schemas.microsoft.com/sharepoint/">
<MetaData>
<ContentTypes>
<ContentTypeRef ID="0x010089E3E6DB8C9B4B3FBB980447E313DE94" />
</ContentTypes>
<Fields>
<Field Type="User" Name="Employee" DisplayName="Employee" Required="TRUE" ID="{7B18E941-BAAD-453A-895C-39579AB5A9F1}" Group="Sample Group" />
<Field Type="Boolean" Name="Manager" DisplayName="Manager" ID="{9FC927CC-45EB-4E9E-8F25-18AAEDF7DCAF}" Group="Sample Group" />
</Fields>
<Views>
<View BaseViewID="0" Type="HTML" MobileView="TRUE" TabularView="FALSE">
<Toolbar Type="Standard" />
<XslLink Default="TRUE">main.xsl</XslLink>
<RowLimit Paged="TRUE">30</RowLimit>
<ViewFields>
<FieldRef Name="Employee" />
<FieldRef Name="Manager" />
</ViewFields>
<Query>
<OrderBy>
<FieldRef Name="Modified" Ascending="FALSE"></FieldRef>
</OrderBy>
</Query>
<ParameterBindings>
<ParameterBinding Name="AddNewAnnouncement" Location="Resource(wss,addnewitem)" />
<ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
<ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_ONET_HOME)" />
</ParameterBindings>
</View>
<View BaseViewID="1" Type="HTML" WebPartZoneID="Main" DisplayName="$Resources:core,objectiv_schema_mwsidcamlidC24;" DefaultView="TRUE" MobileView="TRUE" MobileDefaultView="TRUE" SetupPath="pages\viewpage.aspx" ImageUrl="/_layouts/images/generic.png" Url="AllItems.aspx">
<Toolbar Type="Standard" />
<XslLink Default="TRUE">main.xsl</XslLink>
<RowLimit Paged="TRUE">30</RowLimit>
<ViewFields>
<FieldRef Name="LinkTitle"></FieldRef>
<FieldRef Name="Employee" />
<FieldRef Name="Manager" />
</ViewFields>
<Query>
<OrderBy>
<FieldRef Name="ID"></FieldRef>
</OrderBy>
</Query>
<ParameterBindings>
<ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
<ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_DEFAULT)" />
</ParameterBindings>
</View>
</Views>
<Forms>
<Form Type="DisplayForm" Url="DispForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
<Form Type="EditForm" Url="EditForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
<Form Type="NewForm" Url="NewForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
</Forms>
및 목록 서식 파일 및 콘텐츠 유형 elements.xml :
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<!-- Do not change the value of the Name attribute below. If it does not match the folder name of the List Definition project item, an error will occur when the project is run. -->
<ListTemplate
Name="TeamList"
Type="10000"
BaseType="0"
OnQuickLaunch="TRUE"
SecurityBits="11"
Sequence="410"
DisplayName="TeamList"
Description="My List Definition"
Image="/_layouts/images/itgen.png">
</ListTemplate>
<ContentType
ID="0x010089E3E6DB8C9B4B3FBB980447E313DE94"
Name="Team Member"
Group="Sample Group"
Description=""
Version="0">
<FieldRefs>
<FieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Name="Title" Hidden="TRUE" />
<FieldRef ID="{7B18E941-BAAD-453A-895C-39579AB5A9F1}" />
<FieldRef ID="{9FC927CC-45EB-4E9E-8F25-18AAEDF7DCAF}" />
</FieldRefs>
</ContentType>
<Field Type="User" Name="Employee" DisplayName="Employee" Required="TRUE" ID="{7B18E941-BAAD-453A-895C-39579AB5A9F1}" Group="Sample Group" />
<Field Type="Boolean" Name="Manager" DisplayName="Manager" ID="{9FC927CC-45EB-4E9E-8F25-18AAEDF7DCAF}" Group="Sample Group" />
</Elements>
질문은 : 어떻게 여기
내 목록의 schema.xml입니다 샘플 데이터를이 목록에 추가 하시겠습니까? 특히 "사용자"유형의 필드에?
<ListInstance Title="TeamList"
OnQuickLaunch="TRUE"
TemplateType="10000"
Url="Lists/TeamList"
Description="TeamList">
<Data>
<Rows>
<Row>
<Field Name="Employee">CONTOSO\joses</Field>
<Field Name="Manager">true</Field>
</Row>
</Rows>
</Data>
하지만, 오류가 occures : 오류 '기능을 활성화'배포 단계에서 발생 하나 이상의 필드 유형을
나는 다음과 같은 목록 인스턴스 요소에이 코드를 추가하려고 에 제대로 설치되지 않았습니다. 대화 상자와 함께 작동시키기위한 도움은 매우 감사하겠습니다.
샘플 데이터없이 ListInstance를 만들 수 있습니까? 나는 당신이 목록 제목/URL로 "Zespół"를 지정할 수 있다고 생각하지 않으며 오류가 잘못 될 수도 있습니다 ... – int32
예. 샘플 데이터없이 작동합니다. 오해의 소지가있는 ListInstance 이름에 대해 유감스럽게 생각합니다.이 부분을 환경 언어 (PL)에서 번역하는 것을 잊었습니다. – Redzio
아, 괜찮습니다. 괜찮습니다. CONTOSO \ joses가 있습니까? 그렇다면, 나는이 예외를 야기 할 수있는 아이디어가 더 이상 없기를 두려워합니다. 맞춤 코드없이 이벤트 수신자 – int32