コード例 #1
0
 @Override
 public void onReload() {
   view.setCsvName(ValueUtils.getValue(metadata.getName()));
   view.setVersion(metadata.getVersion());
   view.setSealed(metadata.isSealed());
   view.setMappings(mappings);
 }
コード例 #2
0
  public boolean leave() {
    Log.trace("checking csv mapping");

    DefinitionsMappings mappings = view.getMappings();

    boolean valid = validateMappings(mappings);

    if (showMetadata) {
      String csvName = view.getCsvName();
      String version = view.getVersion();
      valid &= validateAttributes(csvName, version);
    }

    if (valid) {
      publishBus.fireEventFromSource(new MappingsUpdatedEvent(mappings), this);

      PublishMetadata metadata = new PublishMetadata();
      metadata.setName(ValueUtils.getValue(view.getCsvName()));
      metadata.setVersion(view.getVersion());
      metadata.setSealed(view.getSealed());
      metadata.setAttributes(this.metadata.getAttributes());
      publishBus.fireEventFromSource(new ItemUpdatedEvent<PublishMetadata>(metadata), this);
    }

    return valid;
  }
コード例 #3
0
 protected void setMetadata(PublishMetadata metadata) {
   this.metadata = metadata;
   view.setCsvName(ValueUtils.getValue(metadata.getName()));
   view.setVersion(metadata.getVersion());
   view.setSealed(metadata.isSealed());
 }