web.publishEvent-mediator.edit-mediator.jsp Maven / Gradle / Ivy
<%--
~ Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~
~ The ASF licenses this file to You under the Apache License, Version 2.0
~
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~ http://www.apache.org/licenses/LICENSE-2.0
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
--%>
<%@ page import="org.apache.synapse.SynapseException" %>
<%@ page import="org.apache.synapse.config.xml.SynapsePath" %>
<%@ page import="org.apache.synapse.util.xpath.SynapseXPath" %>
<%@ page import="org.wso2.carbon.context.PrivilegedCarbonContext" %>
<%@ page import="org.wso2.carbon.event.sink.EventSink" %>
<%@ page import="org.wso2.carbon.event.sink.EventSinkService" %>
<%@ page import="org.wso2.carbon.mediator.publishevent.ui.Property" %>
<%@ page import="org.wso2.carbon.mediator.publishevent.ui.PublishEventMediator" %>
<%@ 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.ArrayList" %>
<%@ 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" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %>
<%
Mediator mediator = SequenceEditorHelper.getEditingMediator(request, session);
if (!(mediator instanceof org.wso2.carbon.mediator.publishevent.ui.PublishEventMediator)) {
// todo : proper error handling
throw new RuntimeException("Unable to edit the mediator");
}
PublishEventMediator publishEventMediator = (PublishEventMediator) mediator;
List mediatorMetaPropertyList = publishEventMediator.getMetaProperties();
List mediatorCorrelationPropertyList = publishEventMediator.getCorrelationProperties();
List mediatorPayloadPropertyList = publishEventMediator.getPayloadProperties();
List mediatorArbitraryPropertyList = publishEventMediator.getArbitraryProperties();
NameSpacesRegistrar nameSpacesRegistrar = NameSpacesRegistrar.getInstance();
nameSpacesRegistrar.registerNameSpaces(convertPropertyList(mediatorMetaPropertyList), "metaPropertyValue", session);
nameSpacesRegistrar
.registerNameSpaces(convertPropertyList(mediatorCorrelationPropertyList), "correlationPropertyValue",
session);
nameSpacesRegistrar
.registerNameSpaces(convertPropertyList(mediatorPayloadPropertyList), "payloadPropertyValue", session);
nameSpacesRegistrar
.registerNameSpaces(convertPropertyList(mediatorArbitraryPropertyList), "arbitraryPropertyValue", session);
String metaPropertyTableStyle = mediatorMetaPropertyList.isEmpty() ? "display:none;" : "";
String correlationPropertyTableStyle = mediatorCorrelationPropertyList.isEmpty() ? "display:none;" : "";
String payloadPropertyTableStyle = mediatorPayloadPropertyList.isEmpty() ? "display:none;" : "";
String arbitraryPropertyTableStyle = mediatorArbitraryPropertyList.isEmpty() ? "display:none;" : "";
%>
<%!
List convertPropertyList(List list) {
List newList = new ArrayList();
for (Property p : list) {
newList.add(p);
}
return newList;
}
%>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy