Package honeycrm.client.dto

Examples of honeycrm.client.dto.Dto


              final Serializable resolved = object.get(id + "_resolved");
              if (null == resolved || null == ((Dto) resolved).get("name")) {
                // Related item could not be found.
                b.appendHtmlConstant("fail!");
              } else {
                final Dto resolvedDto = (Dto) resolved;
                b.appendHtmlConstant("<a href='#" + resolvedDto.getModule() + " detail " + resolvedDto.getId() + "'>" + resolvedDto.get("name") + "</a>");
              }
            }
           
            return b.toSafeHtml();
          }
View Full Code Here


  protected void redirectToDetailView(SelectionEvent<Suggestion> event) {
    final String label = event.getSelectedItem().getReplacementString();

    if (nameToDto.containsKey(label)) {
      setText("");
      final Dto dto = nameToDto.get(label);
      History.newItem(HistoryTokenFactory.get(dto.getModule(), ModuleAction.DETAIL, dto.getId()));
    } else {
      Window.alert("Cannot determine id of selected item: '" + label + "'");
    }
  }
View Full Code Here

  }

  @Override
  public Dto getData() {
    final String[][] fields = moduleDto.getFormFieldIds();
    final Dto newDto = moduleDto.createDto();

    for (int y = 0; y < fields.length; y++) {
      for (int x = 0; x < fields[y].length; x++) {
        final String field = fields[y][x];

        if (!Dto.isInternalReadOnlyField(field)) {
          // TODO this position y, 2*x+1 depends on the current layout of the form..
          final Widget widgetValue = table.getWidget(y, 2 * x + 1);
          final Serializable value = moduleDto.getFieldById(field).getData(widgetValue);
          newDto.set(field, value);
        }
      }
    }

    // Copy the id field to allow updates.
    newDto.setId(dto.getId());

    return newDto;
  }
View Full Code Here

            q.getDto().set("productID", id);
            q.getDto().set("productCode", productCode);
            q.getDto().set("price", price);

            if (null == q.getDto().get("productID_resolved")) {
              q.getDto().set("productID_resolved", new Dto("Product"));
            }
            final Dto resolved = (Dto) q.getDto().get("productID_resolved");
            resolved.setId(id);
            resolved.set("name", name);

            provider.refresh();
          }
        }
      });
View Full Code Here

    grid.setVisible(true);
  }

  @Override
  public Dto getDto() {
    Dto d = new Dto("Contact");
    d.set("name", name.getText());
    d.set("email", email.getText());
    d.set("phone", phone.getText());
    d.set("notes", notes.getText());
    if (currentDto.getId() > 0)
      d.setId(currentDto.getId());
    return d;
  }
View Full Code Here

        final ModuleAction action = ModuleAction.fromString(tokens[1]);

        if (null != action) {
          switch (action) {
          case DETAIL:
            final Dto dto = new Dto(module);
            dto.setId(NumberParser.convertToLong(tokens[2]));
            eventBus.fireEvent(new OpenEvent(dto));
          }
        }
      }
View Full Code Here

 
  @Override
  protected Widget detailField() {
    // TODO this is more difficult
    final boolean value = false;
    final Dto dto = DtoModuleRegistry.instance().get(dtoIndex).createDto();
    // dto.setId(NumberParser.convertToLong(value));
    dto.setId(dtoId);
    dto.setMarked(value);

    return new MarkWidget(dto, null);
  }
View Full Code Here

    return new HasKeyPressHandlers[] { nameEdit };
  }

  @Override
  public Dto getDto() {
    final Dto d = new Dto(Module.Product.toString());
    d.set("name", nameEdit.getText());
    return d;
  }
View Full Code Here

    final Serializable value = dto.get(fieldId);
    if (null == value || 0 == (Integer) value || 0 == (Long) value) {
      // return an empty label because no account has been selected yet
      return new Label();
    } else {
      final Dto related = ((Dto) dto.get(fieldId + "_resolved"));

      if (null == related) {
        return new Label("[unresolved]");
      } else {
        final ModuleDto moduleDtoRelated = DtoModuleRegistry.instance().get(relatedModule);
        final String token = CollectionHelper.join(" ", moduleDtoRelated.getHistoryToken(), ModuleAction.DETAIL.toString().toLowerCase(), String.valueOf(value));
        final Hyperlink link = new Hyperlink(related.getQuicksearch(), token);

        if (related.getAllPreviewableFieldsSorted().isEmpty()) {
          /**
           * there are no details that can be displayed. only display the link to the related item.
           */
          return link;
        } else {
View Full Code Here

    final ModuleDto moduleDto = DtoModuleRegistry.instance().get(getModule());
   
    // start at 1 to skip header row
    for (int y = 1; y < table.length; y++) {
      final Dto dto = new Dto();
      dto.setModule(getModule());

      for (final String keyHoney : map.keySet()) {
        final String importStr = getGluedValues(table, positions, y, map.get(keyHoney));
        final Serializable typedValue = moduleDto.getFieldById(keyHoney).getTypedData(importStr);
       
        dto.set(keyHoney, typedValue);
      }

      list.add(dto);
    }
View Full Code Here

TOP

Related Classes of honeycrm.client.dto.Dto

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.