Exemplo n.º 1
0
  /**
   * meant to be called after deserialization and initialization of handlers
   *
   * @param newInstance true if the form is to be used for a new entry interaction, false if it is
   *     using an existing IDataModel
   */
  public void initialize(boolean newInstance) {
    if (newInstance) { // only preload new forms (we may have to revisit
      // this)
      preloadInstance(instance.getRoot());
    }

    if (getLocalizer() != null && getLocalizer().getLocale() == null) {
      getLocalizer().setToDefault();
    }

    initializeTriggerables();
  }
  public static void mergeDataModel(
      FormInstance parent, FormInstance child, TreeReference parentRef) {
    TreeElement parentNode = parent.resolveReference(parentRef);
    // ugly
    if (parentNode == null) {
      parentRef = parent.addNode(parentRef);
      parentNode = parent.resolveReference(parentRef);
    }
    TreeElement childNode = child.getRoot();

    int mult = parentNode.getChildMultiplicity(childNode.getName());
    childNode.setMult(mult);

    parentNode.addChild(childNode);
  }
Exemplo n.º 3
0
 public boolean postProcessInstance() {
   return postProcessInstance(instance.getRoot());
 }
Exemplo n.º 4
0
 /**
  * Link a deserialized instance back up with its parent FormDef. this allows select/select1
  * questions to be internationalizable in chatterbox, and (if using CHOICE_INDEX mode) allows the
  * instance to be serialized to xml
  */
 public void attachControlsToInstanceData() {
   attachControlsToInstanceData(instance.getRoot());
 }
 public static TreeReference topRef(FormInstance dm) {
   return ref("/" + dm.getRoot().getName());
 }