Examples of JCRPath


Examples of org.apache.jackrabbit.spi.commons.name.JcrPath

        pathResolver = new ParsingPathResolver(factory, resolver);
    }

    public void testParse() throws Exception {
        for (int i=0; i<tests.length; i++) {
            JcrPath t = tests[i];
            long t1 = System.currentTimeMillis();
            for (int j=0; j<NUM_TESTS; j++) {
                try {
                    Path p = PathParser.parse(t.path, resolver, factory);
                    if (t.normalizedPath==null) {
                        if (!t.isValid()) {
                            fail("Should throw IllegalArgumentException: " + t.path);
                        }
                        assertEquals("\"" + t.path + "\".create(false)", t.path,  pathResolver.getJCRPath(p));
                        assertEquals("\"" + t.path + "\".isNormalized()", t.isNormalized(), p.isNormalized());
                        assertEquals("\"" + t.path + "\".isAbsolute()", t.isAbsolute(), p.isAbsolute());
                    } else {
                        // check with normalization
                        p = p.getNormalizedPath();
                        if (!t.isValid()) {
                            fail("Should throw IllegalArgumentException: " + t.path);
                        }
                        assertEquals("\"" + t.path + "\".create(true)", t.normalizedPath, pathResolver.getJCRPath(p));
                        assertEquals("\"" + t.path + "\".isAbsolute()", t.isAbsolute(), p.isAbsolute());
                    }
                } catch (Exception e) {
                    if (t.isValid()) {
                        System.out.println(t.path);
                        throw e;
                    }
                }
            }
View Full Code Here

Examples of org.apache.jackrabbit.spi.commons.name.JcrPath

        }
    }

    public void testCheckFormat() throws Exception {
        for (int i=0; i<tests.length; i++) {
            JcrPath t = tests[i];
            long t1 = System.currentTimeMillis();
            for (int j=0; j<NUM_TESTS; j++) {
                if (t.normalizedPath==null) {
                    // check just creation
                    boolean isValid = true;
                    try {
                        PathParser.checkFormat(t.path);
                    } catch (MalformedPathException e) {
                        isValid = false;
                    }
                    assertEquals("\"" + t.path + "\".checkFormat()", t.isValid(),  isValid);
                }
            }
            long t2 = System.currentTimeMillis();
            if (NUM_TESTS>1) {
                System.out.println("testCheckFormat():\t" + t + "\t" + (t2-t1) + "\tms");
View Full Code Here

Examples of org.apache.jackrabbit.spi.commons.name.JcrPath

        pathResolver = new ParsingPathResolver(factory, resolver);
    }

    public void testParse() throws Exception {
        for (int i=0; i<tests.length; i++) {
            JcrPath t = tests[i];
            long t1 = System.currentTimeMillis();
            for (int j=0; j<NUM_TESTS; j++) {
                try {
                    Path p = PathParser.parse(t.path, resolver, factory);
                    if (t.normalizedPath==null) {
                        if (!t.isValid()) {
                            fail("Should throw MalformedPathException: " + t.path);
                        }
                        assertEquals("\"" + t.path + "\".create(false)", t.path,  pathResolver.getJCRPath(p));
                        assertEquals("\"" + t.path + "\".isNormalized()", t.isNormalized(), p.isNormalized());
                        assertEquals("\"" + t.path + "\".isAbsolute()", t.isAbsolute(), p.isAbsolute());
                    } else {
                        // check with normalization
                        p = p.getNormalizedPath();
                        if (!t.isValid()) {
                            fail("Should throw MalformedPathException: " + t.path);
                        }
                        assertEquals("\"" + t.path + "\".create(true)", t.normalizedPath, pathResolver.getJCRPath(p));
                        assertEquals("\"" + t.path + "\".isAbsolute()", t.isAbsolute(), p.isAbsolute());
                    }
                } catch (RepositoryException e) {
                    if (t.isValid()) {
                        System.out.println(t.path);
                        throw e;
                    }
                }
            }
View Full Code Here

Examples of org.apache.jackrabbit.spi.commons.name.JcrPath

        }
    }

    public void testCheckFormat() throws Exception {
        for (int i=0; i<tests.length; i++) {
            JcrPath t = tests[i];
            long t1 = System.currentTimeMillis();
            for (int j=0; j<NUM_TESTS; j++) {
                if (t.normalizedPath==null) {
                    // check just creation
                    boolean isValid = true;
                    try {
                        PathParser.checkFormat(t.path);
                    } catch (MalformedPathException e) {
                        isValid = false;
                    }
                    assertEquals("\"" + t.path + "\".checkFormat()", t.isValid(),  isValid);
                }
            }
            long t2 = System.currentTimeMillis();
            if (NUM_TESTS>1) {
                System.out.println("testCheckFormat():\t" + t + "\t" + (t2-t1) + "\tms");
View Full Code Here

Examples of org.apache.jackrabbit.spi.commons.name.JcrPath

        pathResolver = new ParsingPathResolver(factory, resolver);
    }

    public void testParse() throws Exception {
        for (int i=0; i<tests.length; i++) {
            JcrPath t = tests[i];
            long t1 = System.currentTimeMillis();
            for (int j=0; j<NUM_TESTS; j++) {
                try {
                    Path p = PathParser.parse(t.path, resolver, factory);
                    if (t.normalizedPath==null) {
                        if (!t.isValid()) {
                            fail("Should throw IllegalArgumentException: " + t.path);
                        }
                        assertEquals("\"" + t.path + "\".create(false)", t.path,  pathResolver.getJCRPath(p));
                        assertEquals("\"" + t.path + "\".isNormalized()", t.isNormalized(), p.isNormalized());
                        assertEquals("\"" + t.path + "\".isAbsolute()", t.isAbsolute(), p.isAbsolute());
                    } else {
                        // check with normalization
                        p = p.getNormalizedPath();
                        if (!t.isValid()) {
                            fail("Should throw IllegalArgumentException: " + t.path);
                        }
                        assertEquals("\"" + t.path + "\".create(true)", t.normalizedPath, pathResolver.getJCRPath(p));
                        assertEquals("\"" + t.path + "\".isAbsolute()", t.isAbsolute(), p.isAbsolute());
                    }
                } catch (Exception e) {
                    if (t.isValid()) {
                        System.out.println(t.path);
                        throw e;
                    }
                }
            }
View Full Code Here

Examples of org.apache.jackrabbit.spi.commons.name.JcrPath

        }
    }

    public void testCheckFormat() throws Exception {
        for (int i=0; i<tests.length; i++) {
            JcrPath t = tests[i];
            long t1 = System.currentTimeMillis();
            for (int j=0; j<NUM_TESTS; j++) {
                if (t.normalizedPath==null) {
                    // check just creation
                    boolean isValid = true;
                    try {
                        PathParser.checkFormat(t.path);
                    } catch (MalformedPathException e) {
                        isValid = false;
                    }
                    assertEquals("\"" + t.path + "\".checkFormat()", t.isValid(),  isValid);
                }
            }
            long t2 = System.currentTimeMillis();
            if (NUM_TESTS>1) {
                System.out.println("testCheckFormat():\t" + t + "\t" + (t2-t1) + "\tms");
View Full Code Here

Examples of org.apache.jackrabbit.spi.commons.name.JcrPath

        pathResolver = new ParsingPathResolver(factory, resolver);
    }

    public void testParse() throws Exception {
        for (int i=0; i<tests.length; i++) {
            JcrPath t = tests[i];
            long t1 = System.currentTimeMillis();
            for (int j=0; j<NUM_TESTS; j++) {
                try {
                    Path p = PathParser.parse(t.path, resolver, factory);
                    if (t.normalizedPath==null) {
                        if (!t.isValid()) {
                            fail("Should throw IllegalArgumentException: " + t.path);
                        }
                        assertEquals("\"" + t.path + "\".create(false)", t.path,  pathResolver.getJCRPath(p));
                        assertEquals("\"" + t.path + "\".isNormalized()", t.isNormalized(), p.isNormalized());
                        assertEquals("\"" + t.path + "\".isAbsolute()", t.isAbsolute(), p.isAbsolute());
                    } else {
                        // check with normalization
                        p = p.getNormalizedPath();
                        if (!t.isValid()) {
                            fail("Should throw IllegalArgumentException: " + t.path);
                        }
                        assertEquals("\"" + t.path + "\".create(true)", t.normalizedPath, pathResolver.getJCRPath(p));
                        assertEquals("\"" + t.path + "\".isAbsolute()", t.isAbsolute(), p.isAbsolute());
                    }
                } catch (Exception e) {
                    if (t.isValid()) {
                        System.out.println(t.path);
                        throw e;
                    }
                }
            }
View Full Code Here

Examples of org.apache.jackrabbit.spi.commons.name.JcrPath

        }
    }

    public void testCheckFormat() throws Exception {
        for (int i=0; i<tests.length; i++) {
            JcrPath t = tests[i];
            long t1 = System.currentTimeMillis();
            for (int j=0; j<NUM_TESTS; j++) {
                if (t.normalizedPath==null) {
                    // check just creation
                    boolean isValid = true;
                    try {
                        PathParser.checkFormat(t.path);
                    } catch (MalformedPathException e) {
                        isValid = false;
                    }
                    assertEquals("\"" + t.path + "\".checkFormat()", t.isValid(),  isValid);
                }
            }
            long t2 = System.currentTimeMillis();
            if (NUM_TESTS>1) {
                System.out.println("testCheckFormat():\t" + t + "\t" + (t2-t1) + "\tms");
View Full Code Here

Examples of org.exoplatform.services.jcr.ext.hierarchy.impl.HierarchyConfig.JcrPath

            workspaceNames.addAll(hierarchyConfig.getWorkspaces());
         }
         workspaceNames.add(currentRepo.getConfiguration().getDefaultWorkspaceName());
         for (String workspaceName : workspaceNames)
         {
            JcrPath currentjcrPath = null;
            try
            {
               session = currentRepo.getSystemSession(workspaceName);
               Node rootNode = session.getRootNode();
               for (JcrPath jcrPath : jcrPaths)
               {
                  currentjcrPath = jcrPath;
                  if (!jcrPath.getAlias().equals(USER_APPLICATION) && !jcrPath.getAlias().startsWith(USER_PRIVATE)
                     && !jcrPath.getAlias().startsWith(USER_PUBLIC))
                  {
                     createNode(rootNode, jcrPath.getPath(), jcrPath.getNodeType(), jcrPath.getMixinTypes(),
                        jcrPath.getPermissions(null));
                  }
               }
            }
            catch (Exception e)
            {
               log.error("An error occurs while processing the JCR path which alias is "
                  + (currentjcrPath == null ? null : currentjcrPath.getAlias()) + " with the workspace "
                  + workspaceName, e);
            }
            finally
            {
               if (session != null)
View Full Code Here

Examples of org.exoplatform.services.jcr.ext.hierarchy.impl.HierarchyConfig.JcrPath

         }
         for (String workspaceName : workspaceNames)
         {
            if (!isSameWorksapce && workspaceName.equalsIgnoreCase(systemWorkspace))
               continue;
            JcrPath currentjcrPath = null;
            try
            {
               session = manageableRepository.getSystemSession(workspaceName);
               Node rootNode = session.getRootNode();
               for (JcrPath jcrPath : jcrPaths)
               {
                  currentjcrPath = jcrPath;
                  if (!jcrPath.getAlias().equals(USER_APPLICATION) && !jcrPath.getAlias().startsWith(USER_PRIVATE)
                     && !jcrPath.getAlias().startsWith(USER_PUBLIC))
                  {
                     createNode(rootNode, jcrPath.getPath(), jcrPath.getNodeType(), jcrPath.getMixinTypes(),
                        jcrPath.getPermissions(null));
                  }
               }
            }
            catch (Exception e)
            {
               log.error("An error occurs while processing the JCR path which alias is "
                  + (currentjcrPath == null ? null : currentjcrPath.getAlias()) + " with the workspace "
                  + workspaceName, e);
            }
            finally
            {
               if (session != null)
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.