use of com.netsteadfast.greenstep.po.hbm.TbSys in project bamboobsc by billchen198318.
the class ApplicationSiteUtils method getBasePath.
@SuppressWarnings("unchecked")
public static String getBasePath(String sysId, HttpServletRequest request) {
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + "/";
if (StringUtils.isBlank(sysId)) {
return basePath;
}
ISysService<SysVO, TbSys, String> sysService = (ISysService<SysVO, TbSys, String>) AppContext.getBean("core.service.SysService");
SysVO sys = new SysVO();
sys.setSysId(sysId);
try {
DefaultResult<SysVO> result = sysService.findByUK(sys);
if (result.getValue() == null) {
return basePath;
}
sys = result.getValue();
basePath = request.getScheme() + "://" + sys.getHost() + "/" + sys.getContextPath() + "/";
} catch (ServiceException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
return basePath;
}
use of com.netsteadfast.greenstep.po.hbm.TbSys in project bamboobsc by billchen198318.
the class ApplicationSiteUtils method getContextPath.
@SuppressWarnings("unchecked")
public static String getContextPath(String sysId) {
String contextPath = "";
ISysService<SysVO, TbSys, String> sysService = (ISysService<SysVO, TbSys, String>) AppContext.getBean("core.service.SysService");
SysVO sys = new SysVO();
sys.setSysId(sysId);
try {
DefaultResult<SysVO> result = sysService.findByUK(sys);
if (result.getValue() == null) {
return contextPath;
}
sys = result.getValue();
contextPath = sys.getContextPath();
} catch (ServiceException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
return contextPath;
}
use of com.netsteadfast.greenstep.po.hbm.TbSys in project bamboobsc by billchen198318.
the class ApplicationSiteUtils method checkLoginUrlWithAllSysHostConfig.
@SuppressWarnings("unchecked")
public static boolean checkLoginUrlWithAllSysHostConfig(HttpServletRequest request) {
boolean pathSuccess = true;
ISysService<SysVO, TbSys, String> sysService = (ISysService<SysVO, TbSys, String>) AppContext.getBean("core.service.SysService");
try {
List<TbSys> sysList = sysService.findListByParams(null);
for (int i = 0; sysList != null && i < sysList.size() && pathSuccess; i++) {
TbSys sys = sysList.get(i);
pathSuccess = !checkCrossSite(sys.getHost().toLowerCase(), request);
if (pathSuccess) {
pathSuccess = checkTestConnection(sys.getHost(), sys.getContextPath(), request);
}
}
} catch (ServiceException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
return pathSuccess;
}
use of com.netsteadfast.greenstep.po.hbm.TbSys in project bamboobsc by billchen198318.
the class ApplicationSiteUtils method getHost.
@SuppressWarnings("unchecked")
public static String getHost(String sysId) {
String host = "";
ISysService<SysVO, TbSys, String> sysService = (ISysService<SysVO, TbSys, String>) AppContext.getBean("core.service.SysService");
SysVO sys = new SysVO();
sys.setSysId(sysId);
try {
DefaultResult<SysVO> result = sysService.findByUK(sys);
if (result.getValue() == null) {
return "";
}
sys = result.getValue();
host = sys.getHost();
} catch (ServiceException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
return host;
}
use of com.netsteadfast.greenstep.po.hbm.TbSys in project bamboobsc by billchen198318.
the class MenuSupportUtils method loadSysProgData.
protected static List<TbSysProg> loadSysProgData(String system) throws ServiceException, Exception {
List<TbSysProg> progList = null;
TbSys sys = new TbSys();
sys.setSysId(system);
if (sysService.countByEntityUK(sys) != 1) {
// 必需要有 TB_SYS 資料
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.DATA_ERRORS));
}
Map<String, Object> params = new HashMap<String, Object>();
Map<String, String> oderParams = new HashMap<String, String>();
params.put("progSystem", system);
oderParams.put("name", "asc");
progList = sysProgService.findListByParams(params, null, oderParams);
if (progList == null) {
progList = new ArrayList<TbSysProg>();
}
return progList;
}
Aggregations