log.info( messages.get( "FailedToLoadWorkspaceFrom", file.getAbsolutePath() ) );
workspaceConfig = SoapuiWorkspaceDocumentConfig.Factory.parse( file );
if( workspaceConfig.getSoapuiWorkspace().getSettings() == null )
workspaceConfig.getSoapuiWorkspace().addNewSettings();
setPath( file.getAbsolutePath() );
settings = new XmlBeansSettingsImpl( this, SoapUI.getSettings(), workspaceConfig.getSoapuiWorkspace()
.getSettings() );
boolean closeOnStartup = getSettings().getBoolean( UISettings.CLOSE_PROJECTS );
List<WorkspaceProjectConfig> projects = workspaceConfig.getSoapuiWorkspace().getProjectList();
for( int i = 0; i < projects.size(); i++ )
{
WorkspaceProjectConfig wsc = projects.get( i );
String str = PathUtils.denormalizePath( wsc.getStringValue() );
str = PathUtils.adjustRelativePath( str, getProjectRoot(), this );
try
{
// WsdlProject project = new WsdlProject( str, this, false,
// !closeOnStartup &&
// wsc.getStatus() != Status.CLOSED && wsc.getType() !=
// Type.REMOTE, wsc.getName(), null);
WsdlProject project = ( WsdlProject )ProjectFactoryRegistry.getProjectFactory( "wsdl" ).createNew( str,
this, false, !closeOnStartup && wsc.getStatus() != Status.CLOSED && wsc.getType() != Type.REMOTE,
wsc.getName(), null );
projectList.add( project );
}
catch( Exception e )
{
UISupport.showErrorMessage( messages.get( "FailedToLoadProjectInWorkspace", str ) + e.getMessage() );
SoapUI.logError( e );
}
}
}
else
{
workspaceConfig = SoapuiWorkspaceDocumentConfig.Factory.newInstance();
workspaceConfig.addNewSoapuiWorkspace().setName( messages.get( "DefaultWorkspaceName" ) );
workspaceConfig.getSoapuiWorkspace().addNewSettings();
settings = new XmlBeansSettingsImpl( this, SoapUI.getSettings(), workspaceConfig.getSoapuiWorkspace()
.getSettings() );
}
}