CopyPastehas never been so tasty!

Interoperability between Java and SharePoint 2013

by anonymous

  • 0
  • 0
  • 0

Every time a software company brings out a new technology or product in the market, the focus is directed towards the endeavor of catering to the demands of users/customers concerning a specific functionality. Owing to such a need, companies often take route to creating an all – inclusive administrative solutions with the aim of selling a complete package. However, it must be noted that all documents and data created within the system often holds onto an importance, which reaches beyond commercial lifetime of a particular application of creation.

The importance of documents and data often surpasses the actual scope of parent or main application. For instance, documents that have been created in a proprietary system of document management might require an access from a corporate intranet or data present within system of custom relationship management might serve as an input to process of business documents creation.

Now, introduction of SharePoint 2013 has brought into fore the prospect of an effortless integration between a particular application and other external systems that has been implemented within technologies that are not of Microsoft. Well, in such a scenario, the RESTfull web service of SharePoint API increases communication with web application of Java. The chrome control of SharePoint enables the web application of Java to feature a similar kind of styling to that of hosted website.

The Layer of Communication with SharePoint

The web application of Java communicates to a car list in the hosted web, which is referred to as the Interopl and the data list is named as the Cars. The list features columns referring to the model, bran, and price. This particular application is named the Cars App and here is a quick look at the dependencies of the same within Java implementation.

  • json-lib 2.4 – helper classes influencing Json objects
  • resteasy-jaxrs 2.2.1.GA – RESTEasy enabled an easy access of the RESTfull SharePoint API
  • commons-httpclient 3.1- dependent on RESTEasy
  • httpclient 4.1.1 - dependent on RESTEasy
  • spring-web 2.5.6
  • spring-core 2.5.6
  • spring-webmvc 2.5.6
  • commons-logging 1.1.1

The Car service has been defined in order to write and read into Cars list featuring declaration file The implementation of Cars service features a member variable, which define parameters of authentication along with web service URIs endpoints pertaining to SharePoint and Cars list field names.

The particular service also incorporates a number of helper methods. The callRestEasyService helper methods read the data by conducting a HTTP Get as against the RESTfull API of SharePoint. The URI that is given in the req parameter defines just what is being recovered and retrieved. It strictly follows the protocol syntax of OData. In this particular scenario, it would refer to the items of the Car list.

To go for object creation in SharePoint through the RESTfull API, which refers to the Cars list items, it is required to provide a Form Digest, which can easily accessible via a POST To the hosted web endpoint “/_api/contextinfo”. The addRestEasyRetrieveDigest helper conducts the posts and goes through Form Digest. The actual definition of URI is given in the urlDigest of the variable.

The addRestEasyPost helper enables object creation in SharePoint through POSTs as mentioned in the protocol of OData. This particular method helps adding cars to the particular list. The parameter req features the URI of object creation, which refers to the Cars list here. Another detail that is often regarded while creating objects is the need of stating the type. In the particular list, the items refer to the SP.Data.CarsListItem type, which follows the convention SP.Data.<ListName>ListItem.

The parseJsonDigestValue helper method integrates the JSON response from the “/_api/contextinfo” endpoint recovering the form digest.

The parseJson helper translates the response of the JSON to the payload class of Cars retrieving the list.The Cars service explains the method getCars to read the items; whereas, the technique insertCar is used to write the items.

Custom SharePoint development teams can help you build projects within allocated budgets and time schedules.

We provide
Java and SharePoint Integration services. If you would like to talk to one of our expert SharePoint developers, please get in touch with us at Mindfire Solutions.

Add A Comment: