コード例 #1
0
  public String doDefault() throws Exception {
    try {
      super.doDefault();
    } catch (IssueNotFoundException e) {
      return ISSUE_PERMISSION_ERROR;
    } catch (IssuePermissionException e) {
      return ISSUE_PERMISSION_ERROR;
    }

    for (Iterator iterator = getFieldScreenRenderer().getFieldScreenRenderTabs().iterator();
        iterator.hasNext(); ) {
      FieldScreenRenderTab fieldScreenRenderTab = (FieldScreenRenderTab) iterator.next();
      for (Iterator iterator1 = fieldScreenRenderTab.getFieldScreenRenderLayoutItems().iterator();
          iterator1.hasNext(); ) {
        FieldScreenRenderLayoutItem fieldScreenRenderLayoutItem =
            (FieldScreenRenderLayoutItem) iterator1.next();
        if (fieldScreenRenderLayoutItem.isShow(getIssueObject())) {
          fieldScreenRenderLayoutItem.populateFromIssue(getFieldValuesHolder(), getIssueObject());
        }
      }
    }

    // validate the transition is still valid else go back to issue screen
    if (invalidAction()) {
      return WorkflowUIDispatcher.INVALID_ACTION;
    }

    return INPUT;
  }
コード例 #2
0
  public ErrorCollection validate() {
    validateComment();

    if (errorCollection.hasAnyErrors()) return errorCollection;

    for (FieldScreenRenderTab fieldScreenRenderTab :
        getFieldScreenRenderer().getFieldScreenRenderTabs()) {
      for (FieldScreenRenderLayoutItem fieldScreenRenderLayoutItem :
          fieldScreenRenderTab.getFieldScreenRenderLayoutItemsForProcessing()) {
        if (fieldScreenRenderLayoutItem.isShow(getIssue())) {
          OrderableField orderableField = fieldScreenRenderLayoutItem.getOrderableField();

          // JRA-16112 - This is a hack that is here because the resolution field is "special". You
          // can not
          // make the resolution field required and therefore by default the FieldLayoutItem for
          // resolution
          // returns false for the isRequired method. This is so that you can not make the
          // resolution field
          // required for issue creation. HOWEVER, whenever the resolution system field is shown it
          // is
          // required because the edit template does not provide a none option and indicates that it
          // is
          // required. THEREFORE, when the field is included on a transition screen we will do a
          // special
          // check to make the FieldLayoutItem claim it is required IF we run into the resolution
          // field.
          if (IssueFieldConstants.RESOLUTION.equals(orderableField.getId())) {
            fieldScreenRenderLayoutItem =
                new FieldScreenRenderLayoutItemImpl(
                    fieldScreenRenderLayoutItem.getFieldScreenLayoutItem(),
                    fieldScreenRenderLayoutItem.getFieldLayoutItem()) {
                  public boolean isRequired() {
                    return true;
                  }
                };
          }
          orderableField.validateParams(
              getOperationContext(),
              errorCollection,
              authenticationContext.getI18nHelper(),
              getIssue(),
              fieldScreenRenderLayoutItem);
        }
      }
    }

    return errorCollection;
  }
コード例 #3
0
  public ErrorCollection progress() {
    // Only update issue if transition has a screen
    if (hasScreen()) {
      for (FieldScreenRenderTab fieldScreenRenderTab :
          getFieldScreenRenderer().getFieldScreenRenderTabs()) {
        for (FieldScreenRenderLayoutItem fieldScreenRenderLayoutItem :
            fieldScreenRenderTab.getFieldScreenRenderLayoutItemsForProcessing()) {
          if (fieldScreenRenderLayoutItem.isShow(getIssue())) {
            fieldScreenRenderLayoutItem
                .getOrderableField()
                .updateIssue(fieldScreenRenderLayoutItem.getFieldLayoutItem(), getIssue(), params);
          }
        }
      }
    }

    workflowManager.doWorkflowAction(this);

    return errorCollection;
  }