Class: DocumentTypesArray

DocumentTypesArray()

new DocumentTypesArray()

Methods

createDocumentTypeObjectWithFieldTypesArray(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 docarray = kfxCordova.kfxLibLogistics.createDocumentsArray();
var kfsdocumentTypeReadyCallback = function(documentType){
  docarray.createDocumentTypeObjectWithFieldTypesArray(function(success){
      alert(JSON.stringify(success));
  },function(error){
      alert(JSON.stringify(error));
  }, documentType.fieldTypesArray);
};

deleteDocumentTypes(successCallback, errorCallback, documentTypeNameArray)

this method is used to delete the document types from document type array
Parameters:
Name Type Description
successCallback function Default Success Call back function name
errorCallback function Default Error call back function name
documentTypeNameArray Array list of the doucment type names
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 docarray = kfxCordova.kfxLibLogistics.createDocumentsArray();
var kfsdocumentTypeReadyCallback = function(documentType){
  docarray.deleteDocumentTypes(function(success){
      alert(JSON.stringify(success));
  },function(error){
      alert(JSON.stringify(error));
  },[documentType.typeName]);
};

getDocumentTypes(successCallback, errorCallback)

this method is used to get all document type names
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 - 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 docarray = kfxCordova.kfxLibLogistics.createDocumentsArray();
var kfsdocumentTypeReadyCallback = function(documentType){
  docarray.getDocumentTypes(function(success){
      alert(JSON.stringify(success));
  },function(error){
      alert(JSON.stringify(error));
  });
};

getPropertiesOfDocumentType(successCallback, errorCallback, documentTypeName)

this method is used to get the properties of the document type
Parameters:
Name Type Description
successCallback function Default Success Call back function name
errorCallback function Default Error call back function name
documentTypeName String name of the doucment type
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 docarray = kfxCordova.kfxLibLogistics.createDocumentsArray();
var kfsdocumentTypeReadyCallback = function(documentType){
  docarray.getPropertiesOfDocumentType(function(success){
      alert(JSON.stringify(success));
  },function(error){
      alert(JSON.stringify(error));
  },documentType.typeName);
};

removeAllDocumentTypes(successCallback, errorCallback)

this method is used to delete all document types
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 - 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 docarray = kfxCordova.kfxLibLogistics.createDocumentsArray();
var kfsdocumentTypeReadyCallback = function(documentType){
  docarray.removeAllDocumentTypes(function(success){
      alert(JSON.stringify(success));
  },function(error){
      alert(JSON.stringify(error));
  });
};