Author: sohil.shah(a)jboss.com
Date: 2009-01-01 15:07:01 -0500 (Thu, 01 Jan 2009)
New Revision: 12420
Modified:
branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties
Log:
JBPORTAL-2158 - NullPointer exception when accessing non existing directory in CMS
Modified:
branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2008-12-31
21:48:00 UTC (rev 12419)
+++
branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2009-01-01
20:07:01 UTC (rev 12420)
@@ -202,7 +202,7 @@
{
throw new PortletException(e);
}
- }
+ }
}
/**
@@ -247,11 +247,31 @@
sPath = "/";
}
+
JCRCMS.enableUISecurityFilter();
Command listCMD =
CMSService.getCommandFactory().createFolderGetListCommand(sPath);
Folder mainFolder = (Folder)CMSService.execute(listCMD);
- List folders = mainFolder.getFolders();
- List files = mainFolder.getFiles();
+
+ List folders = new ArrayList();
+ List files = new ArrayList();
+
+ if(mainFolder != null)
+ {
+ folders = mainFolder.getFolders();
+ files = mainFolder.getFiles();
+ }
+ else
+ {
+ Object messages =
rReq.getPortletSession().getAttribute("messages");
+ if(messages == null)
+ {
+ messages = new ArrayList();
+ rReq.getPortletSession().setAttribute("messages", messages);
+ }
+
+
((List)messages).add(this.resources.getObject("CMS_MISSING_RESOURCE"));
+ }
+
JCRCMS.disableUISecurityFilter();
rRes.setContentType("text/html");
@@ -276,6 +296,7 @@
{
Object messages =
rReq.getPortletSession().getAttribute("messages");
rReq.getPortletSession().removeAttribute("messages");
+
rReq.setAttribute("messages", messages);
}
Modified:
branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties 2008-12-31
21:48:00 UTC (rev 12419)
+++
branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties 2009-01-01
20:07:01 UTC (rev 12420)
@@ -150,5 +150,6 @@
CMS_DATE_PATTERN=MM/dd/yy HH:mm
INVALID_ARCHIVE_MESSAGE=The archive being uploaded is not a valid archive file
+CMS_MISSING_RESOURCE=Requested CMS Resource could not be Found
Show replies by date