Using a custom mashup merger

You can define and register a custom mashup merger by following the procedure provided in this topic.


  1. Create a custom mashup merger class to create a map of repeating element names and unique identifiers. Refer to the following sample code:
    import org.w3c.dom.Element;
    import com.sterlingcommerce.framework.utils.SCXmlUtils;
    import com.sterlingcommerce.ui.web.framework.extensions.ISCUIMashupMerger;
    public class SCUIXAPICustomMashupMerger implements ISCUIMashupMerger {
    	public void mergeMashupElement(Element parentMashupElement, Element extnMashupElement) {
    		// dbMap Contains, Key is the repeating element node name and Value is the unique key attribute name of that node name under to/target Element.
    		HashMap<String, String> dbMap = new HashMap<String, String>();
    		dbMap.put("Exp", "Name");
    		dbMap.put("Modification", "ModificationType");
    		SCXmlUtils.mergeElement(extnMashupElement, parentMashupElement, false, dbMap);
  2. Create a servlet to load and register it as the default mashup merger class for XAPI. Refer to the following sample code:
    import com.sterlingcommerce.ui.web.framework.helpers.SCUIMashupHelper;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    public class MashupMergerInitServlet extends HttpServlet {
    	private static final long serialVersionUID = 2693427927837832487L;
    	public synchronized void init(ServletConfig config) throws ServletException {
    		SCUIMashupHelper.addMashupMerger("XAPI", "",  config.getServletContext());
  3. Compile the classes and package them into a JAR file. Place the JAR file in the <INSTALL_DIR>/repository/eardata/<package-name>/extn/WEB-INF/lib folder. You may need to create the WEB-INF/lib folders.
  4. Navigate to <INSTALL_DIR>/repository/eardata/<package-name>/extn folder.
  5. Rename the web.xml.sample file to web.xml and add the following entry only:
    <web-app version="2.4" xmlns=""
        xmlns:xsi="" xsi:schemaLocation="">
  6. Rebuild the application EAR or WAR.