web.switch-mediator.edit-mediator.jsp Maven / Gradle / Ivy
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %>
<%@ page import="org.wso2.carbon.mediator.service.ui.Mediator" %>
<%@ page import="org.wso2.carbon.mediator.switchm.SwitchDefaultMediator" %>
<%@ page import="org.wso2.carbon.mediator.switchm.SwitchMediator" %>
<%@ page import="org.wso2.carbon.sequences.ui.util.SequenceEditorHelper" %>
<%@ page import="org.wso2.carbon.sequences.ui.util.ns.NameSpacesRegistrar" %>
<%@ page import="java.util.List" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib uri="http://wso2.org/projects/carbon/taglibs/carbontags.jar" prefix="carbon" %>
<%
Mediator mediator = SequenceEditorHelper.getEditingMediator(request, session);
if (!(mediator instanceof SwitchMediator)) {
// todo : proper error handling
throw new RuntimeException("Unable to edit the mediator");
}
SwitchMediator switchMediator = (SwitchMediator) mediator;
boolean defaultPresent = false;
List mediatorList = switchMediator.getList();
for (Mediator aMediator : mediatorList) {
if (aMediator instanceof SwitchDefaultMediator) {
defaultPresent = true;
break;
}
}
int noOfCases = mediatorList.size();
if (defaultPresent) {
noOfCases = noOfCases - 1;
}
%>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy