View Javadoc

1   /*
2    *  soapUI, copyright (C) 2004-2007 eviware.com 
3    *
4    *  soapUI is free software; you can redistribute it and/or modify it under the 
5    *  terms of version 2.1 of the GNU Lesser General Public License as published by 
6    *  the Free Software Foundation.
7    *
8    *  soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without 
9    *  even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
10   *  See the GNU Lesser General Public License for more details at gnu.org.
11   */
12  
13  package com.eviware.soapui.impl.wsdl.panels.request;
14  
15  import javax.swing.JPanel;
16  
17  import com.eviware.soapui.impl.EmptyPanelBuilder;
18  import com.eviware.soapui.impl.wsdl.WsdlRequest;
19  import com.eviware.soapui.support.components.JPropertiesTable;
20  
21  /***
22   * PanelBuilder for WsdlRequest
23   * 
24   * @author Ole.Matzura
25   */
26  
27  public class WsdlRequestPanelBuilder extends EmptyPanelBuilder<WsdlRequest>
28  {
29     public WsdlRequestPanelBuilder()
30     {
31     }
32  
33     public WsdlRequestDesktopPanel buildDesktopPanel(WsdlRequest request)
34     {
35        return new WsdlRequestDesktopPanel(request);
36     }
37  
38     public boolean hasDesktopPanel()
39     {
40        return true;
41     }
42  
43     public JPanel buildOverviewPanel(WsdlRequest request)
44     {
45     	JPropertiesTable<WsdlRequest> table = new JPropertiesTable<WsdlRequest>( "Request Properties", request );
46  
47  //    basic properties
48     	table.addProperty( "Name", "name", true );
49     	table.addProperty( "Description", "description", true );
50     	table.addProperty( "Message Size", "contentLength", false );
51     	table.addProperty( "Encoding", "encoding", new String[] {null, "UTF-8", "iso-8859-1" } );
52     	table.addProperty( "Endpoint", "endpoint", request.getOperation().getInterface().getEndpoints() );
53     	table.addProperty( "Bind Address", "bindAddress", true );
54     	
55     	// security / authentication
56     	table.addProperty( "Username", "username", true );
57     	table.addProperty( "Password", "password", true );
58     	table.addProperty( "Domain", "domain", true );
59     	table.addProperty( "WSS-Password Type", "wssPasswordType", 
60     			new String[] {WsdlRequest.PW_TYPE_NONE, WsdlRequest.PW_TYPE_TEXT, WsdlRequest.PW_TYPE_DIGEST});
61     	table.addProperty( "WSS TimeToLive", "wssTimeToLive", true );
62  //   	
63  //   	StringList outgoingNames = new StringList( request.getOperation().getInterface().getProject().getWssContainer().getOutgoingNames());
64  //   	outgoingNames.add( "" );
65  //		table.addProperty( "WSS Outgoing", "outgoingWss", outgoingNames.toStringArray() );
66  //		StringList incomingNames = new StringList( request.getOperation().getInterface().getProject().getWssContainer().getIncomingNames() );
67  //		incomingNames.add( "" );
68  //		table.addProperty( "WSS Incoming", "incomingWss", incomingNames.toStringArray() );
69     	
70  		table.addProperty( "Skip SOAP Action", "skipSoapAction", JPropertiesTable.BOOLEAN_OPTIONS );
71  		
72     	// mtom / attachments
73     	table.addProperty( "Enable MTOM", "mtomEnabled", JPropertiesTable.BOOLEAN_OPTIONS );
74     	table.addProperty( "Force MTOM", "forceMtom", JPropertiesTable.BOOLEAN_OPTIONS );
75     	table.addProperty( "Inline Response Attachments", "inlineResponseAttachments", 
76     			JPropertiesTable.BOOLEAN_OPTIONS );
77     	table.addProperty( "Expand MTOM Attachments", "expandMtomResponseAttachments", 
78  	   			JPropertiesTable.BOOLEAN_OPTIONS );
79     	table.addProperty( "Disable multiparts", "multipartEnabled", JPropertiesTable.BOOLEAN_OPTIONS );
80     	table.addProperty( "Encode Attachments", "encodeAttachments", JPropertiesTable.BOOLEAN_OPTIONS );
81     	
82     	// preprocessing
83     	table.addProperty( "Enable Inline Files", "inlineFilesEnabled", JPropertiesTable.BOOLEAN_OPTIONS ).
84     		setDescription( "Enables inline file references in elements with binary content; file:<path>" );
85     	table.addProperty( "Strip whitespaces", "stripWhitespaces", JPropertiesTable.BOOLEAN_OPTIONS );
86     	table.addProperty( "Remove Empty Content", "removeEmptyContent", JPropertiesTable.BOOLEAN_OPTIONS );
87  
88     	// post-processing
89     	table.addProperty( "Pretty Print", "prettyPrint", JPropertiesTable.BOOLEAN_OPTIONS );
90     	
91     	table.setPropertyObject( request );
92     	
93     	return table;
94     }
95  
96     public boolean hasOverviewPanel()
97     {
98        return true;
99     }
100 }