How to programmatically update content in a SharePoint 2010 content editor Web Part using the CSOM? - sharepoint-2010

So I have no clue where to even start with this. I have tried Google to no avail.
My boss had me add a scrolling marquee to one of our SharePoint sites, using a content editor web part. He now wants me to be able to update it once a day from an excel document on a shared drive. I can open and read the excel file with no issue. The thing is that I only have access to what can be done via the CSOM, and so far I can't find a way to update this web part that way.
Anything would be great!

Get XmlString for content editor webpart using webservice "_vti_bin/WebPartPages.asmx". If you want to see all methods of this web service then navigate to "Sharepointsiteurl/_vti_bin/WebPartPages.asmx".
There is a method GetwebPart2 . Using this method retrieve xmlstring. This XmlString contains all information including content of content editor webpart.
3.You have to replace your old content with your new content.
4.Save webpart using savewebpart method with your new xmlString

Related

Adding word control to asp page?

Is it possible to add a Microsoft Office Word control to an aspx page? I want to be able to modify a load and modify a word document from a web page... I'm just not sure if this is possible?
I know there are AJAX controls out there that allow you to perform something somewhat similar, but I would like to use a Microsoft product if possible.
I am using Visual Studio 2010 and VB.NET to try and accomplish this.
You can use RadEditor for ASP.NET AJAX in your ASPX pages to import DOCX or RTF files, edit their contents in your browser and save them to DOCX,RFT or PDF format. The following examples show how to do that:
Import and Export to DOCX
Import and Export to RTF
Use Ms Word vía ActiveX in ASP.NET it's a bad bad idea. It's possible, but currently, this way is not supported by Microsoft, in fact (http://support.microsoft.com/default.aspx/kb/257757).
You will have troubles with performance, scalabity, user's word versions.... And you will have a lot out-controlled winword.exe processes, and so on.
For this reasons, I use a Silverlight Rich Edit Control, from Devxpress. I had a license already, so I didn't try other solutions, like Telerik's Richtextbox, or Google Docs.
Embed editable MS Word document on web page
Edit: I remembered that another way it's using WebDav. I mean, force to client MS Word to open a word doc in a WebDav location. Maybe you can consider it.
How to create a HTML link which forces MS Word to edit document on webdav server
This is the addin for IE:
http://www.microsoft.com/es-es/download/details.aspx?id=15123
Yes, from the reference i got, it look possible.
Follow this link : Click Here

How to convert XDP to PDF in Adobe LiveCycle ES3 via HTTP REST request

I have: LiveCycle server (ES3, JBOSS), Workbench, Designer.
Using LC Desginer I convert PDF to XDP - it's template now.
Now I need to convert that XDP file to PDF.
So, I guess I should somehow call LiveCycle server by HTTP request, in body of this request I can send body of XDP document. All what I need from LC is just PDF.
Looks like simple task, but I can't find ANY information how to do this. I see a lot of examples how to do this in Java, but I don't need Java, I need to do it via HTTP (REST endpoint or SOAP if it's not possible).
Maybe I need to create some "application" in Workbench? If so, is there any step-by-step documentation? Or maybe somebody can explain me, how to do this. Maybe there is already build-in application in ES3 Server - I think it's very common and simple case.
UPD: I've opened job at Odesk for this issue, I promise to post solution here to share knowledge with community
As was promised, here is how to solve this issue:
It's not enough just put PDF into LiveCycle Designer. You exactly need to design form in LC Designer. You can use your PDF as template, but for all things which you want to fulfil by your custom data, you need to add objects in LC Designer (take a look at the "Insert" menu, try Table or Text Field) and add Data Connection in the "Data View" tab. I think it's pretty easy step for professionals, but it can take some time to get by beginners. Save results of your work as, for instance, Template.xdp file.
Also you now have the example of XML file - source of the data. Let's name it DataSource.xml
Now we can install LiveCycle Server. Best for LC ES3 is RHEL 5.5 (we spent around 2 days just to find correct combination of OS and settings). You'll need a clever system-administrator (or just experienced in Adobe LiveCycle :))
Server is working now, you can see web-interface, so let's create application in Adobe LiveCycle Workbench ES3. Add an application with new name and add a process to that application. It will take to many words to describe all steps of process, just take a look at screenshots of result (and notice variables also):
Now most easy part - call this app by the HTTP request. But we can't just send usual POST request to Adobe LiveCycle :) We have to send content of 2 files (Template.xdp and DataSource.xml) as multipart/form-data and names of the parts are the names of input variables (in my example is xmlTemplate and xmlData). And don't forget Authorization header with Basic authorization credentials.
In the Response you'll receive base64-encoded body of the PDF document.
Thanks to Thierry Stortenbeker for this application and for help and patience.
Yes, you have to create an LC application using workbench. Here is how to do it:
Create a new application in workbench using File -> New -> Application.
Create a new Process using the right click menu at the application.
Drop in renderPDF form activity from the activity and name it "renderPDFForm".
Select renderPDF form activity to add variables using the bottom pane of variables.
Add a variable of "Document" type and name it "inputXDP". We will use this to pass xdp file. Mark it to be "input" variable.
Add a variable of "Document" type and name it "outPDF". Mark it to be "output" variable.
Now double click renderPDFForm activity, this will open a property editor on the left side.
Expand "Input" section if not expanded already. Make sure "Form" to be picked up from variable. Then choose "inputXDP" from the dropdown.
Expand "Output" section if not expanded already. Make sure "Rendered Form" to be picked up from variable. Then choose "outPDF" variable from the dropdown.
Now deploy your application by right click menu on application.
That is it. You are ready to go. Now save the process and double click "default start point" to get the rest url where this service would be exposed. The rest url should look like http://localhost:8080/rest/services/RestFormRender/renderForm:1.0. Here RestFormRender is name of the application and renderForm is name of the process. Now make a GET/POST call to this REST url and specify XDP bytes in "inputXDP" request parameter.

Table of Contents Web Part

So I am trying to create a web part in SharePoint 2010 that displays the 5 most recent subsites created.
I've come to find that the Table of Content Web Part has this functionality(through limiting the number of viewable items), but it is also showing the Sites, Lists, Libraries and Discussions links.
Updating the Navigation settings only changes the number of subsites listed, and changing the web.config file does not remove these links either.
I saw a solution using a Library and javascript, but I would prefer to keep my solution limited to out of the box features (or, at most editing the web.config file).
Thanks
I found this source, http://blog.insource.com/applicationdevelopment/sharepoint/listing-sub-sites-with-the-table-of-contents-web-part.html

Change thumbnail size in Sharepoint 2010

I tried to find it using google, but there are only tips for 2007.
I want to change a few layout things, which are:
The thumbnail size of an image library
The thumbnail size in a slide library
I found this good explanation here:
http://vspug.com/keutmann/2007/01/27/how-to-resize-the-thumbnails-in-a-picture-library/
But I can't find the screenshot view (these nice options) anywhere inside my Sharepoint Designer. Its 2010, so maybe they moved it somewhere else. Anyone has an idea where to find this options tab from the screenshot?
Thanks a lot,
Chris
The linked article does not describe SharePoint Designer, but rather SharePoint Manager, which appears to be a third party tool created by the author.
You could give it a try. Like the U2U CAML Query Builder, it might still work for SharePoint 2010, especially if it uses web services to connect to the site.
But if it doesn't, you should be able to write a Feature Receiver that will accomplish the same thing by modifying the ThumbnailSize property. That has to be what the SharePoint Manager tool is doing.
Regarding changing the thumbnail size of the Slide Library (which you cannot use Sharepoint Manager to do unlike the picture library)
This worked for me to get a bigger thumbnail..
Note that the solution relies on having a naming convention for your files which you apply after you have loaded them up to the slide library eg ENG_02_0010, ENG_02_0020 rather than leaving them named as is when uploaded to Sharepoint.
Create another field called Preview say and make it a picture (format url as picture)
For each uploaded slide put the url link as http://siteName/slidelibraryName/_t/ENG_02_0010_pptx.jpg (same name as your slide with a _pptx.jpg extension)
Get rid of the standard thumbnail from your view and put this new column next to the selection box
Worked for me, much bigger and readable thumbnail!
PS
In SP designer you can find all the jpg thumbnails in the _t directory under the slide library
You can also use CSS on the page where you're displaying the thumbnail images. Here is an example:
<style type="text/css">
img[alt="Thumbnail"] {height:100% !Important;width:100% !Important;}
</style>
This looks for the images with an alt attribute of 'Thumbnail'. I successfully tested this with a Slide library in SharePoint 2013 using IE & Chrome.

Develop a custom editable Visual Web Part (WebPart) for SharePoint 2010

I want to develop a webpart that allows editors to amend its content using Sharepoint's Ribbon-based formatting controls, and then display that content in a nicely formatted way. The built-in content editor webpart isn't sufficient because I want to wrap the content in hardcoded HTML so as to enforce my site's graphical design. Also, I would like the web part to potentially contain more than one editable area, and the standard Content Editor webpart only has one.
My ideal would be a visual web part with a predefined HTML layout, with some editable "content areas" to allow modification in edit mode. When the webpart is saved it will just render its content areas as HTML. I have tried using <SharePoint:RichTextField> blocks in a visual web part ascx template but I don't think this is correct. Can anyone give advice?
Okay, nobody had an answer so I had to do it myself :)
http://zootfroot.blogspot.com/2010/09/develop-custom-editable-visual-web-part.html