2021. 12. 6. 03:57
MSTR ContextPath 변경됐을때 PDF Export문제 MicroStrategy2021. 12. 6. 03:57
http://localhost:8080/MicroStrategy/servlet/mstrWeb에서
http://localhost:8080/servlet/mstrWeb으로 ContextPath 변경후 Export 문제 발생
1. Export시 Session 끊어짐
WEB-INF/xml/sys_defaults.properties 파일에
useSessionCookie=1
추가
2. PDF Export시에 d3차트 로딩 실패
기본설정 > 프로젝트 기본값 > 보안 > 내배내기 용 URL 허용 > 현재도메인 URL 패턴 추가
http://localhost:8080/*
3. PDF Export시 /images/를 제외한 다른 폴더의 image파일 not found 에러
http://localhost:8080/servlet/plugins/myplugin/images/mytest.png 식으로 잘못 호출하고 있음.
- web.xml에 서블릿 매핑 추가
<servlet-mapping>
<servlet-name>mstrDocumentImages</servlet-name>
<url-pattern>/servlet/plugins/myplugin/*</url-pattern>
</servlet-mapping>
- DocumentImageServlet 에 관련 코드 추가
private String getRedirectPath(HttpServletRequest request, String path) {
String imagesRootPath = "/images/";
String savedImagesRootPath = "/savedimages/";
String redirectScheme = request.getScheme();
String port = ":" + request.getServerPort();
if (StringUtils.isNotEmpty(_scheme)) {
redirectScheme = _scheme;
port = "";
}
String contextPath = redirectScheme + "://" + request.getServerName() + port + request.getContextPath();
int position = path.toLowerCase(Locale.ENGLISH).indexOf(imagesRootPath);
if (position <= 0) {
position = path.toLowerCase(Locale.ENGLISH).indexOf(savedImagesRootPath);
}
if (position <= 0) {
return "";
}
/////////PDF Export 문제로 추가함/////////////
int myPosition = path.indexOf("/plugins/myplugin/");
if( myPosition > -1) {
position = myPosition;
}
/////////PDF Export 문제로 추가함/////////////
String tempStr = path.substring(position);
tempStr = contextPath + tempStr;
Pattern p = Pattern.compile("\r|\n");
Matcher m = p.matcher(tempStr);
tempStr = m.replaceAll("");
return tempStr;
}
'MicroStrategy' 카테고리의 다른 글
MSTR Web Customization Editor 한글 깨짐 (0) | 2023.07.18 |
---|---|
MSTR Developer 실행중 에러 (0) | 2022.07.01 |
MSTR 2019 Dossier Menu Toolbar Customization (0) | 2020.01.08 |
MicroStrategy Library IPhone 프롬프트 버그 (0) | 2019.12.09 |
MSTR 연산자 목록 (0) | 2019.11.16 |