Пример #1
0
  @Override
  public void edit(T bean) {
    for (FormAdapter<T> form : forms.values()) {
      form.edit(bean);
    }

    AutoBean autoBean = AutoBeanUtils.getAutoBean(bean);
    Map<String, Object> props = AutoBeanUtils.getAllProperties(autoBean);
    String triggerString = (String) props.get(this.triggerProperty);
    if (triggerString == null) triggerString = defaultForm;
    showWidget(triggerString);

    notifyListeners(bean);
  }
Пример #2
0
  public void onSaveSsl(SSLConfig entity, Map<String, Object> changeset) {

    // TODO: https://issues.jboss.org/browse/AS7-3933

    // check transient: requires creation of ssl subresource. otherwise we can simply update it
    boolean isTransient = false;
    String state = (String) AutoBeanUtils.getAutoBean(entity).getTag("state");
    if (state != null && state.equals("transient")) isTransient = true;

    ModelNode createOp = null;

    // the create op, if necessary
    if (isTransient) {
      createOp = new ModelNode();
      createOp.get(ADDRESS).set(Baseadress.get());
      createOp.get(ADDRESS).add("subsystem", "modcluster");
      createOp.get(ADDRESS).add("mod-cluster-config", "configuration");
      createOp.get(ADDRESS).add("ssl", "configuration");
      createOp.get(OP).set(ADD);
    }

    // the updated values

    ModelNode address = new ModelNode();
    address.get(ADDRESS).set(Baseadress.get());
    address.get(ADDRESS).add("subsystem", "modcluster");
    address.get(ADDRESS).add("mod-cluster-config", "configuration");
    address.get(ADDRESS).add("ssl", "configuration");

    ModelNode updateOp = sslAdapter.fromChangeset(changeset, address);
    if (createOp != null) {
      final List<ModelNode> steps = updateOp.get("steps").asList();
      LinkedList<ModelNode> orderedSteps = new LinkedList<ModelNode>();
      orderedSteps.addAll(steps);
      orderedSteps.addFirst(createOp);
      updateOp.get("steps").set(orderedSteps);
    }

    // System.out.println(updateOp);

    dispatcher.execute(
        new DMRAction(updateOp),
        new SimpleCallback<DMRResponse>() {
          @Override
          public void onSuccess(DMRResponse result) {
            ModelNode response = result.get();

            if (response.isFailure()) {
              Console.error(
                  Console.MESSAGES.modificationFailed("SSL Config"),
                  response.getFailureDescription());
            } else {
              Console.info(Console.MESSAGES.modified("SSL Config"));
            }

            loadModcluster();
          }
        });
  }
  @Override
  protected void traverseProperties(
      com.google.gwt.autobean.shared.AutoBeanVisitor visitor,
      com.google.gwt.autobean.shared.impl.AbstractAutoBean.OneShotContext ctx) {
    class _questionSumPropertyContext
        implements com.google.gwt.autobean.shared.AutoBeanVisitor.PropertyContext {
      public boolean canSet() {
        return true;
      }

      public Class<?> getType() {
        return java.lang.Integer.class;
      }

      public void set(Object obj) {
        values.put("questionSum", obj);
      }
    }
    {
      _questionSumPropertyContext _questionSumPropertyContext = new _questionSumPropertyContext();
      Object value = as().getQuestionSum();
      if (visitor.visitValueProperty("questionSum", value, _questionSumPropertyContext))
        visitor.endVisitValueProperty("questionSum", value, _questionSumPropertyContext);
    }
    class _sort_orderPropertyContext
        implements com.google.gwt.autobean.shared.AutoBeanVisitor.PropertyContext {
      public boolean canSet() {
        return true;
      }

      public Class<?> getType() {
        return java.lang.Integer.class;
      }

      public void set(Object obj) {
        values.put("sort_order", obj);
      }
    }
    {
      _sort_orderPropertyContext _sort_orderPropertyContext = new _sort_orderPropertyContext();
      Object value = as().getSort_order();
      if (visitor.visitValueProperty("sort_order", value, _sort_orderPropertyContext))
        visitor.endVisitValueProperty("sort_order", value, _sort_orderPropertyContext);
    }
    class _versionPropertyContext
        implements com.google.gwt.autobean.shared.AutoBeanVisitor.PropertyContext {
      public boolean canSet() {
        return true;
      }

      public Class<?> getType() {
        return java.lang.Integer.class;
      }

      public void set(Object obj) {
        values.put("version", obj);
      }
    }
    {
      _versionPropertyContext _versionPropertyContext = new _versionPropertyContext();
      Object value = as().getVersion();
      if (visitor.visitValueProperty("version", value, _versionPropertyContext))
        visitor.endVisitValueProperty("version", value, _versionPropertyContext);
    }
    class _idPropertyContext
        implements com.google.gwt.autobean.shared.AutoBeanVisitor.PropertyContext {
      public boolean canSet() {
        return true;
      }

      public Class<?> getType() {
        return java.lang.Long.class;
      }

      public void set(Object obj) {
        values.put("id", obj);
      }
    }
    {
      _idPropertyContext _idPropertyContext = new _idPropertyContext();
      Object value = as().getId();
      if (visitor.visitValueProperty("id", value, _idPropertyContext))
        visitor.endVisitValueProperty("id", value, _idPropertyContext);
    }
    class _assesmentPropertyContext
        implements com.google.gwt.autobean.shared.AutoBeanVisitor.PropertyContext {
      public boolean canSet() {
        return true;
      }

      public Class<?> getType() {
        return medizin.client.managed.request.AssesmentProxy.class;
      }

      public void set(Object obj) {
        values.put("assesment", obj);
      }
    }
    {
      _assesmentPropertyContext _assesmentPropertyContext = new _assesmentPropertyContext();
      com.google.gwt.autobean.shared.impl.AbstractAutoBean value =
          (com.google.gwt.autobean.shared.impl.AbstractAutoBean)
              com.google.gwt.autobean.shared.AutoBeanUtils.getAutoBean(as().getAssesment());
      if (visitor.visitReferenceProperty("assesment", value, _assesmentPropertyContext))
        if (value != null) {
          value.traverse(visitor, ctx);
        }
      visitor.endVisitReferenceProperty("assesment", value, _assesmentPropertyContext);
    }
    class _responsiblePersonPropertyContext
        implements com.google.gwt.autobean.shared.AutoBeanVisitor.PropertyContext {
      public boolean canSet() {
        return true;
      }

      public Class<?> getType() {
        return medizin.client.managed.request.PersonProxy.class;
      }

      public void set(Object obj) {
        values.put("responsiblePerson", obj);
      }
    }
    {
      _responsiblePersonPropertyContext _responsiblePersonPropertyContext =
          new _responsiblePersonPropertyContext();
      com.google.gwt.autobean.shared.impl.AbstractAutoBean value =
          (com.google.gwt.autobean.shared.impl.AbstractAutoBean)
              com.google.gwt.autobean.shared.AutoBeanUtils.getAutoBean(as().getResponsiblePerson());
      if (visitor.visitReferenceProperty(
          "responsiblePerson", value, _responsiblePersonPropertyContext))
        if (value != null) {
          value.traverse(visitor, ctx);
        }
      visitor.endVisitReferenceProperty(
          "responsiblePerson", value, _responsiblePersonPropertyContext);
    }
    class _questionEventPropertyContext
        implements com.google.gwt.autobean.shared.AutoBeanVisitor.PropertyContext {
      public boolean canSet() {
        return true;
      }

      public Class<?> getType() {
        return medizin.client.managed.request.QuestionEventProxy.class;
      }

      public void set(Object obj) {
        values.put("questionEvent", obj);
      }
    }
    {
      _questionEventPropertyContext _questionEventPropertyContext =
          new _questionEventPropertyContext();
      com.google.gwt.autobean.shared.impl.AbstractAutoBean value =
          (com.google.gwt.autobean.shared.impl.AbstractAutoBean)
              com.google.gwt.autobean.shared.AutoBeanUtils.getAutoBean(as().getQuestionEvent());
      if (visitor.visitReferenceProperty("questionEvent", value, _questionEventPropertyContext))
        if (value != null) {
          value.traverse(visitor, ctx);
        }
      visitor.endVisitReferenceProperty("questionEvent", value, _questionEventPropertyContext);
    }
  }