@Override protected Map<String, Object> executeImpl(WebScriptRequest req, Status status) { Map<String, Object> model = new HashMap<String, Object>(7, 1.0f); model.put("webscripts", getContainer().getRegistry().getWebScripts()); model.put("failures", getContainer().getRegistry().getFailures()); model.put("rooturl", getContainer().getRegistry().getUri("/")); model.put("rootpackage", getContainer().getRegistry().getPackage("/")); model.put("rootfamily", getContainer().getRegistry().getFamily("/")); model.put("rootlifecycle", getContainer().getRegistry().getLifecycle("/")); return model; }
@Override protected Map<String, Object> executeImpl(WebScriptRequest req, Status status) { Map<String, Object> model = new HashMap<String, Object>(7, 1.0f); model.put("webscripts", getContainer().getRegistry().getWebScripts()); model.put("failures", getContainer().getRegistry().getFailures()); model.put("rooturl", getContainer().getRegistry().getUri("/")); model.put("rootpackage", getContainer().getRegistry().getPackage("/")); model.put("rootfamily", getContainer().getRegistry().getFamily("/")); model.put("rootlifecycle", getContainer().getRegistry().getLifecycle("/")); return model; }
/** * Helper function to reset all web scripts in the web framework * web scripts container */ public void resetWebScripts() { if (this.webFrameworkContainer != null) { int previousCount = this.webFrameworkContainer.getRegistry().getWebScripts().size(); int previousFailures = this.webFrameworkContainer.getRegistry().getFailures().size(); this.webFrameworkContainer.reset(); // debug out logger.info("Reset Web Scripts Registry; registered " + this.webFrameworkContainer.getRegistry().getWebScripts().size() + " Web Scripts. Previously, there were " + previousCount + "."); int newFailures = this.webFrameworkContainer.getRegistry().getFailures().size(); if (newFailures != 0 || previousFailures != 0) { logger.info("Warning: found " + newFailures + " broken Web Scripts. Previously, there were " + previousFailures + "."); } } }
/** * Helper function to reset all web scripts in the web framework * web scripts container */ public void resetWebScripts() { if (this.webFrameworkContainer != null) { int previousCount = this.webFrameworkContainer.getRegistry().getWebScripts().size(); int previousFailures = this.webFrameworkContainer.getRegistry().getFailures().size(); this.webFrameworkContainer.reset(); // debug out logger.info("Reset Web Scripts Registry; registered " + this.webFrameworkContainer.getRegistry().getWebScripts().size() + " Web Scripts. Previously, there were " + previousCount + "."); int newFailures = this.webFrameworkContainer.getRegistry().getFailures().size(); if (newFailures != 0 || previousFailures != 0) { logger.info("Warning: found " + newFailures + " broken Web Scripts. Previously, there were " + previousFailures + "."); } } }
/** * Helper function to reset all web scripts in the web framework * web scripts container */ public static void resetWebScripts() { Container container = getServiceRegistry().getWebFrameworkContainer(); if (container != null) { int previousCount = container.getRegistry().getWebScripts().size(); int previousFailures = container.getRegistry().getFailures().size(); container.reset(); // debug out FrameworkUtil.getLogger().info("Reset Web Scripts Registry; registered " + container.getRegistry().getWebScripts().size() + " Web Scripts. Previously, there were " + previousCount + "."); int newFailures = container.getRegistry().getFailures().size(); if (newFailures != 0 || previousFailures != 0) { FrameworkUtil.getLogger().info("Warning: found " + newFailures + " broken Web Scripts. Previously, there were " + previousFailures + "."); } } }
/** * Helper function to reset all web scripts in the web framework * web scripts container */ public static void resetWebScripts() { Container container = getServiceRegistry().getWebFrameworkContainer(); if (container != null) { int previousCount = container.getRegistry().getWebScripts().size(); int previousFailures = container.getRegistry().getFailures().size(); container.reset(); // debug out FrameworkUtil.getLogger().info("Reset Web Scripts Registry; registered " + container.getRegistry().getWebScripts().size() + " Web Scripts. Previously, there were " + previousCount + "."); int newFailures = container.getRegistry().getFailures().size(); if (newFailures != 0 || previousFailures != 0) { FrameworkUtil.getLogger().info("Warning: found " + newFailures + " broken Web Scripts. Previously, there were " + previousFailures + "."); } } }
@Override protected Map<String, Object> executeImpl(WebScriptRequest req, Status status) { // extract web script package String packagePath = req.getExtensionPath(); if (packagePath == null || packagePath.length() == 0) { packagePath = "/"; } if (!packagePath.startsWith("/")) { packagePath = "/" + packagePath; } // locate web script package Path path = getContainer().getRegistry().getPackage(packagePath); if (path == null) { throw new WebScriptException(Status.STATUS_NOT_FOUND, "Web Script Package '" + packagePath + "' not found"); } Map<String, Object> model = new HashMap<String, Object>(7, 1.0f); model.put("package", path); return model; }
@Override protected Map<String, Object> executeImpl(WebScriptRequest req, Status status) { // extract web script package String familyPath = req.getExtensionPath(); if (familyPath == null || familyPath.length() == 0) { familyPath = "/"; } if (!familyPath.startsWith("/")) { familyPath = "/" + familyPath; } // locate web script package Path path = getContainer().getRegistry().getFamily(familyPath); if (path == null) { throw new WebScriptException(Status.STATUS_NOT_FOUND, "Web Script Family '" + familyPath + "' not found"); } Map<String, Object> model = new HashMap<String, Object>(7, 1.0f); model.put("family", path); return model; }
@Override protected Map<String, Object> executeImpl(WebScriptRequest req, Status status) { // extract web script package String uriPath = req.getExtensionPath(); if (uriPath == null || uriPath.length() == 0) { uriPath = "/"; } if (!uriPath.startsWith("/")) { uriPath = "/" + uriPath; } // locate web script package Path path = getContainer().getRegistry().getUri(uriPath); if (path == null) { throw new WebScriptException(Status.STATUS_NOT_FOUND, "Web Script URI '" + uriPath + "' not found"); } Map<String, Object> model = new HashMap<String, Object>(7, 1.0f); model.put("uri", path); return model; }
@Override protected Map<String, Object> executeImpl(WebScriptRequest req, Status status) { List<String> tasks = new ArrayList<String>(); // reset index String reset = req.getParameter("reset"); if (reset != null && reset.equals("on")) { // reset list of web scripts int previousCount = getContainer().getRegistry().getWebScripts().size(); int previousFailures = getContainer().getRegistry().getFailures().size(); getContainer().reset(); tasks.add("Reset Web Scripts Registry; registered " + getContainer().getRegistry().getWebScripts().size() + " Web Scripts. Previously, there were " + previousCount + "."); int newFailures = getContainer().getRegistry().getFailures().size(); if (newFailures != 0 || previousFailures != 0) { tasks.add("Warning: found " + newFailures + " broken Web Scripts. Previously, there were " + previousFailures + "."); } } // create model for rendering Map<String, Object> model = new HashMap<String, Object>(7, 1.0f); model.put("tasks", tasks); model.put("webscripts", getContainer().getRegistry().getWebScripts()); model.put("failures", getContainer().getRegistry().getFailures()); return model; }
@Override protected Map<String, Object> executeImpl(WebScriptRequest req, Status status) { // extract web script package String uriPath = req.getExtensionPath(); if (uriPath == null || uriPath.length() == 0) { uriPath = "/"; } if (!uriPath.startsWith("/")) { uriPath = "/" + uriPath; } // locate web script package Path path = getContainer().getRegistry().getLifecycle(uriPath); if (path == null) { throw new WebScriptException(Status.STATUS_NOT_FOUND, "Web Script URI '" + uriPath + "' not found"); } Map<String, Object> model = new HashMap<String, Object>(7, 1.0f); model.put("lifecycle", path); return model; }
if (statusTemplate == null) Path path = this.container.getRegistry().getPackage(PathImpl.concatPath("/", getDescription().getScriptPath())); statusTemplate = getPackageStatusTemplate(path, statusCode, format); if (statusTemplate == null)
if (statusTemplate == null) Path path = this.container.getRegistry().getPackage(PathImpl.concatPath("/", getDescription().getScriptPath())); statusTemplate = getPackageStatusTemplate(path, statusCode, format); if (statusTemplate == null)
if (statusTemplate == null) Path path = this.container.getRegistry().getPackage(PathImpl.concatPath("/", getDescription().getScriptPath())); statusTemplate = getPackageStatusTemplate(path, statusCode, format); if (statusTemplate == null)
int previousCount = getContainer().getRegistry().getWebScripts().size(); int previousFailures = getContainer().getRegistry().getFailures().size(); getContainer().reset(); tasks.add("Reset Web Scripts Registry; registered " + getContainer().getRegistry().getWebScripts().size() + " Web Scripts. Previously, there were " + previousCount + "."); int newFailures = getContainer().getRegistry().getFailures().size(); if (newFailures != 0 || previousFailures != 0) model.put("webscripts", getContainer().getRegistry().getWebScripts()); model.put("failures", getContainer().getRegistry().getFailures()); return model;
Collection<WebScript> scripts = getContainer().getRegistry().getWebScripts(); Collection<WebScript> filteredWebScripts = new ArrayList<WebScript>(); for (WebScript script : scripts) Path rootPackage = getContainer().getRegistry().getPackage("/"); Path filteredPackage = filterPath(null, rootPackage, packageFilter, urlFilter, familyFilter);
WebScript script = getContainer().getRegistry().getWebScript(scriptId); if (script == null)
Registry registry = getContainer().getRegistry(); WebScript webscript = registry.getWebScript(scriptId); if (webscript == null)
Registry registry = getContainer().getRegistry(); Path path = registry.getPackage(packagePath); if (path == null)
WebScript script = getContainer().getRegistry().getWebScript(scriptId); if (script == null)