Examples of ScriptContext


Examples of org.huihoo.workflow.rules.ScriptContext

      return;

    }

    // Tell the class loader the root of the context
    ScriptContext scriptContext = ((Context) container).getScriptContext();

    // Assigning permissions for the work directory
    File workDir = (File) scriptContext.getAttribute(Globals.ATTR_WORK_DIR);
    if (workDir != null)
    {
      try
      {
        String workDirPath = workDir.getCanonicalPath();
        classLoader.addPermission(new FilePermission(workDirPath, "read,write"));
        classLoader.addPermission(
          new FilePermission(workDirPath + File.separator + "-", "read,write,delete"));
      }
      catch (IOException e)
      {
        // Ignore
      }
    }

    try
    {

      URL rootURL = scriptContext.getResource("/");
      classLoader.addPermission(rootURL);

      String contextRoot = scriptContext.getRealPath("/");
      try
      {
        contextRoot = (new File(contextRoot)).getCanonicalPath();
        classLoader.addPermission(contextRoot);
      }
      catch (IOException e)
      {
        // Ignore
      }

      URL classesURL = scriptContext.getResource("/WEB-INF/classes/");
      classLoader.addPermission(classesURL);
      URL libURL = scriptContext.getResource("/WEB-INF/lib/");
      classLoader.addPermission(libURL);

      if (libURL != null)
      {
        File rootDir = new File(contextRoot);
View Full Code Here

Examples of org.jmol.script.ScriptContext

  private Object scriptCheck(String strScript, boolean returnContext) {
    // from ConsoleTextPane.checkCommand() and applet Jmol.scriptProcessor()
    if (strScript.indexOf(")") == 0 || strScript.indexOf("!") == 0) // history
      // disabled
      strScript = strScript.substring(1);
    ScriptContext sc = (new ScriptEvaluator(this)).checkScriptSilent(strScript);
    if (returnContext || sc.errorMessage == null)
      return sc;
    return sc.errorMessage;
  }
View Full Code Here

Examples of org.jmol.script.ScriptContext

    resumeButton.setEnabled(isPaused);
    gotoCommand(context.pc, isPaused, attHighlight);
  }
 
  private void gotoCommand(int pt, boolean isPaused, SimpleAttributeSet attr) {   
    ScriptContext context = parsedContext;
    try {
      try {
        setVisible(true);
        int pt2;
        int pt1;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.