jump to navigation

jPoint version 0.7 Released – Objectifies SharePoint Web Services and more November 12, 2009

Posted by willhlaw in jPoint, SharePoint, Web Services.
Tags: , , , ,
add a comment

[cross-posted on The jPoint Blog at http://sharejPoint.com/blog]

image

 

 

 

 

 

 

Here is the link to the jPoint version 0.7 Release on Codeplex. jPoint is the jQuery based library that makes building javascript solutions a lot easier by abstracting a lot of the low-level SharePoint intricacies such as cross browser compatibility, manipulating the HTML mess in Forms, and in particular, the nuances of the different SharePoint web services.  In the previous releases, jPoint required the application developer to iterate through the data returned from the web service as jQueryData, which was XML returned from the jQuery AJAX call. In this 0.7 release, you can now reference the data as an Items object.  Let’s say you want to get the last message from a chat list (assuming the default view has messages ordered by descending ID).  You would be able to write:

jP.Lists.setSPObject(siteURL, “chat”); //adds chat list (as Uppercase) to the Lists object

jP.Lists[“CHAT”].getSPView(); //adds the items from the default view to the Lists.CHAT object

var chatMessage = jP.Lists[“CHAT”].Items[0].message;

Below are the rest of the highlights of the 0.7 release.

Major jPoint.Lists Object Updates:

When using getSPItem, getSPItemsWithQuery, getSPView, getSPViewCollection, getPictures, updateItem, addItem, and deleteItem,
jPoint.Lists["<listname>"] will have the following objects populated depending on current context

  • ListName – name of last list used
  • FieldCount – count of fields
  • ItemCount – count of items
  • Items – array of item object [{fld11:val11,fld12:val12,…},{fld21:val21,fld22:val22,…},…]
    • fields are based on xml response and might not be uniform across rows, so check before use
  • xmlDoc – xml document response from webservice call
  • JQueryData – row data as jQuery object
  • total – count of rs:\\data nodes if exist
  • nextPage – key for paging if rs:\\data exist

Improved Public Functions:

  • jP.Form.readForm() – identification of form fields for dispform.aspx
  • jP.Form.<FieldName>.val() – reading of value from fields with no input element to support dispform.aspx
  • jP.strip(str) – remove special hex encoded characters
  • jP.Lists[<ListName>].getSPListFields() – save additional information into list object
  • jP.Lists[<ListName>].udpateItem(itemid) – process response data to save information into list object
  • jP.Lists[<ListName>].getSPItem, getSPItemsWithQuery, getSPView, getSPViewCollection, getPictures – Return list object

Improved Private Functions:

  • getSPItemData(listObj) – use processResponseData to save information
  • getSPItems(listObj, rowLimit) – use processResponseData to save information
  • getSPViewItems(listObj) – get default view dynamically
  • buildModifyContent(listName, data) – handling when data[i].ID is not null

Newly Added Public Functions:

  • deleteItem(id) – delete SPList item
  • getSPViewCollection() – populate jPoint object with list view collection
  • filterItems(filterField, filterValue) – filter the list items where filterField contains filterValue
  • getItemsFieldData(fieldNames) – extract a subset of Items for specified fields

Newly Added Private Functions:

  • processResonseData(listObj, data) – populate jPoint.Lists.{listname} and jPoint.Lists with list information to process list web service all uniformly
  • saveListObjects(listObj, responseData) – populate jPoint.Lists.{listname} and jPoint.Lists with list information
  • getResultItems(respData) – convert response data into array of item objects
  • getColumns(items) – get complete list of columns from items array
  • buildDeleteContent(listName, id) – construct xml body for deleting SPItem from a specified list
Advertisements