View Javadoc

1   /*
2    *  soapUI, copyright (C) 2004-2008 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 com.eviware.soapui.impl.EmptyPanelBuilder;
16  import com.eviware.soapui.impl.wsdl.WsdlRequest;
17  import com.eviware.soapui.support.components.JPropertiesTable;
18  import com.eviware.soapui.support.types.StringList;
19  
20  import javax.swing.*;
21  
22  /***
23   * PanelBuilder for WsdlRequest
24   * 
25   * @author Ole.Matzura
26   */
27  
28  public class WsdlRequestPanelBuilder extends EmptyPanelBuilder<WsdlRequest>
29  {
30     public WsdlRequestPanelBuilder()
31     {
32     }
33  
34     public WsdlRequestDesktopPanel buildDesktopPanel(WsdlRequest request)
35     {
36        return new WsdlRequestDesktopPanel(request);
37     }
38  
39     public boolean hasDesktopPanel()
40     {
41        return true;
42     }
43  
44     public JPanel buildOverviewPanel(WsdlRequest request)
45     {
46     	JPropertiesTable<WsdlRequest> table = new JPropertiesTable<WsdlRequest>( "Request Properties", request );
47  
48  //    basic properties
49     	table.addProperty( "Name", "name", true );
50     	table.addProperty( "Description", "description", true );
51     	table.addProperty( "Message Size", "contentLength", false );
52     	table.addProperty( "Encoding", "encoding", new String[] {null, "UTF-8", "iso-8859-1" } );
53     	table.addProperty( "Endpoint", "endpoint", request.getOperation().getInterface().getEndpoints() );
54     	table.addProperty( "Bind Address", "bindAddress", true );
55     	
56     	// security / authentication
57     	table.addProperty( "Username", "username", true );
58     	table.addPropertyShadow( "Password", "password", true );
59     	table.addProperty( "Domain", "domain", true );
60     	table.addProperty( "WSS-Password Type", "wssPasswordType", 
61     			new String[] {null, WsdlRequest.PW_TYPE_NONE, WsdlRequest.PW_TYPE_TEXT, WsdlRequest.PW_TYPE_DIGEST});
62     	table.addProperty( "WSS TimeToLive", "wssTimeToLive", true );
63     	
64  		StringList keystores = new StringList( request.getOperation().getInterface().getProject().getWssContainer().getCryptoNames() );
65  		keystores.add( 0, null );
66  		table.addProperty( "SSL Keystore", "sslKeystore", keystores.toStringArray() );
67  
68  //   	
69  //   	StringList outgoingNames = new StringList( request.getOperation().getInterface().getProject().getWssContainer().getOutgoingNames());
70  //   	outgoingNames.add( "" );
71  //		table.addProperty( "WSS Outgoing", "outgoingWss", outgoingNames.toStringArray() );
72  //		StringList incomingNames = new StringList( request.getOperation().getInterface().getProject().getWssContainer().getIncomingNames() );
73  //		incomingNames.add( "" );
74  //		table.addProperty( "WSS Incoming", "incomingWss", incomingNames.toStringArray() );
75     	
76  		table.addProperty( "Skip SOAP Action", "skipSoapAction", JPropertiesTable.BOOLEAN_OPTIONS );
77  		
78     	// mtom / attachments
79     	table.addProperty( "Enable MTOM", "mtomEnabled", JPropertiesTable.BOOLEAN_OPTIONS );
80     	table.addProperty( "Force MTOM", "forceMtom", JPropertiesTable.BOOLEAN_OPTIONS );
81     	table.addProperty( "Inline Response Attachments", "inlineResponseAttachments", 
82     			JPropertiesTable.BOOLEAN_OPTIONS );
83     	table.addProperty( "Expand MTOM Attachments", "expandMtomResponseAttachments", 
84  	   			JPropertiesTable.BOOLEAN_OPTIONS );
85     	table.addProperty( "Disable multiparts", "multipartEnabled", JPropertiesTable.BOOLEAN_OPTIONS );
86     	table.addProperty( "Encode Attachments", "encodeAttachments", JPropertiesTable.BOOLEAN_OPTIONS );
87     	
88     	// preprocessing
89     	table.addProperty( "Enable Inline Files", "inlineFilesEnabled", JPropertiesTable.BOOLEAN_OPTIONS ).
90     		setDescription( "Enables inline file references in elements with binary content; file:<path>" );
91     	table.addProperty( "Strip whitespaces", "stripWhitespaces", JPropertiesTable.BOOLEAN_OPTIONS );
92     	table.addProperty( "Remove Empty Content", "removeEmptyContent", JPropertiesTable.BOOLEAN_OPTIONS );
93  
94     	// post-processing
95     	table.addProperty( "Pretty Print", "prettyPrint", JPropertiesTable.BOOLEAN_OPTIONS );
96     	table.addProperty( "Dump File", "dumpFile", true ).setDescription("Dumps response message to specified file" );
97     	table.addProperty( "Max Size", "maxSize", true).setDescription("The maximum number of bytes to receive" );
98     	
99     	table.addProperty( "WS-Addressing", "wsAddressing", JPropertiesTable.BOOLEAN_OPTIONS );
100    	
101    	table.setPropertyObject( request );
102    	
103    	return table;
104    }
105 
106    public boolean hasOverviewPanel()
107    {
108       return true;
109    }
110 }
111 
112