コード例 #1
0
  private void validateExistingProjectHasValidStateForImport(
      final BackupProject backupProject,
      final BackupSystemInformation backupSystemInformation,
      final Project existingProject,
      final I18nHelper i18n,
      final MessageSet messageSet) {
    final String projectKey = backupProject.getProject().getKey();

    // Verify that the project has no existing issues
    final long issueCount = issueManager.getIssueCountForProject(existingProject.getId());
    if (issueCount != 0) {
      messageSet.addErrorMessage(
          getText(
              i18n,
              "admin.error.project.import.project.contains.issues",
              projectKey,
              String.valueOf(issueCount)));
    }

    // Verify that the project has no existing versions
    final long versionCount = versionManager.getVersions(existingProject.getId()).size();
    if (versionCount != 0) {
      messageSet.addErrorMessage(
          getText(
              i18n,
              "admin.error.project.import.project.contains.versions",
              projectKey,
              String.valueOf(versionCount)));
    }

    // Verify that the project has no existing components
    final long componentCount =
        projectComponentManager.findAllForProject(existingProject.getId()).size();
    if (componentCount != 0) {
      messageSet.addErrorMessage(
          getText(
              i18n,
              "admin.error.project.import.project.contains.components",
              projectKey,
              String.valueOf(componentCount)));
    }

    // Verify that if the project has a default assignee of Unassigned that the current instance of
    // JIRA supports unassigned issues
    if (projectHasDefaultAssigneeUnassigned(backupProject, backupSystemInformation)) {
      // We want this instance of JIRA to allow unassigned issues.
      final boolean allowUnassigned =
          applicationProperties.getOption(APKeys.JIRA_OPTION_ALLOWUNASSIGNED);
      if (!allowUnassigned) {
        messageSet.addErrorMessage(
            getText(
                i18n,
                "admin.error.project.import.project.default.assignee.not.allowed",
                backupProject.getProject().getName()));
      }
    }
  }
コード例 #2
0
 protected boolean isScreenshotAppletEnabledForLinux() {
   return applicationProperties.getOption(APKeys.JIRA_SCREENSHOTAPPLET_LINUX_ENABLED);
 }
コード例 #3
0
 @Override
 public boolean isScreenshotAppletEnabled() {
   return applicationProperties.getOption(APKeys.JIRA_SCREENSHOTAPPLET_ENABLED);
 }
コード例 #4
0
 @Override
 public boolean attachmentsEnabled() {
   boolean allowAttachments = applicationProperties.getOption(APKeys.JIRA_OPTION_ALLOWATTACHMENTS);
   boolean attachmentPathSet = StringUtils.isNotBlank(attachmentPathManager.getAttachmentPath());
   return allowAttachments && attachmentPathSet;
 }
コード例 #5
0
 private boolean attachmentsAllowedAndDirectoryIsSet() {
   String attachmentDir = attachmentPathManager.getAttachmentPath();
   return applicationProperties.getOption(APKeys.JIRA_OPTION_ALLOWATTACHMENTS)
       && StringUtils.isNotBlank(attachmentDir);
 }
コード例 #6
0
 @Override
 public boolean isFieldVisibleAndInScope(final Issue issue) {
   return applicationProperties.getOption(APKeys.JIRA_OPTION_TIMETRACKING)
       && !fieldVisibilityManager.isFieldHidden(IssueFieldConstants.TIMETRACKING, issue);
 }
コード例 #7
0
 /// CLOVER:OFF
 boolean isExternalUserManagementEnabled() {
   return applicationProperties.getOption(APKeys.JIRA_OPTION_USER_EXTERNALMGT);
 }