Author: thomas.heute(a)jboss.com
Date: 2007-05-16 09:11:49 -0400 (Wed, 16 May 2007)
New Revision: 7262
Modified:
trunk/core/src/main/org/jboss/portal/core/model/portal/command/view/ViewPortalCommand.java
Log:
Slightly better error handling
Modified:
trunk/core/src/main/org/jboss/portal/core/model/portal/command/view/ViewPortalCommand.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/portal/command/view/ViewPortalCommand.java 2007-05-16
12:41:35 UTC (rev 7261)
+++
trunk/core/src/main/org/jboss/portal/core/model/portal/command/view/ViewPortalCommand.java 2007-05-16
13:11:49 UTC (rev 7262)
@@ -22,14 +22,13 @@
******************************************************************************/
package org.jboss.portal.core.model.portal.command.view;
-import org.jboss.portal.core.model.portal.command.PageCommand;
+import org.jboss.portal.core.controller.ControllerException;
+import org.jboss.portal.core.controller.ControllerResponse;
+import org.jboss.portal.core.controller.command.info.CommandInfo;
+import org.jboss.portal.core.controller.command.info.ViewCommandInfo;
+import org.jboss.portal.core.model.portal.PortalObjectId;
import org.jboss.portal.core.model.portal.command.PortalCommand;
import org.jboss.portal.core.model.portal.command.response.UpdatePageResponse;
-import org.jboss.portal.core.model.portal.PortalObjectId;
-import org.jboss.portal.core.controller.command.info.CommandInfo;
-import org.jboss.portal.core.controller.command.info.ViewCommandInfo;
-import org.jboss.portal.core.controller.ControllerResponse;
-import org.jboss.portal.core.controller.ControllerException;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -53,6 +52,13 @@
public ControllerResponse execute() throws ControllerException
{
- return new UpdatePageResponse(portal.getDefaultPage().getId());
+ if (portal.getDefaultPage() != null)
+ {
+ return new UpdatePageResponse(portal.getDefaultPage().getId());
+ }
+ else
+ {
+ throw new ControllerException("No default page has been defined for portal
" + portal.getName());
+ }
}
}
Show replies by date