@Override public ResponseEntity<List<MgmtTag>> createDistributionSetTags( @RequestBody final List<MgmtTagRequestBodyPut> tags) { LOG.debug("creating {} ds tags", tags.size()); final List<DistributionSetTag> createdTags = distributionSetTagManagement .create(MgmtTagMapper.mapTagFromRequest(entityFactory, tags)); return new ResponseEntity<>(MgmtTagMapper.toResponseDistributionSetTag(createdTags), HttpStatus.CREATED); }
/** * Creates {@link DistributionSetTag}s in repository. * * @param number * of {@link DistributionSetTag}s * * @return the persisted {@link DistributionSetTag}s */ public List<DistributionSetTag> createDistributionSetTags(final int number) { final List<TagCreate> result = Lists.newArrayListWithExpectedSize(number); for (int i = 0; i < number; i++) { result.add( entityFactory.tag().create().name("tag" + i).description("tagdesc" + i).colour(String.valueOf(i))); } return distributionSetTagManagement.create(result); }
/** * Creates {@link DistributionSetTag}s in repository. * * @param number * of {@link DistributionSetTag}s * * @return the persisted {@link DistributionSetTag}s */ public List<DistributionSetTag> createDistributionSetTags(final int number) { final List<TagCreate> result = Lists.newArrayListWithExpectedSize(number); for (int i = 0; i < number; i++) { result.add( entityFactory.tag().create().name("tag" + i).description("tagdesc" + i).colour(String.valueOf(i))); } return distributionSetTagManagement.create(result); }
private void createNewTag() { if (!StringUtils.isEmpty(getTagName().getValue())) { setColorPicked(ColorPickerHelper.getColorPickedString(getColorPickerLayout().getSelPreview())); String colour = ColorPickerConstants.START_COLOR.getCSS(); if (!StringUtils.isEmpty(getColorPicked())) { colour = getColorPicked(); } final DistributionSetTag newDistTag = getDistributionSetTagManagement().create(getEntityFactory().tag() .create().name(getTagName().getValue()).description(getTagDesc().getValue()).colour(colour)); getEventBus().publish(this, new DistributionSetTagTableEvent(BaseEntityEventType.ADD_ENTITY, newDistTag)); displaySuccess(newDistTag.getName()); } else { displayValidationError(getI18n().getMessage(getMessageErrorMissingTagname())); } }
private void createNewTag() { if (!StringUtils.isEmpty(getTagName().getValue())) { setColorPicked(ColorPickerHelper.getColorPickedString(getColorPickerLayout().getSelPreview())); String colour = ColorPickerConstants.START_COLOR.getCSS(); if (!StringUtils.isEmpty(getColorPicked())) { colour = getColorPicked(); } final DistributionSetTag newDistTag = getDistributionSetTagManagement().create(getEntityFactory().tag() .create().name(getTagName().getValue()).description(getTagDesc().getValue()).colour(colour)); getEventBus().publish(this, new DistributionSetTagTableEvent(BaseEntityEventType.ADD_ENTITY, newDistTag)); displaySuccess(newDistTag.getName()); } else { displayValidationError(getI18n().getMessage(getMessageErrorMissingTagname())); } }
private DistributionSetTag createDistributionSetTag() { final DistributionSetTag updateTag = distributionSetTagManagement .create(entityFactory.tag().create().name("DsTag")); return distributionSetTagManagement.update(entityFactory.tag().update(updateTag.getId()) .description("My name is " + updateTag.getName()).colour("default")); }