|
|
|
@ -150,6 +150,14 @@ public class OnlineWidgetBlock extends AbstractOnlineWidgetBlock {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private String createLocalReuFilename() { |
|
|
|
|
String filename = widget.getFileLoca(); |
|
|
|
|
if (StringUtils.isEmpty(filename) || !filename.endsWith(".reu")) { |
|
|
|
|
filename = widget.getName() + "." + widget.getUuid() + ".reu"; |
|
|
|
|
} |
|
|
|
|
return filename; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void downLoadWidget() { |
|
|
|
|
if (OnlineWidgetRepoPane.getInstance().isShowPackagePanel()) { |
|
|
|
|
ComponentCollector.getInstance().collectDownloadPktNum(); |
|
|
|
@ -170,7 +178,8 @@ public class OnlineWidgetBlock extends AbstractOnlineWidgetBlock {
|
|
|
|
|
protected Boolean doInBackground() { |
|
|
|
|
String filePath; |
|
|
|
|
try { |
|
|
|
|
filePath = DownloadUtils.download(widget.getId(), widget.getName() + "." + widget.getUuid(), process); |
|
|
|
|
String filename = createLocalReuFilename(); |
|
|
|
|
filePath = DownloadUtils.download(widget.getId(), filename, process); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
|
return false; |
|
|
|
@ -179,7 +188,7 @@ public class OnlineWidgetBlock extends AbstractOnlineWidgetBlock {
|
|
|
|
|
//安装
|
|
|
|
|
File file = new File(filePath); |
|
|
|
|
try { |
|
|
|
|
if (file.exists() && getDefaultGroup().installModule(file)) { |
|
|
|
|
if (file.exists() && getDefaultGroup().installUniqueIdModule(file)) { |
|
|
|
|
ShareUtils.recordInstallTime(file.getName(), System.currentTimeMillis()); |
|
|
|
|
ComponentCollector.getInstance().collectCmpDownLoad(widget.getUuid()); |
|
|
|
|
} |
|
|
|
|