How do I rename a file using the SharePoint web services? - web-services

I have a custom definition for a document library and I am trying to rename documents within the library using only the out of the box web services. Having defined a view with the "Name" field supplied and trying the "LinkFilename", my calls to rename a file are respectively returning a failure or ignoring the new value.
How do I rename a file using the SharePoint web services?

Use the Lists.UpdateListItems web method. The XML request should look like:
<Batch OnError="Continue" PreCalc="TRUE" ListVersion="0">
<Method ID="1" Cmd="Update">
<!-- List item ID of document -->
<Field Name="ID">2</Field>
<!-- Full URL to document -->
<Field Name="FileRef">http://Server/FullUrl/File.doc</Field>
<!-- New filename -->
<Field Name="BaseName">NewName</Field>
</Method>
</Batch>

You should be able to use UpdateListItems. Here's an example.
Per comment: So the actual question is "how do I call a web service?" Take a look a this example. Some more good walkthroughs here.

Related

how can I deeplink an app from Google Assistant?

I'm creating a dialogflow agent integrated with Google Assistant.
What I'd like to do is to open an app (my app) when a proper intent is matched. I've seen that actions like Youtube, Spotify etc. are able to do that, for example I can tell the Youtube action "search for cats video" and the Youtube app will open with a list of cats videos.
I tried to use the DeepLink class but I then noticed it's deprecated.
DeepLink class
Is there any way you can suggest me to do this?
Thanks in advance
I think you are looking for App Actions. Here are the steps you need to follow:
Find the right built-in intent. actions.intent.OPEN_APP_FEATURE should be the right one for you.
Create and update actions.xml. It should look like
<?xml version="1.0" encoding="UTF-8"?>
<!-- This is a sample actions.xml -->
<actions>
<action intentName="actions.intent.OPEN_APP_FEATURE">
<!-- Use url from inventory match for deep link fulfillment -->
<fulfillment urlTemplate="{#url}" />
<!-- Define parameters with inventories here -->
<parameter name="feature">
<entity-set-reference entitySetId="featureParamEntitySet" />
</parameter>
</action>
<entity-set entitySetId="featureParamEntitySet">
<!-- Provide a URL per entity -->
<entity url="myapp://deeplink/one" name="featureParam_one" alternateName="#array/featureParam_one_synonyms" />
<entity url="myapp://deeplink/two" name="featureParam_two" alternateName="#array/featureParam_two_synonyms" />
</entity-set>
</actions>

Solr : importing dynamic field names from XML with DIH and xpath

I'm indexing data from a XML file, with many fields like these declared in DataImportHandler's dataconfig.xml :
<field column="pos_A" xpath="/positions/pos_A/#pos" />
<field column="pos_B" xpath="/positions/pos_B/#pos" />
<field column="pos_C" xpath="/positions/pos_C/#pos" />
...
And one matching dynamicField declaration in schema.xml :
<dynamicField name="pos_*" type="sint" indexed="true" stored="true" />
I'm wondering if it's possible to use a transformer to dynamically generate the field names in dataconfig.xml, and have a single line, kinda like :
<field column="pos_{$1}" xpath="/positions/pos_(*)/#pos" />
(pardon my xpath and regex syntax :)
https://issues.apache.org/jira/browse/SOLR-3251 The latest release claims that you can dynamically add fields to the schema. I tried to find documentation for the public interface, but not much luck so far.
>
SOLR-4658: In preparation for REST API requests that can modify the schema,
126 a "managed schema" is introduced.
127 Add '<schemaFactory class="ManagedSchemaFactory" mutable="true"/>' to solrconfig.xml
128 in order to use it, and to enable schema modifications via REST API requests.
129 (Steve Rowe, Robert Muir)

Sharepoint batch for MultiChoice field value insertion

So i have a problem regarding usage of sharepoint list webservices.
I need to get the syntax right for Sharepoint batch script for insertion of new items.
Everyhing works fine except multichoice field type.
I insert the data, but nomatter how i do it, it shows up on SP list item details OK, but when trying to edit item in SP, i see, that SP have taken the value i sent to this field as text string, and does not check the items i have saved as selected.
The script for now is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<Batch OnError="Return">
<Method ID='1' Cmd='New'>
<Field Name='SecurityCheckpoints'>1st checkpoint;2nd checkpoint</Field>
</Method>
</Batch>
Definition for that field is like this:
<Field Type="MultiChoice"
DisplayName="Checkpoints allowed"
Required="TRUE"
FillInChoice="FALSE"
ID="{guid-guid-guid-guid-guid}"
SourceID="{guid-guid-guid-guid-guid}"
StaticName="SecurityCheckpoints"
Name="SecurityCheckpoints"
ColName="ntext2"
RowOrdinal="0"
Version="4">
<CHOICES>
<CHOICE>1st checkpoint</CHOICE>
<CHOICE>2nd checkpoint</CHOICE>
<CHOICE>3rd checkpoint</CHOICE>
</CHOICES>
<Default>1st checkpoint</Default>
</Field>
I have to implement something like custom UI for sharepoint in different-purpouse silverlight app, and so i am using my own webservice to be a proxy between SP and SL, i retrieve SP list definition and dinamicaly build UI controls, so user can fill in the forms.
How do i form the script, so items are selected(ticked) in the SP instead of SP saving them as just string value?
If I use script with only one item ("1st checkpoint"), SP processes it ok, it there is many, data is saved as text string?
What i am doing wrong? How do i correctly seperate multiple values?
I have searched high and low, but have not found example of SP update script, where multichoice sample is included.
Thank You in advance!
I found the sollution - it was too easy:
instead of seperating the choice values using semicolon ";", they had to be seperated using ";#", and putting it in front and in behind the whole list.
So rather than using this:
1st checkpoint;2nd checkpoint
<?xml version="1.0" encoding="UTF-8"?>
<Batch OnError="Return">
<Method ID='1' Cmd='New'>
<Field Name='SecurityCheckpoints'>1st checkpoint;2nd checkpoint</Field>
</Method>
</Batch>
It had to be done like this:
;#1st checkpoint;#2nd checkpoint;#
<?xml version="1.0" encoding="UTF-8"?>
<Batch OnError="Return">
<Method ID='1' Cmd='New'>
<Field Name='SecurityCheckpoints'>;#1st checkpoint;#2nd checkpoint;#</Field>
</Method>
</Batch>
PS:I dont know was it correct way to do this, but I answered my own question. Just for others to know.
I run code below successfully.
<?xml version="1.0" encoding="UTF-8"?><ows:Batch OnError="Return">
<Method ID="0"><SetList>3933c528-5747-4fc7-bdec-6465294997dd</SetList>
<SetVar Name="Cmd">Save</SetVar>
<SetVar Name="ID">New</SetVar>
<SetVar Name="urn:schemas-microsoft-com:office:office#Temp_UNID">8D8DE35CFFE9EEEAC12570920052A8FD</SetVar>
<SetVar Name="urn:schemas-microsoft-com:office:office#Title"> - Birch Data Exchange Specification</SetVar>
<SetVar Name="urn:schemas-microsoft-com:office:office#C0370A_Agora_DocNum">8AL020210178ZZASB</SetVar>
<SetVar Name="urn:schemas-microsoft-com:office:office#C0370A_Agora_Phase"></SetVar>
<SetVar Name="urn:schemas-microsoft-com:office:office#C0370A_Agora_Author">Jerome BOURGER</SetVar>
<SetVar Name="urn:schemas-microsoft-com:office:office#C0370A_Agora_ServicesOri"> </SetVar>
<SetVar Name="urn:schemas-microsoft-com:office:office#C0370A_Agora_Type">;#3 - Quality Plan;#Objectives;#Progress Plan;#Follow-up;#Reports;#</SetVar>
<SetVar Name="urn:schemas-microsoft-com:office:office#C0370A_Agora_Keywords"></SetVar> </Method></ows:Batch>

SharePoint 2010 List Schema.XML not working as imagined

I am created an External List in VS and in the schema.XML file I have a few fields that I would like to change their display name, and format some dates.
We created an External List in SP, exported the wsp, and grabbed the list components of the site and added it to our project.
Here is an example of what I thought would work, but it does not.
<Field DisplayName="Date Closed" Format="DateOnly" Hidden="FALSE" Name="DateClosed" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="DateClosed" Type="DateTime" />
<Field DisplayName="Closed By" Hidden="FALSE" Name="ClosedBy" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="ClosedBy" Type="Text" />
We have a filter setup in the section which is working, so I know that the file is being used. Any insight as to why the changes I made to the field are not taking effect?

Download specific version of a file from SharePoint using web services

Can someone provide a sample for downloading a specific version of a file from SharePoint using web services? Normally I would get the file with the Copy Web Service (.../_vti_bin/copy.asmx). But I don't really know how to specify a version.
Regards
Anton Kalcik
You can use the Versions web service to get which versions exist for a File
The GetVersions method will give you an xml like this:
<results xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<list id="{26E516B0-8241-4B97-984D-000000000000}" />
<versioning enabled="1" />
<settings url="http://Server_Name/Site_Name/_layouts/
1033/LstSetng.aspx?
List={26E516B0-8241-4B97-984D-000000000000}" />
<result version="#4" url="http://Server_Name/Site_Name/
Shared Documents/File_Name.doc"
created="6/7/2003 5:55 PM" createdBy="DOMAIN\User" size="19968"
comments="" />
<result version="1" url="http://Server_Name/Site_Name/
_vti_history/1/Shared Documents/File_Name.doc"
created="6/7/2003 5:49 PM" createdBy="DOMAIN\User" size="19968"
comments="" />
.
.
.
</results>
You can then just use a HTTP GET request for the content of the "url" attribute of the "result" node for the right version
Here's the exact thing you want to do, with code:
Article