Examples of InternalQName


Examples of org.exoplatform.services.jcr.datamodel.InternalQName

   {

      checkValid();

      InternalQName[] mixinTypes = nodeData().getMixinTypeNames();
      InternalQName name = locationFactory.parseJCRName(mixinName).getInternalName();

      // find mixin
      InternalQName removedName = null;
      // Prepare mixin values
      List<InternalQName> newMixin = new ArrayList<InternalQName>();
      List<ValueData> values = new ArrayList<ValueData>();

      for (InternalQName mt : mixinTypes)
View Full Code Here

Examples of org.exoplatform.services.jcr.datamodel.InternalQName

      public int compare(P p1, P p2)
      {
         int r = 0;
         try
         {
            InternalQName qname1 = p1.getQPath().getName();
            InternalQName qname2 = p2.getQPath().getName();
            if (qname1.equals(Constants.JCR_PRIMARYTYPE))
            {
               r = Integer.MIN_VALUE;
            }
            else if (qname2.equals(Constants.JCR_PRIMARYTYPE))
            {
               r = Integer.MAX_VALUE;
            }
            else if (qname1.equals(Constants.JCR_MIXINTYPES))
            {
               r = Integer.MIN_VALUE + 1;
            }
            else if (qname2.equals(Constants.JCR_MIXINTYPES))
            {
               r = Integer.MAX_VALUE - 1;
            }
            else if (qname1.equals(Constants.JCR_UUID))
            {
               r = Integer.MIN_VALUE + 2;
            }
            else if (qname2.equals(Constants.JCR_UUID))
            {
               r = Integer.MAX_VALUE - 2;
            }
            else
            {
               r = qname1.getAsString().compareTo(qname2.getAsString());
            }
         }
         catch (Exception e)
         {
            LOG.error("PropertiesDataOrderComparator error: " + e, e);
View Full Code Here

Examples of org.exoplatform.services.jcr.datamodel.InternalQName

   /**
    * {@inheritDoc}
    */
   public void endElement(String uri, String localName, String name) throws RepositoryException
   {
      InternalQName elementName = locationFactory.parseJCRName(name).getInternalName();

      if (Constants.SV_NODE_NAME.equals(elementName))
      {
         // sv:node element
         endNode();
View Full Code Here

Examples of org.exoplatform.services.jcr.datamodel.InternalQName

    * {@inheritDoc}
    */
   public void startElement(String namespaceURI, String localName, String name, Map<String, String> atts)
      throws RepositoryException
   {
      InternalQName elementName = locationFactory.parseJCRName(name).getInternalName();

      if (Constants.SV_NODE_NAME.equals(elementName))
      {
         // sv:node element

         // node name (value of sv:name attribute)
         String svName = getAttribute(atts, Constants.SV_NAME_NAME);
         if (svName == null)
         {
            throw new RepositoryException("Missing mandatory sv:name attribute of element sv:node");
         }

         NodeData parentData = null;

         parentData = getParent();

         InternalQName currentNodeName = null;
         if (ROOT_NODE_NAME.equals(svName))
         {
            currentNodeName = Constants.ROOT_PATH.getName();
         }
         else
View Full Code Here

Examples of org.exoplatform.services.jcr.datamodel.InternalQName

   private void checkProperties(NodePropertiesInfo currentNodePropertiesInfo) throws RepositoryException
   {
      if (currentNodePropertiesInfo.getNode().getQPath().isDescendantOf(Constants.JCR_VERSION_STORAGE_PATH)
               && currentNodePropertiesInfo.getNode().getPrimaryTypeName().equals(Constants.NT_FROZENNODE))
      {
         InternalQName fptName = null;
         List<InternalQName> fmtNames = new ArrayList<InternalQName>();

         // get frozenPrimaryType and frozenMixinTypes
         try
         {
            for (ImportPropertyData propertyData : currentNodePropertiesInfo.getProperties())
            {
               if (propertyData.getQName().equals(Constants.JCR_FROZENPRIMARYTYPE))
               {
                  fptName = InternalQName.parse(new String(propertyData.getValues().get(0).getAsByteArray(), Constants.DEFAULT_ENCODING));
               }
               else if (propertyData.getQName().equals(Constants.JCR_FROZENMIXINTYPES))
               {
                  for (ValueData valueData : propertyData.getValues())
                  {
                     fmtNames.add(InternalQName.parse(new String(valueData.getAsByteArray(), Constants.DEFAULT_ENCODING)));
                  }
               }
            }
         }
         catch (IllegalStateException e)
         {
            throw new RepositoryException(e.getMessage(), e);
         }
         catch (IllegalNameException e)
         {
            throw new RepositoryException(e.getMessage(), e);
         }
         catch (IOException e)
         {
            throw new RepositoryException(e.getMessage(), e);
         }
        
         InternalQName nodePrimaryTypeName = currentNodePropertiesInfo.getNode().getPrimaryTypeName();
         InternalQName[] nodeMixinTypeName = currentNodePropertiesInfo.getNode().getMixinTypeNames();

         for (ImportPropertyData propertyData : currentNodePropertiesInfo.getProperties())
         {
            PropertyDefinitionDatas defs = nodeTypeDataManager.getPropertyDefinitions(propertyData.getQName(), nodePrimaryTypeName, nodeMixinTypeName);
View Full Code Here

Examples of org.exoplatform.services.jcr.datamodel.InternalQName

   private ImportPropertyData endPrimaryType() throws PathNotFoundException, RepositoryException,
      NoSuchNodeTypeException
   {
      ImportPropertyData propertyData;
      String sName = propertyInfo.getValues().get(0).toString();
      InternalQName primaryTypeName = locationFactory.parseJCRName(sName).getInternalName();

      ImportNodeData nodeData = (ImportNodeData)tree.pop();
      if (!Constants.ROOT_UUID.equals(nodeData.getIdentifier()))
      {
         NodeData parentNodeData = getParent();
View Full Code Here

Examples of org.exoplatform.services.jcr.datamodel.InternalQName

      if (LOG.isDebugEnabled())
      {
         LOG.debug("Node.addMixin " + mixinName + " " + getPath());
      }

      InternalQName name = locationFactory.parseJCRName(mixinName).getInternalName();

      // Does the node already has the mixin
      for (InternalQName mixin : nodeData().getMixinTypeNames())
      {
         if (name.equals(mixin))
         {
            // we already have this mixin type
            LOG.warn("Node already of mixin type " + mixinName + " " + getPath());
            return;
         }
View Full Code Here

Examples of org.exoplatform.services.jcr.datamodel.InternalQName

      {
         throw new ConstraintViolationException("Parent item is not a node " + parentItem.getPath());
      }

      NodeImpl parent = (NodeImpl)parentItem;
      InternalQName name = itemPath.getName().getInternalName();

      // find node type
      NodeDefinitionData nodeDef =
         session.getWorkspace().getNodeTypesHolder()
            .getChildNodeDefinition(name, nodeData().getPrimaryTypeName(), nodeData().getMixinTypeNames());

      if (nodeDef == null)
      {
         throw new ConstraintViolationException("Can not define node type for " + name.getAsString());
      }
      InternalQName primaryTypeName = nodeDef.getName();

      if (nodeDef.getName().equals(name) || primaryTypeName.equals(Constants.JCR_ANY_NAME))
      {
         primaryTypeName = nodeDef.getDefaultPrimaryType();
      }
      // try to make new node
      return doAddNode(parent, name, primaryTypeName);
View Full Code Here

Examples of org.exoplatform.services.jcr.datamodel.InternalQName

      {
         throw new ConstraintViolationException("Parent item is not a node " + parentItem.getPath());
      }
      NodeImpl parent = (NodeImpl)parentItem;

      InternalQName name = itemPath.getName().getInternalName();
      InternalQName ptName = locationFactory.parseJCRName(nodeTypeName).getInternalName();

      // try to make new node
      return doAddNode(parent, name, ptName);
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.datamodel.InternalQName

      List<InternalQName> newMixin = new ArrayList<InternalQName>(mixinTypes.length + 1);
      List<ValueData> values = new ArrayList<ValueData>(mixinTypes.length + 1);

      for (int i = 0; i < mixinTypes.length; i++)
      {
         InternalQName cn = mixinTypes[i];
         newMixin.add(cn);
         values.add(new TransientValueData(cn));
      }
      newMixin.add(type.getName());
      values.add(new TransientValueData(type.getName()));
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.