private void assembleKeyInfo(Key key, TranslationRepresentation representation) { representation.setName(key.getId()); representation.setComment(key.getComment()); }
@Override protected void doAssembleDtoFromAggregate(KeyDTO targetDto, Key sourceEntity) { targetDto.setName(sourceEntity.getEntityId()); targetDto.setComment(sourceEntity.getComment()); targetDto.setOutdated(sourceEntity.isOutdated()); for (Translation tln : sourceEntity.getTranslations().values()) { targetDto.addTranslationDTO(tln.getEntityId().getLocale(), tln.getValue(), tln.isOutdated(), tln.isApproximate()); } }
@Override public void mergeAggregateIntoDto(Key sourceAggregate, KeyDTO targetDto) { targetDto.setName(sourceAggregate.getId()); targetDto.setComment(sourceAggregate.getComment()); targetDto.setOutdated(sourceAggregate.isOutdated()); for (Translation tln : sourceAggregate.getTranslations().values()) { targetDto.addTranslationDTO(tln.getId().getLocale(), tln.getValue(), tln.isOutdated(), tln.isApproximate()); } }
@Override public KeyRepresentation assemble(Key key) { KeyRepresentation keyRepresentation = new KeyRepresentation(); keyRepresentation.setName(key.getId()); keyRepresentation.setComment(key.getComment()); keyRepresentation.setOutdated(key.isOutdated()); String defaultLocale = localeService.getDefaultLocale(); keyRepresentation.setDefaultLocale(defaultLocale); assembleDefaultTranslation(key, keyRepresentation, defaultLocale); return keyRepresentation; }