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

web.eventpublisher.create_event_publisher.jsp Maven / Gradle / Ivy

The newest version!
<%--
  ~ Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
  ~
  ~ WSO2 Inc. 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.wso2.carbon.event.publisher.stub.EventPublisherAdminServiceStub" %>
<%@ page import="org.wso2.carbon.event.publisher.ui.EventPublisherUIConstants" %>
<%@ page import="org.wso2.carbon.event.publisher.ui.EventPublisherUIUtils" %>
<%@ page import="org.wso2.carbon.event.stream.stub.EventStreamAdminServiceStub" %>
<%@ page import="org.wso2.carbon.event.stream.stub.types.EventStreamAttributeDto" %>
<%@ page import="org.wso2.carbon.event.stream.stub.types.EventStreamDefinitionDto" %>
<%@ page import="java.util.List" %>
<%@ page import="org.wso2.carbon.event.publisher.stub.types.DetailOutputAdapterPropertyDto" %>
<%@ page import="org.wso2.carbon.event.publisher.stub.types.OutputAdapterConfigurationDto" %>
<%@ page import="java.util.Arrays" %>
<%@ taglib uri="http://wso2.org/projects/carbon/taglibs/carbontags.jar" prefix="carbon" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>



    















<% EventPublisherAdminServiceStub eventPublisherAdminServiceStub = EventPublisherUIUtils.getEventPublisherAdminService(config, session, request); String[] outputAdapterTypes = eventPublisherAdminServiceStub.getAllOutputAdapterTypes(); String firstEventAdapterType = null; if (outputAdapterTypes != null && outputAdapterTypes.length > 0) { firstEventAdapterType = outputAdapterTypes[0]; } String streamId = request.getParameter("streamId"); String redirectPage = request.getParameter("redirectPage"); EventStreamAdminServiceStub eventStreamAdminServiceStub = EventPublisherUIUtils.getEventStreamAdminService(config, session, request); String[] streamIds = eventStreamAdminServiceStub.getStreamNames(); if (streamId == null && streamIds != null && streamIds.length > 0) { streamId = streamIds[0]; } if (streamId != null && firstEventAdapterType != null) { EventStreamDefinitionDto streamDefinitionDto = eventStreamAdminServiceStub.getStreamDefinitionDto(streamId); EventStreamAttributeDto[] metaAttributeList = streamDefinitionDto.getMetaData(); EventStreamAttributeDto[] correlationAttributeList = streamDefinitionDto.getCorrelationData(); EventStreamAttributeDto[] payloadAttributeList = streamDefinitionDto.getPayloadData(); String attributes = ""; if (metaAttributeList != null && metaAttributeList.length > 0) { for (EventStreamAttributeDto attribute : metaAttributeList) { attributes += EventPublisherUIConstants.PROPERTY_META_PREFIX + attribute.getAttributeName() + " " + attribute.getAttributeType() + ", \n"; } } if (correlationAttributeList != null) { for (EventStreamAttributeDto attribute : correlationAttributeList) { attributes += EventPublisherUIConstants.PROPERTY_CORRELATION_PREFIX + attribute.getAttributeName() + " " + attribute.getAttributeType() + ", \n"; } } if (payloadAttributeList != null) { for (EventStreamAttributeDto attribute : payloadAttributeList) { attributes += attribute.getAttributeName() + " " + attribute.getAttributeType() + ", \n"; } } if (!attributes.equals("")) { attributes = attributes.substring(0, attributes.lastIndexOf(",")); } String streamDefinition = attributes; String streamName = streamDefinitionDto.getName(); String streamVersion = streamDefinitionDto.getVersion(); List attributeList = EventPublisherUIUtils.getAttributeListWithPrefix(streamDefinitionDto); %>
<% } else { %> <% } %>
<% OutputAdapterConfigurationDto outputAdapterConfigurationDto = eventPublisherAdminServiceStub.getOutputAdapterConfigurationSchema(firstEventAdapterType); if (outputAdapterConfigurationDto != null) { %> <% DetailOutputAdapterPropertyDto[] eventAdapterProperties = outputAdapterConfigurationDto.getOutputEventAdapterStaticProperties(); int initialDynamicIndex = 0; if (eventAdapterProperties != null && eventAdapterProperties.length > 0) { initialDynamicIndex=eventAdapterProperties.length; %> <% for (int index=0; index < eventAdapterProperties.length; index++) { %> <% String type = "text"; if (eventAdapterProperties[index].getSecured()) { type = "password"; } %> <% } } eventAdapterProperties = outputAdapterConfigurationDto.getOutputEventAdapterDynamicProperties(); if (eventAdapterProperties != null && eventAdapterProperties.length > 0) { %> <% for ( int index = 0; index < eventAdapterProperties.length; index++) { %> <% String type = "text"; if (eventAdapterProperties[index].getSecured()) { type = "password"; } %> <% } } %>
*
*
*
<%=eventAdapterProperties[index].getDisplayName()%> <% String propertyId = "property_"; if (eventAdapterProperties[index].getRequired()) { propertyId = "property_Required_"; %> * <% } %>
<% if (eventAdapterProperties[index].getOptions()[0] != null) { %> <% } else { %> autocomplete="off" <% }%> name="<%=eventAdapterProperties[index].getKey()%>" id="<%=propertyId%><%=index%>" class="initE" style="width:75%" value="<%= (eventAdapterProperties[index].getDefaultValue()) != null ? eventAdapterProperties[index].getDefaultValue() : "" %>" /> <% } if (eventAdapterProperties[index].getHint() != null) { %>
<%=eventAdapterProperties[index].getHint()%>
<% } %>
<%=eventAdapterProperties[index].getDisplayName()%> <% String propertyId = "property_"; if (eventAdapterProperties[index].getRequired()) { propertyId = "property_Required_"; %> * <% } %>
<% if (eventAdapterProperties[index].getOptions()[0] != null) { %> <% } else { if(type.equals("password")) { %> " /> <% } else { %> " /> <% }} if (eventAdapterProperties[index].getHint() != null) { %>
<%=eventAdapterProperties[index].getHint()%>
<% } %>
*
Advanced
"> ">
<%if(streamId == null){%> <%}else{%> <%}%>
Add Event Stream




© 2015 - 2025 Weber Informatics LLC | Privacy Policy