Package org.exist.storage.md

Examples of org.exist.storage.md.Metas


  /* (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;

        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]);
   
        } else {
            metas = MetaData.get().getMetas(XmldbURI.create( args[0].getStringValue() ));

        }
//    } else
//      throw new XPathException(this, "Unsupported type "+args[0].getItemType());
   
   
    if (metas == null)
      throw new XPathException(this, "No metadata found.");
   
    String key = args[1].getStringValue();

    if ("*".equals(key)) {
        metas.delete();
    } else {
        metas.delete(key);
    }
   
    return Sequence.EMPTY_SEQUENCE;
  }
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();
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;
    if (getSignature().getName().equals(NAME))
      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)
      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

    col.getDocuments(broker, childDocs, lockedDocuments, Lock.WRITE_LOCK);
   
    for (Iterator<DocumentImpl> itChildDocs = childDocs.getDocumentIterator(); itChildDocs.hasNext();) {
      DocumentImpl childDoc = itChildDocs.next();
     
      Metas metas = md.addMetas(childDoc);
     
      if (metas != null) {
          //XXX: md.indexMetas(metas);
          ;
      }
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;
   
    if (getSignature().getName().equals(NAME))
      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)
      throw new XPathException(this, "No metadata found.");

    ValueSequence returnSeq = new ValueSequence();
   
    for (Meta meta : metas.metas()) {
      returnSeq.add(new StringValue(meta.getKey()));
    }
    return returnSeq;
  }
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;
    if (getSignature().getName().equals(NAME))
      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)
      throw new XPathException(this, "No metadata found.");

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

TOP

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

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.