Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Add graceful error handling when entering wrong iteration slug in URL.
Browse files Browse the repository at this point in the history
Also correct a type in the project iteration view page.
  • Loading branch information
Carlos Munoz committed Apr 17, 2012
1 parent a61f7c1 commit d6f057c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Expand Up @@ -31,6 +31,7 @@
import org.jboss.seam.annotations.Logger;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.framework.EntityNotFoundException;
import org.jboss.seam.log.Log;
import org.jboss.seam.security.management.JpaIdentityStore;
import org.zanata.common.ContentState;
Expand Down Expand Up @@ -145,6 +146,14 @@ public String getIterationSlug()
return this.iterationSlug;
}

public void validateIteration()
{
if( this.getProjectIteration() == null )
{
throw new EntityNotFoundException(this.iterationSlug, HProjectIteration.class);
}
}

public List<Status> getAllStatus()
{
List<Status> result = new ArrayList<Status>();
Expand Down
1 change: 1 addition & 0 deletions server/zanata-war/src/main/webapp/WEB-INF/pages.xml
Expand Up @@ -345,6 +345,7 @@
<page view-id="/iteration/view.xhtml" >
<param name="projectSlug" value="#{viewAllStatusAction.projectSlug}" />
<param name="iterationSlug" value="#{viewAllStatusAction.iterationSlug}" />
<action execute="#{viewAllStatusAction.validateIteration}"/>
</page>

<page view-id="/iteration/files.xhtml">
Expand Down
2 changes: 1 addition & 1 deletion server/zanata-war/src/main/webapp/iteration/view.xhtml
Expand Up @@ -155,7 +155,7 @@
<rich:panel id="loggedIn" rendered="#{identity.loggedIn}">
<f:facet name="header">#{messages['jsf.Actions']}</f:facet>
<s:link styleClass="action_link"
rendered="#{s:hasPermission(viewAllStatusAction.projecIteration, 'update')}"
rendered="#{s:hasPermission(viewAllStatusAction.projectIteration, 'update')}"
value="#{messages['jsf.EditVersion']}" view="/iteration/edit.xhtml"
propagation="none">
<f:param name="projectSlug" value="#{viewAllStatusAction.projectSlug}"/>
Expand Down

0 comments on commit d6f057c

Please sign in to comment.