Examples of XMPPath


Examples of com.adobe.xmp.impl.xpath.XMPPath

      startNode = xmp.getRoot();
    }
    else if (baseSchema  &&  baseProperty)
    {
      // Schema and property node provided
      XMPPath path = XMPPathParser.expandXPath(schemaNS, propPath);
     
      // base path is the prop path without the property leaf
      XMPPath basePath = new XMPPath();
      for (int i = 0; i < path.size() - 1; i++)
      {
        basePath.add(path.getSegment(i));
      }
     
      startNode = XMPNodeUtils.findNode(xmp.getRoot(), path, false, null);
      baseNS = schemaNS;
      initialPath = basePath.toString();
    }
    else if (baseSchema  &&  !baseProperty)
    {
      // Only Schema provided
      startNode = XMPNodeUtils.findSchemaNode(xmp.getRoot(), schemaNS, false);
View Full Code Here

Examples of com.adobe.xmp.impl.xpath.XMPPath

      }
     
      if (Utils.checkUUIDFormat(nameStr))
      { 
        // move UUID to xmpMM:InstanceID and remove it from the root node
        XMPPath path = XMPPathParser.expandXPath(XMPConst.NS_XMP_MM, "InstanceID");
        XMPNode idNode = XMPNodeUtils.findNode (tree, path, true, null);
        if (idNode != null)
        {
          idNode.setOptions(null)// Clobber any existing xmpMM:InstanceID.
          idNode.setValue("uuid:" + nameStr);
View Full Code Here

Examples of com.adobe.xmp.impl.xpath.XMPPath

      String fieldName) throws XMPException
  {
    assertFieldNS(fieldNS);
    assertFieldName(fieldName);
   
    XMPPath fieldPath = XMPPathParser.expandXPath(fieldNS, fieldName);
    if (fieldPath.size() != 2)
    {
      throw new XMPException("The field name must be simple", XMPError.BADXPATH);
    }
   
    return '/' + fieldPath.getSegment(XMPPath.STEP_ROOT_PROP).getName();
  }
View Full Code Here

Examples of com.adobe.xmp.impl.xpath.XMPPath

      String qualName) throws XMPException
  {
    assertQualNS(qualNS);
    assertQualName(qualName);
   
    XMPPath qualPath = XMPPathParser.expandXPath(qualNS, qualName);
    if (qualPath.size() != 2)
    {
      throw new XMPException("The qualifier name must be simple", XMPError.BADXPATH);
    }

    return "/?" + qualPath.getSegment(XMPPath.STEP_ROOT_PROP).getName();
  }
View Full Code Here

Examples of com.adobe.xmp.impl.xpath.XMPPath

   * @throws XMPException Thrown if the path to create is not valid.
   */
  public static String composeFieldSelector(String arrayName, String fieldNS,
      String fieldName, String fieldValue) throws XMPException
  {
    XMPPath fieldPath = XMPPathParser.expandXPath(fieldNS, fieldName);
    if (fieldPath.size() != 2)
    {
      throw new XMPException("The fieldName name must be simple", XMPError.BADXPATH);
    }
   
    return arrayName + '[' + fieldPath.getSegment(XMPPath.STEP_ROOT_PROP).getName() +
      "=\"" + fieldValue + "\"]";
  }
View Full Code Here

Examples of com.adobe.xmp.impl.xpath.XMPPath

    XMPNode arrayNode = null;
    XMPNode currItem = null;

    // Return an empty result if the array does not exist,
    // hurl if it isn't the right form.
    XMPPath arrayPath = XMPPathParser.expandXPath(schemaNS, arrayName);
    arrayNode = XMPNodeUtils.findNode(xmpImpl.getRoot(), arrayPath, false, null);
    if (arrayNode == null)
    {
      return "";
    }
View Full Code Here

Examples of com.adobe.xmp.impl.xpath.XMPPath

      throw new XMPException("Options can only provide array form", XMPError.BADOPTIONS);
    }

    // Find the array node, make sure it is OK. Move the current children
    // aside, to be readded later if kept.
    XMPPath arrayPath = XMPPathParser.expandXPath(schemaNS, arrayName);
    XMPNode arrayNode = XMPNodeUtils.findNode(xmp.getRoot(), arrayPath, false, null);
    if (arrayNode != null)
    {
      // The array exists, make sure the form is compatible. Zero
      // arrayForm means take what exists.
View Full Code Here

Examples of com.adobe.xmp.impl.xpath.XMPPath

      {
        throw new XMPException("Property name requires schema namespace",
          XMPError.BADPARAM);
      }

      XMPPath expPath = XMPPathParser.expandXPath(schemaNS, propName);

      XMPNode propNode = XMPNodeUtils.findNode(xmpImpl.getRoot(), expPath, false, null);
      if (propNode != null)
      {
        if (doAllProperties
            || !Utils.isInternalProperty(expPath.getSegment(XMPPath.STEP_SCHEMA)
                .getName(), expPath.getSegment(XMPPath.STEP_ROOT_PROP).getName()))
        {
          XMPNode parent = propNode.getParent();
          parent.removeChild(propNode);
          if (parent.getOptions().isSchemaNode()  &&  !parent.hasChildren())
          {
            // remove empty schema node
            parent.getParent().removeChild(parent);
          }
           
        }
      }
    }
    else if (schemaNS != null && schemaNS.length() > 0)
    {

      // Remove all properties from the named schema. Optionally include
      // aliases, in which case
      // there might not be an actual schema node.

      // XMP_NodePtrPos schemaPos;
      XMPNode schemaNode = XMPNodeUtils.findSchemaNode(xmpImpl.getRoot(), schemaNS, false);
      if (schemaNode != null)
      {
        if (removeSchemaChildren(schemaNode, doAllProperties))
        {
          xmpImpl.getRoot().removeChild(schemaNode);
        }
      }

      if (includeAliases)
      {
        // We're removing the aliases also. Look them up by their
        // namespace prefix.
        // But that takes more code and the extra speed isn't worth it.
        // Lookup the XMP node
        // from the alias, to make sure the actual exists.

        XMPAliasInfo[] aliases = XMPMetaFactory.getSchemaRegistry().findAliases(schemaNS);
        for (int i = 0; i < aliases.length; i++)
        {
          XMPAliasInfo info = aliases[i];
          XMPPath path = XMPPathParser.expandXPath(info.getNamespace(), info
              .getPropName());
          XMPNode actualProp = XMPNodeUtils
              .findNode(xmpImpl.getRoot(), path, false, null);
          if (actualProp != null)
          {
View Full Code Here

Examples of com.adobe.xmp.impl.xpath.XMPPath


    // Locate or create the array. If it already exists, make sure the array
    // form from the options
    // parameter is compatible with the current state.
    XMPPath arrayPath = XMPPathParser.expandXPath(schemaNS, arrayName);


    // Just lookup, don't try to create.
    XMPNode arrayNode = XMPNodeUtils.findNode(tree, arrayPath, false, null);
View Full Code Here

Examples of com.adobe.xmp.impl.xpath.XMPPath

  public int countArrayItems(String schemaNS, String arrayName) throws XMPException
  {
    ParameterAsserts.assertSchemaNS(schemaNS);
    ParameterAsserts.assertArrayName(arrayName);

    XMPPath arrayPath = XMPPathParser.expandXPath(schemaNS, arrayName);
    XMPNode arrayNode = XMPNodeUtils.findNode(tree, arrayPath, false, null);

    if (arrayNode == null)
    {
      return 0;
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.