Package org.exoplatform.services.jcr.ext.resource

Examples of org.exoplatform.services.jcr.ext.resource.UnifiedNodeReference


         {
            SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<Void>()
            {
               public Void run() throws MalformedURLException
               {
                  repos.add(new UnifiedNodeReference(repository, workspace, path).getURL());
                  return null;
               }
            });
         }
         catch (PrivilegedActionException e)
View Full Code Here


      EnvironmentContext ctx = new EnvironmentContext();
      ctx.put(SecurityContext.class, adminSecurityContext);
      String path =
         "/script/groovy/load/db1/ws" + scriptPath //
            + "?file=" //
            + URLEncoder.encode(new UnifiedNodeReference(repository.getName(), workspace.getName(), user).getURL()
               .toString(), "UTF-8");
      int before = binder.getSize();
      ContainerResponse cres = launcher.service("POST", path, "", null, null, ctx);
      assertEquals(204, cres.getStatus());
      int after = binder.getSize();
View Full Code Here

      EnvironmentContext ctx = new EnvironmentContext();
      ctx.put(SecurityContext.class, adminSecurityContext);
      String path =
         "/script/groovy/load/db1/ws" + scriptPath //
            + "?sources=" //
            + URLEncoder.encode(new UnifiedNodeReference(repository.getName(), workspace.getName(), testRoot.getPath())
               .getURL().toString(), "UTF-8");
      int before = binder.getSize();
      ContainerResponse cres = launcher.service("POST", path, "", null, null, ctx);
      assertEquals(204, cres.getStatus());
      int after = binder.getSize();
View Full Code Here

         "package test.validate\n" + //
            "class User001 {def name}");
      // Specify source file location.
      String path =
         "/script/groovy/validate/Test?file=" //
            + URLEncoder.encode(new UnifiedNodeReference(repository.getName(), workspace.getName(), user).getURL()
               .toString(), "UTF-8");
      ContainerResponse cres = launcher.service("POST", path, "", headers, script.getBytes(), null);
      assertEquals(200, cres.getStatus());
   }
View Full Code Here

         "package test.validate\n" + //
            "class User002 {def name}");
      // Specify source folder location.
      String path =
         "/script/groovy/validate/Test?sources=" //
            + URLEncoder.encode(new UnifiedNodeReference(repository.getName(), workspace.getName(), testRoot.getPath())
               .getURL().toString(), "UTF-8");
      ContainerResponse cres = launcher.service("POST", path, "", headers, script.getBytes(), null);
      assertEquals(200, cres.getStatus());
   }
View Full Code Here

      JcrGroovyClassLoaderProvider classLoaderProvider = new JcrGroovyClassLoaderProvider();
      classLoaderProvider.getGroovyClassLoader().setResourceLoader(
         new JcrGroovyResourceLoader(new java.net.URL[]{new java.net.URL("jcr://db1/ws#/groovyRepo")}));
      JcrGroovyCompiler compiler = new JcrGroovyCompiler(classLoaderProvider);

      Class<?>[] classes = compiler.compile(new UnifiedNodeReference("db1", "ws", scriptB));
      assertEquals(1, classes.length);
      GroovyObject go = (GroovyObject)classes[0].newInstance();
      assertEquals("groovy compiler test", go.invokeMethod("getMessage", new Object[0]));
   }
View Full Code Here

   public void testDependenciesBetweenCompiled() throws Exception
   {
      JcrGroovyClassLoaderProvider classLoaderProvider = new JcrGroovyClassLoaderProvider();
      JcrGroovyCompiler compiler = new JcrGroovyCompiler(classLoaderProvider);
      Class<?>[] classes =
         compiler.compile(new UnifiedNodeReference("db1", "ws", scriptB),
            new UnifiedNodeReference("db1", "ws", scriptA));
      assertEquals(2, classes.length);
      GroovyObject go = (GroovyObject)classes[0].newInstance();
      assertEquals("groovy compiler test", go.invokeMethod("getMessage", new Object[0]));
      go = (GroovyObject)classes[1].newInstance();
      assertEquals("groovy compiler test", go.invokeMethod("getMessage", new Object[0]));
View Full Code Here

   public void testAddDependenciesInRuntime() throws Exception
   {
      JcrGroovyClassLoaderProvider classLoaderProvider = new JcrGroovyClassLoaderProvider();
      JcrGroovyCompiler compiler = new JcrGroovyCompiler(classLoaderProvider);
      SourceFolder[] src =
         new SourceFolder[]{new SourceFolder(new UnifiedNodeReference("db1", "ws", groovyRepo.getPath()).getURL())};
      Class<?>[] classes = compiler.compile(src, new UnifiedNodeReference("db1", "ws", scriptB));
      assertEquals(1, classes.length);
      GroovyObject go = (GroovyObject)classes[0].newInstance();
      assertEquals("groovy compiler test", go.invokeMethod("getMessage", new Object[0]));
   }
View Full Code Here

      classLoaderProvider.getGroovyClassLoader().setResourceLoader(
         new JcrGroovyResourceLoader(new java.net.URL[]{new java.net.URL("jcr://db1/ws#/groovyRepo")}));

      JcrGroovyCompiler compiler = new JcrGroovyCompiler(classLoaderProvider);
      Class<?>[] classes =
         compiler.compile(new UnifiedNodeReference("db1", "ws", scriptD),
            new UnifiedNodeReference("db1", "ws", scriptC));
      assertEquals(2, classes.length);
      List<String> names = new ArrayList<String>(2);
      for (Class c : classes)
         names.add(c.getName());
      assertTrue(names.contains("org.exoplatform.test.C"));
View Full Code Here

TOP

Related Classes of org.exoplatform.services.jcr.ext.resource.UnifiedNodeReference

Copyright © 2018 www.massapicom. 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.