How can I read a OneDrive directory with Apache Camel? - sharepoint

I want to be able to automate reading files from a one-drive link, or from SharePoint online.
I had seen a reference to using Camel-CMIS
Using Apache Camel CMIS with Sharepoint 2013 which seemed to be what I wanted, but according to CMIS support for Sharepoint and OneDrive, this applies only to On-Prem SharePoint and I need to access online OneDrive/SharePoint as none of the sites I need to access are on-prem.
Is there another component or approach that can to do this in Camel?
Thanks!

It seems as there is no camel component (yet) for OneDrive.
That being said, there are a few java clients, that make integrating OneDrive in java easier. Here are some examples:
https://github.com/nuxeo/onedrive-java-client
https://github.com/isac322/OneDrive-SDK-java
The best thing to do would be writing the Camel Component based one of those clients and adding it to the official camel repository.
Alternatively, you could use camel routes to do the whole process and then write plain java code where the OneDrive integration comes in.
I have done the same for other services, that only have a java client, but no camel integration.
The advantage is, that you still get all the awesome stuff, that camel brings (robust runnable, error handling, routing etc.)
For example:
from("direct:toOneDrive")
.process(exchange -> {
// Do the OneDrive stuff
})
.to("direct:afterOneDrive");

Related

Render/edit MS Office docs in browser with SharePoint or WOPI

I have a Rails application I want to do CRUD operation on user's documents online but I want to render MS Office (OpenXML-based) docs in the browser. I have heard about WOPI/SharePoint. How can I integrate it with my web app?
What you're looking for is indeed called WOPI. To be precise, you want to integrate Office Online Server (WOPI client) with your application (WOPI host). This is how SharePoint's integration works as well (SharePoint plays the role of a WOPI host here).
You need to implement the following flow:
Translated to your app - your Rails app will generate URLs pointing to the WOPI client and providing it with information about the MS Office files, authentication information, etc. Then, the WOPI client reaches for those files to your Rails app which will also need to implement the REST endpoints defined by MS-WOPI protocol (mainly CheckFileInfo, GetFile, and PutFile actions).
If you just want to provide view for the documents, that are publicily available, you could use office live viewer, or google docs viewer. You need to basically provide an URL to your document to those services.
I have found this site that has demos for online viewers currently available, you could check it out: https://xtai-umd.github.io/docs-viewer-demo/
SharePoint also has something called WopiFrame.aspx page (or WopiFrame2.aspx), that allows you to show documents like the site above, but with authentication. Please note that this will work only for the documents that are stored in the SharePoint (in the particular SharePoint where you use that WopiFrame.aspx, that is).
If you are developing SPFx web part, this is the way to go I think. Since in this case both are running in the context of SharePoint site, you don't really need to think much about security, it's all taken care of.
I mean, implementing your own WOPI server is not easy at all, and in addition to that you'll need Office Web Apps server, either installed on-premise in your organization, or the Microsoft's online one. To be able to use Microsoft's one you need to be a member of Cloud Storage program, as far as I know.
I would not recommend implementing custom WOPI server unless it is really needed for whatever reason (in my case, it was quite specific security requirements)

Accessing SharePoint through Java Application

HI
I want to access my sharepoint site through my java application or through jsp pages. At my website user can search and download documents from sharepoint document library.if any java api? plz send me sample code..
Regards
Siva
http://code.google.com/p/java-sharepoint-library
Library written in Java provided connectivity to Microsoft SharePoint 2007 and 2010 Web Services.
You can check out WSRP then you may be able to show your web parts in java portlets.
http://en.wikipedia.org/wiki/Web_Services_for_Remote_Portlets
I remeber testing it in SharePoint 2007 to show lists in a java portlets.
You can using this http://www.bendsoft.com/downloads/camelot-wcf-service/
http://camelottoolkit.codeplex.com/
http://www.bendsoft.com/downloads/camelot-sharepoint-integration-toolkit/
Alongside with the Camelot ADO.NET Connector it turns SharePoint to an ordinary SQL datalayer so you can select, insert, update and delete from your Lists and Document Libraries (full CRUD support).
I'm not really into java, but there are sample code of using the WCF service and PHP is available here, http://blog.bendsoft.com/2011/04/camelot-php-tools-1-1-for-sharepoint-released/
There are a few soap wsdl clients for java, but it should be a simple task of setting it up.
I have developed an API to access most common Sharepoint Rest API functions (i'm still in work in progress to achieve a full implementation). The idea is to have a very easy to use java API to work with sharepoint sites. You can take a look here
https://github.com/kikovalle/PLGSharepointRestAPI-java

Getting started with Sharepoint 2007 development

We have an ASP.NET website that we use internally to do some project tracking and various work. We would like to integrate some pieces of it to co-exist with Sharepoint2007 WSS.
Basically what we would really need to do is be able to add items to a list in one of the Sharepoint sites.
I'm not sure where to begin. I've looked online a bit but it seems overly complicated. Is there a quick start guide somewhere that can get me rolling with ease?
The SharePoint Web Services would be a logical place to start. In my opinion this would be the easiest way to build interaction between ASP.NET and SharePoint.
A list of available web services can be found on MSDN.
If adding items to a list is the primary goal, then check out the UpdateListItems method of the Lists web service.
With the scope narrowed to Web Services, you can certainly find tutorials/references online. However, this InfoQ post by Trent Swanson is a decent introduction to SP web services. Note that they recommend generating .NET types using XSD files; in practice, for simple projects I have simply parsed the XML myself using LINQ. You can make it as easy or complex as you like, I suppose.

How to access SharePoint files and folders from outside SharePoint?

I need to programatically interface with SharePoint folders, files and lists from outside SharePoint. Most tutorials focus on working within SharePoint itself, or at least on the same server where SharePoint is installed. I need to automate some tasks from completely different servers -- tasks that require reading SharePoint lists, browsing folders, checking files out and in, reading files stored in SharePoint libraries, etc. It used to be easy using UNC folder and file paths. Now many of our SharePoint sites don't allow UNC access (probably for good reasons), but my needs are the same. What languages / libraries / interfaces will allow this? I'd like to be able to do this from server-side .NET code and from PowerShell scripts (not on the SharePoint server). Thanks for any pointers.
SharePoint offers a web services API. I won't claim it's particularly friendly or fun, but it does work. You can get started learning here.
Use Sharepoint Web Services which provides a suite of standard web service endpoints you can use to do most anything you can through the objet model API.
You can use SPServices whichis a jQuery library which abstracts SharePoint's Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works entirely client side and requires no server install.
Here's anoth example of SPServices in use Example
if you are using SharePoint 2010 you can use the Client Side Object Model (http://msdn.microsoft.com/en-us/library/ee537247(v=office.14).aspx). It will help you to access sharepoint objects, lists and everything. There are 3 types one for C#, Silverlight and Javascript.
there are more than one methods:
use csom (client side object model)
use rest services
use sharepoint out of the box web services.
If you want to be able to choose the language in which you program, I'd recommend using the Sharepoint REST API. I'm writing my service in Java, requesting data in JSON, and using Jackson to parse it into Java Objects.

Sharepoint as a CMS

I do not know anything about Sharepoint, and my company is rolling it out in a few departments.
I am familiar with the workings and usage of Oracle (Stellent) CMS (for storing docs with meta-data, searching for docs, etc), and I am asking if I may use Sharepoint in a similar way?
Can I programmatically upload docs to Sharepoint, from a java web application, and do searches and doc retrieval?
Yes. You are able to do all of that from Java via the MOSS 2k7 Web Services. Here's a quick reference for uploading a file to a list (the example uses .NET, but you can use Java just as easily).
David Klein's Corner: Uploading Files to MOSS 2007 via the Copy.asmx Web Service

Resources