Examples of ImportNodeData


Examples of org.exoplatform.services.jcr.impl.xml.importing.dataflow.ImportNodeData

         ImportPropertyData propertyData = endProperty();
         if (propertyData != null)
         {
            changesLog.add(new ItemState(propertyData, ItemState.ADDED, true, getAncestorToSave()));

            ImportNodeData currentNodeInfo = (ImportNodeData)getParent();

            NodePropertiesInfo currentNodePropertiesInfo = mapNodePropertiesInfo.get(currentNodeInfo.getIdentifier());

            currentNodePropertiesInfo.addProperty(propertyData);
         }
      }
      else if (Constants.SV_VALUE_NAME.equals(elementName))
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.xml.importing.dataflow.ImportNodeData

         {
            currentNodeName = locationFactory.parseJCRName(svName).getInternalName();
         }

         int nodeIndex = getNodeIndex(parentData, currentNodeName, null);
         ImportNodeData newNodeData = new ImportNodeData(parentData, currentNodeName, nodeIndex);
         // preset of ACL
         newNodeData.setACL(parentData.getACL());
         newNodeData.setOrderNumber(getNextChildOrderNum(parentData));
         newNodeData.setIdentifier(IdGenerator.generate());

         changesLog.add(new ItemState(newNodeData, ItemState.ADDED, true, getAncestorToSave()));

         mapNodePropertiesInfo.put(newNodeData.getIdentifier(), new NodePropertiesInfo(newNodeData));

         tree.push(newNodeData);

      }
      else if (Constants.SV_PROPERTY_NAME.equals(elementName))
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.xml.importing.dataflow.ImportNodeData

      NoSuchNodeTypeException
   {
      ImportPropertyData propertyData;
      InternalQName[] mixinNames = new InternalQName[propertyInfo.getValuesSize()];
      List<ValueData> values = new ArrayList<ValueData>(propertyInfo.getValuesSize());
      ImportNodeData currentNodeInfo = (ImportNodeData)getParent();
      for (int i = 0; i < propertyInfo.getValuesSize(); i++)
      {

         String value = propertyInfo.getValues().get(i).toString();

         mixinNames[i] = locationFactory.parseJCRName(value).getInternalName();
         currentNodeInfo.addNodeType((nodeTypeDataManager.getNodeType(mixinNames[i])));
         values.add(new TransientValueData(value.toString()));
      }

      currentNodeInfo.setMixinTypeNames(mixinNames);

      propertyData =
         new ImportPropertyData(QPath.makeChildPath(currentNodeInfo.getQPath(), propertyInfo.getName()),
            propertyInfo.getIndentifer(), -1, propertyInfo.getType(), currentNodeInfo.getIdentifier(), true);

      propertyData.setValues(parseValues());
      return propertyData;
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.xml.importing.dataflow.ImportNodeData

    *
    * @throws RepositoryException
    */
   private void endNode() throws RepositoryException
   {
      ImportNodeData currentNodeInfo = (ImportNodeData)tree.pop();

      NodePropertiesInfo currentNodePropertiesInfo = mapNodePropertiesInfo.get(currentNodeInfo.getIdentifier());

      if (currentNodePropertiesInfo != null)
      {
         checkProperties(currentNodePropertiesInfo);
      }

      mapNodePropertiesInfo.remove(currentNodeInfo.getIdentifier());

      currentNodeInfo.setMixinTypeNames(currentNodeInfo.getMixinTypeNames());

      if (currentNodeInfo.isMixVersionable())
      {
         createVersionHistory(currentNodeInfo);
      }

      currentNodeInfo.setACL(ACLInitializationHelper.initAcl(currentNodeInfo.getACL(), currentNodeInfo.getExoOwner(),
         currentNodeInfo.getExoPrivileges()));
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.xml.importing.dataflow.ImportNodeData

   {
      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();
         // nodeTypeDataManager.findChildNodeDefinition(primaryTypeName,)

         // check is nt:versionedChild subnode of frozenNode
         if (nodeData.getQPath().getDepth() > 6 && primaryTypeName.equals(Constants.NT_VERSIONEDCHILD)
            && nodeData.getQPath().getEntries()[5].equals(Constants.JCR_FROZENNODE))
         {
            //do nothing
         }
         else if (!nodeTypeDataManager.isChildNodePrimaryTypeAllowed(primaryTypeName,
            parentNodeData.getPrimaryTypeName(), parentNodeData.getMixinTypeNames()))
         {
            throw new ConstraintViolationException("Can't add node " + nodeData.getQName().getAsString() + " to "
               + parentNodeData.getQPath().getAsString() + " node type " + sName
               + " is not allowed as child's node type for parent node type "
               + parentNodeData.getPrimaryTypeName().getAsString());
         }
      }
      //
      nodeData.addNodeType((nodeTypeDataManager.getNodeType(primaryTypeName)));
      nodeData.setPrimaryTypeName(primaryTypeName);

      propertyData =
         new ImportPropertyData(QPath.makeChildPath(nodeData.getQPath(), propertyInfo.getName()),
            propertyInfo.getIndentifer(), -1, propertyInfo.getType(), nodeData.getIdentifier(), false);

      propertyData.setValues(parseValues());

      tree.push(nodeData);
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.xml.importing.dataflow.ImportNodeData

         endVersionable((ImportNodeData)getParent(), parseValues());
      }
      else
      {

         ImportNodeData currentNodeInfo = (ImportNodeData)getParent();
         List<ValueData> values = parseValues();

         // determinating is property multivalue;
         boolean isMultivalue = true;

         PropertyDefinitionDatas defs =
            nodeTypeDataManager.getPropertyDefinitions(propertyInfo.getName(), currentNodeInfo.getPrimaryTypeName(),
               currentNodeInfo.getMixinTypeNames());

         if (defs == null)
         {
            if (!((Boolean)context.get(ContentImporter.RESPECT_PROPERTY_DEFINITIONS_CONSTRAINTS)))
            {
               log.warn("Property definition not found for " + propertyInfo.getName());
               return null;
            }
            else
               throw new RepositoryException("Property definition not found for " + propertyInfo.getName());

         }

         if (values.size() == 1)
         {
            // there is single-value defeniton
            if (defs.getDefinition(false) != null)
            {
               isMultivalue = false;
            }
         }
         else
         {
            if ((defs.getDefinition(true) == null) && (defs.getDefinition(false) != null))
            {
               throw new ValueFormatException("Can not assign multiple-values " + "Value to a single-valued property "
                  + propertyInfo.getName().getName());
            }
         }
         log.debug("Import " + propertyInfo.getName().getName() + " size=" + propertyInfo.getValuesSize()
            + " isMultivalue=" + isMultivalue);

         propertyData =
            new ImportPropertyData(QPath.makeChildPath(currentNodeInfo.getQPath(), propertyInfo.getName()),
               propertyInfo.getIndentifer(), -1, propertyInfo.getType(), currentNodeInfo.getIdentifier(), isMultivalue);
         propertyData.setValues(values);

      }

      return propertyData;
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.xml.importing.dataflow.ImportNodeData

    * @throws IllegalPathException
    */
   private ImportPropertyData endUuid() throws RepositoryException, PathNotFoundException, IllegalPathException
   {
      ImportPropertyData propertyData;
      ImportNodeData currentNodeInfo = (ImportNodeData)tree.pop();

      currentNodeInfo.setMixReferenceable(nodeTypeDataManager.isNodeType(Constants.MIX_REFERENCEABLE,
         currentNodeInfo.getPrimaryTypeName(), currentNodeInfo.getMixinTypeNames()));

      if (currentNodeInfo.isMixReferenceable())
      {
         currentNodeInfo.setMixVersionable(nodeTypeDataManager.isNodeType(Constants.MIX_VERSIONABLE,
            currentNodeInfo.getPrimaryTypeName(), currentNodeInfo.getMixinTypeNames()));
         checkReferenceable(currentNodeInfo, propertyInfo.getValues().get(0).toString());
      }

      propertyData =
         new ImportPropertyData(QPath.makeChildPath(currentNodeInfo.getQPath(), propertyInfo.getName()),
            propertyInfo.getIndentifer(), -1, propertyInfo.getType(), currentNodeInfo.getIdentifier(), false);

      if (currentNodeInfo.getQPath().isDescendantOf(Constants.JCR_VERSION_STORAGE_PATH))
      {
         propertyData.setValue(new TransientValueData(propertyInfo.getValues().get(0).toString()));
      }
      else
      {
         propertyData.setValue(new TransientValueData(currentNodeInfo.getIdentifier()));
      }

      tree.push(currentNodeInfo);

      mapNodePropertiesInfo.put(currentNodeInfo.getIdentifier(), new NodePropertiesInfo(currentNodeInfo));

      return propertyData;
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.xml.importing.dataflow.ImportNodeData

         }
      }

      if (propertyInfo.getType() == ExtendedPropertyType.PERMISSION)
      {
         ImportNodeData currentNodeInfo = (ImportNodeData)getParent();
         currentNodeInfo.setExoPrivileges(stringValues);
      }
      else if (Constants.EXO_OWNER.equals(propertyInfo.getName()))
      {
         ImportNodeData currentNodeInfo = (ImportNodeData)getParent();
         currentNodeInfo.setExoOwner(stringValues.get(0));
      }
      return values;

   }
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.xml.importing.dataflow.ImportNodeData

         {
            currentNodeName = locationFactory.parseJCRName(svName).getInternalName();
         }

         int nodeIndex = getNodeIndex(parentData, currentNodeName, null);
         ImportNodeData newNodeData = new ImportNodeData(parentData, currentNodeName, nodeIndex);
         // preset of ACL
         newNodeData.setACL(parentData.getACL());
         newNodeData.setOrderNumber(getNextChildOrderNum(parentData));
         newNodeData.setIdentifier(IdGenerator.generate());

         changesLog.add(new ItemState(newNodeData, ItemState.ADDED, true, getAncestorToSave()));

         tree.push(newNodeData);
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.xml.importing.dataflow.ImportNodeData

      NoSuchNodeTypeException
   {
      ImportPropertyData propertyData;
      InternalQName[] mixinNames = new InternalQName[propertyInfo.getValuesSize()];
      List<ValueData> values = new ArrayList<ValueData>(propertyInfo.getValuesSize());
      ImportNodeData currentNodeInfo = (ImportNodeData)getParent();
      for (int i = 0; i < propertyInfo.getValuesSize(); i++)
      {

         String value = propertyInfo.getValues().get(i).toString();

         mixinNames[i] = locationFactory.parseJCRName(value).getInternalName();
         currentNodeInfo.addNodeType((nodeTypeDataManager.getNodeType(mixinNames[i])));
         values.add(new TransientValueData(value.toString()));
      }

      currentNodeInfo.setMixinTypeNames(mixinNames);

      propertyData =
         new ImportPropertyData(QPath.makeChildPath(currentNodeInfo.getQPath(), propertyInfo.getName()), propertyInfo
            .getIndentifer(), 0, propertyInfo.getType(), currentNodeInfo.getIdentifier(), true);
      propertyData.setValues(parseValues());
      return propertyData;
   }
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.