Saiku3.15去除License与主界面

  1. 资源下载

  2. 修改org.saiku.web.service.SessionService.java

public Map<String, Object> login(HttpServletRequest req, String username, String password ) throws LicenseException {
//		Object sl = null;
//		String notice = null;
		HttpSession session = ((HttpServletRequest)req).getSession(true);
		session.getId();
		sessionRepo.setSession(session);
		
//		try {
//			sl = l.getLicense();
//		} catch (Exception e) {
//			log.debug("Could not process license", e);
//			throw new LicenseException("Error fetching license. Get a free license from http://licensing.meteorite.bi. You can upload it at /upload.html");
//		}

//		if (sl != null) {
		if (true) {

//			try {
//				l.validateLicense();
//			} catch (RepositoryException | IOException | ClassNotFoundException e) {
//				log.debug("Repository Exception, couldn't get license", e);
//				throw new LicenseException("Error fetching license. Please check your logs.");
//			}

			//				if (l.getLicense() instanceof SaikuLicense2) {
			if (true) {
			    if (authenticationManager != null) {
			        authenticate(req, username, password);
			    }
			    if (SecurityContextHolder.getContext() != null
			        && SecurityContextHolder.getContext().getAuthentication() != null) {
			        Authentication auth = SecurityContextHolder.getContext().getAuthentication();

			        if (authorisationPredicate.isAuthorised(auth)) {
			            Object p = auth.getPrincipal();
			            createSession(auth, username, password);
			            return sessionHolder.get(p);
			        } else {
			            log.info(username + " failed authorisation. Rejecting login");
			            throw new RuntimeException("Authorisation failed for: " + username);
			        }
			    }
			    return new HashMap<>();
			}
		}
		return null;
	}
  1. 修改org.saiku.web.rest.resources.License.java
public Response getLicense() {
//    try {
//      return Response.ok().entity(licenseUtils.getLicense()).build();
//    } catch (IOException | RepositoryException | ClassNotFoundException e) {
//      e.printStackTrace();
//    }
//    return Response.serverError().build();
	  
	  return Response.ok().build();
    }
  
public Response validateLicense() {
//    if(!userService.isAdmin()){
//      return Response.status(Response.Status.FORBIDDEN).build();
//    }
//    try {
//      licenseUtils.validateLicense();
//    } catch (IOException e) {
//      e.printStackTrace();
//      return Response.status(Response.Status.INTERNAL_SERVER_ERROR)
//                     .entity(e.getLocalizedMessage()).build();
//    } catch (ClassNotFoundException e) {
//      e.printStackTrace();
//      return Response.status(Response.Status.INTERNAL_SERVER_ERROR)
//                     .entity(e.getLocalizedMessage()).build();
//    } catch (LicenseException e) {
//      return Response.status(Response.Status.INTERNAL_SERVER_ERROR)
//                     .entity(e.getLocalizedMessage()).build();
//    } catch (RepositoryException e) {
//      return Response.status(Response.Status.INTERNAL_SERVER_ERROR)
//                     .entity("Could not find license file").build();
//    } catch (Exception e) {
//      e.printStackTrace();
//    }
    return Response.ok().entity("Valid License").build();


  }  
  1. 去除商业提示信息

a) saiku-server\tomcat\webapps\ROOT\index.html

<!-- 
<script type="text/x-jquery-tmpl" id="template-upgrade">
            <div class="upgradeheader">
                You are using Saiku Community Edition, please consider <a target="_blank" href="http://saiku.meteorite.bi/support">purchasing support, or entering a sponsorship agreement with us</a> to support development. <a href="mailto:info@meteorite.bi?subject=Supporting Saiku">info@meteorite.bi</a><span class="close_tab sprite"></span>
            </div>
        </script>
-->

b) saiku-server\tomcat\webapps\ROOT\js\saiku\views\Upgrade.js

render: function() {
		return this;
		
/*
		var self = this;
		var license = new License();

		if(Settings.BIPLUGIN5){
				if(Saiku.session.get("notice") != undefined && Saiku.session.get("notice")!=null && Saiku.session.get("notice")!=""){
					$(this.el).append("<div><div id='uphead' class='upgradeheader'>Notice:"+Saiku.session.get("notice")+"</div>");

				}
				if (Settings.LICENSE.licenseType != undefined && (Settings.LICENSE.licenseType != "trial" && Settings.LICENSE.licenseType != "Open Source License")) {
					return this;
				}
				if (Settings.LICENSE != undefined && Settings.LICENSE.licenseType === "trial") {
					var yourEpoch = parseFloat(Settings.LICENSE.expiration);
					var yourDate = new Date(yourEpoch);
					self.remainingdays = self.daydiff(new Date(), yourDate);


					$(this.el).append("<div><div id='uphead' class='upgradeheader'>You are using a Saiku Enterprise" +
						" Trial license, you have "+ self.remainingdays+" days remaining. <a href='http://www.meteorite.bi/saiku-pricing'>Buy licenses online.</a></div>");
					return self;
				}
				else {
					$(this.el).append("<div><div id='uphead' class='upgradeheader'>You are using Saiku Community" +
						" Edition, please consider upgrading to <a target='_blank' href='http://meteorite.bi'>Saiku Enterprise</a>, or entering a <a href='http://meteorite.bi/products/saiku/sponsorship'>sponsorship agreement with us</a> to support development. " +
						"<a href='http://meteorite.bi/products/saiku/community'>Or contribute by joining our community and helping other users!</a></div></div>");

					return self;
				}
		}
		else {
				if(Saiku.session.get("notice") != undefined && Saiku.session.get("notice")!=null && Saiku.session.get("notice")!=""){
					$(this.el).append("<div><div id='uphead' class='upgradeheader'>Notice:"+Saiku.session.get("notice")+"</div>");

				}
				if (Settings.LICENSE.licenseType != undefined && (Settings.LICENSE.licenseType != "trial" &&
					Settings.LICENSE.licenseType != "Open Source License")) {
					return this;
				}
				if (Settings.LICENSE.licenseType === "trial") {
					var yourEpoch = parseFloat(Settings.LICENSE.expiration);
					var yourDate = new Date(yourEpoch);

					self.remainingdays = self.daydiff(new Date(), yourDate);

					$(this.el).append("<div><div id='uphead' class='upgradeheader'>You are using a Saiku Enterprise" +
						" Trial license, you have "+ self.remainingdays+" days remaining. <a href='http://www.meteorite.bi/saiku-pricing'>Buy licenses online.</a></div>");
					return self;
				}
				else {
					$(this.el).append("<div><div id='uphead' class='upgradeheader'>You are using Saiku Community" +
						" Edition, please consider upgrading to <a target='_blank' href='http://meteorite.bi'>Saiku Enterprise</a>, or entering a <a href='http://meteorite.bi/products/saiku/sponsorship'>sponsorship agreement with us</a> to support development. " +
						"<a href='http://meteorite.bi/products/saiku/community'>Or contribute by joining our community and helping other users!</a></div></div>");
					return self;
				}
		}



*/




	},
  1. 去除登陆后的欢迎页面

a) saiku-server\tomcat\webapps\ROOT\js\saiku\views\SplashScreen.js

#修改成空白页 
template: function() {
        var template = $("");
        return _.template(template)({
            //    cube_navigation: Saiku.session.sessionworkspace.cube_navigation
        });

    }
  1. 文章参考
    http://www.cnblogs.com/avivaye/p/4877882.html
  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值