[Carbon-dev] svn commit r43100 - branches/carbon-platform/2.0.1/carbon-components/bpel/org.wso2.carbon.bpel.ui/src/main/resources/web/bpel

waruna at wso2.com waruna at wso2.com
Tue Aug 11 04:09:53 PDT 2009


Author: waruna
Date: Tue Aug 11 04:09:53 2009
New Revision: 43100
URL: http://wso2.org/svn/browse/wso2?view=rev&revision=43100

Log:
added the SVGGenerateServlet to get the SVG image so that the SVG is rendered in all the browsers except IE

Modified:
   branches/carbon-platform/2.0.1/carbon-components/bpel/org.wso2.carbon.bpel.ui/src/main/resources/web/bpel/process_view.jsp

Modified: branches/carbon-platform/2.0.1/carbon-components/bpel/org.wso2.carbon.bpel.ui/src/main/resources/web/bpel/process_view.jsp
URL: http://wso2.org/svn/browse/wso2/branches/carbon-platform/2.0.1/carbon-components/bpel/org.wso2.carbon.bpel.ui/src/main/resources/web/bpel/process_view.jsp?rev=43100&r1=43099&r2=43100&view=diff
==============================================================================
--- branches/carbon-platform/2.0.1/carbon-components/bpel/org.wso2.carbon.bpel.ui/src/main/resources/web/bpel/process_view.jsp	(original)
+++ branches/carbon-platform/2.0.1/carbon-components/bpel/org.wso2.carbon.bpel.ui/src/main/resources/web/bpel/process_view.jsp	Tue Aug 11 04:09:53 2009
@@ -31,6 +31,7 @@
 
     String userAgent = request.getHeader( "User-Agent" );
     boolean isFirefox = ( userAgent != null && userAgent.indexOf( "Firefox/" ) != -1 );
+    boolean isMSIE = ( userAgent != null && userAgent.indexOf( "MSIE" ) != -1 );
 
     String cookie = (String) session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
     String processDef;
@@ -128,42 +129,7 @@
         return;
     }
 
-    SVGInterface svg;
-    try {
-        BPELInterface bpel = new BPELImpl();
-        OMElement bpelStr = bpel.load(processDef);
-        bpel.processBpelString(bpelStr);
-
-        LayoutManager layoutManager = BPEL2SVGFactory.getInstance().getLayoutManager();
-        layoutManager.setVerticalLayout(true);
-        layoutManager.layoutSVG(bpel.getRootActivity());
-
-        svg = new SVGImpl();
-        svg.setRootActivity(bpel.getRootActivity());
-        svgStr = svg.generateSVGString();
-        //if (isMSIE) {
-
-    } catch (NullPointerException e) {
-        CarbonUIMessage.sendCarbonUIMessage(e.getMessage(),
-                CarbonUIMessage.ERROR, request, e);
-%>
-<script type="text/javascript">
-    location.href = "../admin/error.jsp";
-</script>
-<%
-        return;
-    } catch (Exception e) {
-        CarbonUIMessage.sendCarbonUIMessage(e.getMessage(),
-                CarbonUIMessage.ERROR, request, e);
-%>
-<script type="text/javascript">
-    location.href = "../admin/error.jsp";
-</script>
-<%
-        return;
-    }
-
-    try {
+   try {
         StringReader sr = new StringReader(processDef);
 		StringWriter sw = new StringWriter();
         PrettyXML.init();
@@ -271,26 +237,9 @@
             return false;
         };
 
-        BPEL.process.drawSVG = function(svgStr) {
-            jQuery.each(jQuery.browser, function(i, val) {
-                if (val == true) {
-                    if (i == "mozilla") {
-                        var parser = new DOMParser();
-                        var dom = parser.parseFromString(svgStr, "text/xml");
-                        document.getElementById('bpel2svg').appendChild(dom.documentElement);
-                    }
-                }
-            });
-        };
-
         jQuery(document).ready(function() {
             BPEL.process.loadInstanceSummary();
             intObj = setInterval("BPEL.process.loadInstanceSummary()", 20000);
-            <%
-            if (isFirefox) {
-            %>
-             BPEL.process.drawSVG(<%=svgStr%>);
-            <% } %>
             var wid = jQuery("#process-details").width();
             jQuery("#process-definition").width(wid);
             jQuery("#bpel2svg").width(wid - 2);
@@ -432,8 +381,11 @@
             <%=processDefFancy%>
         </div>
         <div id="bpel2svg" style="height:auto;">
-            <%if (!isFirefox) { %>
+            <%if (isMSIE) { %>
                 <%="<img src=../png?pid=" + pid + " />"%>
+            <%}
+               else { %>
+            <%="<object type=\"image/svg+xml\" data=../svg?pid=" + pid + " />"%>
             <%}%>
         </div>
         



More information about the Carbon-dev mailing list