Package org.exoplatform.services.jcr.datamodel

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


         }
      }

      AccessControlList acl = new AccessControlList(owner, accessList);

      InternalQName ptName = null;
      try
      {
         ptName = InternalQName.parse(new String(frozenPrimaryType.getValues().get(0).getAsByteArray()));
      }
      catch (IllegalNameException e)
View Full Code Here


      if (log.isDebugEnabled())
      {
         log.debug("Visit node " + frozen.getQPath().getAsString() + ", HAS NULL FROZEN NODE");
      }

      InternalQName qname = frozen.getQPath().getName();

      if (qname.equals(Constants.JCR_FROZENNODE) && level == 0)
      {
         // child props/nodes will be restored
         if (log.isDebugEnabled())
         {
            log.debug("jcr:frozenNode " + frozen.getQPath().getAsString());
View Full Code Here

      // TODO what to do if REFERENCE property target doesn't exists in workspace
      if (currentNode() != null)
      {
         NodeData frozenParent = (NodeData)dataManager.getItemData(property.getParentIdentifier());

         InternalQName qname = property.getQPath().getName();

         if (nodeTypeDataManager.isNodeType(Constants.NT_FROZENNODE, frozenParent.getPrimaryTypeName()))
            if (qname.equals(Constants.JCR_FROZENPRIMARYTYPE))
            {
               qname = Constants.JCR_PRIMARYTYPE;
            }
            else if (qname.equals(Constants.JCR_FROZENUUID))
            {
               qname = Constants.JCR_UUID;
            }
            else if (qname.equals(Constants.JCR_FROZENMIXINTYPES))
            {
               qname = Constants.JCR_MIXINTYPES;
            }
            else if (qname.equals(Constants.JCR_PRIMARYTYPE) || qname.equals(Constants.JCR_UUID)
               || qname.equals(Constants.JCR_MIXINTYPES))
            {
               // skip these props, as they are a nt:frozenNode special props
               return;
            }

         int action =
            nodeTypeDataManager.getPropertyDefinitions(qname, currentNode().getPrimaryTypeName(),
               currentNode().getMixinTypeNames()).getAnyDefinition().getOnParentVersion();

         if (log.isDebugEnabled())
         {
            log.debug("Visit property " + property.getQPath().getAsString() + " "
               + currentNode().getQPath().getAsString() + " " + OnParentVersionAction.nameFromValue(action));
         }

         if (action == OnParentVersionAction.COPY || action == OnParentVersionAction.VERSION
            || action == OnParentVersionAction.INITIALIZE || action == OnParentVersionAction.COMPUTE)
         {
            // In case of COPY, VERSION - copy property

            PropertyData tagetProperty = null;
            if (qname.equals(Constants.JCR_PREDECESSORS))
            {
               tagetProperty =
                  TransientPropertyData.createPropertyData(currentNode(), qname, property.getType(), property
                     .isMultiValued(), new ArrayList<ValueData>());
            }
View Full Code Here

   }

   @Override
   protected void leaving(NodeData frozen, int level) throws RepositoryException
   {
      InternalQName qname = frozen.getQPath().getName();

      if (qname.equals(Constants.JCR_FROZENNODE) && level == 0)
      {

         if (log.isDebugEnabled())
         {
            log.debug("leaving jcr:frozenNode " + frozen.getQPath().getAsString());
View Full Code Here

      checkValid();

      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

         throw new PathNotFoundException("Parent not found for " + itemPath.getAsString(true));
      if (!parentItem.isNode())
         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

         throw new PathNotFoundException("Parent not found for " + itemPath.getAsString(true));
      if (!parentItem.isNode())
         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

      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

         { // root - no parent
            if (nodeDefinition == null)
            {
               NodeType required =
                  nodeTypeManager.getNodeType(locationFactory.createJCRName(Constants.NT_BASE).getAsString());
               InternalQName requiredName = sysLocFactory.parseJCRName(required.getName()).getInternalName();
               NodeDefinitionData ntData =
                  new NodeDefinitionData(null, null, true, true, OnParentVersionAction.ABORT, false,
                     new InternalQName[]{requiredName}, null, true);
               this.nodeDefinition =
                  new NodeDefinitionImpl(ntData, nodeTypesHolder, nodeTypeManager, sysLocFactory,
View Full Code Here

   {

      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

TOP

Related Classes of org.exoplatform.services.jcr.datamodel.InternalQName

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.