mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Workaround added to WebScript status template to handle very strange proxied Hibernate Exception objects.
Fix to PageTag to work outside of a valid FacesContext scope. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10122 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -371,21 +371,28 @@ public class PageTag extends TagSupport
|
|||||||
*/
|
*/
|
||||||
private String getWindowOnloadCode()
|
private String getWindowOnloadCode()
|
||||||
{
|
{
|
||||||
CCProperties ccProps = (CCProperties) FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "CCProperties");
|
FacesContext fc = FacesContext.getCurrentInstance();
|
||||||
|
if (fc != null)
|
||||||
StringBuffer onloadCode = new StringBuffer();
|
|
||||||
if (ccProps.getWebdavUrl() != null || ccProps.getCifsPath() != null)
|
|
||||||
{
|
{
|
||||||
String webdavUrl = (ccProps.getWebdavUrl() != null) ? (ccProps.getWebdavUrl()) : ("");
|
CCProperties ccProps = (CCProperties) FacesHelper.getManagedBean(fc, "CCProperties");
|
||||||
String cifsPath = (ccProps.getCifsPath() != null) ? (ccProps.getCifsPath()) : ("");
|
|
||||||
|
StringBuilder onloadCode = new StringBuilder();
|
||||||
onloadCode.append("window.onload=onloadFunc('").append(webdavUrl).append("','").append(cifsPath).append("');");
|
if (ccProps.getWebdavUrl() != null || ccProps.getCifsPath() != null)
|
||||||
|
{
|
||||||
ccProps.setCifsPath(null); // we need reset cifsPath flag
|
String webdavUrl = (ccProps.getWebdavUrl() != null) ? (ccProps.getWebdavUrl()) : ("");
|
||||||
ccProps.setWebdavUrl(null); // we need reset webdavUrl flag
|
String cifsPath = (ccProps.getCifsPath() != null) ? (ccProps.getCifsPath()) : ("");
|
||||||
|
|
||||||
|
onloadCode.append("window.onload=onloadFunc('").append(webdavUrl).append("','").append(cifsPath).append("');");
|
||||||
|
|
||||||
|
ccProps.setCifsPath(null); // we need reset cifsPath flag
|
||||||
|
ccProps.setWebdavUrl(null); // we need reset webdavUrl flag
|
||||||
|
}
|
||||||
|
|
||||||
|
return onloadCode.toString();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
return onloadCode.toString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user