Community articledeleteSignature method
Added by IBM contributorIBM | Edited by IBM contributorChris Dawes on June 12, 2012
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

No abstract provided.


This method deletes the specified digital signature in the form. For security reasons, the form must meet certain criteria before this is allowed. None of the following should be locked by another signature: the signature, its descendants, the associated signature button, and its signer option. If these criteria are met, then the signature's locks are removed, the signature item is deleted, and the signer of the associated signature button is set to empty ("").


   public void deleteSignature(
      FormNodeP signatureItem
   ) throws UWIException;


Table 1. Method parameters
signatureItemFormNodePThe signature node to delete. You can retrieve this node by calling dereferenceEx


Nothing if call is successful or throws a generic exception (UWIException) if an error occurs.


If the signatureItem item contains a layoutinfo option, deleteSignature will not remove the entire signature from the form. Instead, the signature item and the layoutinfo option will remain. To completely delete the signature item, you must delete the remaining nodes manually by using destroy to delete the signature item.


In the example, the signature button node is passed in as a parameter. Each signature button contains the SID of its corresponding signature object, getLiteralByRefEx is used to extract it into the variable "theSigID". The first call to dereferenceEx retrieves the signature node using the ID that was extracted from the button. The second call to dereferenceEx checks for the existence of the layoutinfo option. The signature is then deleted with deleteSignature, and if the layoutinfo option exists, it is deleted with destroy.
   private static void deleteSignature(FormNodeP theForm, FormNodeP theSigButton) throws UWIException
   FormNodeP theSigNode;
   String theSigID;
   boolean layoutinfo;
      /* Get the SID of the signature from the signature button */

      theSigID = theSigButton.getLiteralByRefEx(null, "signature", 0, null, null);
      /* Retrieve the signature object */

      if((theSigNode = theForm.dereferenceEx(null, theSigID, 0, 
         FormNodeP.UFL_ITEM_REFERENCE, null)) == null)
         throw new UWIException("Could not locate " + theSigNode + " node");
      /* Check to see if the signature contains a layoutinfo option. Set 
         layoutinfo to true if it does or false if it does not. */
      layoutinfo = true;
      if(theSigNode.dereferenceEx(null, "layoutinfo", 0, 
         FormNodeP.UFL_OPTION_REFERENCE, null) == null)
         layoutinfo = false;
      /* Delete the signature. */
      /* If the signature contained a layoutinfo option, destroy the 
         remaining nodes. */
      if (layoutinfo == true)

Parent topic:
FormNodeP class