コード例 #1
0
  public void save(String storeBasePath) throws Exception {

    PersistenceManager persistenceManager = getContext().getPersistenceManager();

    if (persistenceManager == null) throw new NullPointerException("Persistence manager not set");

    PersistedFormDocument formDocument = persistenceManager.saveForm(this, storeBasePath);
    setFormType(formDocument.getFormType());
    setFormId(formDocument.getFormId());
  }
コード例 #2
0
  public void saveAllVersions(Long parentId) throws Exception {

    PersistenceManager persistenceManager = getContext().getPersistenceManager();

    if (persistenceManager == null) throw new NullPointerException("Persistence manager not set");

    PersistedFormDocument formDocument = persistenceManager.saveAllVersions(this, parentId);
    setFormType(formDocument.getFormType());
    setFormId(formDocument.getFormId());
  }
コード例 #3
0
  public void lazyLoadDocument(PersistedFormDocument persistedForm) {

    if (persistedForm != null) {
      setFormId(persistedForm.getFormId());
      setFormType(persistedForm.getFormType());
      setFormVersion(persistedForm.getVersion());
    }

    setContainerElement(FormManagerUtil.getComponentsContainerElement(getXformsDocument()));

    persistedFormForLazyLoading = persistedForm;
  }
コード例 #4
0
  private void loadDocumentInternal(PersistedFormDocument persistedForm) {

    Document xformsXmlDoc = getXformsDocument();

    if (persistedForm != null) {
      setFormId(persistedForm.getFormId());
      setFormType(persistedForm.getFormType());
      setFormVersion(persistedForm.getVersion());
    }

    setContainerElement(FormManagerUtil.getComponentsContainerElement(xformsXmlDoc));
    loadContainerComponents();
    setProperties();

    loaded = true;
  }