@Override public boolean remove(Object o) { return facets.remove(o); }
/** * @param paneId panel name * @return the actual state of panel */ public boolean toggleCollapsed(String paneId) throws IOException { if (collapsed.contains(paneId)) { collapsed.remove(paneId); return false; } else { collapsed.add(paneId); return true; } }
/** * Bare-minimum configuration mechanism to change the update center. */ @RequirePOST public HttpResponse doSiteConfigure(@QueryParameter String site) throws IOException { Jenkins hudson = Jenkins.getInstance(); hudson.checkPermission(CONFIGURE_UPDATECENTER); UpdateCenter uc = hudson.getUpdateCenter(); PersistedList<UpdateSite> sites = uc.getSites(); for (UpdateSite s : sites) { if (s.getId().equals(UpdateCenter.ID_DEFAULT)) sites.remove(s); } sites.add(new UpdateSite(UpdateCenter.ID_DEFAULT, site)); return new HttpRedirect("advanced"); }
sites.remove(site); } else if (ID_DEFAULT.equals(site.getId())) { defaultSiteExists = true;
@RequirePOST public HttpResponse doUpdateSources(StaplerRequest req) throws IOException { Jenkins.getInstance().checkPermission(CONFIGURE_UPDATECENTER); if (req.hasParameter("remove")) { UpdateCenter uc = Jenkins.getInstance().getUpdateCenter(); BulkChange bc = new BulkChange(uc); try { for (String id : req.getParameterValues("sources")) uc.getSites().remove(uc.getById(id)); } finally { bc.commit(); } } else if (req.hasParameter("add")) return new HttpRedirect("addSite"); return new HttpRedirect("./sites"); }
@Override public boolean remove(Object o) { return facets.remove(o); }
/** * @param paneId panel name * @return the actual state of panel */ public boolean toggleCollapsed(String paneId) throws IOException { if (collapsed.contains(paneId)) { collapsed.remove(paneId); return false; } else { collapsed.add(paneId); return true; } }
/** * This web method requires POST, admin rights and nonnull repo. * Responds with redirect to monitor page * * @param repo to be disignored. Never null */ @RequirePOST @ValidateRepoName @RequireAdminRights @RespondWithRedirect public void doDisignore(@Nonnull @GHRepoName GitHubRepositoryName repo) { ignored.remove(repo); }
/** * Bare-minimum configuration mechanism to change the update center. */ public HttpResponse doSiteConfigure(@QueryParameter String site) throws IOException { Hudson hudson = Hudson.getInstance(); hudson.checkPermission(Hudson.ADMINISTER); UpdateCenter uc = hudson.getUpdateCenter(); PersistedList<UpdateSite> sites = uc.getSites(); for (UpdateSite s : sites) { if (s.getId().equals("default")) sites.remove(s); } sites.add(new UpdateSite("default",site)); return HttpResponses.redirectToContextRoot(); }
/** * Bare-minimum configuration mechanism to change the update center. */ public HttpResponse doSiteConfigure(@QueryParameter String site) throws IOException { Hudson hudson = Hudson.getInstance(); hudson.checkPermission(Hudson.ADMINISTER); UpdateCenter uc = hudson.getUpdateCenter(); PersistedList<UpdateSite> sites = uc.getSites(); for (UpdateSite s : sites) { if (s.getId().equals("default")) sites.remove(s); } sites.add(new UpdateSite("default",site)); return HttpResponses.redirectToContextRoot(); }
/** * Bare-minimum configuration mechanism to change the update center. */ public HttpResponse doSiteConfigure(@QueryParameter String site) throws IOException { Hudson hudson = Hudson.getInstance(); hudson.checkPermission(Hudson.ADMINISTER); UpdateCenter uc = hudson.getUpdateCenter(); PersistedList<UpdateSite> sites = uc.getSites(); for (UpdateSite s : sites) { if (s.getId().equals("default")) sites.remove(s); } sites.add(new UpdateSite("default",site)); return HttpResponses.redirectToContextRoot(); }
/** * Bare-minimum configuration mechanism to change the update center. */ public HttpResponse doSiteConfigure(@QueryParameter String site) throws IOException { Hudson hudson = Hudson.getInstance(); hudson.checkPermission(Hudson.ADMINISTER); UpdateCenter uc = hudson.getUpdateCenter(); PersistedList<UpdateSite> sites = uc.getSites(); for (UpdateSite s : sites) { if (s.getId().equals("default")) { sites.remove(s); } } sites.add(new UpdateSite("default", site)); return HttpResponses.redirectToContextRoot(); }
/** * Bare-minimum configuration mechanism to change the update center. */ @RequirePOST public HttpResponse doSiteConfigure(@QueryParameter String site) throws IOException { Jenkins hudson = Jenkins.getInstance(); hudson.checkPermission(CONFIGURE_UPDATECENTER); UpdateCenter uc = hudson.getUpdateCenter(); PersistedList<UpdateSite> sites = uc.getSites(); for (UpdateSite s : sites) { if (s.getId().equals(UpdateCenter.ID_DEFAULT)) sites.remove(s); } sites.add(new UpdateSite(UpdateCenter.ID_DEFAULT, site)); return new HttpRedirect("advanced"); }
/** * Loads the data from the disk into this object. */ public synchronized void load() throws IOException { UpdateSite defaultSite = new UpdateSite("default", config.getUpdateCenterUrl()); XmlFile file = getConfigFile(); if (file.exists()) { try { sites.replaceBy(((PersistedList) file.unmarshal(sites)).toList()); } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to load " + file, e); } for (UpdateSite site : sites) { // replace the legacy site with the new site if (site.isLegacyDefault()) { sites.remove(site); sites.add(defaultSite); break; } } } else { if (sites.isEmpty()) { // If there aren't already any UpdateSources, add the default one. // to maintain compatibility with existing UpdateCenterConfiguration, create the default one as specified by UpdateCenterConfiguration sites.add(defaultSite); } } }
/** * Loads the data from the disk into this object. */ public synchronized void load() throws IOException { UpdateSite defaultSite = new UpdateSite("default", config.getUpdateCenterUrl() + "update-center.json"); XmlFile file = getConfigFile(); if(file.exists()) { try { sites.replaceBy(((PersistedList)file.unmarshal(sites)).toList()); } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to load "+file, e); } for (UpdateSite site : sites) { // replace the legacy site with the new site if (site.isLegacyDefault()) { sites.remove(site); sites.add(defaultSite); break; } } } else { if (sites.isEmpty()) { // If there aren't already any UpdateSources, add the default one. // to maintain compatibility with existing UpdateCenterConfiguration, create the default one as specified by UpdateCenterConfiguration sites.add(defaultSite); } } }
public HttpResponse doUpdateSources(StaplerRequest req) throws IOException { Hudson.getInstance().checkPermission(Hudson.ADMINISTER); if (req.hasParameter("remove")) { UpdateCenter uc = Hudson.getInstance().getUpdateCenter(); BulkChange bc = new BulkChange(uc); try { for (String id : req.getParameterValues("sources")) uc.getSites().remove(uc.getById(id)); } finally { bc.commit(); } } else if (req.hasParameter("add")) return new HttpRedirect("addSite"); return new HttpRedirect("./sites"); }
public HttpResponse doUpdateSources(StaplerRequest req) throws IOException { Hudson.getInstance().checkPermission(Hudson.ADMINISTER); if (req.hasParameter("remove")) { UpdateCenter uc = Hudson.getInstance().getUpdateCenter(); BulkChange bc = new BulkChange(uc); try { for (String id : req.getParameterValues("sources")) { uc.getSites().remove(uc.getById(id)); } } finally { bc.commit(); } } else if (req.hasParameter("add")) { return new HttpRedirect("addSite"); } return new HttpRedirect("./sites"); }
public HttpResponse doUpdateSources(StaplerRequest req) throws IOException { Hudson.getInstance().checkPermission(Hudson.ADMINISTER); if (req.hasParameter("remove")) { UpdateCenter uc = Hudson.getInstance().getUpdateCenter(); BulkChange bc = new BulkChange(uc); try { for (String id : req.getParameterValues("sources")) uc.getSites().remove(uc.getById(id)); } finally { bc.commit(); } } else if (req.hasParameter("add")) return new HttpRedirect("addSite"); return new HttpRedirect("./sites"); }
public HttpResponse doUpdateSources(StaplerRequest req) throws IOException { Hudson.getInstance().checkPermission(Hudson.ADMINISTER); if (req.hasParameter("remove")) { UpdateCenter uc = Hudson.getInstance().getUpdateCenter(); BulkChange bc = new BulkChange(uc); try { for (String id : req.getParameterValues("sources")) uc.getSites().remove(uc.getById(id)); } finally { bc.commit(); } } else if (req.hasParameter("add")) return new HttpRedirect("addSite"); return new HttpRedirect("./sites"); }
@RequirePOST public HttpResponse doUpdateSources(StaplerRequest req) throws IOException { Jenkins.getInstance().checkPermission(CONFIGURE_UPDATECENTER); if (req.hasParameter("remove")) { UpdateCenter uc = Jenkins.getInstance().getUpdateCenter(); BulkChange bc = new BulkChange(uc); try { for (String id : req.getParameterValues("sources")) uc.getSites().remove(uc.getById(id)); } finally { bc.commit(); } } else if (req.hasParameter("add")) return new HttpRedirect("addSite"); return new HttpRedirect("./sites"); }