SOAP AddWebPart: XsltListViewWebPart for a Picture or Document Library

Hello everybody.
I am trying to add list webparts to a webpartpage via SOAP/REST.
I am using the AddWebPart or AddWebPartToZone Methods of the webpartpages.asmx Webservice like so:
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<AddWebPartToZone xmlns="http://microsoft.com/sharepoint/webpartpages">
<pageUrl>/sites/ideas4u/Pages/abcxyz.aspx</pageUrl>
<webPartXml>
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
&lt;webParts&gt;
&lt;webPart xmlns=&quot;http://schemas.microsoft.com/WebPart/v3&quot;&gt;
&lt;metaData&gt;
&lt;type name=&quot;Microsoft.SharePoint.WebPartPages.XsltListViewWebPart, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c&quot; /&gt;
&lt;importErrorMessage&gt;Cannot import this Web Part.&lt;/importErrorMessage&gt;
&lt;/metaData&gt;
&lt;data&gt;
&lt;properties&gt;
&lt;property name=&quot;ListUrl&quot; type=&quot;string&quot;&gt;/sites/ideas4u/Lists/myVeryList&lt;/property&gt;
&lt;property name=&quot;MissingAssembly&quot; type=&quot;string&quot;&gt;Cannot import this Web Part.&lt;/property&gt;
&lt;/properties&gt;
&lt;/data&gt;
&lt;/webPart&gt;
&lt;/webParts&gt;</webPartXml>
<storage>Shared</storage>
<zoneId>Zone 2</zoneId>
<zoneIndex>1</zoneIndex>
</AddWebPartToZone>
</soap12:Body>
</soap12:Envelope>
this works for Link-lists and Discussions, but I can't get it to work for Picture or Document libraries ...
ie. when myVeryList is a Picture Library or Document Library I get this error (which does not help at all):
What am I doing wrong?
I simply need a way to add a document/picture library webpart to a webpartpage via SOAP or REST requests. (since I am developing an iOS-App).

Hi,
Glad to hear that you solve this issue, thanks for your sharing.
Thanks,
Linda Li
Linda Li
TechNet Community Support

Similar Messages

  • How to update managed metadata column for all file in document library using powershell

    Hi,
    How to update managed metadata column for all file in document library using powershell?
    Any help on it.
    Thanks & REgards
    Poomani Sankaran

    Hi TanPart,
    I have changed the code which you have give in order to get the files from SharePoint 2010 Foundation  Document Library.But i am getting below error in powershell.
    Property 'ListItemCollectionPosition' cannot be found on this object; make sure it exists and is settable.
    Could you tell me which is the issues in it?
    See the code below.
    $web = Get-SPWeb http://ntmoss2010:9090/Site
    $list = $web.Lists["DocLib"]
    $query = New-Object Microsoft.SharePoint.SPQuery
    $query.ViewAttributes = "Scope='Recursive'";
    $query.RowLimit = 2000
    $caml = '<Where><Contains><FieldRef Name="Title" /><Value Type="Text">Process Documents/Delivery</Value></Contains></Where>' +
            '<OrderBy Override="TRUE"><FieldRef Name="ID"/></OrderBy>'
    $query.Query = $caml
    do
        $listItems = $list.GetItems($query)
        $spQuery.ListItemCollectionPosition = $listItems.ListItemCollectionPosition
        foreach($item in $listItems)
            #Cast to SPListItem to avoid ambiguous overload error
            $spItem = [Microsoft.SharePoint.SPListItem]$item;
            Write-Host $spItem.Title       
    while ($spQuery.ListItemCollectionPosition -ne $null)
    Thanks & Regards
    Poomani Sankaran

  • Attaching Attributes to Image For Loading to SharePoint Document Library

    We currently have a need to create a searchable document library which will consist solely of images. The standard metadata for a file/image won't suffice in this case. We have some custom attributes that will need to be searchable.
    Essentially, we will have a library of receipt images for expense reporting purposes. We get these images from a third party who handles all of our expense reporting. There are two large zipped files we receive: one file contains all the actual expense report
    "data" that was processed that day(amount, date, client, job, etc.) and the second file contains all the receipt images for those expense report items. Each data file contains data for individual expense reports, and each expense report is assigned
    a unique ID. Each line item in an expense report is also assigned a unique ID. Lastly, each receipt image for a line item of a specific expense report is also assigned a unique ID.
    The zipped image file only contains images. There is a main image file - this contains several smaller zipped files. Each of the smaller zipped files contains all receipt images for a specific expense report. Each image file name is comprosed of three parts:
    The expense report identifier, the unique image identifier, and the expense report line item identifier.
    So, to put this all into perspective:
    On Thursday, we received an image file named extract_images_p006320452r3_20140904171423
    This file contained images for the following unique expense reports:
    The compressed file 95FB8C488519427793FC contains the following receipt images:
    The "data" file - as mentioned before - contains the actual info about the expense and image. These include: date of transaction, date approved, vendor, amount. GL code, type, function, client, project, billable or not, and several other attributes.
    All of this information - including the location of the images - is stored in a SQL Server database and then placed in an SSAS cube.
    The images are related back to the underlying data via the expense report id, and line item id.
    What I need to be able to do is to somehow "tag" these images with all their underlying attributes, load then into a SharePoint document library, and make them searchable.
    I have already figured out that I would need to create several SharePoint lists based on the available values in my OLAP cube (essentially a dataset each for clients, vendors, etc.). The part I have no idea how to accomplish is how to tag each image with
    its respective information.
    All the pertinent info is stored in the database tables, just don't know how to attach it to each image.
    Hopefully, this made some kind of sense. If anyone has any idea on how to even remotely accomplish such a thing, your input would be greatly appreciated!
    Thanks in advance!
    A. M. Robinson

    You will have to develop a custom solution to do this. I am assuming you have taken the first steps to define separate document libraries for the expense reports and images along with site columns and contenttypes. You would define the site columns based
    on the data you want to search on and assign these to corresponding contenttypes. So basically a contenttype for expense reports and receipts possibly. You would link the two contenttypes using the expense report id.
    Your custom solution would have to break apart the zip files and upload and index (set site column data) for each file. Then the user could search on the expense report id and get all the files associated with the expense report.
    An alternative could be to use one document library and have all the files uploaded into their own document set (folder).
    Blog | SharePoint Field Notes Dev Tools |
    SPFastDeploy | SPRemoteAPIExplorer

  • How to call out of box delete function on client side for deleting item in document library SharePoint 2010.

    Hi,
    We want to add the custom functionality to delete the item in document library .
    if we click on custom button it should delete the item in document library.
    Could anyone please suggest me.
    How to accomplish the task.
    Thanks ... 

    Hi,
    Any update?
    Best Regards
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Searching for a folder in document library doesn't work properly if the folder is at the root level.

    Hi,
    I have a folder named FS0 on my sharepoint 2013 site. The folder is the first level folder under
    Default Document library (Shared Documents). When I search for FS0 on the sharepoint site, the search result give a link to home.aspx and not the folder. If I search for any folder that is a second level folder in the library, I get a search result that takes
    me inside the folder on clicking it. In my case, I search for a folder named FS1 which directly under FS0. The search result takes me inside FS1 in this case. How can I make the search result display proper links for root level folders also?<o:p></o:p>
    Thanks
    Pranava

    Hi Pranava,
    I couldn't reproduce this issue, when I create root folder FS0 in "Shared Documents" and start a full crawl, I click the FS0 link from search results page, it will open the FS0 folder as well as folder under FS0.
    Please right-click the FS0 name hyperlink (e.g. mine is http://sp/Shared%20Documents/FS0) and paste in IE browser see if it could be accessed successfully.
    Also test if other Shared Documents have this issue in other site collection or web applications, if not, run a full crawl may do a trick (please reset search index if only full crawl still doesn't work).
    Thanks
    Daniel Yang
    TechNet Community Support

  • I have a question that I think I know the answer to, but am looking for confirmation.  I have a dell computer at home that has clip art available on it for putting pictures into documents.  Do I need to install an APP to get something similar to clip art?

    I have a question that I think I know the answer to, but am looking for confirmation.  I have a desktop computer at home that has clip art loaded onto it.  I recently got an iPad and am looking for something similar.  I assume I need to get an APP for it, and if that is correct, does anyone have one that they like?

    Sort of.  There is an app called art shop that gives you a place to park clip art.   But I don't think you really need it. 
    If you have a collection of clip art you want available, move it to the camera roll on your pad/ phone, then copy paste into your document the clip you want.
    You can get them into the camaera roll by putting them in a single event in your picture library and syncing them over,  or e mail them to your self, and save to the camera roll, or send them to drop box, and bring them down that way.
    The challenge is getting them all in one place to make it easy for you to find, which is why syncing might be the best approach in the long run.
    As near as I can tell there is not a ready made clip art collection in app format laying around.

  • How to get Custom-Content-type Column Value of a Document Library-Folder

    Hello
    I have to add a custom-column(folder-imageURL) for Folders in a Document Library.
    So I have created a Custom-CotentType "FolderCtype" with new column "folder-imageURL" and attached in the Document Library.
    Whenever I create a new folder in that document library I will select my "FolderCtype" & and then add an image url in "folder-imageURL" column.
    How do I access this image url in Code?
    part of my code is as follows.
    SPContentType cntType = List.ContentTypes["FolderCtype"];
    SPField field = cntType.Fields.GetField("folder-imageURL");  //I have Field name here//
     foreach (SPFolder folder in RtFolder.SubFolders)
                        if (folder.Name.ToUpper() != "FORMS")
                           string FolderName = folder.Name;
                          string FolderImageUrl = ?              //How can I get this????//
    Thanks in advance

    Hi, Patrickm, Thank You
    If your “folder-imageURL” column is a “Hyperlink or Picture” column, then you can get the hyperlink like this:
    SPListItem item = folder.Item;
    if (item[field.Title] != null)
    string FolderImageUrl = item[field.Title].ToString().Split(',')[0];
    Console.WriteLine(FolderImageUrl);
    Best regards,
    Patrick
    Patrick Liang
    TechNet Community Support
    S H A J A N

  • How to get document library column data through Programmatically

    HI,
    I have one scenario..here i have to get the particular document library column data...Like fetching List data.
    In LIST We will do LIke this:
    using (SPSite site = new SPSite(SPContext.Current.Site.Url))
                using (SPWeb web = site.OpenWeb())
                    SPList list = web.Lists["ListName"];
                    SPListItem item = list.Items.Add();              
                    item["Title"] = txtTitle.Text;
    item.update()
       But here we want to fetch  data from document library column data....
    I did following way....can any one suggest me....
    using (SPSite site = new SPSite(SPContext.Current.Site.Url))
                using (SPWeb web = site.OpenWeb())
                    SPDocumentLibrary documentLib = web.Lists["DocumentName"] as SPDocumentLibrary;
                    SPListItem items = documentLib.Items.Add();
    Thanks.....

    Hi,
    The code that you have posted is adding data to the list or document library. Do you want to add or fetch data from or to document library?
    You can refer following link for Inserting/Updating documents in document library:
    http://blogs.perficient.com/microsoft/2009/04/working-with-documents-stored-in-sharepoint-document-library-programmatically/
    For fetching data from document library, you can use following code:
    using (SPSite site = new SPSite(SPContext.Current.Site.Url))
    using (SPWeb web = site.OpenWeb())
    string documentLibName = "Doc_Lib_Name";
    SPFolder docLibrary = web.GetFolder(documentLibName);
    foreach (SPFile file in docLibrary.Files)
    var customColValue = file.Item["Custom_Column_Name"];
    Hope this helps!
    Regards, Shruti

  • Attachments in document library sharepoint 2013

    I have an document library I need to attach multiple documents for a same item .I know there is no option available for attachments in the document library of sharepoint 2013 ..
    Is there any other way to attach multiple documents as a single document in the document library of sharepoint 2013 .
    Thanks
    Mohammad Arif

    If you can use a list then you can attach multiple attachments to the list.
    Regards,
    Bijay
    SharePoint MVP, India
    Twitter |
    Facebook |
    LinkedIn
    EnjoySharePoint.com |
    OnlySharePoint2013.com

  • Document Library Web Part - link to DispForm.aspx

    Hi there. I'm trying to solve a problem that appeared when I tried to create a simple page with the list of documents from my document library. I need Title field displayed as a hyperlink to DispForm.aspx, not to Document itself, and not to a dropdown menu with Edit option.
    The reason of this requirement is that we don't like to allow users to download document w/o reading metadata assosiated with it. On the other hand, ordinary user must not see Edit links in menu, because we don't want to tempt them to try edit document at all.
    Of course, I can customize the data view in Sharepoint Designer - go to Code View and manually change <xsl:value-of select="@FileRef"/> to something like ..../dispform.aspx?ID=<xsl:value-of select="@ID"/>. But this ways seems to mee a bit ugly and I don't like to repeat this for each and other document library.
    Is there any elegant way to solve the problem?
    Thanks.

    If you are working in MOSS 2007 then a more elegant way would be to create your custom document library definition.
    You need to go to the 12 hive --> features --> document library list definition.
    Create a copy of this list definition and modify it so that the document name points to the dispform.aspx.
    Install and activate the new feature and create document libraries using your new template.
    And the other part of not showing the edit item options can be achieved using sharepoint permissions. Why create something custom for that?
    Regards, Huzefa Mala, MCTS

  • Image Trace with Document Library palette feature - bug?

    I've been trying out the different palette options in Image Trace and I believe I've come across a feature that does not work as the designers intended. In Adobe's documentation, there is very little said about the feature, which I believe is intended to allow you to substitute a custom palette for the palette that would be created by the original artwork that is being traced. It's under the Palette drop-down menu and is available if you've selected the Color Mode. It's called Document Library. In Adobe's documentation, there are these two paragraphs:
    [Reproduced from http://helpx.adobe.com/illustrator/using/image-trace.html#tracing_options]
    Palette
    Specifies a palette for generating a color or grayscale tracing from the original image. (This option is available only when Mode is set to Color or Grayscale.)
    To let Illustrator determine the colors in the tracing, select Automatic.To use the document swatches as a palette for the tracing, select Document Library.
    This would be a great feature, if it worked! I have a lot of artwork to trace, it's all in a set yellow-to-green palette, and it would be a big time-saver if I didn't have to change the palette after the trace. Unfortunately, the feature doesn't work as promised. Either that, or I'm doing something wrong.
    I've embedded a video to demonstrate the problem, and would appreciate any comments.
    Message was edited by: pixelboss to include link to the documentation

    What I started with:
    What I expected
    (but in a different palette):
    What I got:
    Do I really need to describe what I don't like about these results?
    Since the original experiment, I have tinkered with it and discovered that the more colors I have in my palette, the better. I had three colors; it only used one of the three. With some settings changes I could get it to use two. With six colors, it used four. I was unable to get it to use all six.
    I apologize for the poor quality of the original rendering of the video. I have since re-rendered it. Embedded below, but if you still cannot see what is going on, I recommend you click on the direct link and go to YouTube, where you will be able to either use the Large Player feature or make the video full-screen. Hopefully that will make it possible to see more detail.

  • Links in a document library

    I am developing a document library where resources/documents can either be 'real' documents or just links to documents on the web. Is it possible to have this kind of amalgamation (both links and documents) inside document library?
    If I remember it correctly, ultimately SharePoint stores the hyperlinks to documents in its fields and the actual content is stored in content database. If that is right, then I should be able to programmatically add links or document to the library. I just wanted to make sure that only real documents are allowed in the document library.
    Another option would be to create a separate links library besides document library which I do not like because I will end up developing more custom code.
    Thanks!

    Hi Diffident,
       What i will suggest you is that, you must create a new link column(custom column) in the same document library where you want to upload the documents and want to keeps the links as well. For that, go to document library -> Library Tab on
    ribbon -> Library Settings then create a custom column.
    So whenever you upload a document, you will have to mentioned the additional details.
    Regards,
    Malkeet Singh
    If a post answers your question, please click Mark As Answeron that post and
    Vote as Helpful

  • Moving files from one document library to another

    I want to move all files which are 30 days old, from one library to another.
    What is the best way to do this?
    Shall I create a workflow for this or a timer job? I am not sure if we can do this using workflow because I think it works on events and here I need a process that will work continuously (for e.g. every hour or every day etc) and check for files which are
    30 days older, and move to different document library (this target library will be in another site collection).
    What do you say?

    There are 2-approach I would recommend here,
    Either Create SharePoint Timer Job OR Create Windows Service which runs every day and will check the document library for any documents satisfy the 30 days old criteria.
    Personally I will always go for Windows service. Reasons are easy to build/install/less downtime and if you use framework like Topshelf then easy to debug. Also it allows you to have configuration for your SharePoint Site/Document library. Libraries like
    Serilog allows you to have better structured logs created for your service easily. Multiple instances of the same service running on the same server.
    There are few links I want to share with you for kind of similar discussion happened earlier,
    http://sharepoint.stackexchange.com/questions/96089/when-should-we-use-sharepoint-timer-job-and-when-windows-task-scheduler
    https://social.msdn.microsoft.com/forums/sharepoint/en-US/abd71245-8f64-40ba-8861-a852893cd8d5/timer-job-vs-custom-windows-service
    https://social.technet.microsoft.com/Forums/sharepoint/en-US/c87abaec-7cf2-4697-bf2d-31d235541598/sharepoint-timer-job-vs-windows-schedule-to-consume-web-service?forum=sharepointadminprevious
    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this
    will help others who are looking for solutions to the same or similar problem.

  • I made un update for OSX-10.9.2. , and when a scan a document or a picture, and order `save as` , the file saved is a black picture or document. I can't see the file. What happens? I made the downloads of files required in HP site.  Tks, Paulo

    I made un update for OSX-10.9.2. , and when a scan a document or a picture in one printer HP D-110, and order `save as` , the file saved is a black picture or document. I can't see the file. What happens? I made the downloads of files required by HP for the OS maverick in HP site. 
    Tks, Paula

    This link should help:
    http://h30434.www3.hp.com/t5/Mac-Printing-and-Scanning/OS-X-10-9-Mavericks-Incor rect-output-using-HP-Scan/td-p/3069079

  • Authentication prompt issue when opening an office file in a document library with read permission for domain users

    An user as part of the domain users tries to open an office file from a document library but he got an authentication prompt asking him to authenticate. Domain users has only access to this library and not to the whole site. This uses to work in SharePoint
    2007 without any problem but not in SharePoint 2013, we didn't have a workflow on SP2007.
    Domain users has read access to only this document library in the site, but he shouldn't get an authentication prompt since he is part of the domain users and he is not trying to modify the document, he can open the document but gets two prompts, he can't
    also see the list using explorer view since nothings appears using the explorer view.
    Now, when opening the file, we can see..Updating Workflow Status, but we don't have any workflow working on this site or library, event any feature related to workflow.
    If we go to the event viewer in the server, we find this information,
    I also checked this thread but I couldn't find this scenario.
    https://social.technet.microsoft.com/Forums/sharepoint/en-US/91bc770b-bb70-4885-a4ad-a243edb88753/event-id-8026-workflow-soap-getworkflowdataforitem-failed-doc-library-no-workflow?forum=sharepointgeneralprevious
    I also created another list with the same permissions and using other office files but got the same behavior.
    Now, we have migrated this site from SP2007 to SP2013.
    Any ideas?

    OK, I am going to throw out a lot of ideas here so hopefully they get you closer to a diagnosis. Hang on :)
    Does it happen to work for some users but not others? If so, try logging in on the "good" computer with the "bad" username. This will tell you if the problem is related to the end-user's system. Also, once the user downloads a document
    successfully can they open and work on it in Word? Also, does the document library have any custom content types associated with it or does it just use 'Document'?
    I notice that there are other folks on the web that have run into this same problem and the similarity seems to be that they are either on SharePoint 2007 or have upgraded from 2007. Did this doc library start out as a 2007 library?
    What you might want to do is this: Make a site collection from scratch in 2013 (or find one that you know was created in 2013). Choose team site (or whatever you want) for the root web and set up the security the same way you have it on the malfunctioning
    library. Now, use windows explorer to copy and paste some of the documents to the new location. Be sure you recreate any needed content types. Now test it from the troubled user's computer.
    I'm thinking there may be something that is different about the library since it was migrated through various versions and updates since 2007. I've sometimes found that there can be problems (especially with user profiles but that's a different story) with
    things that go through this evolution.

Maybe you are looking for