NodeDescriptor d = NodeDescriptor.all().findByName(mode); if (d == null) { throw new Failure("No node type ‘" + mode + "’ is known");
v = copy(req, owner, name); } else { ViewDescriptor descriptor = all().findByName(mode); if (descriptor == null) { throw new Failure("No view type ‘" + mode + "’ is known");
if(mode==null) throw new Failure("No mode given"); TopLevelItemDescriptor descriptor = Items.all().findByName(mode); if (descriptor == null) { throw new Failure("No item type ‘" + mode + "’ is known");
NodeDescriptor d = NodeDescriptor.all().findByName(mode); if (d == null) { throw new Failure("No node type ‘" + mode + "’ is known");
public static View create(StaplerRequest req, StaplerResponse rsp, ViewGroup owner) throws FormException, IOException, ServletException { String name = req.getParameter("name"); checkGoodName(name); if(owner.getView(name)!=null) throw new FormException(Messages.Hudson_ViewAlreadyExists(name),"name"); String mode = req.getParameter("mode"); if (mode==null || mode.length()==0) throw new FormException(Messages.View_MissingMode(),"mode"); // create a view View v = all().findByName(mode).newInstance(req,req.getSubmittedForm()); v.owner = owner; // redirect to the config screen rsp.sendRedirect2(req.getContextPath()+'/'+v.getUrl()+v.getPostConstructLandingPage()); return v; } }
public static View create(StaplerRequest req, StaplerResponse rsp, ViewGroup owner) throws FormException, IOException, ServletException { String name = req.getParameter("name"); checkGoodName(name); if(owner.getView(name)!=null) throw new FormException(Messages.Hudson_ViewAlreadyExists(name),"name"); String mode = req.getParameter("mode"); if (mode==null || mode.length()==0) throw new FormException(Messages.View_MissingMode(),"mode"); // create a view View v = all().findByName(mode).newInstance(req,req.getSubmittedForm()); v.owner = owner; // redirect to the config screen rsp.sendRedirect2(req.getContextPath()+'/'+v.getUrl()+v.getPostConstructLandingPage()); return v; } }
public static View create(StaplerRequest req, StaplerResponse rsp, ViewGroup owner) throws FormException, IOException, ServletException { String name = req.getParameter("name"); checkGoodName(name); if(owner.getView(name)!=null) throw new FormException(Messages.Hudson_ViewAlreadyExists(name),"name"); String mode = req.getParameter("mode"); if (mode==null || mode.length()==0) throw new FormException(Messages.View_MissingMode(),"mode"); // create a view View v = all().findByName(mode).newInstance(req,req.getSubmittedForm()); v.owner = owner; // redirect to the config screen rsp.sendRedirect2(req.getContextPath()+'/'+v.getUrl()+v.getPostConstructLandingPage()); return v; } }
v = copy(req, owner, name); } else { ViewDescriptor descriptor = all().findByName(mode); if (descriptor == null) { throw new Failure("No view type ‘" + mode + "’ is known");
public static View create(StaplerRequest req, StaplerResponse rsp, ViewGroup owner) throws FormException, IOException, ServletException { String name = req.getParameter("name"); checkGoodName(name); if (owner.getView(name) != null) { throw new FormException(Messages.Hudson_ViewAlreadyExists(name), "name"); } String mode = req.getParameter("mode"); if (mode == null || mode.length() == 0) { throw new FormException(Messages.View_MissingMode(), "mode"); } // create a view View v = all().findByName(mode).newInstance(req, req.getSubmittedForm()); v.owner = owner; if (!(owner instanceof MyViewsProperty)) { //TODO: Get teamname to add from view creation UI addToTeam(v.getViewName(), null); } // redirect to the config screen rsp.sendRedirect2(req.getContextPath() + '/' + v.getUrl() + v.getPostConstructLandingPage()); return v; }
if(mode==null) throw new Failure("No mode given"); TopLevelItemDescriptor descriptor = Items.all().findByName(mode); if (descriptor == null) { throw new Failure("No item type ‘" + mode + "’ is known");