Class: PagesArray

PagesArray()

new PagesArray()

Methods

addImageToPage(successCallback, errorCallback, properties)

Method to Add image to page.After the image is added, the currentImageIndex is updated to indicate that the most recent image is current.
Parameters:
Name Type Description
successCallback function Default Success Call back function name
errorCallback function Default Error call back function name
properties Object A JSON object contains the page and image ids.
Properties
Name Type Attributes Default Description
pageID String <optional>
null unique id which is used to get the page and perform the corresponding operations
imageID String <optional>
null id of the image which we want to add to page
See:
Returns:
The return value is captured in the 'successCallback' for a successful operation, and might return in 'errorCallback' for an incomplete/invalid operation. Returns the following values in the corresponding functions successCallback - KMC_SUCCESS success call back with page Object properties. errorCallback - error message would contain the appropriate error description.Possible error objects are Exception,KmcException,JSONException.
Example
var pageObject = null, imageObject = null;
var pagearray = kfxCordova.kfxLibLogistics.createPagesArray();
pagearray.addImageToPage(function(success){
       alert(JSON.stringify(success));
},function(error){
       alert(JSON.stringify(error));
},{pageID:pageObject.pageID,imageID:imageObject.imgID});

createPageObject(successCallback, errorCallback, pageproperties)

Method to Create new page object
Parameters:
Name Type Description
successCallback function Default Success Call back function name
errorCallback function Default Error call back function name
pageproperties Object A JSON object contains the properties of the page object.
{pageproperties.side String = "FRONT"} what type of page you want to create i.e, front or back
Returns:
The return value is captured in the 'successCallback' for a successful operation, and might return in 'errorCallback' for an incomplete/invalid operation. Returns the following values in the corresponding functions successCallback - Gets the created pageObject. errorCallback - error message would contain the appropriate error description.Possible error objects are Exception,KmcException,JSONException.
Example
var pageObject = null;
var pagearray = kfxCordova.kfxLibLogistics.createPagesArray();
pagearray.createPageObject(function(pageObj){
      pageObject = pageObj;
},function(error){
      alert(JSON.stringify(error));
},{side:"FRONT"});// use side:"BACK" to create back side image

deletePages(successCallback, errorCallback, pageIdArray)

Method to delete pages from pageArray which you wants to delete.
Parameters:
Name Type Description
successCallback function Default Success Call back function name
errorCallback function Default Error call back function name
pageIdArray Array A JSON array contains the ids of the pages.
See:
Returns:
The return value is captured in the 'successCB' for a successful operation, and might return in 'errorCB' for an incomplete/invalid operation. Returns the following values in the corresponding functions successCB : The library returns KMC_SUCCESS. errorCB : error message would contain the appropriate error description.Possible error objects are Exception,KmcException,JSONException.
Example
var pageIDArray = null;
var pagearray = kfxCordova.kfxLibLogistics.createPagesArray();
pagearray.deletePages(function(success){
       alert(JSON.stringify(success));
},function(error){
       alert(JSON.stringify(error));
},pageIDArray); //pageIDArray contains the pageids which you wants to delete.

getPageIds(successCallback, errorCallback)

Method to get all page ids from pageArray
Parameters:
Name Type Description
successCallback function Default Success Call back function name
errorCallback function Default Error call back function name
Returns:
The return value is captured in the 'successCallback' for a successful operation, and might return in 'errorCallback' for an incomplete/invalid operation. Returns the following values in the corresponding functions successCB : KMC_SUCCESS success call back jsonArray of page ids. errorCB : error message would contain the appropriate error description.Possible error objects are Exception,KmcException,JSONException.
Example
var pageIDArray = null;
var pagearray = kfxCordova.kfxLibLogistics.createPagesArray();
pagearray.getPageIds(function(pageIdArrays){
      pageIDArray = pageIdArrays;
},function(error){
      alert(JSON.stringify(error));
});

getPropertiesOfPage(successCallback, errorCallback, pageproperties)

Get the properties of the page from PageArray
Parameters:
Name Type Description
successCallback function Default Success Call back function name
errorCallback function Default Error call back function name
pageproperties Object A JSON object contains the properties of the page object.
Properties
Name Type Attributes Default Description
pageID String <optional>
null unique id which is used to get the page and perform the corresponding operations
Returns:
The return value is captured in the 'successCallback' for a successful operation, and might return in 'errorCallback' for an incomplete/invalid operation. Returns the following values in the corresponding functions successCallback - KMC_SUCCESS success call back with page Object properties. errorCallback - error message would contain the appropriate error description.Possible error objects are KmcRuntimeException,Exception.
Example
var pagearray = kfxCordova.kfxLibLogistics.createPagesArray();
pagearray.getPropertiesOfPage(function(properties){
      alert(JSON.stringify(properties));
},function(error){
       alert(JSON.stringify(error));
},{pageID:pageObject.pageID});

removeAllPages(successCallback, errorCallback)

Method to remove all pages from pageArray
Parameters:
Name Type Description
successCallback function Default Success Call back function name
errorCallback function Default Error call back function name
Returns:
The return value is captured in the 'successCallback' for a successful operation, and might return in 'errorCallback' for an incomplete/invalid operation. Returns the following values in the corresponding functions successCallback - The library returns KMC_SUCCESS. errorCallback - error message would contain the appropriate error description.Possible error objects are Exception,KmcException,JSONException.
Example
var pagearray = kfxCordova.kfxLibLogistics.createPagesArray();
pagearray.removeAllPages(function(success){
       alert(JSON.stringify(success));
},function(error){
       alert(JSON.stringify(error));
});

removeImageFromPage(successCallback, errorCallback, properties)

Method to Remove image from page.The image to be removed is determined by matching the supplied imageID string to the contents of the images in the array. If the current image is removed, the currentImageIndex is set to 0. Otherwise, the currentImageIndex refers to the same image.
Parameters:
Name Type Description
successCallback function Default Success Call back function name
errorCallback function Default Error call back function name
properties Object A JSON object contains the page and image ids.
Properties
Name Type Attributes Default Description
pageID String <optional>
null unique id which is used to get the page and perform the corresponding operations
imageID String <optional>
null id of the image which we want to remove from page
See:
Returns:
The return value is captured in the 'successCallback' for a successful operation, and might return in 'errorCallback' for an incomplete/invalid operation. Returns the following values in the corresponding functions successCallback - KMC_SUCCESS success call back with page Object properties. errorCallback - error message would contain the appropriate error description.Possible error objects are Exception,KmcException,JSONException.
Example
var pageObject = null, imageObject = null;
var pagearray = kfxCordova.kfxLibLogistics.createPagesArray();
pagearray.removeImageFromPage(function(success){
       alert(JSON.stringify(success));
},function(error){
       alert(JSON.stringify(error));
},{pageID:pageObject.pageID,imageID:imgObj.imgID});

setPageProperties(successCallback, errorCallback, pageproperties)

Set the properties of the page from PageArray
Parameters:
Name Type Description
successCallback function Default Success Call back function name
errorCallback function Default Error call back function name
pageproperties Object A JSON object contains the properties of the page object.
Properties
Name Type Attributes Default Description
pageID String <optional>
null unique id which is used to get the page and perform the corresponding operations
side String <optional>
"FRONT" What side of the page i.e, either FRONT or BACK
See:
Returns:
The return value is captured in the 'successCallback' for a successful operation, and might return in 'errorCallback' for an incomplete/invalid operation. Returns the following values in the corresponding functions successCallback - KMC_SUCCESS success call back errorCallback - error message would contain the appropriate error description.Possible error objects are KmcRuntimeException,Exception.
Example
var pageObject = null;
var pagearray = kfxCordova.kfxLibLogistics.createPagesArray();
pagearray.setPageProperties(function(success){
       alert(JSON.stringify(success));
},function(error){
       alert(JSON.stringify(error));
},{pageID:pageObject.pageID,side:"FRONT"}); // use side:"BACK" to set back side pageobject properties.