Examples of JCRName


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

    private static int NUM_TESTS = 1;


    public void testParse() throws Exception {
        for (int i=0; i<tests.length; i++) {
            JcrName t = tests[i];
            long t1 = System.currentTimeMillis();
            for (int j=0; j<NUM_TESTS; j++) {
                try {
                    Name n = NameParser.parse(t.jcrName, resolver, factory);
                    if (!t.isValid()) {
                        fail("Should throw IllegalNameException: " + t.jcrName);
                    }
                    assertEquals("\"" + t.jcrName + "\".uri", t.prefix, n.getNamespaceURI());
                    assertEquals("\"" + t.jcrName + "\".localName", t.name, n.getLocalName());
                } catch (IllegalNameException e) {
                    if (t.isValid()) {
                        throw e;
                    }
                } catch (NamespaceException e) {
                    if (t.isValid()) {
                        throw e;
                    }
                }
            }
            long t2 = System.currentTimeMillis();
View Full Code Here

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

        }
    }

    public void testCheckFormat() throws Exception {
        for (int i=0; i<tests.length; i++) {
            JcrName t = tests[i];
            long t1 = System.currentTimeMillis();
            for (int j=0; j<NUM_TESTS; j++) {
                // check just creation
                boolean isValid = true;
                try {
                    NameParser.checkFormat(t.jcrName);
                } catch (IllegalNameException e) {
                    isValid = false;
                }
                assertEquals("\"" + t.jcrName + "\".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.JcrName

    private static int NUM_TESTS = 1;


    public void testParse() throws Exception {
        for (int i=0; i<tests.length; i++) {
            JcrName t = tests[i];
            long t1 = System.currentTimeMillis();
            for (int j=0; j<NUM_TESTS; j++) {
                try {
                    Name n = NameParser.parse(t.jcrName, resolver, factory);
                    if (!t.isValid()) {
                        fail("Should throw IllegalNameException: " + t.jcrName);
                    }
                    assertEquals("\"" + t.jcrName + "\".uri", t.prefix, n.getNamespaceURI());
                    assertEquals("\"" + t.jcrName + "\".localName", t.name, n.getLocalName());
                } catch (IllegalNameException e) {
                    if (t.isValid()) {
                        throw e;
                    }
                } catch (NamespaceException e) {
                    if (t.isValid()) {
                        throw e;
                    }
                }
            }
            long t2 = System.currentTimeMillis();
View Full Code Here

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

        }
    }

    public void testCheckFormat() throws Exception {
        for (int i=0; i<tests.length; i++) {
            JcrName t = tests[i];
            long t1 = System.currentTimeMillis();
            for (int j=0; j<NUM_TESTS; j++) {
                // check just creation
                boolean isValid = true;
                try {
                    NameParser.checkFormat(t.jcrName);
                } catch (IllegalNameException e) {
                    isValid = false;
                }
                assertEquals("\"" + t.jcrName + "\".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.impl.core.JCRName

    * @throws RepositoryException
    */

   protected String getAttribute(Map<String, String> attributes, InternalQName name) throws RepositoryException
   {
      JCRName jname = locationFactory.createJCRName(name);
      return attributes.get(jname.getAsString());
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.JCRName

    * unpooled Version object.
    */
   public Version version(String versionName, boolean pool) throws VersionException, RepositoryException
   {

      JCRName jcrVersionName = locationFactory.parseJCRName(versionName);
      VersionImpl version =
         (VersionImpl)dataManager.getItem(nodeData(), new QPathEntry(jcrVersionName.getInternalName(), 1), pool,
            ItemType.NODE);
      if (version == null)
      {
         throw new VersionException("There are no version with name '" + versionName + "' in the version history "
            + getPath());
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.JCRName

      return labels;
   }

   protected NodeData getVersionDataByLabel(String labelName) throws VersionException, RepositoryException
   {
      JCRName jcrLabelName = locationFactory.parseJCRName(labelName);
      InternalQName labelQName = jcrLabelName.getInternalName();

      return getData().getVersionDataByLabel(labelQName);
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.JCRName

   public void addVersionLabel(String versionName, String label, boolean moveLabel) throws VersionException,
      RepositoryException
   {
      checkValid();

      JCRName jcrLabelName = locationFactory.parseJCRName(label);
      InternalQName labelQName = jcrLabelName.getInternalName();

      NodeData labels = getVersionLabelsData();

      List<PropertyData> labelsList = dataManager.getChildPropertiesData(labels);
      for (PropertyData prop : labelsList)
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.JCRName

    */
   public void removeVersionLabel(String labelName) throws VersionException, RepositoryException
   {
      checkValid();

      JCRName jcrLabelName = locationFactory.parseJCRName(labelName);
      InternalQName labelQName = jcrLabelName.getInternalName();

      PropertyData vldata =
         (PropertyData)dataManager.getItemData(getData().getVersionLabelsData(), new QPathEntry(labelQName, 0),
            ItemType.PROPERTY);

View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.JCRName

    * @throws RepositoryException
    */

   protected String getAttribute(Map<String, String> attributes, InternalQName name) throws RepositoryException
   {
      JCRName jname = locationFactory.createJCRName(name);
      return attributes.get(jname.getAsString());
   }
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.