.forEach(id -> identifiers.add(id)); snippet.getLabels().stream() .map(label -> label.getId()) .forEach(id -> identifiers.add(id));
if (requestLabelEntity.getComponent().getId() != null) { throw new IllegalArgumentException("Label ID cannot be specified."); final Revision revision = getRevision(labelEntity, labelEntity.getComponent().getId()); final LabelEntity entity = serviceFacade.createLabel(revision, groupId, labelEntity.getComponent()); labelResource.populateRemainingLabelEntityContent(entity);
@Override public LabelEntity createLabel(final Revision revision, final String groupId, final LabelDTO labelDTO) { final RevisionUpdate<LabelDTO> snapshot = createComponent( revision, labelDTO, () -> labelDAO.createLabel(groupId, labelDTO), label -> dtoFactory.createLabelDto(label)); final Label label = labelDAO.getLabel(labelDTO.getId()); final PermissionsDTO permissions = dtoFactory.createPermissionsDto(label); return entityFactory.createLabelEntity(snapshot.getComponent(), dtoFactory.createRevisionDTO(snapshot.getLastModification()), permissions); }
@Override public LabelEntity updateLabel(final Revision revision, final LabelDTO labelDTO) { final Label labelNode = labelDAO.getLabel(labelDTO.getId()); final RevisionUpdate<LabelDTO> snapshot = updateComponent(revision, labelNode, () -> labelDAO.updateLabel(labelDTO), label -> dtoFactory.createLabelDto(label)); final PermissionsDTO permissions = dtoFactory.createPermissionsDto(labelNode); return entityFactory.createLabelEntity(snapshot.getComponent(), dtoFactory.createRevisionDTO(snapshot.getLastModification()), permissions); }
final Label label = group.getLabel(snippetLabel.getId());
}); snippet.getLabels().forEach(labelDTO -> { rollbackClonedPolicy(ResourceFactory.getComponentResource(ResourceType.Label, labelDTO.getId(), labelDTO.getLabel())); }); snippet.getOutputPorts().forEach(outputPortDTO -> {
public LabelEntity createLabelEntity(final LabelDTO dto, final RevisionDTO revision, final PermissionsDTO permissions) { final LabelEntity entity = new LabelEntity(); entity.setRevision(revision); if (dto != null) { entity.setPermissions(permissions); entity.setId(dto.getId()); entity.setPosition(dto.getPosition()); final DimensionsDTO dimensions = new DimensionsDTO(); dimensions.setHeight(dto.getHeight()); dimensions.setWidth(dto.getWidth()); entity.setDimensions(dimensions); if (permissions != null && permissions.getCanRead()) { entity.setComponent(dto); } } return entity; }
public LabelDTO copy(final LabelDTO original) { final LabelDTO copy = new LabelDTO(); copy.setId(original.getId()); copy.setParentGroupId(original.getParentGroupId()); copy.setLabel(original.getLabel()); copy.setStyle(copy(original.getStyle())); copy.setPosition(original.getPosition()); copy.setWidth(original.getWidth()); copy.setHeight(original.getHeight()); copy.setVersionedComponentId(original.getVersionedComponentId()); return copy; }
@Override public Label createLabel(String groupId, LabelDTO labelDTO) { if (labelDTO.getParentGroupId() != null && !flowController.getFlowManager().areGroupsSame(groupId, labelDTO.getParentGroupId())) { throw new IllegalArgumentException("Cannot specify a different Parent Group ID than the Group to which the Label is being added."); } // get the desired group ProcessGroup group = locateProcessGroup(flowController, groupId); // create the label Label label = flowController.getFlowManager().createLabel(labelDTO.getId(), labelDTO.getLabel()); if (labelDTO.getPosition() != null) { label.setPosition(new Position(labelDTO.getPosition().getX(), labelDTO.getPosition().getY())); } if (labelDTO.getWidth() != null && labelDTO.getHeight() != null) { label.setSize(new Size(labelDTO.getWidth(), labelDTO.getHeight())); } label.setStyle(labelDTO.getStyle()); // add the label group.addLabel(label); return label; }
for (final LabelDTO labelDTO : snippetContents.getLabels()) { final LabelDTO label = dtoFactory.copy(labelDTO); label.setId(generateId(labelDTO.getId(), idGenerationSeed, isCopy)); label.setParentGroupId(groupId); labels.add(label); ResourceFactory.getComponentResource(ResourceType.Label, labelDTO.getId(), labelDTO.getLabel()), ResourceFactory.getComponentResource(ResourceType.Label, label.getId(), label.getLabel()), idGenerationSeed);
@Override public Label updateLabel(LabelDTO labelDTO) { // get the label being updated Label label = locateLabel(labelDTO.getId()); // update the label state if (labelDTO.getPosition() != null) { label.setPosition(new Position(labelDTO.getPosition().getX(), labelDTO.getPosition().getY())); } if (labelDTO.getStyle() != null) { label.setStyle(labelDTO.getStyle()); } if (labelDTO.getLabel() != null) { label.setValue(labelDTO.getLabel()); } if (labelDTO.getWidth() != null && labelDTO.getHeight() != null) { label.setSize(new Size(labelDTO.getWidth(), labelDTO.getHeight())); } label.getProcessGroup().onComponentModified(); return label; }
for (final Element labelElement : labelNodeList) { final LabelDTO labelDTO = FlowFromDOMFactory.getLabel(labelElement); final Label label = flowManager.createLabel(labelDTO.getId(), labelDTO.getLabel()); label.setVersionedComponentId(labelDTO.getVersionedComponentId()); label.setStyle(labelDTO.getStyle());
for (final Element labelElement : labelNodeList) { final LabelDTO labelDTO = FlowFromDOMFactory.getLabel(labelElement); final Label label = flowManager.createLabel(labelDTO.getId(), labelDTO.getLabel()); label.setStyle(labelDTO.getStyle()); label.setPosition(new Position(labelDTO.getPosition().getX(), labelDTO.getPosition().getY()));
final Label label = flowManager.createLabel(labelDTO.getId(), labelDTO.getLabel()); label.setPosition(toPosition(labelDTO.getPosition())); if (labelDTO.getWidth() != null && labelDTO.getHeight() != null) {