Esempio n. 1
0
 public String getIdentifier() {
   return component.getName()
       + "-"
       + endpoint.getName()
       + "-"
       + map.get("service")
       + "-"
       + map.get("endpoint");
 }
Esempio n. 2
0
  @SuppressWarnings("serial")
  public BeanEditorPage(PersistedObject po) {
    if (po.getId() != null) {
      setDefaultModel(Models.domain(dao, po));
    } else {
      setDefaultModel(Models.model(po));
    }

    final ComponentType ct = componentService.getComponent(po.getComponentType());

    add(new Label("name", ct.getName()));
    add(new Label("namespace", ct.getNamespace()));

    ArrayList<AbstractType> fields = Lists.newArrayList();
    String name = ct.getName() + '.';

    if (po.isBean()) {
      BeanType bt = ct.getBean(po.getDeclaredType());
      name += bt.getClazz();
      fields.addAll(bt.getProperties());
    } else {
      EndpointType et = ct.getEndpoint(po.getDeclaredType());
      name += et.getName();
      fields.addAll(et.getAttributes());
      fields.addAll(et.getProperties());
    }

    FieldInfos fi = new FieldInfos(name, fields);

    editor =
        new EditorPanel("editor", po.getServiceAssembly(), fi, po.getDetachedValues()) {
          @Override
          public void onSubmit() {
            BeanEditorPage.this.onSubmit(getValues());
          }
        };
    add(editor);
  }