BOE4.1升级默认时间处理方案2015年7月i目录1需求说明..............................................................................................................................................................12准备工作..............................................................................................................................................................13SDK开发升级.....................................................................................................................................................14升级内容详细说明..............................................................................................................................................24.1修改内容.................................................................................................................................................24.2部署以及更新:.....................................................................................................................................4第1页1需求说明机场SAPBOE系统由R3版本升级至R4SP4版本,需要调整系统所有WEBI报表的默认时间:昨日、今日、明日,需要针对该功能的R3自定义开发功能进行R4版本的SDK升级。昨日:默认时间1970-1-1或1970-1-100:00:00今日:默认时间1970-1-2或1970-1-200:00:00明日:默认时间1970-1-3或1970-1-300:00:002准备工作在升级SDK做工之前,需要进行如下准备工作:1)进行BOE的整体软件升级:安装BOER4SP4新版本。2)BOER3系统对象的整体升级到BOER4SP4版本。3SDK开发升级升级对象com.businessobjects.webpath.AnalyticalReporting_jsp.6.0.18.jar对象路径BOE安装路径\Tomcat6\webapps\BOE\WEB-INF\eclipse\plugins子对象内容getPrompts_jsp.java第2页getPrompts_jsp.class4升级内容详细说明4.1修改内容使用解压缩软件打开com.businessobjects.webpath.AnalyticalReporting_jsp.6.0.18.jar导航路径:\web\WEB-INF\precompiledJspSrc\org\apache\jsp\webiDHTML\viewer,找到getPrompts_jsp.java文件查找JAVA文件如下内容的:JSONArrayanswerInfo=promptHelper.getPromptAnswerInfo(parameter,requestWrapper,i);在这行下面添加如下代码:if(answerInfo.length()0){for(inta=0;aanswerInfo.length();a++){JSONObjectdefaultObject=(JSONObject)answerInfo.get(a);StringdefaultValue=defaultObject.getString(caption);SimpleDateFormatformat=newSimpleDateFormat(yyyy-MM-dd);SimpleDateFormatformat1=newSimpleDateFormat(yyyy-MM-ddHH:mm:ss);Calendarcalendar=Calendar.getInstance();intyear=calendar.get(Calendar.YEAR);intmonth=calendar.get(Calendar.MONTH);intday=calendar.get(Calendar.DAY_OF_MONTH);if(defaultValue!=null&&(defaultValue.indexOf(00:00)-1)){try{defaultValue=format1.format(format1.parse(defaultValue));}catch(Exceptione){e.printStackTrace();}if(defaultValue.equals(1970-01-0100:00:00)){defaultObject.remove(caption);calendar.set(year,month,day-1,0,0,0);第3页defaultObject.put(caption,format1.format(calendar.getTime()));}elseif(defaultValue.equals(1970-01-0200:00:00)){defaultObject.remove(caption);calendar.set(year,month,day,0,0,0);defaultObject.put(caption,format1.format(calendar.getTime()));}elseif(defaultValue.equals(1970-01-0300:00:00)){defaultObject.remove(caption);calendar.set(year,month,day+1,0,0,0);defaultObject.put(caption,format1.format(calendar.getTime()));}}else{try{defaultValue=format.format(format.parse(defaultValue));}catch(Exceptione){e.printStackTrace();}if(defaultValue.equals(1970-01-01)){defaultObject.remove(caption);calendar.set(year,month,day-1);defaultObject.put(caption,format.format(calendar.getTime()));}elseif(defaultValue.equals(1970-01-02)){defaultObject.remove(caption);defaultObject.put(caption,format.format(newDate()));}elseif(defaultValue.equals(1970-01-03)){defaultObject.remove(caption);calendar.set(year,month,day+1);defaultObject.put(caption,format.format(calendar.getTime()));}}}}保存并更新改JAVA文件编译该JAVA文件为getPrompts_jsp.class,覆盖JAR包文件如下路径:web\WEB-INF\precompiledJspClasses\org\apache\jsp\webiDHTML\viewer下面的getPrompts_jsp.class文件第4页4.2部署以及更新:将修改后的JAR包文件更新之服务器如下目录:BOER4默认安装目录\Tomcat6\webapps\BOE\WEB-INF\eclipse\plugins和BOER4默认安装目录\Tomcat6\work\Catalina\localhost\BOE\eclipse\plugins重起Tomcat