Package org.fao.geonet.kernel

Examples of org.fao.geonet.kernel.EditLib.findElement()


            if (at != -1) {
                attribute = ref.substring(at + 1);
                ref = ref.substring(0, at);
            }
           
            Element el = editLib.findElement(md, ref);
            if (el == null) {
                Log.error(Geonet.EDITOR, EditLib.MSG_ELEMENT_NOT_FOUND_AT_REF + ref);
                continue;
            }
           
View Full Code Here


    //--- get metadata from session
    Element md = getMetadataFromSession(session, id);

    //--- ref is parent element so find it
    EditLib editLib = dataManager.getEditLib();
        Element el = editLib.findElement(md, ref);
    if (el == null)
      throw new IllegalStateException(EditLib.MSG_ELEMENT_NOT_FOUND_AT_REF + ref);

    //--- locate the geonet:element and geonet:info elements and clone for
    //--- later re-use
View Full Code Here

    Element info = (Element)(md.getChild(Edit.RootChild.INFO,Edit.NAMESPACE)).clone();
    md.removeChild(Edit.RootChild.INFO,Edit.NAMESPACE);

    //--- get element to remove
        EditLib editLib = dataManager.getEditLib();
    Element el = editLib.findElement(md, ref);

    if (el == null)
      throw new IllegalStateException(EditLib.MSG_ELEMENT_NOT_FOUND_AT_REF + ref);

View Full Code Here

    //--- get metadata from session
    Element md = getMetadataFromSession(session, id);

    //--- get element to remove
        EditLib editLib = dataManager.getEditLib();
    Element el = editLib.findElement(md, elementId);

    if (el != null) {
        Pair<Namespace, String> attInfo = parseAttributeName(attributeName, ":", id, md, editLib);
        el.removeAttribute(attInfo.two(), attInfo.one());
    }
View Full Code Here

    //--- get metadata from session
    Element md = getMetadataFromSession(session, id);

    //--- get element to swap
        EditLib editLib = dataManager.getEditLib();
    Element elSwap = editLib.findElement(md, ref);

    if (elSwap == null)
      throw new IllegalStateException(EditLib.MSG_ELEMENT_NOT_FOUND_AT_REF + ref);

    //--- swap the elements
View Full Code Here

    //--- check if the metadata has been modified from last time
    if (currVersion != null && !editLib.getVersion(id).equals(currVersion))
      return false;

    //--- get element to add
    Element el = editLib.findElement(md, ref);

    if (el == null)
      Log.error(Geonet.DATA_MANAGER, EditLib.MSG_ELEMENT_NOT_FOUND_AT_REF + ref);
      //throw new IllegalStateException("Element not found at ref = " + ref);
View Full Code Here

    //--- check if the metadata has been modified from last time
    if (currVersion != null && !editLib.getVersion(id).equals(currVersion))
      return false;

    //--- get element to remove
    Element el = editLib.findElement(md, ref);

    if (el == null)
      throw new IllegalStateException(EditLib.MSG_ELEMENT_NOT_FOUND_AT_REF + ref);

    //--- remove editing info added by previous call
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.