Community articledeleteSignature method
Added by IBM contributorIBM on May 2, 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.



Description

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 ("").

Method

   public void deleteSignature(
      FormNodeP signatureItem
   ) throws UWIException;


Parameters

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


Returns

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

Usage details

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.

Example

In the example, the first call to dereferenceEx retrieves the signature node from the signature button, in this case PAGE1.SIGITEM2. 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) throws UWIException
   {
   FormNodeP tempNode;
   boolean layoutinfo;
 
      /* Locate the signature node. */
 
      if((tempNode = theForm.dereferenceEx(null, "PAGE1.SIGITEM2", 0, 
         FormNodeP.UFL_ITEM_REFERENCE, null)) == null)
      {
         throw new UWIException("Could not locate SIGITEM2 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(tempNode.dereferenceEx(null, "layoutinfo", 0, 
         FormNodeP.UFL_OPTION_REFERENCE, null) == null)
         layoutinfo = false;
 
      /* Delete the signature. */
 
      theForm.deleteSignature(tempNode);
 
      /* If the signature contained a layoutinfo option, destroy the 
         remaining nodes. */
 
      if (layoutinfo == true)
      {
         tempNode.destroy();
      }
   }


Parent topic:
FormNodeP class