Search in sources :

Example 16 with MCRBinding

use of org.mycore.frontend.xeditor.MCRBinding in project mycore by MyCoRe-Org.

the class MCRSwapInsertTarget method handle.

public void handle(String swapParameter, MCRBinding root) throws JaxenException, JDOMException {
    String[] tokens = swapParameter.split("\\|");
    String parentXPath = tokens[0];
    String posString = tokens[1];
    int pos = Integer.parseInt(posString);
    String method = tokens[2];
    String elementNameWithPredicates = swapParameter.substring(parentXPath.length() + posString.length() + method.length() + 3);
    MCRBinding parentBinding = new MCRBinding(parentXPath, false, root);
    MCRRepeatBinding repeatBinding = new MCRRepeatBinding(elementNameWithPredicates, parentBinding, method);
    handle(pos, repeatBinding);
    repeatBinding.detach();
    parentBinding.detach();
}
Also used : MCRRepeatBinding(org.mycore.frontend.xeditor.MCRRepeatBinding) MCRBinding(org.mycore.frontend.xeditor.MCRBinding)

Aggregations

MCRBinding (org.mycore.frontend.xeditor.MCRBinding)16 Element (org.jdom2.Element)9 Document (org.jdom2.Document)8 Test (org.junit.Test)8 MCRNodeBuilder (org.mycore.common.xml.MCRNodeBuilder)8 MCRRepeatBinding (org.mycore.frontend.xeditor.MCRRepeatBinding)7 Attribute (org.jdom2.Attribute)2 MCRXPathEvaluator (org.mycore.common.xml.MCRXPathEvaluator)1