I'm creating a new component Talend. This component have many data in input (example : a Title, a Content, an Extract and an Author) and it returns same data (but Title, Extract and Content have been modified). So, in output I have the Title modified, the Content modified, the Extract modified and the Author (which it has not been modified).
I would that my component returns another line. A line more. An id for example. Is it possible that my component create new "line" and returns them ?
I don't know if I'm understandable...
Can you help me please ?
Bye.
PS : If you're french : it's a french forum with my problem
I solved my problem.
I must add this in the xml files :
<PARAMETER NAME="SCHEMA" FIELD="SCHEMA_TYPE" REQUIRED="true" NUM_ROW="10">
<TABLE READONLY="false">
<COLUMN NAME="id" TYPE="id_String" LENGTH="255" READONLY="true" CUSTOM="true" />
</TABLE>
</PARAMETER>
Related
We want to create lists in our tenant on developer site. We want do develope it in our developer site and than deploy on client side using package (maybe sppkg).
We tried to create lists in visual studio 2017 using Sharepoint Add-in and in Visual studio code by using SPFX framework, with tutorials based on microsoft spfx documentation link - https://learn.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/provision-sp-assets-from-package.
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Field ID="{060E50AC-E9C1-4D3C-B1F9-DE0BCAC300F6}"
Name="SPFxAmount"
DisplayName="Amount"
Type="Currency"
Decimals="2"
Min="0"
Required="FALSE"
Group="SPFx Columns" />
<Field ID="{943E7530-5E2B-4C02-8259-CCD93A9ECB18}"
Name="SPFxCostCenter"
DisplayName="Cost Center"
Type="Choice"
Required="FALSE"
Group="SPFx Columns">
<CHOICES>
<CHOICE>Administration</CHOICE>
<CHOICE>Information</CHOICE>
<CHOICE>Facilities</CHOICE>
<CHOICE>Operations</CHOICE>
<CHOICE>Sales</CHOICE>
<CHOICE>Marketing</CHOICE>
</CHOICES>
</Field>
<ContentType ID="0x010042D0C1C200A14B6887742B6344675C8B"
Name="Cost Center"
Group="SPFx Content Types"
Description="Sample content types from web part solution">
<FieldRefs>
<FieldRef ID="{060E50AC-E9C1-4D3C-B1F9-DE0BCAC300F6}" />
<FieldRef ID="{943E7530-5E2B-4C02-8259-CCD93A9ECB18}" />
</FieldRefs>
</ContentType>
<ListInstance
CustomSchema="schema.xml"
FeatureId="00bfea71-de22-43b2-a848-c05709900100"
Title="SPFx List"
Description="SPFx List"
TemplateType="100"
Url="Lists/SPFxList">
</ListInstance>
</Elements>
With SPFX we created webpart and in code we created 2 lists in elemnts.xml and schema.xml. Than we had problem with some content type IDs. So our problem is to create list by code. Can anybody give us advice what and how is best option to develope these lists?
Etc this two simple lists
Employee -name,surename
Vacation -employee, numberOfDays
Unfortunately, documentation for the XML is a bit hard-to-find. Here is an overview of what I've learned thus far working with SPFx:
Fields
Let's start by creating some Fields. If you want to create a SharePoint list, Fields would represent the columns of the list. The basic outline of a Field is as follows (note that the #1 through #5 are for reference purposes only, and should not be included in any final code):
<Field
1 ID="{DAFF97CE-C27D-4D27-9863-4422526CC395}"
2 Name="EmployeeName"
3 DisplayName="Name"
4 Description="Column for the employee's first name."
5 Type="Text"
/>
ID: GUID (Globally Unique IDentifier) for the Field. You need to generate one. Use an online generator such as this one - make sure it is uppercase, with hyphens, and with braces (reference). Visual Studio has a generator built-in, if you are using it.
Name: The Internal Name for the Field. This is the name that exists "under the hood". If you interact with the Field programmatically, this is the name you would use.
DisplayName: The Display Name for the Field. This is the name that is shown in SharePoint. It is usually for presentation purposes only.
Description: A text description of the Field. Useful for remembering what a field is for, but not important otherwise.
Type: This is the important one. It defines what kind of column you will create. As you have likely seen when creating columns in the SharePoint web interface, there are a lot of different types, such as "Single line of text", "Date and time", "Person or group", "Calculated", etc. The Type attribute directly maps to these allowed choices.
Types
The hard part is figuring out what the allowed values for Type are. Thankfully, these are documented in the Field element specification. Scroll down to the row for Type.
Examine the documentation for whether there are other required or optional attributes based on the Type you selected. For example, for a Number type, you can have extra attributes Decimals, Min, and Max. Below, we can specify that for Number Of Days, you can only pick a whole number, cannot take less than 1 day off, and cannot take more than 30 days off.
<Field
ID="{B34A7173-5AB7-4ABC-812B-EF8D0386498F}"
Name="NumberOfDays"
DisplayName="Number of Days"
Description="The number of days employee will take off."
Type="Number"
Decimals="0"
Min="1"
Max="30"
/>
List Fields vs. Site Fields
Once you have created the Fields, you have a choice to make: Should these fields be List Columns or Site Columns?
Fields that are entered into a schema.xml will become List Columns; in other words, limited to that List.
Fields that are entered into elements.xml will become Site Columns.
Keep this choice in mind, and keep the Field definitions you created. We will come back to them.
Lists
Now let's create a List Schema. You will not (and should not) have to create this thing from scratch - look at and copy-and-paste the boilerplate below into your solution (again, numbers on the left are for reference purposes only):
<List xmlns:ows="Microsoft SharePoint"
1 BaseType="0"
Direction="$Resources:Direction;"
xmlns="http://schemas.microsoft.com/sharepoint/">
<MetaData>
<ContentTypes />
2 <Fields></Fields>
<Views>
<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/dlicon.png"
Url="AllItems.aspx">
<XslLink Default="TRUE">main.xsl</XslLink>
<JSLink>clienttemplates.js</JSLink>
<RowLimit Paged="TRUE">30</RowLimit>
<Toolbar Type="Standard" />
3 <ViewFields>
<FieldRef Name="<FIELD_1>" />
<FieldRef Name="<FIELD_2>" />
<FieldRef Name="<FIELD_3>" />
</ViewFields>
<Query>
<OrderBy>
<FieldRef Name="ID" />
</OrderBy>
</Query>
</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>
</MetaData>
</List>
BaseType: This represents the type of list you want to create. See this documentation for the allowed values. Generic List (the type you would create if you clicked "Add Custom List" or "Create List" in the SharePoint web interface) would be 0, and is probably most common. Another common option is Document Library, which would be 1.
Fields: If you have chosen to create your Fields as List Columns, this is where you would paste your Field definitions. Field definitions added here will be automatically created in the list, when the list is created. (If you want Site Columns, leave the Fields as-is, and save your Field definitions for later.)
<!-- ... -->
<ContentTypes />
<Fields>
<Field
ID="{DAFF97CE-C27D-4D27-9863-4422526CC395}"
Name="EmployeeName"
DisplayName="Name"
Description="Column for the employee's first name."
Type="Text"
/>
<Field
ID="{AA4D083E-1B32-4AF5-B572-DA06B3996A94}"
Name="EmployeeSurname"
DisplayName="Surname"
Description="Column for the employee's surname."
Type="Text"
/>
</Fields>
<Views>
<!-- ... -->
ViewFields: ViewFields define the columns that will be visible in the View in which it is associated. (Playing around with Views is a more advanced topic for another post.) For now, ensure that you have a FieldRef for each Field that you add to your list. Make sure to specify the Internal Name of each Field. (Always do this, regardless of whether you want List Columns or Site Columns.)
<!-- ... -->
<Toolbar Type="Standard" />
<ViewFields>
<FieldRef Name="EmployeeName" />
<FieldRef Name="EmployeeSurname" />
</ViewFields>
<Query>
<!-- ... -->
Now you have a List Schema which defines everything you need to know about a List.
Note: If you want multiple different lists, you must create multiple List Schema files. Just copy-and-paste the boilerplate schema, and add modifications in the same way as above.
Elements
Finally let's tie everything together. elements.xml is where you tell SPFx every item you want provisioned.
To create a list, you need a ListInstance element. Here is the documentation. Below is an example of an elements.xml file (once again, the numbers on the left are for reference only):
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<ListInstance
1 CustomSchema="schema-employees.xml"
2 Description="List for employee name and surname."
3 FeatureId="00bfea71-de22-43b2-a848-c05709900100"
4 TemplateType="100"
5 Title="Employee Names"
6 Url="Lists/EmployeeNames"
/>
</Elements>
CustomSchema: Name of the List Schema file that we worked on earlier. In this case I have called it schema-employees.xml - you can name it whatever you like, just make sure the names match.
Description: A text description of the list. Not too important.
FeatureId: Recall that earlier in the List Schema we decided that we were making a Custom List with BaseType="0". A Custom List has a corresponding Feature ID, which must match the type of List created. See here for a list of feature IDs. Find the Feature Name for CustomList to double-check that the Feature IDs are the same. If you were provisioning another kind of list, such as a Document Library, you would have to come here to find the corresponding FeatureId.
Template Type: This is another part that must match the type of List created. See here for a list of template types. In this case, see that GenericList maps to a TemplateType of 100. A Document Library would be 101, etc.
Title: Visible title of the list, which will be shown in the Site Contents of a site. Not too important.
Url: This dictates the web URL where you will find this list. Usually, as you may have noticed while creating lists using the SharePoint web interface, Custom Lists are placed under /sites/YOUR_SITE/Lists/. The example above follows this convention, but you can set the URL to other values as well.
That's all for the ListInstance. Additionally, if you had decided to implement your Fields as Site Columns, elements.xml is where you would paste the Field definitions. Just make sure you paste the Fields before the ListInstance, because otherwise SharePoint will not know what Fields you are referring to (they would not have been created yet!).
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Field
ID="{DAFF97CE-C27D-4D27-9863-4422526CC395}"
Name="EmployeeName"
DisplayName="Name"
Description="Column for the employee's first name."
Type="Text"
/>
<Field
ID="{AA4D083E-1B32-4AF5-B572-DA06B3996A94}"
Name="EmployeeSurname"
DisplayName="Surname"
Description="Column for the employee's surname."
Type="Text"
/>
<ListInstance
CustomSchema="schema-employees.xml"
Description="List for employee name and surname."
FeatureId="00bfea71-de22-43b2-a848-c05709900100"
TemplateType="100"
Title="Employee Names"
Url="Lists/EmployeeNames"
/>
</Elements>
Having specified the elements.xml, we have successfully created an XML definition for the Lists we want to create!
A Final Note
Don't forget that in order for SPFx to know about the schema-employees.xml and elements.xml, you must include them as part of a Feature definition in the package-solution.json. This is addressed in the tutorial linked in the original question, but I wanted to make note of it anyway.
thank you a lot for perfect info, it's what we are looking for!
You recommend copy and paste list definition i VS (or other IDE). I would to ask you is there some way to design lists with person, lookup, compute and another "advanced" columns and download XML schema definition to copy and paste into VS because I need on the end package solution to sppkg? It's because I find this way to much faster than code all in VS.
Thank you.
I created a SharePoint hosted app and a new list. But I want to show its list column display name by a resources file. For that I created a new resource
from rigth click Feature > Add Feature Resource then the created key is PersonName and the value Person Name.
After I wrote in the list schema.xml
<Field ID="{27912FBB-5063-4FF7-9829-B194DDBC7FEB}" Type="Text" Name="PersonName" DisplayName="$Resources:PersonName" Required="TRUE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="PersonName" MaxLength="255" />
But the list columns seems to be
$Resources:_FeatureId{54A6CD41-6DB3-45FF-9A2F-D496A13A871F},PersonName;
How can I fix that?
I am sure pretty late, but I just had the same problem and I figured it out.
What you are probably doing is try to use the resource key inside of the schema.xml of the list.
That is the wrong place to use it. Instead copy the whole line:
<Field ID="{27912FBB-5063-4FF7-9829-B194DDBC7FEB}" Type="Text" Name="PersonName" DisplayName="$Resources:PersonName" Required="TRUE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="PersonName" MaxLength="255" />
Inside of the elements.xml of the list where the list definition is. So it should for your example look like this:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<ListTemplate
Name="UserList"
Type="100"
BaseType="0"
OnQuickLaunch="TRUE"
SecurityBits="11"
Sequence="410"
DisplayName="UserList"
Description="My List Definition"
Image="/_layouts/15/images/itgen.png"/>
<Field ID="{27912FBB-5063-4FF7-9829-B194DDBC7FEB}" Type="Text"
Name="PersonName" DisplayName="$Resources:PersonName"
Required="TRUE" SourceID="http://schemas.microsoft.com/sharepoint/v3"
StaticName="PersonName" MaxLength="255" />
</Elements>
If you read carefully this is also documented in the msdn:
https://msdn.microsoft.com/en-us/library/office/fp179919.aspx#LocalizingAppWeb
search for the title "To localize the column names of a custom list" and you should find it.
I have an xPage with this content:
<div class="lotusFrame">
<xc:layoutCommonBanner />
<xp:callback facetName="facetTitleBar" id="callbackTitleBar" />
<xc:layoutDiscrepancyPlaceBar />
<div class="lotusMain">
<div class="lotusColLeft">
<xp:callback facetName="facetColLeft" id="callbackColLeft" />
</div>
<div class="lotusColRight">
<xp:callback facetName="facetColRight" id="callbackColRight" />
</div>
<div class="lotusContent">
<xp:callback facetName="facetContent" id="callbackContent" />
</div>
</div>
<xc:layoutCommonFooter />
<xc:layoutCommonLegal />
</div>
As you can see, there are several custom controls in it composing layout. In the facetContent, there is a document with document datasource. It's the only document in the page. I need to get this document somehow in the layoutDiscrepancyPlaceBar custom control.
I found some old articles on the web with undocumented feature called currentDocument. It should be on every page with document datasource. But it doesn's work. I have Domino 8.5.2 and currentDocument seems to be no longer supported.
Can you help me out? How can I get document datasource from one custom control in another custom control. Is it even possible?
Thanks in advance, Jiří
EDIT: OK, it is still supported, but it only works in custom control, that is included inside the one with document datasource. In the case scenario above it doesn't work.
Your best option is to hand over the binding name in a custom property. (lets call it bindto. Then you bind your field to
"${#{"+compositeData.bindto+"}}"
See details here (inside the prezi)
P.S. currentDocument is documented somewhere.
You can also pass a handle on the data source directly to the custom control, as well as the name of the item to bind to on the data source. Because EL supports array syntax as well as dot syntax, this allows you to define expressions like this:
#{compositeData.dsn[compositeData.fieldName]}
(where "dsn" is the property being passed the handle on the data source, and "fieldName" is the property being passed the name of the item to bind to on that data source.)
More details on this approach can be found here.
Is there any way to have a custom recipe add some text and image fields to the page? It looks like part of the recipe handles commands, but I can't find any commands that do this at # http://docs.orchardproject.net/Documentation/Using-the-command-line-interface
Update
Thanks for the response Bertrand, but there are some issues with that.
I exported everything for a recipe from a tenant that has 1. added fields, 2. added parts to the Page along with 3. an added List and 4. an added container widget to the Default layer that shows the list.
<Metadata>
<Types>
<Page ContentTypeSettings.Draftable="True" TypeIndexing.Included="true">
<TagsPart />
<LocalizationPart />
<TitlePart/>
<AutoroutePart />
<ContainablePart />
<AmazonProductsPart />
<YouTubeVideosPart />
</Page>
</Types>
<Parts>
<BodyPart BodyPartSettings.FlavorDefault="html" />
<Page ContentPartSettings.Attachable="True">
<Thumbnail.ImageField DisplayName="Thumbnail" ImageFieldSettings.MaxHeight="75" ImageFieldSettings.MaxWidth="75" ImageFieldSettings.Required="False" ImageFieldSettings.AlternateText="True" ImageFieldSettings.ResizeAction="Validate" />
<PageImage.ImageField DisplayName="PageImage" ImageFieldSettings.MaxHeight="250" ImageFieldSettings.MaxWidth="0" ImageFieldSettings.Required="False" ImageFieldSettings.AlternateText="True" ImageFieldSettings.ResizeAction="Resize" />
<PreContent.TextField DisplayName="PreContent" ImageFieldSettings.MaxHeight="0" ImageFieldSettings.MaxWidth="0" ImageFieldSettings.Required="False" ImageFieldSettings.AlternateText="False" ImageFieldSettings.ResizeAction="Validate" TextFieldSettings.Flavor="Html" TextFieldSettings.Required="False" />
<PostContent.TextField DisplayName="PostContent" ImageFieldSettings.MaxHeight="0" ImageFieldSettings.MaxWidth="0" ImageFieldSettings.Required="False" ImageFieldSettings.AlternateText="False" ImageFieldSettings.ResizeAction="Validate" TextFieldSettings.Flavor="Html" TextFieldSettings.Required="False" />
</Page>
</Parts>
</Metadata>
...
<Data>
<List Id="/alias=page-list" Status="Published">
<CommonPart Owner="/User.UserName=admin" CreatedUtc="2012-05-26T22:52:20Z" PublishedUtc="2012-05-26T22:57:37Z" ModifiedUtc="2012-05-26T22:57:37Z" />
<AutoroutePart Alias="page-list" UseCustomPattern="false" />
<AdminMenuPart AdminMenuPosition="2" OnAdminMenu="false" />
<MenuPart MenuText="Page List" MenuPosition="3" OnMainMenu="false" />
<ContainerPart ItemContentType="Page" ItemsShown="true" Paginated="true" PageSize="10" OrderByProperty="CommonPart.CreatedUtc" OrderByDirection="1" />
<TitlePart Title="Page List" />
</List>
<ContainerWidget Id="" Status="Published">
<CommonPart Owner="/User.UserName=admin" Container="/Layer.LayerName=Default" CreatedUtc="2012-05-26T22:55:42Z" PublishedUtc="2012-05-26T22:55:42Z" ModifiedUtc="2012-05-26T22:55:42Z" />
<WidgetPart Title="Page List" Position="1" Zone="AsideFirst" RenderTitle="false" />
<ContainerWidgetPart Container="/alias=page-list" PageSize="5" OrderByProperty="CommonPart.CreatedUtc" OrderByDirection="1" ApplyFilter="false" FilterByProperty="CustomPropertiesPart.CustomOne" FilterByOperator="=" />
</ContainerWidget>
</Data>
I then inject that into a copy of the default recipe with the appropriate modules activated.
When creating a new tenant from that recipe,
All the modules are enabled, good
The list is created, good
The page has the added parts, good
The page does not have the added fields, bad
The container widget does not exist, bad
It looks like the part fields are not added, and the widget was not created.
I did another simple test, and it looks like a bug?
Repro Steps:
Add fields to the page
Add a widget
Export everything
delete the widget
Import the exported xml
Expected: The widget to be back
Actual: the widget is still missing
is the recipe suppose to honor page fields and widgets, did I do something wrong, or is this a bug?
Update
Okay, this has to be a bug. When manually adding the fields, I get this message even though it isn't showing the fields: "A field with the same name already exists."
You don't need a command, this is supported by recipes without that. The easiest way to get an example is to add a field from the admin UI, and then export the metadata and examine the recipe that created.
There was a similar question posted regarding the same topic, but I'm adding to the question and the previous discussion was resolved.
Here is the link to the original question: Auto number column in SharePoint list
I'm now trying to find out if in a Custom List in MOSS SharePoint 2007 there is a column called "ID(link to item)".
I know that when creating an Issues List in SharePoint, there exists an "Issue ID (link to item)" field that is by by default included in the view, however, I cannot find out if a similar field exists for a Custom List.
The answer is No... but you can create one.
Cracking open a website using SharePoint Manager (which rocks) you can see the definition of the "IssueID" column and the one that is used to display the "ID(link to item)"
I include the schema xml from my site below
<?xml version="1.0" encoding="utf-16"?>
<Field ID="{de57307b-e69a-4cf9-b3a9-b6a728ecf773}" Sealed="TRUE" ReadOnly="TRUE" Name="IssueID" Type="Computed" DisplayName="Issue ID" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="IssueID" FromBaseType="TRUE">
<FieldRefs>
<FieldRef Name="ID" />
</FieldRefs>
<DisplayPattern>
<Column Name="ID" />
</DisplayPattern>
</Field>
<?xml version="1.0" encoding="utf-16"?>
<Field ID="{03f89857-27c9-4b58-aaab-620647deda9b}" ReadOnly="TRUE" Type="Computed" Name="LinkIssueIDNoMenu" DisplayName="Issue ID" Dir="" DisplayNameSrcField="IssueID" AuthoringInfo="(linked to item)" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="LinkIssueIDNoMenu">
<FieldRefs>
<FieldRef Name="ID" />
</FieldRefs>
<DisplayPattern>
<HTML><![CDATA[<a href="]]></HTML>
<URL />
<HTML><![CDATA[" ONCLICK="GoToLink(this);return false;" target="_self">]]></HTML>
<Column HTMLEncode="TRUE" Name="ID" />
<HTML><![CDATA[</a>]]></HTML>
</DisplayPattern>
</Field>
Change the GUIDs and you can add these columns to a custom list, they will display in the manner you require. I would recommend creating a feature for the columns (maybe use STSDev) and releasing via a solution to any thing other than a dev site.
You could use SharePoint Designer to convert your list view into a Data View WebPart. From there you have complete control over the XSL used for the view rendering which would make it trivial for you to link to the item from any or all fields.
There is a powershell script available which you can use to add context menu for a field.
ADD THE SHAREPOINT LIST ITEM'S CONTEXT MENU TO ANY COLUMN WITH POWERSHELL
PS> & .\AddMenuColumn.ps1 -webUrl http://[server:port]/site/subsite/ -listName "Test" -fieldTitle "justAnyColumn" -addToDefaultView $true