public void save() throws IOException { // persistence is a part of the owner // due to initialization timing issue, it can be null when this method is called if (owner != null) { owner.save(); } }
public void addView(@Nonnull View v) throws IOException { v.owner = owner; views().add(v); owner.save(); }
public synchronized void deleteView(@Nonnull View view) throws IOException { if (views().size() <= 1) throw new IllegalStateException("Cannot delete last view"); views().remove(view); owner.save(); }
@RequirePOST public TopLevelItem doCreateItem(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { ItemGroup<? extends TopLevelItem> ig = getOwner().getItemGroup(); if (ig instanceof ModifiableItemGroup) { TopLevelItem item = ((ModifiableItemGroup<? extends TopLevelItem>)ig).doCreateItem(req, rsp); if(item!=null) { jobNames.add(item.getName()); owner.save(); } return item; } return null; }
@Override @RequirePOST public HttpResponse doRemoveJobFromView(@QueryParameter String name) throws IOException, ServletException { checkPermission(View.CONFIGURE); if(name==null) throw new Failure("Query parameter 'name' is required"); TopLevelItem item = resolveName(name); if (item==null) throw new Failure("Query parameter 'name' does not correspond to a known and readable item"); if (remove(item)) owner.save(); return HttpResponses.ok(); }
@Override @RequirePOST public Item doCreateItem(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { ItemGroup<? extends TopLevelItem> ig = getOwner().getItemGroup(); if (ig instanceof ModifiableItemGroup) { TopLevelItem item = ((ModifiableItemGroup<? extends TopLevelItem>)ig).doCreateItem(req, rsp); if (item!=null) { if (needToAddToCurrentView(req)) { synchronized (this) { jobNames.add(item.getRelativeNameFrom(getOwner().getItemGroup())); } owner.save(); } } return item; } return null; }
@Override @RequirePOST public HttpResponse doAddJobToView(@QueryParameter String name) throws IOException, ServletException { checkPermission(View.CONFIGURE); if(name==null) throw new Failure("Query parameter 'name' is required"); TopLevelItem item = resolveName(name); if (item == null) throw new Failure("Query parameter 'name' does not correspond to a known item"); if (contains(item)) return HttpResponses.ok(); add(item); owner.save(); return HttpResponses.ok(); }
public void save() throws IOException { // persistence is a part of the owner. // due to the initialization timing issue, it can be null when this method is called. if (owner!=null) owner.save(); }
public void save() throws IOException { // persistence is a part of the owner. // due to the initialization timing issue, it can be null when this method is called. if (owner!=null) owner.save(); }
public void save() throws IOException { // persistence is a part of the owner // due to initialization timing issue, it can be null when this method is called if (owner != null) { owner.save(); } }
public void save() throws IOException { // persistence is a part of the owner. // due to the initialization timing issue, it can be null when this method is called. if (owner != null) { owner.save(); } }
public void addView(View v) throws IOException { v.owner = owner; views().add(v); owner.save(); }
public synchronized void deleteView(View view) throws IOException { if (views().size() <= 1) throw new IllegalStateException("Cannot delete last view"); views().remove(view); owner.save(); }
public Item doCreateItem(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { Item item = Hudson.getInstance().doCreateItem(req, rsp); if(item!=null) { jobNames.add(item.getName()); owner.save(); } return item; }
public synchronized Item doCreateItem(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { Item item = Hudson.getInstance().doCreateItem(req, rsp); if(item!=null) { jobNames.add(item.getName()); owner.save(); } return item; }
public synchronized Item doCreateItem(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { Item item = Hudson.getInstance().doCreateItem(req, rsp); if(item!=null) { jobNames.add(item.getName()); owner.save(); } return item; }
public synchronized Item doCreateItem(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { Item item = Hudson.getInstance().doCreateItem(req, rsp); if (item != null) { jobNames.add(item.getName()); owner.save(); } return item; }
/** * Accepts the new description. */ public synchronized void doSubmitDescription( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { checkPermission(CONFIGURE); description = req.getParameter("description"); owner.save(); rsp.sendRedirect("."); // go to the top page }
/** * Accepts the new description. */ public synchronized void doSubmitDescription( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { checkPermission(CONFIGURE); description = req.getParameter("description"); owner.save(); rsp.sendRedirect("."); // go to the top page }
@Override @RequirePOST public HttpResponse doRemoveJobFromView(@QueryParameter String name) throws IOException, ServletException { checkPermission(View.CONFIGURE); if(name==null) throw new Failure("Query parameter 'name' is required"); TopLevelItem item = resolveName(name); if (item==null) throw new Failure("Query parameter 'name' does not correspond to a known and readable item"); if (remove(item)) owner.save(); return HttpResponses.ok(); }