/** {@inheritDoc} */ @Override protected void submit(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException, Descriptor.FormException { super.submit(req, rsp); synchronized (this) { JSONObject json = req.getSubmittedForm(); /* Set<String> oldSourceIds = new HashSet<String>(); for (SCMSource source : getSCMSources()) { oldSourceIds.add(source.getId()); } */ sources.replaceBy(req.bindJSONToList(BranchSource.class, json.opt("sources"))); for (SCMSource scmSource : getSCMSources()) { scmSource.setOwner(this); } setProjectFactory( req.bindJSON(BranchProjectFactory.class, json.getJSONObject("projectFactory"))); save(); /* TODO currently ComputedFolder.save always reschedules indexing; could define API to be more discerning Set<String> newSourceIds = new HashSet<String>(); for (SCMSource source : getSCMSources()) { newSourceIds.add(source.getId()); } reindex = !newSourceIds.equals(oldSourceIds); */ } }
/** {@inheritDoc} */ @Override public void onLoad(ItemGroup<? extends Item> parent, String name) throws IOException { super.onLoad(parent, name); init2(); }