All Downloads are FREE. Search and download functionalities are using the official Maven repository.

web.inbound.editInbound.jsp Maven / Gradle / Ivy

The newest version!

<%@page import="java.util.HashSet"%>
<%@page import="java.util.Set"%>
<%@page import="org.wso2.carbon.inbound.ui.internal.InboundDescription"%>
<%@page import="org.wso2.carbon.inbound.ui.internal.InboundManagementClient"%>
<%@page import="org.wso2.carbon.inbound.ui.internal.InboundClientConstants"%>
<%@page import="java.util.List"%>
<%@page import="java.util.Set"%>
<%@page import="java.util.HashSet"%>
<%@ page import="org.owasp.encoder.Encode" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib uri="http://wso2.org/projects/carbon/taglibs/carbontags.jar" prefix="carbon" %>





















    

    <% InboundManagementClient client;
        try {
            client = InboundManagementClient.getInstance(config, session);
            InboundDescription inboundDescription = client.getInboundDescription(request.getParameter("name"));
            String inboundTypeValue = inboundDescription.getType();
            boolean isMBbased = false;
            
            if (InboundClientConstants.TYPE_JMS.equalsIgnoreCase(inboundTypeValue)) {
            	if (inboundDescription.getParameters().containsKey("connectionfactory.QueueConnectionFactory")) {
            		isMBbased = true;
            		inboundTypeValue = InboundClientConstants.TYPE_WSO2MB;
            		String connectionURL = inboundDescription.getParameters().get("connectionfactory.QueueConnectionFactory");
            		inboundDescription.getParameters().put("wso2mb.connection.url", connectionURL);
            	} else if (inboundDescription.getParameters().containsKey("connectionfactory.TopicConnectionFactory")) {
            		isMBbased = true;
            		inboundTypeValue = InboundClientConstants.TYPE_WSO2MB;
            		String connectionURL = inboundDescription.getParameters().get("connectionfactory.TopicConnectionFactory");
            		inboundDescription.getParameters().put("wso2mb.connection.url", connectionURL);
            	}
            }
            
            ListdefaultParams = client.getDefaultParameters(inboundTypeValue);            
            ListadvParams = client.getAdvParameters(inboundTypeValue); 
            SetdefaultParamNames = new HashSet();
            String specialParams = client.getKAFKASpecialParameters();
            String topicListParams = client.getKAFKATopicListParameters();
            String firstSpecialParam = "";
    %>       
    
    

<% if(!(InboundClientConstants.TYPE_HTTP.equals(inboundDescription.getType()) || InboundClientConstants.TYPE_HTTPS.equals(inboundDescription.getType())) ) { %> <% } else { %> <% } %> <% if(InboundClientConstants.TYPE_CLASS.equals(inboundDescription.getType())){ %> <% } %> <%if(!defaultParams.isEmpty()){ %> <%} %> <% int ctr = -1; for(String defaultParamOri : defaultParams) { String [] arrParamOri = defaultParamOri.split(InboundClientConstants.STRING_SPLITTER); String defaultParam = arrParamOri[0].trim(); defaultParamNames.add(defaultParam); ctr++; %> <% } %> <% if(InboundClientConstants.TYPE_KAFKA.equals(inboundDescription.getType())){%> <%}%> <% if(InboundClientConstants.TYPE_CLASS.equals(inboundDescription.getType())){ %> <% int i = 0; for(String strKey : inboundDescription.getParameters().keySet()) { if(!defaultParamNames.contains(strKey)){ if (strKey.equalsIgnoreCase("inbound.behavior")) { if(inboundDescription.getParameters().get(strKey).equalsIgnoreCase("listening")){ %> <% }else if(inboundDescription.getParameters().get(strKey).equalsIgnoreCase("eventBased")){ %> <% }else if(inboundDescription.getParameters().get(strKey).equalsIgnoreCase("polling")){ %> <% } continue; } i++; %> <% } %> <% } %> <%}else{ if(!advParams.isEmpty()){%> <%} }%>
<%=inboundDescription.getName()%>
<%=inboundTypeValue%>
*
*
*
"/>
"/>
*
*
*
*
<%=Encode.forHtmlContent(defaultParam) %>* <%if(arrParamOri.length > 2){%> <%if(InboundClientConstants.TYPE_KAFKA.equals(inboundDescription.getType())){ firstSpecialParam = arrParamOri[1].trim(); %> <%}%> <%for(int i = 1;i <%if(eleValue.equals(inboundDescription.getParameters().get(defaultParam))){ firstSpecialParam = eleValue; %> <%}else{%> <%}%> <%}%> <%} else{ %> <%if(InboundClientConstants.TYPE_HTTPS.equals(inboundDescription.getType()) && defaultParam.equals("keystore")){%> <%}else if (isMBbased && (defaultParam.equals("wso2mb.connection.url"))) {%> (eg: amqp://admin:admin@clientID/carbon?brokerlist='tcp://localhost:5673' ) <%} else{ %> <%} %> <%} %>
<% String[] allSpecialParams = specialParams.split(","); String[] parentLevelParameters = allSpecialParams[0].split(InboundClientConstants.STRING_SPLITTER); %> <% int specialParameterCount = 0; for (int s = 0; s < parentLevelParameters.length; s++) { %> <% specialParameterCount++; } for (int s = 1; s < allSpecialParams.length; s++) { %> <% specialParameterCount++; } for(int s = 0;s -1 && specialParam.split(InboundClientConstants.STRING_SPLITTER)[0].trim().equals("topics/topic.filter"))) { String[] tLists = specialParam.split(InboundClientConstants.STRING_SPLITTER); if(inboundDescription.getParameters().get(tLists[1].trim())==null && inboundDescription.getParameters().get(tLists[2].trim())==null){ eleVal = ""; topicsOrTopicFilterEle = tLists[1].trim(); } else{ eleVal = ((inboundDescription.getParameters().get(tLists[1].trim())==null)?inboundDescription.getParameters().get(tLists[2].trim()):inboundDescription.getParameters().get(tLists[1].trim())); topicsOrTopicFilterEle = ((inboundDescription.getParameters().get(tLists[1].trim())==null)?tLists[2].trim():tLists[1].trim()); } String inboundDescriptionOfParams = inboundDescription.getParameters().toString(); %> <%} else{ if(allSpecialParams[s].startsWith(firstSpecialParam+".")){ if(inboundDescription.getParameters().get(allSpecialParams[s]) != null){ eleVal = inboundDescription.getParameters().get(allSpecialParams[s]); }%> <%} } }%>
<%=Encode.forHtmlContent(specialParam.split(InboundClientConstants.STRING_SPLITTER)[0].trim())%>*
<% if(topicsOrTopicFilterEle.equals("topic.filter")){ String[] splitedInboundDescription = inboundDescriptionOfParams.replace("{","").replace("}","").split(","); if(!inboundDescriptionOfParams.equals("")){ for(int j=0; j <% } %>
<%=Encode.forHtmlContent(specialParam.split(InboundClientConstants.STRING_SPLITTER)[0].trim())%>*
<%=Encode.forHtmlContent(specialParam.split(InboundClientConstants.STRING_SPLITTER)[1].trim())%> name*
<%=Encode.forHtmlContent(allSpecialParams[s].replace(firstSpecialParam+".", ""))%>*
" onclick="inboundUpdate('','','','','','',document.inboundupdateform); return false;"/> " onclick="document.location.href='index.jsp?ordinal=0';"/>
<% } catch (Throwable e) { %> <% return; } %>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy