초안 및 제출 데이터 서비스 사용자 정의

개요

AEM Forms을 사용하면 적응형 양식을 초안으로 저장할 수 있습니다. 초안 기능은 사용자에게 진행 중인 양식을 유지 관리할 수 있는 옵션을 제공합니다. 그런 다음 사용자는 언제든지 장치에서 양식을 작성 및 제출할 수 있습니다.

기본적으로 AEM Forms은 초안 및 제출과 연관된 사용자 데이터를 /content/forms/fp 노드의 게시 인스턴스에 저장합니다.

그러나 AEM Forms 포털 구성 요소는 초안 및 제출용 사용자 데이터 저장 구현을 사용자 정의할 수 있도록 해주는 데이터 서비스를 제공합니다. 예를 들어 조직에서 현재 구현한 데이터 저장소에 데이터를 저장할 수 있습니다.

사용자 데이터 저장소를 사용자 지정하려면 초안 데이터제출 데이터 서비스를 구현해야 합니다.

전제 조건

초안 데이터 서비스

사용자 초안 데이터 저장소를 사용자 지정하려면 DraftAFDataService 인터페이스의 모든 방법에 대한 구현을 제공해야 합니다.

메서드 및 해당 인수에 대한 설명은 인터페이스의 다음 코드 샘플에 제공됩니다.

public interface DraftAFDataService {

 /**
  * Deletes the user data stored against the ID passed as the argument
  *
  * @param draftDataID
  * @return status for the just occurred delete draft UserData operation
  * @throws FormsPortalException
  */
 public Boolean deleteAFDraftUserData (String draftDataID) throws FormsPortalException;

 /**
  * Saves user data provided in the argument map
  *
  * @param draftUserDataMap contains Form Data (key - "guideState"), Adaptive Form Name (Key - "guideName"), and Draft DataID (Key - "userDataID") in case of update
  * @return userData ID would be returned which needs to be saved in metadata node
  * @throws FormsPortalException
  */
 public String saveAFUserData (Map<String, Object> draftUserDataMap) throws FormsPortalException;

 /**
  * Gets the user data stored against the ID passed as the argument
  *
  * @param Draft DataID
  * @return guideState (which would then be populated in adaptive form to reload the draft) which is stored against draftDataID
  * @throws FormsPortalException
  */
 public byte[] getAFDraftUserData(String draftDataID) throws FormsPortalException;

 /**
  * Saves the attachments for current adaptive form instance
  *
  * @param attachmentsBytes would expect byte array of the attachment to be saved
  * @return id for the attachment just saved (so that it could be retrieved later)
  * @throws FormsPortalException
  */
 public String saveAttachments(byte[] attachmentBytes) throws FormsPortalException;
}

데이터 서비스 제출

사용자 제출 데이터 저장소를 사용자 지정하려면 SubmittedAFDataService 인터페이스의 모든 방법에 대한 구현을 제공해야 합니다.

메서드 및 해당 인수에 대한 설명은 인터페이스의 다음 코드 샘플에 제공됩니다.

public interface SubmittedAFDataService {

 /**
  * Submits the user data passed in argument map
  *
  * @param submittedAFUserdataMap contains Form Data (key - "guideState"), Adaptive Form Name (Key - "guideName"), and Draft DataID (Key - "userDataID")
  * @return userData ID is returned that needs to be saved in the metadata node
  * @throws FormsPortalException
  */
 public String submitAFUserData (Map<String, Object> submittedAFUserdataMap) throws FormsPortalException;

 /**
  * Gets the user data stored against the ID passed as argument
  *
  * @param submitDataID
  * @return guideState which would be used to open DOR
  * @throws FormsPortalException
  */
 public byte[] getSubmittedAFUSerData(String submitDataID) throws FormsPortalException;

 /**
  * Deletes user data stored against the ID passed as argument
  *
  * @param Submit DataID
  * @return status of the delete operation on Submitted User data
  * @throws FormsPortalException
  */

 public Boolean deleteSubmittedAFUserData(String submitDataID) throws FormsPortalException;

 /**
  * Submits the attachment bytes passed as argument
  *
  * @param attachmentsBytes would expect byte array of the attachment to be saved
  * @return id for the attachment just saved (so that it could be retrieved later)
  * @throws FormsPortalException
  */
 public String submitAttachments(Object attachmentBytes) throws FormsPortalException;

}

이 페이지에서는