.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Easy Web
Imran Ghani
Post New Web Links

Silverlight client object model : Read a document from a document library

Posted By:      Posted Date: September 13, 2010    Points: 0   Category :SharePoint
 
How do I read/download a document/file from a SharePoint document library using silverlight client object model? The most closest function that I found was: Microsoft.SharePoint.Client.File.OpenBinaryDirect() but this seems to be throwing an exception "Operation not supported".


View Complete Post


More Related Resource Links

View previous version of a file in document library using Client Object Model

  

Hi,

 

Using Server-side object model, it is pretty simple to get the previous file versions. Say I wanted to view a file in its initial version, all I’d need to do is :

 

file.Versions[0].File

 

When using Client object model, I couldn’t any analogous method/property which would let me fetch the previous version of file.

Can somebody point me to a sample or the property which would serve my purpose?


Extract document for a SPListItem from a Document Library using the Object Model

  

WSS 3.0

I want to use the object model to extract the document from a Document Library. I am doing a foreach(SPListItem item in docLib).

How can I use SPListItem to get the document for that item?


Add a new link to a document using the client object model

  

I need to add a new document link to a document library using the client object model. What I want to do is the same as the code sample below but instead of creating a new document I want to create a new link to a document.

ClientContext context = new ClientContext("http://wdev2008:22880");
context.Load(context.Web);
List list = context.Web.Lists.GetByTitle("Test Doc Link Library");
context.Load(list);context.ExecuteQuery();

FileCreationInformation fileCreateInfo = new FileCreationInformation();
fileCreateInfo.Content = new byte[] { 0x33 };
fileCreateInfo.Url = "zerobyte";
File file = list.RootFolder.Files.Add(fileCreateInfo);
context.Load(file);context.ExecuteQuery();

Thanks,

Aaron


How to get Audit/History Log of Document using Client Object Model 2010?

  

I want to get the history/audit log of particular Document in my Library. When was it updated, who did checkin/checkout  on which date on this file?

 

Is there a way to get these information using Client Object Model?


Ronak Patel

how to extract the files from the document library using object model

  

Hi,

I need to extract the files from the document library using object model in sharepoint 2007.

Can anyone help me.

Regards,

Jyoshna


Jyoshna

How to get Audit/History Log of Document using Client Object Model 2010?

  

I want to get the history/audit log of particular Document in my Library. When was it updated, who did checkin/checkout  on which date on this file?

 

Is there a way to get these information using Client Object Model?


Ronak Patel

Check-out issue when opening a document from a document library when a read-only copy is open

  
We have an issue when a user has a read-only copy of a document from SharePoint open and then tries to check-out and edit another copy of the document (i.e. from the document library) the checked out copy is not connected to the web server. For the user it will look the same they will make edits, save and then close, but when they do so the document is not updated in SharePoint - it may be saved locally in their SP drafts, but the user will think that they have lost their version. We then get the checked out to another user error and you have to discard changes to get the document working again. Steps to reproduce this issue: * click on the name of a office doc on a Document Library * Make sure "Read Only" is selected and click "ok" * Minimize open document * click on the same file on the Document Library * Make sure "check out and edit" is selected and the "Use my local drafts folder" checkbox is ticked. Select OK. * Edit document and press save. Changes are never saved back in SharePoint, they are only on the local draft. We are using MOSS with SP2. Clients are on Office 2003 and 2007 Is this normal behaviour? Is there anything that can be done to prevent this from happening?

Video: SharePoint 2010: Silverlight Client Object Model

  
In this video you will learn how to use the SharePoint client object model to program a Silverlight application against SharePoint data. (Length: 9:03)

Video: Developing Silverlight Applications by Using the SharePoint 2010 Client Object Model

  
This demonstration shows how to use the client object model from a Silverlight application. (Length: 11:15)

Office 2007 Documents Open in Read-Only when Opening them from a WSS 2.0 Document Library

  
Hi, When any of our Windows 7 Pro computers that run Office 2007 Pro attempt to open a Word document that resides in a WSS 2.0 document library by using the drop down menu and selecting "Edit with MS Word", the documents open in read-only.  Our work-around is to save the document locally, modify it, and then save it back to the document library. We have some Windows XP and Vista systems that run Office 2007 and they are fine and can simply edit the document and save it.  We also have a handful of pc's that run Office 2003 and they are not having any issues either. Things I've tried: Office 2007 Repair - no luck Office Reinstall - no luck Some registry mod HKCU\Software\Microsoft\Office\12\Internet\OpenDocumentReadWrite=1 (noted on a MSKB article) - no luck and after re-reading the article it clearly states that this will not address content hosted on WSS or SPS sites Clearing IE temp files, resttting IE to defaults - no luck Once again, this only seems to happen to Win7Pro pc's that run Office 2007.  Honestly, I can't tell if IE8 has anything to do with this. Any thoughts or help would be extrememly appreciated. Thanks, Mike

Silverlight Client Object Model - List Fields Names

  

I'm trying to get the DisplayName of the Fields of a list through the Client Object Model (Silverlight)

I can retrieve the fields of a list as an authenticated user but not as anonymous: getting list.fields as anonymous simply returns Access Denied.

Is there a way to enable list.fields for the Client Object Model?

Or is there any other way of getting the DisplayName of Fields of a List?


how to get complete Document Library url into SPSite object

  

Hi!

some documents are in Document Library of sharepoint 2007.

this url is http://abcd:24931/docu/Forms/AllItems.aspx

my task is

i need to display these documents into datagridview of windows form application.

so, i written SPSite siteurl= new SPSite("http://abcd:24931/docu/Forms/AllItems.aspx");

but here(while debuging...) siteurl object is does not contain above complete url.

just it(siteurl) contain only http://abcd:24931, this is my big problem please provide a soluton....

and i think your understood my task also please provide some idea(coding) about my task.

thanks & regards

jilani

 


how to get complete sharepoint Document Library url into SPSite object

  

Hi!

some documents are in Document Library of sharepoint 2007.

this url is http://abcd:24931/docu/Forms/AllItems.aspx

my task is

i need to display these documents into datagridview of windows form application.

so, i written SPSite siteurl= new SPSite("http://abcd:24931/docu/Forms/AllItems.aspx");

but here(while debuging...) siteurl object is does not contain above complete url.

just it(siteurl) contain only http://abcd:24931, this is my big problem please provide a soluton....

and i think your understood my task also please provide some idea(coding) about my task.

after that some suggestions... i write like below but still i am getting same problem

still i am getting same problem.......

using (SPSite ospSite = new SPSite(http://abcd:24931))   ----->output is not respond

SharePoint Workflow : Failed to Start when a document is added to library from server-side object mo

  

When I add a document using my server-side object model code, I get an exception "The type or namespace name 'Office' does not exist in the namespace 'Microsoft'" in the server logs and in the library I can see the Workflow status as "Failed to Start".

...

myLibrary.Files.Add(...);

myLibrary.Update();

...

Interestingly, when I add a document to the same library from sharepoint site portal, it works just fine, the workflow kicks off with the state : in-progress.

Also, I modified the task form for the Approval workflow template from SharePoint Designer using infopath.(Not sure if that be a problem as adding from portal works fine.)

What am I missing out here??

 Details of the exception:

09/29/2010 18:11:19.15  w3wp.exe (0x2508)                        0x2710 SharePoint Foundation          Workflow Infrastructure        98d8 Unexpected Microsoft.SharePoint.SPException: <Error><CompilerError Line="0" Column="20" Text="The type or namespace name 'Office' does not exist in the namespace 'Microsoft' (a

Getting SPRequest object was not disposed before the end of this thread in SP document library event

  

I am using a sharepoint event listener attached to a document library to export files when they are added or modified. Here is a partial stack trace from the SP log for the SPRequest object was not disposed:

This SPRequest was allocated at    at Microsoft.SharePoint.Library.SPRequest..ctor()     at Microsoft.SharePoint.SPGlobal.CreateSPRequestAndSetIdentity(SPSite site, String name, Boolean bNotGlobalAdminCode, String strUrl, Boolean bNotAddToContext, Byte[] UserToken, String userName, Boolean bIgnoreTokenTimeout, Boolean bAsAnonymous)     at Microsoft.SharePoint.SPWeb.InitializeSPRequest()     at Microsoft.SharePoint.SPFile.GetFileStream(OpenBinaryFlags openOptions, String etagNotMatch, String& etagNew)     at Microsoft.SharePoint.SPFile.OpenBinary(SPOpenBinaryOptions openOptions)     at Extract.SharePoint.Redaction.IdShieldFileListener.HandleSharePointFileEvent(SPItemEventProperties properties, FileEventType eventType)

Here is basically the code in the HandleSharePointFileEvent:

    public override void ItemUpdated(SPItemEventProperties properties)
    {
        HandleSharePoi

Can't add item using client object model of sharepoint 2010 with read only permission to user.

  

Hi

I have already developed Silverlight application in SharePoint 2010 using client object model.

But I have one scenario that user can comment on the item, so there is a update operation come in picture for user, but user have read only permission to site.

So please help me resolved this problem.

We can use Run with elevated privileges method in SP object model. I think Silverlight client object model don’t support this method.

Is there any alternative workaround to solve this problem?

Tha


Start site workflow using silverlight client object model.

  

Hi,

I created a sequensial site workflow using VS2010. Its working fine. I want to start it manually using silverlight client object model.

Can any one help me how it can be done?


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend