Package org.exoplatform.services.jcr.impl.core

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


   /**
    * {@inheritDoc}
    */
   public String getString() throws ValueFormatException, IllegalStateException, RepositoryException
   {
      JCRName name = locationFactory.createJCRName(getQName());
      return name.getAsString();
   }
View Full Code Here


    * 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, false);
      if (version == null)
      {
         throw new VersionException("There are no version with name '" + versionName + "' in the version history "
            + getPath());
View Full Code Here

      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

   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

    */
   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

      assertEquals("", path.getName().getName());
   }

   public void testCreateName() throws Exception
   {
      JCRName name = factory.parseJCRName("jcr:test");
      assertEquals("jcr:test", name.getAsString());
      assertEquals("test", name.getName());
      assertEquals(namespaceRegistry.getNamespaceURIByPrefix("jcr"), name.getNamespace());
      assertEquals("jcr", name.getPrefix());
      assertEquals("[" + namespaceRegistry.getNamespaceURIByPrefix("jcr") + "]test", name.getInternalName()
         .getAsString());

      JCRName name1 = factory.createJCRName(name.getInternalName());
      assertTrue(name.equals(name1));
   }
View Full Code Here

      assertFalse(path.equals(new Object()));
   }

   public void testEqualsJCRName() throws RepositoryException
   {
      JCRName name = factory.parseAbsPath("/jcr:node/node1[2]/exo:node2").getName();
      assertFalse(name.equals(null));
      assertFalse(name.equals(new Object()));
   }
View Full Code Here

    * @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

                  throw new ValueFormatException("Path '" + value + "' is invalid");
               }
            case PropertyType.NAME :
               try
               {
                  JCRName name = locationFactory.parseJCRName(value);
                  return createValue(name);
               }
               catch (RepositoryException e)
               {
                  throw new ValueFormatException("Name '" + value + "' is invalid", e);
View Full Code Here

   public boolean accept(ItemData item)
   {
      try
      {
         JCRName name = session.getLocationFactory().createJCRName(item.getQPath().getName());
         for (String expr : expressions)
         {
            if (estimate(name.getAsString(), expr))
            {
               return true;
            }
         }
      }
View Full Code Here

TOP

Related Classes of org.exoplatform.services.jcr.impl.core.JCRName

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.