Package org.exoplatform.services.jcr.datamodel

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


               QPath pathValue = locationFactory.parseJCRPath(value.getString()).getInternalPath();
               pvd = new TransientValueData(pathValue);
            }
            return pvd;
         case PropertyType.NAME :
            InternalQName nameValue = locationFactory.parseJCRName(value.getString()).getInternalName();
            return new TransientValueData(nameValue);
         case PropertyType.REFERENCE :
            Identifier identifier = new Identifier(value.getString());
            return new TransientValueData(identifier);
         case ExtendedPropertyType.PERMISSION :
View Full Code Here


            {
               log.warn("null value found at property " + prop.getQPath().getAsString());
            }

            ExtendedValue val = null;
            InternalQName name = prop.getQPath().getName();

            for (ValueData value : data)
            {
               val = (ExtendedValue)vFactory.loadValue(value, propType);

               switch (propType)
               {
                  case PropertyType.BOOLEAN :
                     if (isIndexed(name))
                     {
                        addBooleanValue(doc, fieldName, Boolean.valueOf(val.getBoolean()));
                     }
                     break;
                  case PropertyType.DATE :
                     if (isIndexed(name))
                     {
                        addCalendarValue(doc, fieldName, val.getDate());
                     }
                     break;
                  case PropertyType.DOUBLE :
                     if (isIndexed(name))
                     {
                        addDoubleValue(doc, fieldName, new Double(val.getDouble()));
                     }
                     break;
                  case PropertyType.LONG :
                     if (isIndexed(name))
                     {
                        addLongValue(doc, fieldName, new Long(val.getLong()));
                     }
                     break;
                  case PropertyType.REFERENCE :
                     if (isIndexed(name))
                     {
                        addReferenceValue(doc, fieldName, val.getString());
                     }
                     break;
                  case PropertyType.PATH :
                     if (isIndexed(name))
                     {
                        addPathValue(doc, fieldName, val.getString());
                     }
                     break;
                  case PropertyType.STRING :
                     if (isIndexed(name))
                     {
                        // never fulltext index jcr:uuid String
                        if (name.equals(Constants.JCR_UUID))
                        {
                           addStringValue(doc, fieldName, val.getString(), false, false, DEFAULT_BOOST);
                        }
                        else
                        {
                           addStringValue(doc, fieldName, val.getString(), true, isIncludedInNodeIndex(name),
                              getPropertyBoost(name), useInExcerpt(name));
                        }
                     }
                     break;
                  case PropertyType.NAME :
                     // jcr:primaryType and jcr:mixinTypes are required for correct
                     // node type resolution in queries
                     if (isIndexed(name) || name.equals(Constants.JCR_PRIMARYTYPE)
                        || name.equals(Constants.JCR_MIXINTYPES))
                     {
                        addNameValue(doc, fieldName, val.getString());
                     }
                     break;
                  case ExtendedPropertyType.PERMISSION :
View Full Code Here

      //            // is running in a cluster.
      //            throw new RepositoryException(
      //                    "Missing child node entry for node with id: "
      //                    + node.getNodeId());
      //        }
      InternalQName name = node.getQPath().getName();
      addNodeName(doc, name.getNamespace(), name.getName());
   }
View Full Code Here

            {
               log.warn("null value found at property " + prop.getQPath().getAsString());
            }

            ExtendedValue val = null;
            InternalQName name = prop.getQPath().getName();

            for (ValueData value : data)
            {
               val = (ExtendedValue)vFactory.loadValue(value, propType);

               switch (propType)
               {
                  case PropertyType.BOOLEAN :
                     if (isIndexed(name))
                     {
                        addBooleanValue(doc, fieldName, Boolean.valueOf(val.getBoolean()));
                     }
                     break;
                  case PropertyType.DATE :
                     if (isIndexed(name))
                     {
                        addCalendarValue(doc, fieldName, val.getDate());
                     }
                     break;
                  case PropertyType.DOUBLE :
                     if (isIndexed(name))
                     {
                        addDoubleValue(doc, fieldName, new Double(val.getDouble()));
                     }
                     break;
                  case PropertyType.LONG :
                     if (isIndexed(name))
                     {
                        addLongValue(doc, fieldName, new Long(val.getLong()));
                     }
                     break;
                  case PropertyType.REFERENCE :
                     if (isIndexed(name))
                     {
                        addReferenceValue(doc, fieldName, val.getString());
                     }
                     break;
                  case PropertyType.PATH :
                     if (isIndexed(name))
                     {
                        addPathValue(doc, fieldName, val.getString());
                     }
                     break;
                  case PropertyType.STRING :
                     if (isIndexed(name))
                     {
                        // never fulltext index jcr:uuid String
                        if (name.equals(Constants.JCR_UUID))
                        {
                           addStringValue(doc, fieldName, val.getString(), false, false, DEFAULT_BOOST);
                        }
                        else
                        {
                           addStringValue(doc, fieldName, val.getString(), true, isIncludedInNodeIndex(name),
                              getPropertyBoost(name), useInExcerpt(name));
                        }
                     }
                     break;
                  case PropertyType.NAME :
                     // jcr:primaryType and jcr:mixinTypes are required for correct
                     // node type resolution in queries
                     if (isIndexed(name) || name.equals(Constants.JCR_PRIMARYTYPE)
                        || name.equals(Constants.JCR_MIXINTYPES))
                     {
                        addNameValue(doc, fieldName, val.getString());
                     }
                     break;
                  case ExtendedPropertyType.PERMISSION :
View Full Code Here

      //            // is running in a cluster.
      //            throw new RepositoryException(
      //                    "Missing child node entry for node with id: "
      //                    + node.getNodeId());
      //        }
      InternalQName name = node.getQPath().getName();
      addNodeName(doc, name.getNamespace(), name.getName());
   }
View Full Code Here

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

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

   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 =
View Full Code Here

   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();
         // 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,
View Full Code Here

               }
               return;
            }

            ExtendedValue val = null;
            InternalQName name = prop.getQPath().getName();

            for (ValueData value : data)
            {
               val = (ExtendedValue)vFactory.loadValue(value, propType);

               switch (propType)
               {
                  case PropertyType.BOOLEAN :
                     if (isIndexed(name))
                     {
                        addBooleanValue(doc, fieldName, Boolean.valueOf(val.getBoolean()));
                     }
                     break;
                  case PropertyType.DATE :
                     if (isIndexed(name))
                     {
                        addCalendarValue(doc, fieldName, val.getDate());
                     }
                     break;
                  case PropertyType.DOUBLE :
                     if (isIndexed(name))
                     {
                        addDoubleValue(doc, fieldName, new Double(val.getDouble()));
                     }
                     break;
                  case PropertyType.LONG :
                     if (isIndexed(name))
                     {
                        addLongValue(doc, fieldName, new Long(val.getLong()));
                     }
                     break;
                  case PropertyType.REFERENCE :
                     if (isIndexed(name))
                     {
                        addReferenceValue(doc, fieldName, val.getString());
                     }
                     break;
                  case PropertyType.PATH :
                     if (isIndexed(name))
                     {
                        addPathValue(doc, fieldName, val.getString());
                     }
                     break;
                  case PropertyType.STRING :
                     if (isIndexed(name))
                     {
                        // never fulltext index jcr:uuid String
                        if (name.equals(Constants.JCR_UUID))
                        {
                           addStringValue(doc, fieldName, val.getString(), false, false, DEFAULT_BOOST);
                        }
                        else
                        {
                           addStringValue(doc, fieldName, val.getString(), true, isIncludedInNodeIndex(name),
                              getPropertyBoost(name), useInExcerpt(name));
                        }
                     }
                     break;
                  case PropertyType.NAME :
                     // jcr:primaryType and jcr:mixinTypes are required for correct
                     // node type resolution in queries
                     if (isIndexed(name) || name.equals(Constants.JCR_PRIMARYTYPE)
                        || name.equals(Constants.JCR_MIXINTYPES))
                     {
                        addNameValue(doc, fieldName, val.getString());
                     }
                     break;
                  case ExtendedPropertyType.PERMISSION :
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.