protected FieldScreenRenderLayoutItem buildFieldScreenRenderLayoutItem(final OrderableField field, final GenericValue issue) { return new FieldScreenRenderLayoutItemImpl(null, fieldLayoutManager.getFieldLayout(issue).getFieldLayoutItem(field)); }
protected FieldScreenRenderLayoutItem buildFieldScreenRenderLayoutItem(final OrderableField field, GenericValue issue) { return new FieldScreenRenderLayoutItemImpl(null, fieldLayoutManager.getFieldLayout(issue).getFieldLayoutItem(field)); }
private FieldScreenRenderLayoutItem getCustomFieldRenderLayoutItem(Issue issue, IssueOperation issueOperation, FieldLayoutItem fieldLayoutItem, FieldScreenLayoutItem fieldScreenLayoutItem) { // Check if the custom field is in scope CustomField customField = (CustomField) fieldLayoutItem.getOrderableField(); if (customField.isInScope(issue.getProjectObject(), Collections.singletonList(issue.getIssueTypeId()))) { if (IssueOperations.VIEW_ISSUE_OPERATION.equals(issueOperation)) { // If we are viewing an issue only show fields that have a view template // If changing this, see if http://confluence.atlassian.com/display/JIRACOM/Displaying+Custom+Fields+with+no+value needs updating if (haveDataToRender(customField, issue)) { return new FieldScreenRenderLayoutItemImpl(fieldScreenLayoutItem, fieldLayoutItem); } } else { return new FieldScreenRenderLayoutItemImpl(fieldScreenLayoutItem, fieldLayoutItem); } } return null; }
public void validateFields(JiraServiceContext context, OperationContext operationContext, I18nHelper i18nHelper, Issue targetIssue, Collection<FieldLayoutItem> fieldLayoutItems) { ErrorCollection errorCollection = context.getErrorCollection(); // Loop over all the fields that need to be edited for the move for (FieldLayoutItem fieldLayoutItem : fieldLayoutItems) { OrderableField orderableField = fieldLayoutItem.getOrderableField(); orderableField.validateParams(operationContext, errorCollection, i18nHelper, targetIssue, new FieldScreenRenderLayoutItemImpl(null, fieldLayoutItem)); } }
@Override public FieldScreenRenderLayoutItem apply(final FieldScreenLayoutItem fieldScreenLayoutItem) { final FieldLayout fieldLayout = fieldLayoutManager.getFieldLayout(issue); final OrderableField orderableField = fieldScreenLayoutItem.getOrderableField(); final FieldLayoutItem fieldLayoutItem = fieldLayout.getFieldLayoutItem(orderableField); if (fieldManager.isCustomField(orderableField)) { return getCustomFieldRenderLayoutItem(issue, operation, fieldLayoutItem, fieldScreenLayoutItem); } else { return new FieldScreenRenderLayoutItemImpl(fieldScreenLayoutItem, fieldLayoutItem); } } })), com.google.common.base.Predicates.notNull());
public FieldScreenRenderLayoutItem getFieldScreenRenderLayoutItem(OrderableField orderableField) { final List<FieldScreenRenderTab> tabList = getFieldScreenRenderTabs(); if (tabList != null) { for (FieldScreenRenderTab fieldScreenRenderTab : tabList) { for (FieldScreenRenderLayoutItem fieldScreenRenderLayoutItem : fieldScreenRenderTab.getFieldScreenRenderLayoutItems()) { if (fieldScreenRenderLayoutItem.getOrderableField().getId().equals(orderableField.getId())) { return fieldScreenRenderLayoutItem; } } } } return new FieldScreenRenderLayoutItemImpl(null, getFieldLayout().getFieldLayoutItem(orderableField)); }
public void populateFields(JiraServiceContext context, OperationContext operationContext, I18nHelper i18nHelper, Issue targetIssue, Collection<FieldLayoutItem> fieldLayoutItems) { ErrorCollection errorCollection = context.getErrorCollection(); // Loop over all the fields that need to be edited for the move for (FieldLayoutItem fieldLayoutItem : fieldLayoutItems) { OrderableField orderableField = fieldLayoutItem.getOrderableField(); if (orderableField.isShown(targetIssue)) { // As the issue has been shown then initialise it from the action's parameters orderableField.populateFromParams(operationContext.getFieldValuesHolder(), ActionContext.getParameters()); // Validate the value of the field orderableField.validateParams(operationContext, errorCollection, i18nHelper, targetIssue, new FieldScreenRenderLayoutItemImpl(null, fieldLayoutItem)); } else { // If the field has not been shown (but it needs to be moved) populate with the default value orderableField.populateDefaults(operationContext.getFieldValuesHolder(), targetIssue); // Validate the parameter. In theory as the field places a default value itself the value should be valid, however, a check for // 'requireability' still has to be made. orderableField.validateParams(operationContext, errorCollection, i18nHelper, targetIssue, new FieldScreenRenderLayoutItemImpl(null, fieldLayoutItem)); } } }
new FieldScreenRenderLayoutItemImpl(null, fieldLayoutItem)); new FieldScreenRenderLayoutItemImpl(null, fieldLayoutItem)); if (errorCollection2.getErrors() != null && !errorCollection2.getErrors().isEmpty())
orderableField.validateParams(getMoveIssueBean(), this, this, targetIssue, new FieldScreenRenderLayoutItemImpl(null, fieldLayoutItem)); orderableField.validateParams(getMoveIssueBean(), errorCollection, this, targetIssue, new FieldScreenRenderLayoutItemImpl(null, fieldLayoutItem)); if (errorCollection.getErrors() != null && !errorCollection.getErrors().isEmpty())