Présentation

Le service AEM forms vous permet d’enregistrer un formulaire sous forme de brouillon. La fonctionnalité de brouillon vous permet de mettre à jour un formulaire de travail en cours, que vous pouvez remplir et envoyer ultérieurement sur n’importe quel périphérique.

Par défaut, le service AEM forms stocke les données d’utilisateur associées au brouillon et à l’envoi d’un formulaire dans le nœud /fr/content/forms/fp de l’instance de publication. En outre, les composants du portail AEM forms fournissent des services de données, que vous pouvez utiliser pour personnaliser l’implémentation du stockage des données utilisateur pour les brouillons et les envois. Par exemple, vous pouvez stocker des données utilisateur dans un magasin de données.

Service de données de brouillon

Pour personnaliser le stockage des données utilisateur pour les brouillons, vous devez implémenter toutes les méthodes de l’interface DraftDataService. L’exemple de code suivant décrit les méthodes et les arguments.

public interface DraftDataService {
	
    /**
     * To save/modify user data for this userDataID, it will be null in case of creation 
     * @param userDataID, unique identifier associated with this user data
     * @param formName, name of the form whose draft is being saved
     * @param formData, user data associated with this draft
     * @return userdataID, corresponding to which user data has been stored and which can be used later to retrieve this user data
     * @throws FormsPortalException
     */
	public String saveData (String userDataID, String formName, String formData) throws FormsPortalException;
	
	/**
	 * Returns the user data stored against the ID passed as the argument
	 * @param draftDataID unique data id for data associated with a draft
	 * @return user data associated with this data ID
	 * @throws FormsPortalException
	 */
	
	public byte[] getData (String draftDataID) throws FormsPortalException;
	
	/**
	 * To delete data associated with this draft
	 * @param draftDataID unique data id for data associated with a draft
	 * @return status of delete operation on data associated with this draft 
	 * @throws FormsPortalException
	 */
	
	public boolean deleteData (String draftDataID) throws FormsPortalException;
	
	/**
	 * Saves the attachment for current form instance 
	 * @param draftID associated with this draft
	 * @param attachmentsBytes would expect byte array of the attachment to be saved
	 * @return unique id for the attachment just saved (so that it could be retrieved later)
	 * @throws FormsPortalException
	 */
	public String saveAttachment (String draftID, byte[] attachmentBytes) throws FormsPortalException;
	
	/**
	 * To delete an attachment
	 * @param attachmentID, unique id for this attachment
	 * @return status of delete operation performed on attachment corresponding to this attachment ID
	 * @throws FormsPortalException
	 */
	public boolean deleteAttachment (String attachmentID) throws FormsPortalException;
	
	/**
	 * To get attachment bytes
	 * @param attachmentID, unique id for this attachment
	 * @return data corresponding to this attachmentID
	 * @throws FormsPortalException
	 */
	public byte[] getAttachment (String attachmentID) throws FormsPortalException;
}

Service Submission Data

Pour personnaliser le stockage des données utilisateur pour les envois, vous devez implémenter toutes les méthodes de l’interface SubmitDataService. L’exemple de code suivant décrit les méthodes et les arguments.

public interface SubmitDataService {
	
	/**
	 * Submits the user data passed in argument map
	 * @param userDataID, unique identifier associated with this user data
	 * @param formName, name of the form whose draft is being submitted
	 * @param formData, user data associated with this submission
	 * @return userdataID, corresponding to which the user data has been stored and which can be used later to retrieve this data
	 * @throws FormsPortalException
	 */
	public String saveData (String userDataID, String formName, String formData) throws FormsPortalException;
	
	/**
	 * Gets the user data stored against the ID passed as argument
	 * @param userDataID, unique id associated with this user data for this submission
	 * @return user data associated with this submission
	 * @throws FormsPortalException
	 */
	public byte[] getData(String userDataID) throws FormsPortalException;
	
	/**
	 * Deletes user data stored against the userDataID
	 * @param userDataID, unique id associated with this user data for this submission
	 * @return status of the delete operation on this submission
	 * @throws FormsPortalException
	 */
	
	public boolean deleteData(String userDataID) throws FormsPortalException;
	
	
	/**
	 * Submits the attachment bytes passed as argument
	 * @param submitID, unique id associated with the submission metadata
	 * @param attachmentsBytes would expect byte array of the attachment for this submission
	 * @return id for the attachment just saved (so that it could be retrieved later) 
	 * @throws FormsPortalException
	 */
	public String saveAttachment(String submitID, byte[] attachmentBytes) throws FormsPortalException;

	/**
	 * To delete an attachment
	 * @param attachmentID, unique id for this attachment
	 * @return status of delete operation performed on attachment corresponding to this attachment ID
	 * @throws FormsPortalException
	 */
	public boolean deleteAttachment (String attachmentID) throws FormsPortalException;
	
	/**
	 * To get attachment bytes
	 * @param attachmentID, unique id for this attachment
	 * @return data corresponding to this attachmentID
	 * @throws FormsPortalException
	 */
	public byte[] getAttachment (String attachmentID) throws FormsPortalException;
}

Ce produit est distribué sous licence Creative Commons Attribution - Pas d’utilisation commerciale - Partage à l’identique 3.0 non transposé  Les publications Twitter™ et Facebook ne sont pas couvertes par les dispositions Creative Commons.

Mentions légales   |   Politique de confidentialité en ligne