|
|
@ -15,8 +15,8 @@ import com.fr.file.filter.ChooseFileFilter; |
|
|
|
import com.fr.io.exporter.DesignExportType; |
|
|
|
import com.fr.io.exporter.DesignExportType; |
|
|
|
import com.fr.io.exporter.ExporterKey; |
|
|
|
import com.fr.io.exporter.ExporterKey; |
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
import com.fanruan.product.ProductConstants; |
|
|
|
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
|
|
|
import com.fr.stable.project.ProjectConstants; |
|
|
|
import com.fr.third.jodd.io.FileNameUtil; |
|
|
|
import com.fr.third.jodd.io.FileNameUtil; |
|
|
|
import com.fr.workspace.WorkContext; |
|
|
|
import com.fr.workspace.WorkContext; |
|
|
|
import com.fr.workspace.server.exporter.TemplateExportOperator; |
|
|
|
import com.fr.workspace.server.exporter.TemplateExportOperator; |
|
|
@ -211,20 +211,16 @@ public abstract class AbstractExportAction<E extends JTemplate<?, ?>> extends JT |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void dealExporter(OutputStream outputStream, String path, final Map<String, Object> para) throws Exception { |
|
|
|
private void dealExporter(OutputStream outputStream, String path, final Map<String, Object> para) throws Exception { |
|
|
|
|
|
|
|
if (path.startsWith(ProjectConstants.REPORTLETS_NAME)) { |
|
|
|
|
|
|
|
path = path.substring(ProjectConstants.REPORTLETS_NAME.length()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 没有办法处理这个 isLocal 判断,因为一个是修改参数传递结果,一个是返回值做结果
|
|
|
|
|
|
|
|
// todo 后续想想办法
|
|
|
|
|
|
|
|
if (WorkContext.getCurrent().isLocal()) { |
|
|
|
|
|
|
|
WorkContext.getCurrent().get(TemplateExportOperator.class) |
|
|
|
|
|
|
|
.export(exportKey(), exportType(), outputStream, path, para); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
byte[] contents = |
|
|
|
byte[] contents = |
|
|
|
WorkContext.getCurrent().get(TemplateExportOperator.class) |
|
|
|
WorkContext.getCurrent().get(TemplateExportOperator.class) |
|
|
|
.export(exportKey(), exportType(), null, path, para); |
|
|
|
.export(exportKey(), exportType(), null, path, para); |
|
|
|
|
|
|
|
|
|
|
|
outputStream.write(contents); |
|
|
|
outputStream.write(contents); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void update() { |
|
|
|
public void update() { |
|
|
|