Class: kfxLibLogistics

kfxCordova.kfxLibLogistics()

new kfxLibLogistics()

Methods

(static) createCaptureServer(successCallback, errorCallback, parameters)

this method is used to get the instance of capture server
Parameters:
Name Type Description
successCallback function Default Success Call back function name
errorCallback function Default Error call back function name
parameters Object A JSON object contains server url and servertype to create capture server
Properties
Name Type Attributes Default Description
serverUrl String <optional>
"" Url which is used to connect to the capture server
serverType String <optional>
"" Type of the capture server. It is either "SERVER_KFS" or "SERVER_KTA".
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 jsonArray of page ids. errorCallback - error message would contain the appropriate error description.Possible error objects are Exception,KmcException,JSONException.
Example
var captureServerObject = null;
var parameters = {serverUrl:"Valid Url",serverType:"SERVER_KFS"};
var captureServerInstance = kfxCordova.kfxLibLogistics.createCaptureServer(function(captureObj){
      captureServerObject = captureObj;
},function(error){
      alert(JSON.stringify(error));
},parameters);

(static) createDocumentsArray()

this method is used to get the instance of documents array
Example
var documentsArrayInstance = kfxCordova.kfxLibLogistics.createDocumentsArray();

(static) createDocumentTypeObjectFromFieldTypes(successCallback, errorCallback, fieldTypesArray)

this method is used to create the document type
Parameters:
Name Type Description
successCallback function Default Success Call back function name
errorCallback function Default Error call back function name
fieldTypesArray Array list of field types
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 jsonArray of page ids. errorCallback - error message would contain the appropriate error description.Possible error objects are Exception,KmcException,JSONException.
Example
var createdDocument = null;
var captureServer = null;
var documentTypesArray = null;
kfxCordova.kfxLibLogistics.createCaptureServer(function(captureServerObj){
     captureServer = captureServerObj;
},function(error){
     alert(JSON.stringify(error));
},{serverUrl:"valid url",serverType:"SERVER_KFS"});

captureServer.registerDevice(function(success){
     captureServer.loginAnonymously(function(success){
         documentTypesArray = success;
     },function(registerError){
         alert(JSON.stringify(registerError));
     });
},function(registerError){
     alert(JSON.stringify(registerError));
});
var documentType = documentTypesArray[0];
var kfsdocumentTypeReadyCallback = function(documentType){
  kfxCordova.kfxLibLogistics.createDocumentTypeObjectFromFieldTypes(function(success){
      alert(JSON.stringify(success));
  },function(error){
      alert(JSON.stringify(error));
  },documentType.fieldTypesArray);
};

(static) createDocumentTypesArray()

this method is used to get the instance of document types array
Example
var documentTypesArrayInstance = kfxCordova.kfxLibLogistics.createDocumentTypesArray();

(static) createDocumentWithDocumentType(successCallback, errorCallback, docTypeName)

Method to Create document using documentType and add in DocumentsArray.
Parameters:
Name Type Description
successCallback function Default Success Call back function name
errorCallback function Default Error call back function name
docTypeName String A JSON object contains the documenttype 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 createdDocument = null;
var captureServer = null;
var documentTypesArray = null;
kfxCordova.kfxLibLogistics.createCaptureServer(function(captureServerObj){
     captureServer = captureServerObj;
},function(error){
     alert(JSON.stringify(error));
},{serverUrl:"valid url",serverType:"SERVER_KFS"});

captureServer.registerDevice(function(success){
     captureServer.loginAnonymously(function(success){
         documentTypesArray = success;
     },function(registerError){
         alert(JSON.stringify(registerError));
     });
},function(registerError){
     alert(JSON.stringify(registerError));
});
var documentType = documentTypesArray[0];
var kfsdocumentTypeReadyCallback = function(documentType){
  kfxCordova.kfxLibLogistics.createDocumentWithDocumentType(function(docObject){
      createdDocument = docObject;
  },function(error){
      alert(JSON.stringify(error));
  },documentType.typeName);
};

(static) createDocumentWithDocumentTypeAndId(successCallback, errorCallback, docTypeNameAndId)

Method to Create document using documentType and id and add in DocumentsArray.
Parameters:
Name Type Description
successCallback function Default Success Call back function name
errorCallback function Default Error call back function name
docTypeNameAndId Object :A JSON object contains the documenttype name and id.
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 createdDocument = null;
var captureServer = null;
var documentTypesArray = null;
kfxCordova.kfxLibLogistics.createCaptureServer(function(captureServerObj){
     captureServer = captureServerObj;
},function(error){
     alert(JSON.stringify(error));
},{serverUrl:"valid url",serverType:"SERVER_KFS"});

captureServer.registerDevice(function(success){
     captureServer.loginAnonymously(function(success){
         documentTypesArray = success;
     },function(registerError){
         alert(JSON.stringify(registerError));
     });
},function(registerError){
     alert(JSON.stringify(registerError));
});
var documentType = documentTypesArray[0];
var kfsdocumentTypeReadyCallback = function(documentType){
  kfxCordova.kfxLibLogistics.createDocumentWithDocumentTypeAndId(function(docObject){
      createdDocument = docObject;
  },function(error){
      alert(JSON.stringify(error));
  },{ documentTypeName:documentType.typeName,documentID: "document id what do you want to give"});
};

(static) createFieldObject()

this method is used to get the instance of field object
Example
var fieldInstance = kfxCordova.kfxLibLogistics.createFieldObject();

(static) createFieldTypeObject()

this method is used to get the instance of field type instance
Example
var fieldTypeInstance = kfxCordova.kfxLibLogistics.createFieldTypeObject();

(static) 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;
kfxCordova.kfxLibLogistics.createPageObject(function(pageObj){
      pageObject = pageObj;
},function(error){
      alert(JSON.stringify(error));
},{side:"FRONT"});// use side:"BACK" to create back side image

(static) createPagesArray()

this method is used to get the instance of pages array
Example
var pagesArrayInstance = kfxCordova.kfxLibLogistics.createPagesArray();

(static) createServerExtractor(successCallback, errorCallback, parameters)

This method is used to get the instance of server Extractor. It expects type of the server and server url. The newly created object is retained and the old one would be destroyed. For example if you create serverExtractor object using RTTI type and subsequently create serverExtractor object using KTA type,only KTA type object will exist.
Parameters:
Name Type Description
successCallback function Default Success call back function name
errorCallback function Default Error call back function name
parameters Object JSON object which contains server type and server url to create server extractor
Properties
Name Type Attributes Description
serverType String <optional>
Type of the server. It is either "SERVER_RTTI" or "SERVER_KTA".
serverUrl String <optional>
Valid server url which is used to create , login and extract data from server.
See:
  • Check the 'errorCallback' method for any failures in case of unexpected behaviour of the method. Generally the error call back would return a JSON object with ErrorMsg & ErrorDesc' giving the description of the error.
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 will contain the created ServerExtractor. errorCallback - error message would contain the appropriate error description.Possible error objects are Wrong Parameters,KmcRuntimeException,Exception.
Example
var constructorOptions = {serverType:"SERVER_KTA",serverUrl:"Enter server url"};
  var extractor = null;
  kfxCordova.kfxLibLogistics.createServerExtractor(function(serverExtractor){
      extractor = serverExtractor;

  },function(error){
      alert(JSON.stringify(error));
  },constructorOptions);

(static) createUserProfileObject()

this method is used to get the instance of user profile object
Example
var userProfileInstance = kfxCordova.kfxLibLogistics.createUserProfileObject();