<%-- /* * Copyright 2001-2013 The Apache Software Foundation. * * Licensed 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. * */ Document : service editor Created on : Feb 24, 2013, 3:31:39 PM Author : Alex O'Ree --%> <%@page import="java.net.URLEncoder"%> <%@page import="org.uddi.api_v3.*"%> <%@page import="org.apache.juddi.webconsole.PostBackConstants"%> <%@page import="org.apache.juddi.webconsole.hub.UddiHub"%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <%//@include file="csrf.jsp" boolean newitem = false; String bindingid = request.getParameter("id"); String serviceid = request.getParameter("svcid"); if (bindingid == null && serviceid == null) { response.sendRedirect("index.jsp"); } if (bindingid == null || bindingid.length() == 0) { //response.sendRedirect("browse.jsp"); if (serviceid != null && serviceid.length() > 0) { newitem = true; } else { //no service id or business id response.sendRedirect("index.jsp"); } } UddiHub x = UddiHub.getInstance(application, request.getSession()); BindingTemplate bd = null; if (!newitem) { bd = x.GetBindingDetailsAsObject(bindingid); } else { bd = new BindingTemplate(); bd.setServiceKey(serviceid); BusinessService be = x.GetServiceDetail(serviceid); if (be == null) { //incase an invalid business id was passed in response.sendRedirect("index.jsp"); } else { bd.setServiceKey(be.getServiceKey()); } } if (bd == null) { //we can't make a new binding without a service to reference response.sendRedirect("index.jsp"); return; } %> <%@include file="header-top.jsp" %>

<%=ResourceLoader.GetResource(session, "pages.bindingeditor.title")%>

<% int totalBTDescriptions = 0; %> <%=ResourceLoader.GetResource(session, "items.service.key")%>
<% if (bd == null || bd.getServiceKey() == null) { out.write(""); } else { out.write(""); out.write(StringEscapeUtils.escapeHtml(bd.getServiceKey())); out.write(""); if (bd.getCategoryBag() == null) { bd.setCategoryBag(new CategoryBag()); } } %>

<% if (!newitem) { out.write(" "); } %> <%=ResourceLoader.GetResource(session, "items.bindingtemplate.key")%> - <%=ResourceLoader.GetResource(session, "items.bindingtemplate.description")%> <%=ResourceLoader.GetResource(session, "navbar.help")%>
id="<%=PostBackConstants.BINDINGKEY%>"> <% if (!newitem) { out.write(StringEscapeUtils.escapeHtml(bd.getBindingKey())); } int currentcatkeyrefBT = 0; int currentcatkeyrefgrpBT = 0; int currentbindingtemplatesInstance = 0; int currentOverviewDocs = 0; if (bd.getCategoryBag() != null) { currentcatkeyrefBT += bd.getCategoryBag().getKeyedReference().size(); currentcatkeyrefgrpBT += bd.getCategoryBag().getKeyedReferenceGroup().size(); } if (bd.getTModelInstanceDetails() != null) { currentbindingtemplatesInstance = bd.getTModelInstanceDetails().getTModelInstanceInfo().size(); } if (bd.getTModelInstanceDetails() != null) { for (int k = 0; k < bd.getTModelInstanceDetails().getTModelInstanceInfo().size(); k++) { if (bd.getTModelInstanceDetails().getTModelInstanceInfo().get(k).getInstanceDetails() != null) { currentOverviewDocs += bd.getTModelInstanceDetails().getTModelInstanceInfo().get(k).getInstanceDetails().getOverviewDoc().size(); } } } %>

<%=ResourceLoader.GetResource(session, "items.description")%> - <%=ResourceLoader.GetResource(session, "items.services.description")%>
<%=ResourceLoader.GetResource(session, "items.description.add")%>
<% for (int i = 0; i < bd.getDescription().size(); i++) { out.write("
"); out.write(""); out.write("
" + ResourceLoader.GetResource(session, "items.key") + ": 
" + "
" + StringEscapeUtils.escapeHtml(bd.getDescription().get(i).getValue()) + "
"); out.write("
" + ResourceLoader.GetResource(session, "items.lang") + ": 
" + "
" + (bd.getDescription().get(i).getLang() == null ? "" : StringEscapeUtils.escapeHtml(bd.getDescription().get(i).getLang())) + "
"); out.write("
"); //confirmed 1:1 } %>

<%=ResourceLoader.GetResource(session, "pages.editor.tabnav.categories")%> - <%=ResourceLoader.GetResource(session, "items.categories.description")%>

<%=ResourceLoader.GetResource(session, "items.keyrefcats")%>:
<%=ResourceLoader.GetResource(session, "items.keyrefcat.add")%>
<%@include file="quickref_catbag.jsp" %>
<% if (bd.getCategoryBag() == null) { bd.setCategoryBag(new CategoryBag()); } // out.write("Keyed Reference Categories:"); for (int i = 0; i < bd.getCategoryBag().getKeyedReference().size(); i++) { out.write("
"); out.write(""); out.write("
" + ResourceLoader.GetResource(session, "items.key") + " (" + ResourceLoader.GetResource(session, "items.picker") + ") " + "" + ":  
" + "
" + StringEscapeUtils.escapeHtml(bd.getCategoryBag().getKeyedReference().get(i).getTModelKey()) + "
"); out.write("
" + ResourceLoader.GetResource(session, "items.name") + ":  
" + "
" + StringEscapeUtils.escapeHtml(bd.getCategoryBag().getKeyedReference().get(i).getKeyName()) + "
"); out.write("
" + ResourceLoader.GetResource(session, "items.value") + ":  
" + "
" + StringEscapeUtils.escapeHtml(bd.getCategoryBag().getKeyedReference().get(i).getKeyValue()) + "
"); out.write("
"); } %>

<%=ResourceLoader.GetResource(session, "items.keyrefgroup")%>
<%=ResourceLoader.GetResource(session, "items.keyrefgroup.add")%>
<%@include file="quickref_krgrp.jsp" %>
<% //div count good so far for (int i = 0; i < bd.getCategoryBag().getKeyedReferenceGroup().size(); i++) { out.write("
" + "" + "
" + ResourceLoader.GetResource(session, "items.key") + " (" + ResourceLoader.GetResource(session, "items.picker") + ") " + "" + ":  
" + "
" + StringEscapeUtils.escapeHtml(bd.getCategoryBag().getKeyedReferenceGroup().get(i).getTModelKey()) + "
" + "
" + "
" + ResourceLoader.GetResource(session, "items.keyrefcat.add") + "
"); for (int k = 0; k < bd.getCategoryBag().getKeyedReferenceGroup().get(i).getKeyedReference().size(); k++) { out.write("
"); out.write(""); out.write("
" + ResourceLoader.GetResource(session, "items.key") + " (" + ResourceLoader.GetResource(session, "items.picker") + ") " + "" + ":  
" + "
" + StringEscapeUtils.escapeHtml(bd.getCategoryBag().getKeyedReferenceGroup().get(i).getKeyedReference().get(k).getTModelKey()) + "
"); out.write("
" + ResourceLoader.GetResource(session, "items.name") + ":  
" + "
" + StringEscapeUtils.escapeHtml(bd.getCategoryBag().getKeyedReferenceGroup().get(i).getKeyedReference().get(k).getKeyName()) + "
"); out.write("
" + ResourceLoader.GetResource(session, "items.value") + ":  
" + "
" + StringEscapeUtils.escapeHtml(bd.getCategoryBag().getKeyedReferenceGroup().get(i).getKeyedReference().get(k).getKeyValue()) + "
"); out.write("
"); } out.write("
"); //this ends the group container for key ref PostBackConstants.CATBAG_KEY_REF_GRP + i + PostBackConstants.KEY_REF } %>

<%=ResourceLoader.GetResource(session, "items.accesspoint")%> - <%=ResourceLoader.GetResource(session, "items.accesspoint.description")%>
<% //items.hostingredirector //TODO need an html select in here? if (bd.getHostingRedirector() == null && bd.getAccessPoint()==null) { bd.setAccessPoint(new AccessPoint()); } if (bd.getHostingRedirector() != null) { out.write("
" + ResourceLoader.GetResource(session, "items.hostingredirector") + ":  
" + "
" + (bd.getHostingRedirector().getBindingKey()==null ? "" :StringEscapeUtils.escapeHtml(bd.getHostingRedirector().getBindingKey())) + "
"); } if (bd.getAccessPoint() != null) { out.write("
" + ResourceLoader.GetResource(session, "items.accesspoint.type") + ":  
" + "
" + (bd.getAccessPoint().getUseType()==null?"":StringEscapeUtils.escapeHtml(bd.getAccessPoint().getUseType())) + "
"); out.write("
" + ResourceLoader.GetResource(session, "items.accesspoint.value") + ":  
" + "
" + (bd.getAccessPoint().getValue()==null?"":StringEscapeUtils.escapeHtml(bd.getAccessPoint().getValue())) + "
"); // this was an unbalanced divout.write("
"); } %>
<%=ResourceLoader.GetResource(session, "items.tmodelinstance.info")%> - <%=ResourceLoader.GetResource(session, "items.tmodelinstance.info.desc")%>
<%=ResourceLoader.GetResource(session, "items.tmodelinstance.add")%>
<%@include file="quickref_tmodelinstance.jsp" %>
<% if (bd.getTModelInstanceDetails() != null) { for (int k = 0; k < bd.getTModelInstanceDetails().getTModelInstanceInfo().size(); k++) { %>
<% out.write("
" + " 
"); out.write("
" + ResourceLoader.GetResource(session, "items.tmodel.key") + " (" + ResourceLoader.GetResource(session, "items.picker") + ") " + "" + ":  
" + "
" + StringEscapeUtils.escapeHtml(bd.getTModelInstanceDetails().getTModelInstanceInfo().get(k).getTModelKey()) + "
"); // out.write("
Value
" // + "
" + ((bd.getTModelInstanceDetails().getTModelInstanceInfo().get(k).getInstanceDetails() != null) ? StringEscapeUtils.escapeHtml(bd.getTModelInstanceDetails().getTModelInstanceInfo().get(k).getInstanceDetails().getInstanceParms()) : "") + "
"); %>
<% out.write("
" + ResourceLoader.GetResource(session, "items.tmodelinstance.parameters") + ":  
" + "
"); if (bd.getTModelInstanceDetails().getTModelInstanceInfo().get(k).getInstanceDetails() != null && bd.getTModelInstanceDetails().getTModelInstanceInfo().get(k).getInstanceDetails().getInstanceParms() != null) { out.write(StringEscapeUtils.escapeHtml(bd.getTModelInstanceDetails().getTModelInstanceInfo().get(k).getInstanceDetails().getInstanceParms())); } out.write("
"); %>
<%=ResourceLoader.GetResource(session, "items.tmodelinstance.description")%> - <%=ResourceLoader.GetResource(session, "items.tmodelinstance.description2")%>
<%=ResourceLoader.GetResource(session, "items.tmodelinstance.description.add")%>
<% for (int j = 0; j < bd.getTModelInstanceDetails().getTModelInstanceInfo().get(k).getDescription().size(); j++) { out.write("
"); out.write("
" + " 
"); out.write("
" + ResourceLoader.GetResource(session, "items.name") + ": 
" + "
" + StringEscapeUtils.escapeHtml(bd.getTModelInstanceDetails().getTModelInstanceInfo().get(k).getDescription().get(j).getValue()) + "
"); out.write("
" + ResourceLoader.GetResource(session, "items.lang") + ": 
" + "
" + (bd.getTModelInstanceDetails().getTModelInstanceInfo().get(k).getDescription().get(j).getLang() == null ? " " : StringEscapeUtils.escapeHtml(bd.getTModelInstanceDetails().getTModelInstanceInfo().get(k).getDescription().get(j).getLang())) + "
"); out.write("
"); } %>

<%=ResourceLoader.GetResource(session, "items.overviewurl")%> - <%=ResourceLoader.GetResource(session, "items.overviewurl.description")%>
<%=ResourceLoader.GetResource(session, "items.overviewurl.add")%>
<% // out.write("
"); if (bd.getTModelInstanceDetails().getTModelInstanceInfo().get(k).getInstanceDetails() != null) for (int j = 0; j < bd.getTModelInstanceDetails().getTModelInstanceInfo().get(k).getInstanceDetails().getOverviewDoc().size(); j++) { if (bd.getTModelInstanceDetails().getTModelInstanceInfo().get(k).getInstanceDetails().getOverviewDoc().get(j) == null) { continue; } out.write("
"); if (bd.getTModelInstanceDetails().getTModelInstanceInfo().get(k).getInstanceDetails().getOverviewDoc().get(j).getOverviewURL() != null) { out.write(""); out.write("
" + ResourceLoader.GetResource(session, "items.value") + ": 
" + "
" + (bd.getTModelInstanceDetails().getTModelInstanceInfo().get(k).getInstanceDetails().getOverviewDoc().get(j).getOverviewURL().getValue() != null ? StringEscapeUtils.escapeHtml(bd.getTModelInstanceDetails().getTModelInstanceInfo().get(k).getInstanceDetails().getOverviewDoc().get(j).getOverviewURL().getValue()) : "") + "
"); out.write("
Use type: 
" + "
" + (bd.getTModelInstanceDetails().getTModelInstanceInfo().get(k).getInstanceDetails().getOverviewDoc().get(j).getOverviewURL().getUseType() != null ? StringEscapeUtils.escapeHtml(bd.getTModelInstanceDetails().getTModelInstanceInfo().get(k).getInstanceDetails().getOverviewDoc().get(j).getOverviewURL().getUseType()) : "") + "
"); } %>
<%=ResourceLoader.GetResource(session, "items.overviewdocument.description")%>
<%=ResourceLoader.GetResource(session, "items.overviewurl.description.add")%>
<% // out.write("
"); for (int h = 0; h < bd.getTModelInstanceDetails().getTModelInstanceInfo().get(k).getInstanceDetails().getOverviewDoc().get(j).getDescription().size(); h++) { out.write("
"); out.write(""); out.write("
" + ResourceLoader.GetResource(session, "items.value") + ": 
" + "
" + StringEscapeUtils.escapeHtml(bd.getTModelInstanceDetails().getTModelInstanceInfo().get(k).getInstanceDetails().getOverviewDoc().get(j).getDescription().get(h).getValue()) + "
"); out.write("
" + ResourceLoader.GetResource(session, "items.lang") + ": 
" + "
" + (bd.getTModelInstanceDetails().getTModelInstanceInfo().get(k).getInstanceDetails().getOverviewDoc().get(j).getDescription().get(h).getLang() == null ? "" : StringEscapeUtils.escapeHtml(bd.getTModelInstanceDetails().getTModelInstanceInfo().get(k).getInstanceDetails().getOverviewDoc().get(j).getDescription().get(h).getLang())) + "
"); out.write("
"); } %>
<% out.write("
"); } %>

<% } //end of instance details %> <% } %>
<%=ResourceLoader.GetResource(session, "items.dsigs")%>
<% if (bd.getSignature().isEmpty()) { out.write(ResourceLoader.GetResource(session, "items.signed.not")); } else { out.write(ResourceLoader.GetResource(session, "items.signed") + " " + bd.getSignature().size()); %> <% for (int k = 0; k < bd.getSignature().size(); k++) { out.write(""); } %>
# <%=ResourceLoader.GetResource(session, "pages.signatures.signedby")%> <%=ResourceLoader.GetResource(session, "pages.signatures.status")%>
" + k + ""); out.write(x.SignatureToReadable(bd.getSignature().get(k))); out.write(""); out.write("" + ResourceLoader.GetResource(session, "items.signed.viewcert") + ""); out.write("
" + ResourceLoader.GetResource(session, "items.loading") + "
"); %> <% out.write("
<% } %>

<% if (!newitem) { %>
<% } %>


<% if (bd.getSignature().isEmpty()) { %> <%=ResourceLoader.GetResource(session, "actions.save")%> <% } else { %> <%=ResourceLoader.GetResource(session, "actions.save")%> | <% } if (!newitem) { %> | <%=ResourceLoader.GetResource(session, "actions.delete")%> | &type=bindingTemplate"> <%=ResourceLoader.GetResource(session, "actions.sign")%> | " title="<%=ResourceLoader.GetResource(session, "actions.subscribe.description")%>"> <%=ResourceLoader.GetResource(session, "actions.subscribe")%> | <%=ResourceLoader.GetResource(session, "actions.asxml")%> <% } %>
<% if (!newitem) { %> <% } %> <%@include file="tmodelChooser.jsp" %> <%@include file="keyHelpModal.jsp" %> <%@include file="header-bottom.jsp" %>