@ -14,6 +14,7 @@ import com.fr.data.impl.ExcelTableData;
import com.fr.data.impl.FileTableData ;
import com.fr.data.impl.FileTableData ;
import com.fr.data.impl.TextTableData ;
import com.fr.data.impl.TextTableData ;
import com.fr.data.impl.XMLTableData ;
import com.fr.data.impl.XMLTableData ;
import com.fr.decision.webservice.bean.dataset.FileDataSetBean ;
import com.fr.design.actions.UpdateAction ;
import com.fr.design.actions.UpdateAction ;
import com.fr.design.constants.LayoutConstants ;
import com.fr.design.constants.LayoutConstants ;
import com.fr.design.data.datapane.preview.PreviewTablePane ;
import com.fr.design.data.datapane.preview.PreviewTablePane ;
@ -47,6 +48,7 @@ import com.fr.stable.ParameterProvider;
import com.fr.stable.StringUtils ;
import com.fr.stable.StringUtils ;
import com.fr.stable.xml.XMLReadable ;
import com.fr.stable.xml.XMLReadable ;
import com.fr.stable.xml.XMLableReader ;
import com.fr.stable.xml.XMLableReader ;
import com.fr.workspace.server.repository.tabledata.TableDataRepository ;
import javax.swing.ButtonGroup ;
import javax.swing.ButtonGroup ;
import javax.swing.JOptionPane ;
import javax.swing.JOptionPane ;
@ -233,22 +235,20 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
}
}
params = getEditorPaneParameter ( ) ;
params = getEditorPaneParameter ( ) ;
URLDataSource url = new URLDataSource ( urlText . getText ( ) . trim ( ) , params ) ;
URLDataSource url = new URLDataSource ( urlText . getText ( ) . trim ( ) , params ) ;
InputStream in = null ;
boolean result = false ;
try {
try {
in = url . getSourceStream ( params ) ;
String urlText = ParameterHelper . analyze4Templatee ( url . getUrl ( ) , params ) ;
FileDataSetBean bean = new FileDataSetBean ( ) ;
bean . setFilePath ( urlText ) ;
result = TableDataRepository . getInstance ( ) . testFilePath ( bean ) ;
} catch ( Throwable e ) {
} catch ( Throwable e ) {
FineLoggerFactory . getLogger ( ) . error ( e . getMessage ( ) , e ) ;
FineLoggerFactory . getLogger ( ) . error ( e . getMessage ( ) , e ) ;
}
}
if ( in = = null ) {
if ( ! result ) {
FineJOptionPane . showMessageDialog ( DesignerContext . getDesignerFrame ( ) , com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Basic_Database_Connection_Failed" ) ,
FineJOptionPane . showMessageDialog ( DesignerContext . getDesignerFrame ( ) , com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Basic_Database_Connection_Failed" ) ,
com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Basic_Error" ) , JOptionPane . ERROR_MESSAGE , UIManager . getIcon ( "OptionPane.errorIcon" ) ) ;
com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Basic_Error" ) , JOptionPane . ERROR_MESSAGE , UIManager . getIcon ( "OptionPane.errorIcon" ) ) ;
} else {
} else {
FineJOptionPane . showMessageDialog ( DesignerContext . getDesignerFrame ( ) , com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Basic_Datasource_Connection_Successfully" ) ) ;
FineJOptionPane . showMessageDialog ( DesignerContext . getDesignerFrame ( ) , com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Basic_Datasource_Connection_Successfully" ) ) ;
try {
in . close ( ) ;
} catch ( IOException e ) {
in = null ;
}
}
}
}
}
} ;
} ;