1、下载gliffy-confluence-plugin-9.1.2.obr
2、解压后找到GliffyLicenseManager.class
3、反编译GliffyLicenseManager.class,替换原来的实现,重新编译成class后替换进去
package com.gliffy.plugin.confluence.license;
import com.atlassian.confluence.setup.BootstrapManager;
import com.atlassian.confluence.setup.settings.CoreFeaturesManager;
import com.atlassian.upm.api.license.PluginLicenseManager;
import com.atlassian.upm.api.license.entity.LicenseError;
import com.atlassian.upm.api.license.entity.LicenseType;
import com.atlassian.upm.api.license.entity.PluginLicense;
import com.atlassian.upm.api.util.Option;
import org.joda.time.DateTime;
import org.joda.time.Days;
import org.joda.time.ReadableInstant;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class GliffyLicenseManager {
private static final Logger logger = LoggerFactory.getLogger(GliffyLicenseManager.class);
private PluginLicenseManager licenseManager;
private CoreFeaturesManager coreFeaturesManager;
private BootstrapManager bootstrapManager;
public GliffyLicenseManager(PluginLicenseManager licenseManager, CoreFeaturesManager coreFeaturesManager, BootstrapManager bootstrapManager) {
this.licenseManager = licenseManager;
this.coreFeaturesManager = coreFeaturesManager;
this.bootstrapManager = bootstrapManager;
}
/*private PluginLicense fetchLicense() {
PluginLicense license = null;
Option<PluginLicense> licenseOption = this.licenseManager.getLicense();
if (licenseOption.isDefined()) {
license = (PluginLicense)licenseOption.get();
} else {
logger.debug("no Gliffy license found");
}
return license;
}*/
public boolean isValid() {
/*PluginLicense license = this.fetchLicense();
return license != null ? license.isValid() : false;*/
return true;
}
public boolean isSupported() {
/*PluginLicense license = this.fetchLicense();
if (license != null) {
return !license.isMaintenanceExpired();
} else {
return false;
}*/
return true;
}
public boolean isEvaluation() {
/*PluginLicense license = this.fetchLicense();
return license != null ? license.isEvaluation() : false;*/
return false;
}
public String getLicenseError() {
/*PluginLicense license = this.fetchLicense();
if (license != null) {
Option<LicenseError> errorOption = license.getError();
if (errorOption.isDefined()) {
return ((LicenseError)errorOption.get()).toString();
}
}
return null;*/
return null;
}
public String getSEN() {
/*PluginLicense license = this.fetchLicense();
if (license != null) {
Option<String> customerIdOption = license.getSupportEntitlementNumber();
if (customerIdOption.isDefined()) {
return (String)customerIdOption.get();
}
}
return null;*/
return null;
}
public boolean isCloud() {
/*return this.coreFeaturesManager.isOnDemand();*/
return false;
}
public LicenseType getLicenseType() {
/*PluginLicense license = this.fetchLicense();
return license != null ? license.getLicenseType() : null;*/
return LicenseType.COMMERCIAL;
}
public int getDaysToExpiration() {
/*PluginLicense license = this.fetchLicense();
if (license != null) {
Option<DateTime> expiryDateOption = license.getExpiryDate();
if (expiryDateOption.isDefined()) {
return Days.daysBetween(new DateTime(), (ReadableInstant)expiryDateOption.get()).getDays();
}
}
return 0;*/
return Integer.MAX_VALUE;
}
public Integer getUserCount() {
/*PluginLicense license = this.fetchLicense();
if (license != null) {
Option<Integer> qtyUsersOption = license.getEdition();
if (qtyUsersOption.isDefined()) {
return (Integer)qtyUsersOption.get();
}
}
return null;*/
return Integer.MAX_VALUE;
}
public boolean isFree() {
/*if (this.fetchLicense() == null) {
return false;
} else {
LicenseType type = this.getLicenseType();
return type.equals(LicenseType.COMMUNITY) || type.equals(LicenseType.NON_PROFIT) || type.equals(LicenseType.OPEN_SOURCE);
}*/
return false;
}
public boolean isCommercial() {
return this.isValid() && this.isSupported() && !this.isEvaluation() && !this.isFree();
}
public long getLicenseInstallUnixTimestamp() {
/*PluginLicense license = this.fetchLicense();
return license != null ? license.getCreationDate().getMillis() / 1000L : 0L;*/
return 0L;
}
public String getLicenseManagementURL() {
/*return this.bootstrapManager.getWebAppContextPath() + "/plugins/servlet/upm#manage/com.gliffy.integration.confluence";*/
return "";
}
public boolean isNonAnalyticsLicenseType() {
/*LicenseType licenseType = this.getLicenseType();
boolean isEvalCloudInstance = this.isCloud() && (this.isEvaluation() || licenseType == null);
return isEvalCloudInstance || LicenseType.DEVELOPER.equals(licenseType) || LicenseType.TESTING.equals(licenseType) || LicenseType.DEMONSTRATION.equals(licenseType);*/
return false;
}
}