Skip to content

Commit

Permalink
fix a problem related to resourcePath management in datasets of type …
Browse files Browse the repository at this point in the history
…FILE

git-svn-id: svn://svn.forge.objectweb.org/svnroot/spagobi/V_4.x/Server/trunk@22258 99afaf0d-6903-0410-885a-c66a8bbb5f81
  • Loading branch information
gioia committed Mar 17, 2014
1 parent b132a81 commit d1e1a38
Showing 1 changed file with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import it.eng.qbe.dataset.QbeDataSet;
import it.eng.spagobi.commons.dao.DAOConfig;
import it.eng.spagobi.commons.utilities.StringUtilities;
import it.eng.spagobi.container.ObjectUtils;
import it.eng.spagobi.tools.dataset.bo.CustomDataSet;
import it.eng.spagobi.tools.dataset.bo.FileDataSet;
Expand Down Expand Up @@ -145,14 +146,24 @@ public static IDataSet toDataSet(SbiDataSet sbiDataSet) {
try{
if(sbiDataSet.getType().equalsIgnoreCase(DataSetConstants.DS_FILE)){
ds = new FileDataSet();
((FileDataSet)ds).setResourcePath(DAOConfig.getResourcePath());
FileDataSet fds = (FileDataSet)ds;

String resourcePath = jsonConf.optString("resourcePath");
if(StringUtilities.isEmpty(resourcePath)) {
resourcePath = DAOConfig.getResourcePath();
jsonConf.put("resourcePath", resourcePath);
}
fds.setResourcePath( resourcePath );

fds.setConfiguration( jsonConf.toString() );

ds.setConfiguration(sbiDataSet.getConfiguration());
if (jsonConf.getString(DataSetConstants.FILE_TYPE) != null){
((FileDataSet)ds).setFileType(jsonConf.getString(DataSetConstants.FILE_TYPE));
fds.setFileType(jsonConf.getString(DataSetConstants.FILE_TYPE));
}
((FileDataSet)ds).setFileName(jsonConf.getString(DataSetConstants.FILE_NAME));
ds.setDsType(FILE_DS_TYPE);
fds.setFileName(jsonConf.getString(DataSetConstants.FILE_NAME));
fds.setDsType(FILE_DS_TYPE);


}

if(sbiDataSet.getType().equalsIgnoreCase(DataSetConstants.DS_QUERY)) {
Expand Down

0 comments on commit d1e1a38

Please sign in to comment.