public ContextMenu from(ModelObjectWithContextMenu self, StaplerRequest request, StaplerResponse response, String view) throws JellyException, IOException { WebApp webApp = WebApp.getCurrent(); final Script s = webApp.getMetaClass(self).getTearOff(JellyClassTearOff.class).findScript(view); if (s!=null) { JellyFacet facet = webApp.getFacet(JellyFacet.class); request.setAttribute("taskTags",this); // <l:task> will look for this variable and populate us request.setAttribute("mode","side-panel"); // run sidepanel but ignore generated HTML facet.scriptInvoker.invokeScript(request,response,new Script() { public Script compile() throws JellyException { return this; } public void run(JellyContext context, XMLOutput output) throws JellyTagException { Functions.initPageVariables(context); s.run(context,output); } },self,new XMLOutput(new DefaultHandler())); } else if (self instanceof Actionable) { // fallback this.addAll(((Actionable)self).getAllActions()); } return this; } }
/** * Convenience maintenance method to clear all the cached scripts for the given tearoff type. * * <p> * This is useful when you want to have the scripts reloaded into the live system without * the performance penalty of {@link MetaClass#NO_CACHE}. * * @see MetaClass#NO_CACHE */ public void clearScripts(Class<? extends AbstractTearOff> clazz) { synchronized (classMap) { for (MetaClass v : classMap.values()) { AbstractTearOff t = v.getTearOff(clazz); if (t!=null) t.clearScripts(); } } }
/** * Convenience maintenance method to clear all the cached scripts for the given tearoff type. * * <p> * This is useful when you want to have the scripts reloaded into the live system without * the performance penalty of {@link MetaClass#NO_CACHE}. * * @see MetaClass#NO_CACHE */ public void clearScripts(Class<? extends AbstractTearOff> clazz) { synchronized (classMap) { for (MetaClass v : classMap.values()) { AbstractTearOff t = v.getTearOff(clazz); if (t!=null) t.clearScripts(); } } }
/** * Convenience maintenance method to clear all the cached scripts for the given tearoff type. * * <p> * This is useful when you want to have the scripts reloaded into the live system without * the performance penalty of {@link MetaClass#NO_CACHE}. * * @see MetaClass#NO_CACHE */ public void clearScripts(Class<? extends AbstractTearOff> clazz) { synchronized (classMap) { for (MetaClass v : classMap.values()) { AbstractTearOff t = v.getTearOff(clazz); if (t!=null) t.clearScripts(); } } }
public ContextMenu from(ModelObjectWithContextMenu self, StaplerRequest request, StaplerResponse response, String view) throws JellyException, IOException { WebApp webApp = WebApp.getCurrent(); final Script s = webApp.getMetaClass(self).getTearOff(JellyClassTearOff.class).findScript(view); if (s!=null) { JellyFacet facet = webApp.getFacet(JellyFacet.class); request.setAttribute("taskTags",this); // <l:task> will look for this variable and populate us request.setAttribute("mode","side-panel"); // run sidepanel but ignore generated HTML facet.scriptInvoker.invokeScript(request,response,new Script() { public Script compile() throws JellyException { return this; } public void run(JellyContext context, XMLOutput output) throws JellyTagException { Functions.initPageVariables(context); s.run(context,output); } },self,new XMLOutput(new DefaultHandler())); } else if (self instanceof Actionable) { // fallback this.addAll(((Actionable)self).getAllActions()); } return this; } }