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

web.rawXSLT-mediator.edit-mediator.jsp Maven / Gradle / Ivy

There is a newer version: 4.7.219
Show newest version

<%@page import="org.apache.synapse.mediators.Value" %>
<%@page import="org.apache.synapse.util.xpath.SynapseXPath" %>
<%@ 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.service.util.MediatorProperty" %>
<%@ page import="org.wso2.carbon.sequences.ui.util.SequenceEditorHelper" %>
<%@ page import="org.wso2.carbon.sequences.ui.util.ns.NameSpacesRegistrar" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.Map" %>
<%@ page import="org.wso2.carbon.mediator.fastXSLT.FastXSLTMediator" %>
<%@ 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 FastXSLTMediator)) {
        // todo : proper error handling
        throw new RuntimeException("Unable to edit the mediator");
    }
    FastXSLTMediator fastXSLTMediator = (FastXSLTMediator) mediator;

    boolean isKeyDynamic = false;
    String keyVal = "";

    Value key = fastXSLTMediator.getXsltKey();

    if (key != null) {

        if (key.getKeyValue() != null) {
            isKeyDynamic = false;
            keyVal = key.getKeyValue();
        } else if (key.getExpression() != null) {
            isKeyDynamic = true;
            keyVal = key.getExpression().toString();
            NameSpacesRegistrar nameSpacesRegistrarKey = NameSpacesRegistrar.getInstance();
            nameSpacesRegistrarKey.registerNameSpaces(key.getExpression(), "mediator.fastXSLT.key.dynamic_val", session);
        }

    }
    SynapseXPath sourceXPath = fastXSLTMediator.getSource();
    String source = "";
    NameSpacesRegistrar nameSpacesRegistrar = NameSpacesRegistrar.getInstance();
    if (sourceXPath != null) {
        nameSpacesRegistrar.registerNameSpaces(sourceXPath, "mediator.fastXSLT.source", session);
        source = sourceXPath.toString();
    }
    List mediatorPropertyList = fastXSLTMediator.getProperties();
    nameSpacesRegistrar.registerNameSpaces(mediatorPropertyList, "propertyValue", session);
    List featureList = fastXSLTMediator.getFeatures();
    String propertyTableStyle = mediatorPropertyList.isEmpty() ? "display:none;" : "";
    String featureTableStyle = featureList.isEmpty() ? "display:none;" : "";
    Map resources = fastXSLTMediator.getResources();
%>

> >
: /> />
*
*

<% int i = 0; for (MediatorProperty mp : mediatorPropertyList) { if (mp != null) { String value = mp.getValue(); SynapseXPath synapseXPath = mp.getExpression(); boolean isLiteral = value != null && !"".equals(value); %> <% } i++; } %>
<% if (value != null && !"".equals(value)) {%> <%} else if (synapseXPath != null) {%> <%} else { %> <% }%> "> <% if (!isLiteral && synapseXPath != null) {%> <%}%>

<% int k = 0; for (MediatorProperty property : featureList) { if (property != null) { String value = property.getValue(); boolean isTrue = value != null && Boolean.valueOf(value.trim()); %> <% } k++; } %>

<% Iterator itr = resources.keySet().iterator(); if(itr.hasNext()){ %> <% for (itr = resources.keySet().iterator(); itr.hasNext(); ) { int j = 0; String location = (String) itr.next(); if (location == null) { location = ""; } String regKey = resources.get(location); if (regKey == null) { regKey = ""; } %> <% j++; } } %>
<%= location%> <%= regKey%>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy