package com.neusoft.report.engine;

import com.neusoft.report.common.Logger;
import com.neusoft.report.common.ReportMessage;
import com.neusoft.report.common.entity.defaultt.DefaultPropertyLoader;
import com.neusoft.report.engine.core.MultiReportEngine;
import com.neusoft.report.engine.core.ReportCacheMgr;
import com.neusoft.report.engine.export.param.TempUploadManager;
import com.neusoft.report.engine.rao.tempmemo.TempMemoManager;
import com.neusoft.report.engine.security.licence.UtilProtection;
import com.neusoft.report.engine.util.PerformanceDebug;
import com.neusoft.report.engine.util.ReportManifestInfo;
import com.neusoft.unieap.rbc.license.LicenseManager;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import javax.servlet.ServletContext; public class ReportManager {
public static final String PROJECT_PATH = "projectPath";
public static final String PROJECT_BASE_URL = "baseURL";
public static final String SERVLET_CONTEXT = "context";
public static final String CONFIG_PATH = "configPath";
public static final String CONFIG_BASE_URL = "configBaseURL";
public static final String LICENSE_PATH = "licensePath";
public static final String LICENSE_FILE_NAME = "licenseFileName";
private static final String DEFAULT_LICENSE_NAME = "unieap.license";
private static String projectPath;
private static URL baseURL;
private static URL configURL;
private static ServletContext context;
private static String configRoot;
private static String webPath;
private static String licensePath;
private static String licenseFileName; public ReportManager() {
} public static ReportEngine create() {
if (PerformanceDebug.isDebugEnabled()) {
PerformanceDebug.debug("Performance-Requist", true, 0L);
} return new MultiReportEngine();
} public static void initiate(Map var0) throws MalformedURLException {
projectPath = (String)var0.get("projectPath");
context = (ServletContext)var0.get("context");
baseURL = (URL)var0.get("baseURL");
configRoot = (String)var0.get("configPath");
configURL = configRoot != null && configRoot.startsWith(File.separator) ? (new File(configRoot)).toURL() : (URL)var0.get("configBaseURL");
licensePath = var0.containsKey("licensePath") ? (String)var0.get("licensePath") : (projectPath != null && !projectPath.equals("/") ? projectPath + "WEB-INF" + File.separator + "conf" + File.separator + "unieap" + File.separator + "license" + File.separator : (new URL(baseURL, "WEB-INF/conf/unieap/license/")).getFile());
licenseFileName = var0.containsKey("licenseFileName") ? (String)var0.get("licenseFileName") : "unieap.license";
Logger.getLogger(ReportManager.class).info(ReportMessage.createMessage("using_report_config_path", new String[]{configURL.toExternalForm()}));
startLicenceCheck(licensePath);
printProductInfo();
startCleanTask();
startCleanTemp();
initCache();
DefaultPropertyLoader.load();
} public static String getProjectPath() {
return projectPath;
} public static URL getProjectBaseURL() {
return baseURL;
} public static URL getResourceURL(String var0) throws MalformedURLException {
return context.getResource(var0);
} public static Set getResourcePaths(String var0) {
HashSet var1;
if (context != null) {
var1 = new HashSet();
Set var8 = context.getResourcePaths(var0);
if (var8 != null) {
try {
Iterator var9 = var8.iterator(); while(var9.hasNext()) {
String var10 = (String)var9.next();
var1.add(context.getResource(var10));
}
} catch (MalformedURLException var6) {
var6.printStackTrace();
}
} return var1;
} else {
var1 = new HashSet();
File var2 = null;
if (baseURL.getProtocol().equalsIgnoreCase("file")) {
try {
var2 = new File((new URL(baseURL, var0.substring())).getFile());
} catch (MalformedURLException var5) {
var5.printStackTrace();
return var1;
}
} else {
var2 = new File(projectPath + File.separator + var0.substring());
} if (var2.isDirectory()) {
String[] var3 = var2.list(); try {
for(int var4 = ; var4 < var3.length; ++var4) {
var1.add(new URL(var2.toURL(), var3[var4]));
}
} catch (MalformedURLException var7) {
var7.printStackTrace();
}
} return var1;
}
} public static Set getConfigPaths(String var0) {
if (configRoot != null && configRoot.startsWith(File.separator)) {
HashSet var1 = new HashSet();
File var2 = new File(configRoot + File.separator + var0.replace('/', File.separatorChar));
if (var2.isDirectory()) {
String var3 = var2.getAbsolutePath();
String[] var4 = var2.list(); try {
for(int var5 = ; var5 < var4.length; ++var5) {
var1.add((new File(var3 + File.separator + var4[var5])).toURL());
}
} catch (MalformedURLException var6) {
var6.printStackTrace();
return var1;
}
} return var1;
} else {
return getResourcePaths("/" + getConfigRoot() + var0);
}
} private static String getConfigRoot() {
return configRoot == null ? "WEB-INF/conf/unieap/report/" : configRoot;
} public static URL getConfigURL() {
return configURL;
} public static String getConfigPath() {
return configRoot == null ? projectPath + "WEB-INF" + File.separator + "conf" + File.separator + "unieap" + File.separator + "report" + File.separator : (configRoot.startsWith(File.separator) ? configRoot : projectPath + configRoot);
} public static String getWebPath() {
return webPath;
} public static String getLicencePath() {
return licensePath;
} public static String getLicenceFileName() {
return licenseFileName;
} public static void setWebPath(String var0) {
webPath = var0;
} private static void printProductInfo() {
ReportManifestInfo.paintMainfestInfo();
if (LicenseManager.getInstance().getLicense() != null) {
ReportManifestInfo.printLicenseInfo();
} } private static void startLicenceCheck(String var0) {
LicenseManager.getInstance().setLicensePath(var0);
LicenseManager.getInstance().startLicenseListener(UtilProtection.getProtection(), (long)UtilProtection.CHECK_INTERVAL);
} private static void startCleanTask() {
TempMemoManager.getInstance().startCleanTask();
} private static void startCleanTemp() {
TempUploadManager.getInstance().cleanUploadTempFiles();
} private static void initCache() {
ReportCacheMgr.getCachePath();
}
}

ReportManager的更多相关文章

  1. MyBatis 配置文件头部换行异常

    INFO - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory ...

  2. Exception mybatis 配置文件:<typeAlias alias="***" type="***"/> 重复配置

    INFO - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory ...

  3. 实现SQL Server 2008 Reporting Services匿名访问报表有两种方法

    一.通过修改SQL Server 2008的配置文件,去掉Windows的验证. 1.首先我们找到SQL安装目录下的两个Web.config配置文件,默认安装目录分别是(C:\Program File ...

  4. 匿名访问ReportService报表服务器(一)

    我的数据库版本是sql server 2008 r2,系统环境是windows server2008. 对于sql server 2008 r2上报rs报表的匿名访问问题,我这边尝试过两个可行方案: ...

  5. 二十一、【.Net开源框架】EFW框架Web前端开发之目录结构和使用FireBug调试方法

    回<[开源]EFW框架系列文章索引> EFW框架源代码下载V1.2:http://pan.baidu.com/s/1hcnuA EFW框架实例源代码下载:http://pan.baidu. ...

  6. SSRS匿名访问

    ---本人数据库是SqlServer2008 R2 匿名访问Reporting Service 2008 我想通过访问Url的方式,把部署到Sql Server  Reporting Service ...

  7. Asp.Net缓存(1)

    知其根本,方能应用.MSDN上的缓存讲解.先看原来讲解. Asp.Net缓存概述 通常,应用程序可以将那些频繁访问的数据,以及那些需要大量处理时间来创建的数据存储在内存中,从而提高性能. 在这些情况下 ...

  8. Cache 应用程序数据缓存

    System.Web.Caching 命名空间提供用于缓存服务器上常用数据的类.此命名空间包括 Cache 类,该类是一个字典,您可以在其中存储任意数据对象,如哈希表和数据集.它还为这些对象提供了失效 ...

  9. SQL Server 2005中设置Reporting Services发布web报表的匿名访问

    原文:SQL Server 2005中设置Reporting Services发布web报表的匿名访问 一位朋友提出个问题:集成到SQL Server 2005中的Reporting Services ...

随机推荐

  1. apache traffic server安装

    wget http://mirrors.hust.edu.cn/apache/trafficserver/trafficserver-7.1.1.tar.bz2 tar -jxvf trafficse ...

  2. oracle 如何解锁表

    --查询被锁的表 select b.owner,b.object_name,a.session_id,a.locked_mode from v$locked_object a,dba_objects ...

  3. Ubuntu 双网卡route

    ip route flush table sz ip route add default via 183.2.218.254 dev eth0 src 183.2.218.4 table sz ip ...

  4. nslookup 工具的使用方法记录

    查询IP地址 nslookup最简单的用法就是查询域名对应的IP地址,包括A记录和CNAME记录,如果查到的是CNAME记录还会返回别名记录的设置情况.其用法是: nslookup 域名 定查询记录类 ...

  5. 数据可视化--> numpy

    一.NumPy 1.简介: 官网链接:http://www.numpy.org/ NumPy是Python语言的一个扩充程序库.支持高级大量的维度数组与矩阵运算,此外也针对数组运算提供大量的数学函数库 ...

  6. 界面开发工具集Telerik UI for ASP.NET AJAX发布R2 2019

    Telerik UI for ASP.NET AJAX拥有构建ASP.NET AJAX和SharePoint应用程序的80+控件,将为任何浏览器和设备构建Web Forms应用程序的时间缩短一半.Te ...

  7. 17.树的子结构(python)

    题目描述 输入两棵二叉树A,B,判断B是不是A的子结构.(ps:我们约定空树不是任意一个树的子结构) class Solution: def HasSubtree(self, pRoot1, pRoo ...

  8. css-select的三角在不同浏览器的样式是不一样的,所以我们这样解决???

    select{ width:57px; height:23px; border:1px solid #e9e9e9; outline: none; appearance: none; -moz-app ...

  9. DOM例子小结(一)

    一.点击按钮切换图片 核心思路: 1.首先获取元素 2.为元素添加点击事件 3.当事件被触发时运行代码 <!DOCTYPE html> <html lang="en&quo ...

  10. chalk插件 使终端输出的字带颜色

    1.使终端输出红色字体: const chalk = require('chalk'); console.log(chalk.red('this is red!') 这时运行终端,打印的this is ...