| API Reference | Type | Description |
|---|---|---|
| Lists | Subclass | Manipulates lists and list items (retrieve, save, delete) |
| List | Subclass | |
| Form | Subclass | Manipulates fields on a form (get/set, hide, disable) |
| Webparts | Subclass | Manipulates webparts on a page (overwrite script vars) |
| Core | --- | The base jPoint class has utility functions and helpful variables |
The main purpose of Lists is to interact with the lists.asmx web service. It abstracts the web service and does a lot of the heavy lifting for the jPoint API developer. The main function that will be used is setSPObject(). This function creates List Item objects such as jP.Lists.Announcements and jP.Lists.Tasks.
| Name | Type | Description |
|---|---|---|
| List | Subclass | Manipulates List items (retrieve, save, delete) |
| setSPObject | Function | Creates a List Item |
| [list name] | Variable | List Collection array that has been created from setSPObject calls |
| Items | Variable | List Item Collection array created from last List operation |
| FieldCount | Variable | Length of Items array created from last List operation |
jPoint.Lists.setSPObject( SiteURL, ListName )
set List Item
| Name | Type | Optional | Description |
|---|---|---|---|
| SiteURL | String | false | SiteURL |
| ListName | String | false | Sharepoint List Name |
List Item object
| Name | Type | Description |
|---|---|---|
| getSPItem | Function | Gets a unique SharePoint list item by ID (int) |
| getSPItemsWithQuery | Function | Gets a set of SharePoint list items by CAML Query |
| updateItem | Function | Updates or adds an item to a SharePoint list |
| addItem | Function | Add a new item to a SharePoint list |
| getSPView | Function | Populates a jPoint object with items for particular SharePoint view |
| getPictures | Function | Populates a jPoint object with items for particular SharePoint Picture List view |
List.getSPItem( ListItemID )
get SPListItem by ID (int)
| Name | Type | Optional | Description |
|---|---|---|---|
| ListItemID | Int | false | Unique list item ID |
Nothing
List.getSPItemsWithQuery( CamlQuery, rowLimit )
get SPListItems by CAML query
| Name | Type | Optional | Description |
|---|---|---|---|
| CamlQuery | String | false | Xml String of CAML Query |
| rowLimit | Int | false | The maximum number of list items to return |
Nothing
List.updateItem( data )
update/add SPList item
| Name | Type | Optional | Description |
|---|---|---|---|
| data | JSON | false | example:data to modified JSON object [{ id:0, title:'title123', user:'user123'}, {id:5, title:'title124', user:'user124'}] - if id = 0 Add item otherwise update item |
Operation Result success: (bool) whether the operation is success errorCode: error code, 0x00000000 for no error errorText: error text, null for no error id: item id, -1 for error
List.addItem( data )
add a new item SPList item
| Name | Type | Optional | Description |
|---|---|---|---|
| data | JSON | false | example:data to modified JSON object [{ id:0, title:'title123', user:'user123'}, {id:0, title:'title125', user:'user125'}] - note: name example 'title' is case sensitive and is internal field name of the sharepoint list column |
Operation Result success: (bool) whether the operation is success errorCode: error code, 0x00000000 for no error errorText: error text, null for no error id: item id, -1 for error
List.getSPView( ViewName )
populate jPoint object with items for particular view
| Name | Type | Optional | Description |
|---|---|---|---|
| ViewName | String | false | default view name is "All Items" |
Nothing
List.getSPView( ViewName )
populate jPoint object with items for Picture List view
| Name | Type | Optional | Description |
|---|---|---|---|
| ViewName | String | false | default view name is "All Pictures" |
Nothing
The main purpose of Form is to tag and manipulate the fields on a form page or form webpart. It is important for this functionality to be cross-browser compatible and to work not only on the Form pages (NewForm.aspx, DispForm.aspx, and EditForm.aspx), but also custom webpart pages that contain a Form webpart.
| Name | Type | Description |
|---|---|---|
| readForm | Function | Detects WSS form fields and populates the Form variables |
| saveForm | Function | Detects WSS form fields and populates the Form variables |
| Id | Variable | 0 if a new, unsaved form, value of item’s id otherwise |
| Schema | Variable | Object populated from lists.asmx -> GetListContentType |
| AutoSaveInterval | Variable | Not yet implemented in jPoint-0.3. |
| ItemNames | Variable | Array of the form field’s internal names |
| Items | Variable | Array of DOM elements pointing to each field |
| FieldCount | Variable | Length of Items array |
Nothing
Nothing
The main purpose of Webparts is to update the script on the page so that on the next page refresh, the new script is able to run. This class uses the WebPartPages.asmx web service.
| Name | Type | Description |
|---|---|---|
| Save | Function | Replaces contents of jPart (script webpart) that is on the page |
| getPageWebPartProperties | Function | Wrapper for web service that helps identify jPart on the page |
| updatejPartProperties | Function | Replaces local jPart properities required for easy deployment |
jPoint.Webparts.Save( WebpartObj, WebpartContents )
Replaces jParts content
| Name | Type | Optional | Description |
|---|---|---|---|
| WebpartObj | Object | false | |
| WebpartContents | Object | false |
jPoint.Webparts.getPageWebPartProperties( SiteURL, WebpartFinderID )
Wrapper for web service that helps identify jPart on the page
| Name | Type | Optional | Description |
|---|---|---|---|
| SiteURL | String | false | |
| WebpartFinderID | String | false |
wpsObj Object
jPoint.Webparts.updatejPartProperties( WebpartObj, LocalOptions )
Replaces local jPart properities required for easy deployment
| Name | Type | Optional | Description |
|---|---|---|---|
| WebpartObj | Object | false | |
| LocalOptions | Object | false |
The jPoint core consists of utility functions and helpful variables that describe the jPoint class.
| Name | Type | Description |
|---|---|---|
| extend | Function | Borrowed from jQuery to extend core jPoint class |
| config | Function | Manage jPart (content editor webpart w/ script) setup |
| getScript | Function | Loads javascript files asynchronously or synchronously |
| valSiteURL | Function | Gets and sets base class SiteURL |
| valListName | Function | Gets and sets base class ListName |
| strip | Function | Removes white space and specials chars from a string |
| sameNames | Function | Compares two strings after stripping |
| Jpoint | Variable | Version number |
| ListName | Variable | Cuurent List Name |
| SiteURL | Variable | Current Site URL |
jPoint.extend( [deep], target, object1, [object] )
This method copies the jQuery extend method. See http://docs.jquery.com/Utilities/jQuery.extend.
Nothing
Modified object
jPoint.config( myjOptions )
This method starts the configuration webpart process
| Name | Type | Optional | Description |
|---|---|---|---|
| myjOptions.Local | Custom Array | false | myjOptions.Local is comprised of jPart developer defined JSON objects |
| myjOptions.Plugin | Array | false |
Nothing
jPoint.getScript( fileURL, [blocking], [callback] )
Setup after jQuery's getScript with the exception of an extra parameter, blocking, to load javascript files. See http://docs.jquery.com/Ajax/jQuery.getScript. Loads, and executes, a local JavaScript file using an HTTP GET request.
| Name | Type | Optional | Description |
|---|---|---|---|
| fileURL | String | false | fileURL is the URL of the file to load. |
| blocking | Boolean | true | blocking (optional, defaults to False) loads file asynchronously if False, synchronously if True. |
| callback | Function | true | callback (optional) is a function to be called after script is called (AND loaded in case blocking is True). |
True if jQuery's getScript was succesfully called, otherwise False. Return value of True does not mean script has been retrieved, only that call was made. purpose: Get: returns value of jPoint.SiteURL
jPoint.valSiteURL( [value] )
Getter/Setter. Get: returns value of jPoint.SiteURL. Set: sets value of jPoint.SiteURL with ‘value’ parameter. Certain functions in jPoint need this variable set. If the developer does not set the variable manually, jPoint tries to figure out the current site.
| Name | Type | Optional | Description |
|---|---|---|---|
| value | String | true | value (Optional). If not present, function is Getter, else function is Setter and value is String representing siteURL. |
If value is not present, function returns Sharepoint’s javascript variable, L_Menu_BaseUrl, representing the siteURL. If value is present, function just returns value.
jPoint.valListName( [value] )
Getter/Setter. Get: returns value of the current List. Set: sets value of jPoint.ListName with ‘value’ parameter. Certain functions in jPoint need this variable set. If the developer does not set the variable manually, jPoint tries to figure out the current list by looking for the part of the URL after “/Lists/”.
| Name | Type | Optional | Description |
|---|---|---|---|
| value | String | true | value (Optional). If not present, function is Getter, else function is Setter and value is String representing listName. |
If value is not present, function returns the part of URL after “/Lists/” else jPoint.ListName or “”. If value is present, function just returns value.
jPoint.strip( str )
Strips the whitespace and special characters from the String str. It is used within jPoint to collapse a Form or List field display name or List name so that the name can be assigned as a variable to the parent class.
| Name | Type | Optional | Description |
|---|---|---|---|
| str | String | false | str is a String. |
str with whitespace and special characters stripped out purpose: compares two names to see if they are the same except for whitespace and special characters to abstract away from encoding and decoding strings Used primarly to compare display names of URL parameters and Sharepoint fields input: name1 and name2 are strings visibility: public return: true or false
jPoint.sameNames( name1, name2 )
Compares two names to see if they are the same except for whitespace and special characters to abstract away from encoding and decoding strings. It is used primarily to compare the display names of Form fields and URL parameters.
| Name | Type | Optional | Description |
|---|---|---|---|
| name1 | String | false | name1 is a String |
| name2 | String | false | name2 is a String |
True if strings are equal or are equal once stripped (see jPoint.strip), else False.
Contains a String of the version of jPoint currently being used.
Contains a String of the current list being evaluated by jPoint.
Contains a String of the current site executing jPoint scripts.