Package org.exist.storage.md

Examples of org.exist.storage.md.Meta


   */
  public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
    Metas metas = null;

        if (args.length == 1) {
            Meta meta = MetaData.get().getMeta(args[0].getStringValue());
            meta.delete();
            return Sequence.EMPTY_SEQUENCE;
       
        } else if (args[0] instanceof DocumentImpl) {
      metas = MetaData.get().getMetas((DocumentImpl)args[0]);
   
View Full Code Here


  /* (non-Javadoc)
   * @see org.exist.xquery.BasicFunction#eval(org.exist.xquery.value.Sequence[], org.exist.xquery.value.Sequence)
   */
  public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
    Metas metas = null;
    Meta meta = null;
   
    if (getSignature().getName().equals(NAME))
      if (args.length == 1) {
        meta = MetaData.get().getMeta(args[0].getStringValue());

      } else {
        if (args[0] instanceof DocumentImpl) {
          metas = MetaData.get().getMetas(((DocumentImpl)args[0]));
         
        } else
          throw new XPathException(this, "Unsupported type "+args[0].getItemType());
      }
   
    else if (getSignature().getName().equals(NAME_URL))
      metas = MetaData.get().getMetas(XmldbURI.create(args[0].getStringValue()));
   
    if (metas == null && meta == null)
      throw new XPathException(this, "No metadata found.");

    if (meta == null)
      meta = metas.get(args[1].getStringValue());
   
    if (meta == null)
        return Sequence.EMPTY_SEQUENCE;

    ValueSequence returnSeq = new ValueSequence();
   
    if (meta.getValue() instanceof DocumentImpl) {
      returnSeq.add( new NodeProxy( (DocumentImpl) meta.getValue() ) );
   
    } else {
      returnSeq.add(new StringValue(meta.getValue().toString()));
    }

    return returnSeq;
  }
View Full Code Here

      metas = MetaData.get().getMetas(XmldbURI.create(args[0].getStringValue()));
   
    if (metas == null)
      throw new XPathException(this, "No metadata found.");

    Meta meta;
    if (args[2] instanceof DocumentImpl)
      meta = metas.put(args[1].getStringValue(), args[2]);
    else
      meta = metas.put(args[1].getStringValue(), args[2].getStringValue());

    ValueSequence returnSeq = new ValueSequence();
    returnSeq.add(new StringValue(meta.getUUID()));
    return returnSeq;
  }
View Full Code Here

TOP

Related Classes of org.exist.storage.md.Meta

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.