Tabnine Logo
ProjectService.updateProject
Code IndexAdd Tabnine to your IDE (free)

How to use
updateProject
method
in
com.atlassian.jira.bc.project.ProjectService

Best Java code snippets using com.atlassian.jira.bc.project.ProjectService.updateProject (Showing top 8 results out of 315)

origin: com.atlassian.jira.plugins/atlassian-jira-rpc-plugin

public void setProjectAvatar(final User user, final String projectKey, final Long avatarId) throws RemoteException
{
  Project project = retrieveProjectForAdministration(user, projectKey);
  final com.atlassian.jira.bc.project.ProjectService.UpdateProjectValidationResult result = validateSetAvatar(user, project, avatarId);
  if (result.isValid())
  {
    projectService.updateProject(result);
  }
  else
  {
    throw new RemoteException("Error setting Avatar on project: " + result.getErrorCollection());
  }
}
origin: com.atlassian.jira.plugins/atlassian-jira-rpc-plugin

public RemoteProject updateProject(User user, RemoteProject rProject) throws RemoteException
{
  //Note: The permissionScheme should never be null, but just in case.
  final Long permissionSchemeId = rProject.getPermissionScheme() == null ? null : rProject.getPermissionScheme().getId();
  final Long notificationSchemeId = rProject.getNotificationScheme() == null ? null : rProject.getNotificationScheme().getId();
  final Long issueSecuritySchemeId = rProject.getIssueSecurityScheme() == null ? null : rProject.getIssueSecurityScheme().getId();
  com.atlassian.jira.bc.project.ProjectService.UpdateProjectValidationResult result =
      projectService.validateUpdateProject(user, rProject.getName(), rProject.getKey(), rProject.getDescription(),
          rProject.getLead(), rProject.getProjectUrl(), null);
  com.atlassian.jira.bc.project.ProjectService.UpdateProjectSchemesValidationResult schemesResult =
      projectService.validateUpdateProjectSchemes(user, permissionSchemeId, notificationSchemeId, issueSecuritySchemeId);
  ErrorCollection errors = new SimpleErrorCollection();
  errors.addErrorCollection(result.getErrorCollection());
  errors.addErrorCollection(schemesResult.getErrorCollection());
  if (errors.hasAnyErrors())
  {
    throw new RemoteValidationException("Cannot update project: ", errors);
  }
  final Project updatedProject = projectService.updateProject(result);
  projectService.updateProjectSchemes(schemesResult, updatedProject);
  final RemoteProject remoteProject = new RemoteProject(updatedProject, applicationProperties);
  remoteProject.setNotificationScheme(rProject.getNotificationScheme());
  remoteProject.setPermissionScheme(rProject.getPermissionScheme());
  remoteProject.setIssueSecurityScheme(rProject.getIssueSecurityScheme());
  return remoteProject;
}
origin: com.atlassian.jira/jira-rest-plugin

projectService.updateProject(updateValidationResult);
return Response.ok().cacheControl(NO_CACHE).build();
origin: com.atlassian.jira.plugins/atlassian-jira-rpc-plugin

if (result.isValid())
  projectService.updateProject(result);
origin: com.atlassian.jira/jira-rest-plugin

  @Override
  public Response apply(final Project project)
  {
    final String id = avatarBean.getId();
    Long avatarId;
    try
    {
      avatarId = id == null ? null : Long.valueOf(id);
    }
    catch (NumberFormatException e)
    {
      avatarId = null;
    }
    final ProjectService.UpdateProjectValidationResult updateProjectValidationResult =
        projectService.validateUpdateProject(authContext.getUser(), project.getName(), project.getKey(),
            project.getDescription(), project.getLeadUserName(), project.getUrl(), project.getAssigneeType(),
            avatarId);
    if (!updateProjectValidationResult.isValid())
    {
      throwWebException(updateProjectValidationResult.getErrorCollection());
    }
    projectService.updateProject(updateProjectValidationResult);
    return responses.noContent();
  }
});
origin: com.atlassian.jira.plugins/atlassian-jira-rpc-plugin

public void deleteProjectAvatar(final User user, final long avatarId) throws RemoteException
{
  final Avatar avatar = avatarManager.getById(avatarId);
  // only when the avtatar is system, the owner is null, but we check either since we cannot proceed either way
  if (avatar == null || avatar.isSystemAvatar() || avatar.getOwner() == null)
  {
    throw new RemoteException("No such custom Avatar with id " + avatarId);
  }
  Project project = retrieveProjectForAdministration(user, Long.valueOf(avatar.getOwner()));
  final boolean deletingTheCurrentAvatar = project.getAvatar().getId() == avatarId;
  if (deletingTheCurrentAvatar)
  {
    // deleting the current one need to switch current avatar to default
    final Long defaultAvatarId = avatarManager.getDefaultAvatarId(Avatar.Type.PROJECT);
    final com.atlassian.jira.bc.project.ProjectService.UpdateProjectValidationResult updateProjectValidationResult = validateSetAvatar(user, project, defaultAvatarId);
    if (updateProjectValidationResult.isValid())
    {
      projectService.updateProject(updateProjectValidationResult);
      avatarManager.delete(avatarId, true);
    }
  }
  else
  {
    avatarManager.delete(avatarId, true);
  }
}
origin: com.atlassian.jira/jira-core

@RequiresXsrfCheck
protected String doExecute() throws Exception
{
  if (!(hasProjectAdminPermission() || hasAdminPermission()))
  {
    return "securitybreach";
  }
  final ProjectService.UpdateProjectValidationResult result = getUpdateProjectValidationResult();
  projectService.updateProject(result);
  final String redirectURL;
  if (result.isKeyChanged())
  {
    redirectURL = "/secure/project/IndexProject.jspa?pid=" + getProjectObject().getId();
  }
  else
  {
    redirectURL = "/plugins/servlet/project-config/" + getProjectObject().getKey() + "/summary";
  }
  if (isInlineDialogMode())
  {
    return returnCompleteWithInlineRedirect(redirectURL);
  }
  return getRedirect(redirectURL);
}
origin: com.atlassian.jira/jira-core

@RequiresXsrfCheck
protected String doExecute() throws Exception
{
  if (!(hasProjectAdminPermission() || hasAdminPermission()))
  {
    return "securitybreach";
  }
  final Project projectObject = getProjectObject();
  final ProjectService.UpdateProjectValidationResult result =
      projectService.validateUpdateProject(getLoggedInUser(), projectObject.getName(), projectObject.getKey(),
          projectObject.getDescription(), getLead(), projectObject.getUrl(), getAssigneeType(), getAvatarId());
  projectService.updateProject(result);
  if (isInlineDialogMode())
  {
    return returnComplete();
  }
  return getRedirect("/plugins/servlet/project-config/" + getProjectObject().getKey() + "/roles");
}
com.atlassian.jira.bc.projectProjectServiceupdateProject

Javadoc

Using the validation result from #validateUpdateProject(User,String,String,String,String,String,Long) this method performs the actual update on the project.

Popular methods of ProjectService

  • getProjectByKey
    Used to retrieve a com.atlassian.jira.project.Project object by key. This method returns a com.atlas
  • deleteProject
    Deletes the project provided by the deleteProjectValidationResult. There's a number of steps involve
  • getProjectById
    Used to retrieve a com.atlassian.jira.project.Project object by id. This method returns a com.atlass
  • getProjectByKeyForAction
    Used to retrieve a com.atlassian.jira.project.Project object by key providing the user can perform t
  • validateDeleteProject
    Validation to delete a project is quite straightforward. The user must have global admin rights and
  • validateUpdateProject
    Validates updating a project's details. The project is looked up by the key provided. If no project
  • createProject
    Using the validation result from #validateCreateProject(ApplicationUser,ProjectCreationData) a new p
  • getAllProjectsForAction
    Used to retrieve a list of com.atlassian.jira.project.Project objects. This method returns a com.atl
  • getProjectByIdForAction
    Used to retrieve a com.atlassian.jira.project.Project object by id providing the user can perform th
  • updateProjectSchemes
    Updates the project schemes for a particular project, given a validation result and project to updat
  • validateCreateProject
    This method needs to be called before creating a project to ensure all parameters are correct. There
  • validateUpdateProjectSchemes
    If the scheme ids are not null or -1 (-1 is often used to reset schemes), then an attempt will be ma
  • validateCreateProject,
  • validateUpdateProjectSchemes,
  • getAllProjects,
  • getMaximumKeyLength,
  • getMaximumNameLength,
  • isValidProjectKey,
  • updateProjectType

Popular in Java

  • Running tasks concurrently on multiple threads
  • setScale (BigDecimal)
  • getResourceAsStream (ClassLoader)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • Kernel (java.awt.image)
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • JList (javax.swing)
  • JOptionPane (javax.swing)
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now