|
|
@ -1,8 +1,8 @@ |
|
|
|
package com.fr.design.extra; |
|
|
|
package com.fr.design.extra; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.base.FRContext; |
|
|
|
import com.fr.base.FRContext; |
|
|
|
import com.fr.design.DesignerEnvManager; |
|
|
|
|
|
|
|
import com.fr.design.extra.exe.callback.*; |
|
|
|
import com.fr.design.extra.exe.callback.*; |
|
|
|
|
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
import com.fr.general.FRLogger; |
|
|
|
import com.fr.general.FRLogger; |
|
|
|
import com.fr.general.Inter; |
|
|
|
import com.fr.general.Inter; |
|
|
|
import com.fr.general.SiteCenter; |
|
|
|
import com.fr.general.SiteCenter; |
|
|
@ -33,15 +33,8 @@ public class PluginOperateUtils { |
|
|
|
|
|
|
|
|
|
|
|
public static void installPluginOnline(final PluginMarker pluginMarker, JSCallback jsCallback) { |
|
|
|
public static void installPluginOnline(final PluginMarker pluginMarker, JSCallback jsCallback) { |
|
|
|
//下载插件
|
|
|
|
//下载插件
|
|
|
|
if (!BBSPluginLogin.getInstance().hasLogin()) { |
|
|
|
|
|
|
|
UserLoginContext.fireLoginContextListener(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (BBSPluginLogin.getInstance().hasLogin()) { |
|
|
|
|
|
|
|
PluginTask pluginTask = PluginTask.installTask(pluginMarker); |
|
|
|
PluginTask pluginTask = PluginTask.installTask(pluginMarker); |
|
|
|
PluginControllerHelper.installOnline(pluginMarker, new InstallOnlineCallback(pluginTask, jsCallback)); |
|
|
|
PluginControllerHelper.installOnline(pluginMarker, new InstallOnlineCallback(pluginTask, jsCallback)); |
|
|
|
}else{ |
|
|
|
|
|
|
|
jsCallback.execute("success"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static void installPluginFromDisk(File zipFile, JSCallback jsCallback) { |
|
|
|
public static void installPluginFromDisk(File zipFile, JSCallback jsCallback) { |
|
|
@ -50,15 +43,10 @@ public class PluginOperateUtils { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void updatePluginOnline(List<PluginMarker> pluginMarkerList, JSCallback jsCallback) { |
|
|
|
public static void updatePluginOnline(List<PluginMarker> pluginMarkerList, JSCallback jsCallback) { |
|
|
|
if (!(BBSPluginLogin.getInstance().hasLogin())) { |
|
|
|
|
|
|
|
LoginCheckContext.fireLoginCheckListener(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (BBSPluginLogin.getInstance().hasLogin()) { |
|
|
|
|
|
|
|
for (int i = 0; i < pluginMarkerList.size(); i++) { |
|
|
|
for (int i = 0; i < pluginMarkerList.size(); i++) { |
|
|
|
updatePluginOnline(pluginMarkerList.get(i), jsCallback); |
|
|
|
updatePluginOnline(pluginMarkerList.get(i), jsCallback); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void updatePluginOnline(PluginMarker pluginMarker, JSCallback jsCallback) { |
|
|
|
public static void updatePluginOnline(PluginMarker pluginMarker, JSCallback jsCallback) { |
|
|
|
try { |
|
|
|
try { |
|
|
@ -76,8 +64,8 @@ public class PluginOperateUtils { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void updatePluginFromDisk(final String filePath, JSCallback jsCallback) { |
|
|
|
public static void updatePluginFromDisk(File zipFile, JSCallback jsCallback) { |
|
|
|
PluginManager.getController().update(new File(filePath), new UpdateFromDiskCallback(new File(filePath), jsCallback)); |
|
|
|
PluginManager.getController().update(zipFile, new UpdateFromDiskCallback(zipFile, jsCallback)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -271,22 +259,16 @@ public class PluginOperateUtils { |
|
|
|
}).start(); |
|
|
|
}).start(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static void getLoginInfo(JSCallback jsCallback) { |
|
|
|
public static void getLoginInfo(JSCallback jsCallback, UILabel uiLabel) { |
|
|
|
|
|
|
|
|
|
|
|
if (!BBSPluginLogin.getInstance().hasLogin()) { |
|
|
|
|
|
|
|
String userName = DesignerEnvManager.getEnvManager().getBBSName(); |
|
|
|
|
|
|
|
String password = DesignerEnvManager.getEnvManager().getBBSPassword(); |
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(userName)) { |
|
|
|
|
|
|
|
BBSPluginLogin.getInstance().login(new BBSUserInfo(userName, password)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
BBSUserInfo bbsUserInfo = BBSPluginLogin.getInstance().getUserInfo(); |
|
|
|
BBSUserInfo bbsUserInfo = BBSPluginLogin.getInstance().getUserInfo(); |
|
|
|
String username = bbsUserInfo == null ? "" : bbsUserInfo.getUserName(); |
|
|
|
String username = bbsUserInfo == null ? "" : bbsUserInfo.getUserName(); |
|
|
|
String inShowUsername = DesignerEnvManager.getEnvManager().getInShowBBsName(); |
|
|
|
|
|
|
|
if (StringUtils.isEmpty(username) && StringUtils.isEmpty(inShowUsername)) { |
|
|
|
if (StringUtils.isEmpty(username)) { |
|
|
|
return; |
|
|
|
jsCallback.execute(""); |
|
|
|
|
|
|
|
uiLabel.setText(Inter.getLocText("FR-Base_UnSignIn")); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
String result = StringUtils.isEmpty(inShowUsername) ? username : inShowUsername; |
|
|
|
uiLabel.setText(username); |
|
|
|
|
|
|
|
String result = username; |
|
|
|
jsCallback.execute(result); |
|
|
|
jsCallback.execute(result); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|