Localization in Custom Policy Azure B2C - azure-ad-b2c

I have localized DisplayName and UserHelpText (like shown below). How to localize the email pattern HelpText ("The email you provided is not valid")? Please advise
<ClaimType Id="signInName">
<DisplayName>Please enter your email</DisplayName>
<DataType>string</DataType>
<UserHelpText>Enter your email address to signin</UserHelpText>
<Restriction>
<Pattern RegularExpression="^[a-zA-Z0-9_.+-]+#[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$" HelpText="The email you provided is not valid"/>
</Restriction>
</ClaimType>
<Localization Enabled="true">
<SupportedLanguages DefaultLanguage="en" MergeBehavior="ReplaceAll">
<SupportedLanguage>en</SupportedLanguage>
<SupportedLanguage>es</SupportedLanguage>
</SupportedLanguages>
<LocalizedResources Id="en">
<LocalizedStrings>
<LocalizedString ElementType="ClaimType" ElementId="signInName" StringId="DisplayName">Please enter your email</LocalizedString>
<LocalizedString ElementType="ClaimType" ElementId="signInName" StringId="UserHelpText">Enter your email address to signin</LocalizedString>
</LocalizedStrings>
</LocalizedResources>
<LocalizedResources Id="es">
<LocalizedStrings>
<LocalizedString ElementType="ClaimType" ElementId="signInName" StringId="DisplayName">Por favor introduzca su correo electrónico</LocalizedString>
<LocalizedString ElementType="ClaimType" ElementId="signInName" StringId="UserHelpText">Ingrese su dirección de correo electrónico para iniciar sesión</LocalizedString>
</LocalizedStrings>
</LocalizedResources>
</Localization>

For invalid email Id, you can use inbuilt invalid_email UXElement and add the below LocalizedString:
<LocalizedString ElementType="UxElement" StringId="invalid_email">#Please enter a valid email address</LocalizedString>
Reference docs:
https://learn.microsoft.com/en-us/azure/active-directory-b2c/custom-policy-localization
https://medium.com/the-new-control-plane/customising-the-message-error-text-in-azure-ad-b2c-custom-policies-d1e1ff2640d3

Found the best way.
For en,
<LocalizedString ElementType="ClaimType" ElementId="signInName" StringId="PatternHelpText">The email you provided is not valid</LocalizedString>
For es,
<LocalizedString ElementType="ClaimType" ElementId="signInName" StringId="PatternHelpText">El correo electrónico que proporcionaste no es válido</LocalizedString>

I have the "same" problem with the localization.
In my TrustedFrameworkExperience file I added the password complexity:
<Predicates>
<Predicate Id="LengthRange" Method="IsLengthRange">
<UserHelpText>The password must be between 10 and 16 characters</UserHelpText>
<Parameters>
<Parameter Id="Minimum">10</Parameter>
<Parameter Id="Maximum">16</Parameter>
</Parameters>
</Predicate>
<Predicate Id="Lowercase" Method="IncludesCharacters">
<UserHelpText>a lowercase letter</UserHelpText>
<Parameters>
<Parameter Id="CharacterSet">a-z</Parameter>
</Parameters>
</Predicate>
<Predicate Id="Uppercase" Method="IncludesCharacters">
<UserHelpText>an uppercase letter</UserHelpText>
<Parameters>
<Parameter Id="CharacterSet">A-Z</Parameter>
</Parameters>
</Predicate>
<Predicate Id="Number" Method="IncludesCharacters">
<UserHelpText>a digit</UserHelpText>
<Parameters>
<Parameter Id="CharacterSet">0-9</Parameter>
</Parameters>
</Predicate>
<Predicate Id="Symbol" Method="IncludesCharacters">
<UserHelpText>a symbol</UserHelpText>
<Parameters>
<Parameter Id="CharacterSet">##$%^&*\-_+=[]{}|\\:',.?/`~"();!</Parameter>
</Parameters>
</Predicate>
<Predicate Id="DisallowedWhitespace" Method="MatchesRegex" HelpText="The password must not begin or end with a whitespace character">
<Parameters>
<Parameter Id="RegularExpression">(^\S.*\S$)|(^\S+$)|(^$)</Parameter>
</Parameters>
</Predicate>
</Predicates>
<PredicateValidations>
<PredicateValidation Id="CustomPassword">
<PredicateGroups>
<PredicateGroup Id="DisallowedWhitespaceGroup">
<PredicateReferences>
<PredicateReference Id="DisallowedWhitespace" />
</PredicateReferences>
</PredicateGroup>
<PredicateGroup Id="LengthGroup">
<PredicateReferences MatchAtLeast="1">
<PredicateReference Id="LengthRange" />
</PredicateReferences>
</PredicateGroup>
<PredicateGroup Id="CharacterClasses">
<UserHelpText>The password must have at least one of the following:</UserHelpText>
<PredicateReferences MatchAtLeast="4">
<PredicateReference Id="Lowercase" />
<PredicateReference Id="Uppercase" />
<PredicateReference Id="Number" />
<PredicateReference Id="Symbol" />
</PredicateReferences>
</PredicateGroup>
</PredicateGroups>
</PredicateValidation>
</PredicateValidations>
How can I add the localization for the UserHelpText?
P.S. Resolved
I edited the trust framework localization file and added the localized string on localizedresourcesid api.localaccountsignup
Localized string element type "predictate" elementid "lenghtrange" stringid "helptext"
Localized string element type "predictate" elementid "lowercase" stringid "helptext"
Localized string element type "predictate" elementid "uppercase" stringid "helptext"
Localized string element type "predictate" elementid "number" stringid "helptext"
Localized string element type "predictate" elementid "Symbol" stringid "helptext"
Localized string element type "predictatevalidation" elementid "custompassword" stringid "characterclasses"

Related

Unable to translate signin page in Azure AD B2C IEF

Recently wanted to translate our custom SignUpSignin policy to Italian.
We can customize the UI just fine, and translate most texts. However, we are unable to modify the "E-Mail" and the "Password" translations. The email claim is translated just fine in other policies (e.g. password reset).
We tried various claim names without success (signInName, email, password, ...). Translations in german did not work either.
<UserJourney Id="SignUpOrSignIn">
<OrchestrationSteps>
<OrchestrationStep Order="1"
Type="CombinedSignInAndSignUp"
ContentDefinitionReferenceId="api.signuporsignin">
...
<ContentDefinition Id="api.signuporsignin">
<LoadUri>our_custom_ui</LoadUri>
<RecoveryUri>~/common/default_page_error.html</RecoveryUri>
<DataUri>urn:com:microsoft:aad:b2c:elements:unifiedssp:1.0.0</DataUri>
<Metadata>
<Item Key="DisplayName">Signin and Signup</Item>
</Metadata>
<LocalizedResourcesReferences>
<LocalizedResourcesReference Language="de"
LocalizedResourcesReferenceId="de" />
<LocalizedResourcesReference Language="en"
LocalizedResourcesReferenceId="en" />
<LocalizedResourcesReference Language="it"
LocalizedResourcesReferenceId="it" />
</LocalizedResourcesReferences>
</ContentDefinition>
...
<Localization>
<SupportedLanguages DefaultLanguage="en">
<SupportedLanguage>en</SupportedLanguage>
<SupportedLanguage>de</SupportedLanguage>
<SupportedLanguage>it</SupportedLanguage>
</SupportedLanguages>
<LocalizedResources Id="it">
<LocalizedStrings>
<LocalizedString ElementType="ClaimType"
ElementId="email"
StringId="DisplayName">Indirizzo e-mail</LocalizedString>
<LocalizedString ElementType="ClaimType"
ElementId="signInName"
StringId="DisplayName">Indirizzo e-mail</LocalizedString>
<LocalizedString ElementType="ClaimType"
ElementId="password"
StringId="DisplayName">Some dummy text</LocalizedString>
Update:
This is my resulting html
<div class="entry">
<div class="entry-item">
<label for="signInName">
Indirizzo di posta elettronica
</label>
<div class="error itemLevel" aria-hidden="true" style="display: none;">
<p role="alert"></p>
</div>
<input id="signInName" name="Indirizzo e-mail" pattern="^...$" placeholder="Indirizzo di posta elettronica" value="" tabindex="1" type="email">
</div>
<div class="entry-item">
<div class="password-label">
<label for="password">Password</label>
<a id="forgotPassword" tabindex="2" href="...">Password dimenticata?</a>
</div>
<div class="error itemLevel" aria-hidden="true" style="display: none;">
<p role="alert"></p>
</div>
<input id="password" name="Some dummy text" placeholder="Password" tabindex="1" type="password">
</div>
<div class="working"></div>
<div class="buttons">
<button id="next" tabindex="1">Accedi</button>
</div>
</div>
You must add the <SupportedLanguages /> element to the<Localization /> element:
<BuildingBlocks>
<Localization>
<SupportedLanguages DefaultLanguage="en">
<SupportedLanguage>de</SupportedLanguage>
<SupportedLanguage>en</SupportedLanguage>
<SupportedLanguage>it</SupportedLanguage>
</SupportedLanguages>
</Localization>
</BuildingBlocks>

SAML 2.0 Response and the KeyInfo element

All, I have a quick question on the SAML 2.0 response that I've been working with as part of my web SSO.We are the Identity provider and we send SAML token to our Service Provider(SP). SP wants us to sign the entire before sending that.We sent SP our public certificate already. Whose certificate details go under the element in the generated SAML 2.0 response ? Is that the IDP's or the Service Providers(SP).We don't have a public certificate from our SP yet
<samlp2:Response xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ID="_71b134e9-1ab3-4680-90a4-3b95c8530a59" Version="2.0" IssueInstant="2017-09-21T17:29:21.6178748Z" Destination="https://sp.com" xmlns:samlp2="urn:oasis:names:tc:SAML:2.0:protocol">
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
<Reference URI="#_79b534eb-9771-4d22-9d61-d4dc5997be70">
<Transforms>
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
<Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>RzEq/7vrq</DigestValue>
</Reference>
</SignedInfo>
<SignatureValue>jQCx6BZyoW+okh+zxwrd</SignatureValue>
<KeyInfo>
<X509Data>
<X509IssuerSerial>
<X509IssuerName>CN=CA, DC=us, DC=local</X509IssuerName>
<X509SerialNumber>1248841732558767</X509SerialNumber>
</X509IssuerSerial>
<X509Certificate>MIIEpTCCA42gAwIBAgITOAAAARWJYtXzIdPzr</X509Certificate>
</X509Data>
</KeyInfo>
</Signature>
<samlp2:Status>
<samlp2:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success" />
</samlp2:Status>
<saml2:Assertion Version="2.0" ID="_79b534eb-9771-4d22-9d61-d4dc5997be70" IssueInstant="2017-09-21T17:29:21.6208748Z" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion">
<saml2:Issuer>https://mycompany.com/</saml2:Issuer>
<saml2:Subject>
<saml2:NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified">TestUser</saml2:NameID>
<saml2:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
<saml2:SubjectConfirmationData NotBefore="2017-09-21T17:29:21.6218748Z" NotOnOrAfter="2017-09-21T17:33:21.6218748Z" />
</saml2:SubjectConfirmation>
</saml2:Subject>
<saml2:Conditions NotBefore="2017-09-21T17:29:21.6218748Z" NotOnOrAfter="2017-09-21T17:33:21.6218748Z" />
<saml2:AuthnStatement AuthnInstant="2017-09-21T17:29:21.6228748Z" SessionNotOnOrAfter="2017-09-21T17:34:21.6228748Z">
<saml2:AuthnContext>
<saml2:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:unspecified</saml2:AuthnContextClassRef>
</saml2:AuthnContext>
</saml2:AuthnStatement>
<saml20:AttributeStatement xmlns:saml20="urn:oasis:names:tc:SAML:2.0:assertion">
<saml20:Attribute Name="MyCompany" NameFormat="www.sp.com">
<saml20:AttributeValue>test value</saml20:AttributeValue>
</saml20:Attribute>
</saml20:AttributeStatement>
</saml2:Assertion>
</samlp2:Response>
The certificate in the Response should be the one of the IDP. This way the SP can be sure the IDP signed the response and it wasn't manipulated by the user agent (or anyone else).

DocuSign API - Creating an envelope with a Document that has an Approve button

I am creating a draft envelope with a TXT document - which needs to display an Approve button to allow the signer to sign without placing a signature/initials on the document itself. Unfortunately I can't get the Approve button to show on the document, where have I gone wrong?
Here is the Request XML:
<ns1:envelopeDefinition xmlns:ns1="http://www.docusign.com/restapi">
<ns1:emailSubject>Test from iPaaS</ns1:emailSubject>
<ns1:documents>
<ns1:document>
<ns1:name>TestDocument</ns1:name>
<ns1:documentId>1</ns1:documentId>
<ns1:documentBase64><Base64BytesHere></ns1:documentBase64>
<ns1:fileExtension>txt</ns1:fileExtension>
</ns1:document>
</ns1:documents>
<ns1:recipients>
<ns1:signers>
<ns1:signer>
<ns1:routingOrder>1</ns1:routingOrder>
<ns1:recipientId>1</ns1:recipientId>
<ns1:name>John Smith</ns1:name>
<ns1:email>nobody#nobody.com</ns1:email>
</ns1:signer>
</ns1:signers>
</ns1:recipients>
<ns1:tabs>
<ns1:approveTabs>
<ns1:approve>
<anchorCaseSensitive />
<anchorHorizontalAlignment />
<anchorIgnoreIfNotPresent />
<anchorMatchWholeWord />
<anchorString />
<anchorUnits />
<anchorXOffset />
<anchorYOffset />
<conditionalParentLabel />
<conditionalParentValue />
<customTabId />
<documentId>1</documentId>
<mergeField />
<pageNumber>1</pageNumber>
<recipientId>1</recipientId>
<tabId />
<tabOrder />
<templateLocked />
<templateRequired />
<xPosition>100</xPosition>
<yPosition>100</yPosition>
<bold />
<font />
<fontColor />
<fontSize />
<italic />
<tabLabel />
<underline />
<buttonText />
<height>30</height>
<width>50</width>
</ns1:approve>
</ns1:approveTabs>
</ns1:tabs>
</ns1:envelopeDefinition>
Essentially I am looking for something that looks like the attached screenshot
The <tabs> node should be inside the <signer> node. The following example should work.
<ns1:envelopeDefinition xmlns:ns1="http://www.docusign.com/restapi">
<ns1:emailSubject>Test from iPaaS</ns1:emailSubject>
<ns1:documents>
<ns1:document>
<ns1:name>TestDocument</ns1:name>
<ns1:documentId>1</ns1:documentId>
<ns1:fileExtension>txt</ns1:fileExtension>
<ns1:documentBase64>RG9jIFRXTyBUV08gVFdP</ns1:documentBase64>
<ns1:fileExtension>txt</ns1:fileExtension>
</ns1:document>
</ns1:documents>
<ns1:recipients>
<ns1:signers>
<ns1:signer>
<ns1:routingOrder>1</ns1:routingOrder>
<ns1:recipientId>1</ns1:recipientId>
<ns1:name>John Smith</ns1:name>
<ns1:email>johnsmith#acme.com</ns1:email>
<ns1:tabs>
<ns1:approveTabs>
<ns1:approve>
<documentId>1</documentId>
<pageNumber>1</pageNumber>
<xPosition>100</xPosition>
<yPosition>100</yPosition>
<height>30</height>
<width>50</width>
</ns1:approve>
</ns1:approveTabs>
</ns1:tabs>
</ns1:signer>
</ns1:signers>
</ns1:recipients>
</ns1:envelopeDefinition>

Required Field/FieldRef Content Type not working correctly for currency

I have the following field specified in my ContentType xml for a currency field. Any other required field in the content type works as expected for the list bar this one, it doesn't show as required. I really can't see what is wrong, can anyone help please?
<Field ID="{060e50ac-e9c1-4d3c-b1f9-de0bcac300f6}" Name="Price" DisplayName="Price" Type="Currency" Decimals="2" Min="0" Required="TRUE" Group="MyGroup" ColName="Price"/>
...
<ContentType ID="0x01000a35b7a7e98c46248e063d79ddd67f6c"
Name="MarketPlaceContentType"
Group="MyGroup"
Description="Market place item, holds Title, Description, Category etc"
Inherits="FALSE"
Overwrite="TRUE"
Version="0">
<FieldRef ID="{060E50AC-E9C1-4D3C-B1F9-DE0BCAC300F6}" Name="Price" DisplayName="Price" Required="TRUE" />
i'm working on this with Burt and can share a bit more light on the issue, guidance on what we are doing wrong would be great!!
1) We've created a content type.
E.g
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Field ID="{060e50ac-e9c1-4d3c-b1f9-de0bcac300f6}" Name="Price" DisplayName="Price" Type="Text" Required="False" Group="" ColName="Price" StaticName="Price" />
<!-- Parent ContentType: Item (0x01) -->
<!-- set Inherits="FALSE" so the new template is picked up-->
<ContentType ID="0x01000a35b7a7e98c46248e063d79ddd67f6c"
Name="MarketPlaceContentType"
Group=""
Description="Market place item, holds Title, Description, Category etc"
Inherits="FALSE"
Version="0">
<FieldRefs>
<FieldRef ID="{060E50AC-E9C1-4D3C-B1F9-DE0BCAC300F6}" Name="Price" DisplayName="Price" Required="TRUE" />
</FieldRefs>
</ContentType>
</Elements>
2) We've created a list definition using this content type
<
?xml version="1.0" encoding="utf-8"?>
<List xmlns:ows="Microsoft SharePoint" Title="Lists - MarketPlace" FolderCreation="FALSE" Direction="$Resources:Direction;" Url="Lists/Lists-MarketPlace"
BaseType="0" xmlns="http://schemas.microsoft.com/sharepoint/" NavigateForFormsPages="False" DisableAttachments="true" BrowserFileHandling="permissive" EnableContentTypes="TRUE">
<MetaData>
<ContentTypes>
<ContentType ID="0x01000a35b7a7e98c46248e063d79ddd67f6c" Name="MarketPlaceContentType"
Group="" Description="Market place item, holds Title, Description, Category etc" >
<FieldRefs>
<FieldRef ID="{060E50AC-E9C1-4D3C-B1F9-DE0BCAC300F6}" Name="Price" DisplayName="Price" Required="true" />
</FieldRefs>
</ContentType>
</ContentTypes>
<Fields>
<Field ID="{060e50ac-e9c1-4d3c-b1f9-de0bcac300f6}" Name="Price" DisplayName="Price" Type="Text" Required="True" Group="" />
</Fields>
<Views>
<View BaseViewID="0" Type="HTML" MobileView="TRUE" TabularView="FALSE">
<Toolbar Type="Standard" />
<XslLink>main.xsl</XslLink>
<RowLimit Paged="TRUE">30</RowLimit>
<ViewFields>
<FieldRef Name="LinkTitleNoMenu">
</FieldRef>
</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\template\marketpgviewpage.aspx" ImageUrl="/_layouts/images/generic.png" Url="AllItems.aspx" >
<Toolbar Type="Standard" />
<XslLink Default="TRUE">main.xsl</XslLink>
<RowLimit Paged="TRUE">10</RowLimit>
<ViewFields>
<FieldRef Name="MarketplaceCategories" DisplayName="Category"></FieldRef>
<FieldRef Name="LinkTitle" DisplayName="Title"></FieldRef>
<FieldRef Name="Author" DisplayName="Name" />
<FieldRef Name="Created" Format="DateOnly" DisplayName="Date"/>
<FieldRef Name="Locations" DisplayName="Location"></FieldRef>
<FieldRef Name="MarketplaceItemExpiryDate" DisplayName="Expiry Date" Format="DateOnly"></FieldRef>
</ViewFields>
<Query>
<OrderBy>
<FieldRef Name="ID" Ascending="False" />
</OrderBy>
</Query>
<ParameterBindings>
<ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
<ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_DEFAULT)" />
</ParameterBindings>
</View>
<View BaseViewID="2" Type="HTML" WebPartZoneID="Main" DisplayName="Items By Category" DefaultView="false" MobileView="TRUE"
MobileDefaultView="TRUE"
SetupPath="pages\template\marketpgviewpage.aspx" ImageUrl="/_layouts/images/generic.png" Url="ItemsByCategory.aspx" >
<Toolbar Type="Standard" />
<XslLink Default="TRUE">main.xsl</XslLink>
<RowLimit Paged="TRUE">10</RowLimit>
<ViewFields>
<FieldRef Name="LinkTitle" DisplayName="Title"></FieldRef>
<FieldRef Name="Price"/>
</ViewFields>
<Query>
<Where>
<Eq>
<FieldRef Name="MarketplaceCategories" />
<Value Type="Text">{MarketplaceCategories}</Value>
</Eq>
</Where>
<OrderBy>
<FieldRef Name="Created" Ascending="False" />
</OrderBy>
</Query>
<ParameterBindings>
<ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
<ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_DEFAULT)" />
<ParameterBinding Name="MarketplaceCategories" Location="Control(tcCategories, SelectedItem)"/>
</ParameterBindings>
</View>
</Views>
<Forms>
<Form Type="NewForm" Url="NewForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main"/>
<Form Type="EditForm" Url="EditForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
<Form Type="DisplayForm" Url="CustomDisplayForm.aspx" SetupPath="features\$SharePoint.Feature.DeploymentPath$\MarketPlace\displayitem.aspx" UseLegacyForm="true" WebPartZoneID="Main" Template="MarketPlaceDisplayForm"/>
</Forms>
</MetaData>
</List>
3) Our content types have various fields that we want to amend their attributes but we are unable to update them easily.
Any pointers on what we are doing wrong would be great !!!!
We've resolved the issue, for anyone who reads this and spends hours going mental like i did!!!!
Content Type allows you to create your basic data structure for reuse, e.g. JumbleSale item. The item has various properties that already exist in SharePoint as site columns, e.g Title. It also has some properties that are unique to 'CUSTOM PROJECT', e.g Location and some that are unique to the item, e.g. Price.
The JumbleSale content type defines a structure that holds all these properties together. New fields unique to the content type are defined in the elements.xml of the content type. Reused fields from 'CUSTOM PROJECT' and SharePoint site columns are referenced via FieldRef properties (NB. 'CUSTOM PROJECT' Site columns could be defined in the Custom'CUSTOM PROJECT'Fields wsp).
List definition's, declared via the schema.xml, reference these content types definitions. They also list the Views and Filters.
(NB. OTB Visual studio will copy the content type definition into the content type field ref section in the schema.xml. To avoid complications, remove the duplicate FieldRef's.)
To update the displayName of any SharePoint Site Column in your list definition:
Redeclare the fields by copying the field definition to the Field section in the schema.
Update the displayName property
Add Sealed=”TRUE”
Update the views to display the columns of the content type you wish to display.
Look at this link for similar scenario, http://spandothers.wordpress.com/2009/01/17/renaming-the-title-column-in-a-sharepoint-list/

Sharepoint 2010 - Adding Sample data to User Field type

Hi StackOverflow members!
I have developing custom list in Visual Studio (trough XML). I created list definition (with content type) and added list instance to it.
Here is schema.xml of my list:
<?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>
and elements.xml with list template and content type:
<?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>
The question is: how to add sample data to this list? Especially to field of type "User"?
I tried to add this code in list instance element like this:
<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>
but, error occures: Error occurred in deployment step 'Activate Features': At least one field type in not installed properly. Any help for makeing it work with dialog would be very appreciated.
A User field is a special type of Lookup field. As such, the text value is represented in the format of ID;#TextValue. And really, it is only the ID that is important. The Value is largely ignored. This can be a problem because while the username will always be the same, the ID that represents that user will change from site collection to site collection.
Your row XML should look something like this:
<Data>
<Rows>
<Row>
<Field Name="Employee">99;#CONTOSO\joses</Field>
<Field Name="Manager">true</Field>
</Row>
</Rows>
</Data>
You said that this is being deployed to an existing site, so you can browse to the User Information page for CONTOSO\joses. The ID will be in the URL's query string. But be aware that even if the feature works in this site, there is no guarantee that the feature will work in other site collections.
To avoid this problem, instead of seeding a list instance using XML, I will generally use a Feature Receiver to pre-populate lists with User fields. I prefer EnsureUser because it will add the user to the site if the user does not already exist.
This will also work:
<Field Name="Employee">-1;#CONTOSO\joses</Field>
In SharePoint 2013 using -1;# to fill a column of type User is less prone to error.
If you misspell or provide a nonexistent user:
<Field Name="Employee">-1;#domain\nonexistent account or misspelled</Field>
The record is NOT created.
Explicitly specifying the ID may result in assigning an existing group or user and could be lot harder to debug. Especially if you also provide a value for the ID column:
<Field Name="ID">1</Field>
<Field Name="Employee">1;#domain\nonexistent account or misspelled</Field>
Both Rich's and Jonathan's answers are correct, just wanted to clarify and couldn't comment due to low rep.

Resources