Skip to content

Commit 07a3f09

Browse files
authored
Adjust redirect handling (#420)
1 parent 21d334a commit 07a3f09

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

cluster/src/org/labkey/cluster/ClusterController.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@
4343
import org.labkey.api.util.HtmlString;
4444
import org.labkey.api.util.PageFlowUtil;
4545
import org.labkey.api.util.URLHelper;
46+
import org.labkey.api.view.ActionURL;
4647
import org.labkey.api.view.HtmlView;
48+
import org.labkey.api.view.RedirectException;
4749
import org.labkey.cluster.pipeline.AbstractClusterExecutionEngine;
4850
import org.springframework.validation.BindException;
4951
import org.springframework.validation.Errors;
@@ -492,7 +494,7 @@ else if (!sf.lookupContainer().hasPermission(getUser(), ReadPermission.class))
492494
}
493495

494496
@Override
495-
public URLHelper getRedirectURL(ViewJavaLogForm viewJavaLogForm) throws Exception
497+
public ActionURL getRedirectURL(ViewJavaLogForm viewJavaLogForm) throws Exception
496498
{
497499
PipelineStatusFile sf = PipelineService.get().getStatusFile(viewJavaLogForm.getJobId());
498500
File parentDir = new File(sf.getFilePath()).getParentFile();
@@ -540,7 +542,7 @@ public URLHelper getRedirectURL(ViewJavaLogForm viewJavaLogForm) throws Exceptio
540542

541543
relPath = org.labkey.api.util.Path.parse(FilenameUtils.separatorsToUnix(relPath)).encode();
542544

543-
return new URLHelper(root.getWebdavURL() + relPath);
545+
throw new RedirectException(new URLHelper(root.getWebdavURL() + relPath));
544546
}
545547
}
546548

discvrcore/src/org/labkey/discvrcore/DiscvrCoreController.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ public void setTargetContainer(String targetContainer)
285285
public class SetTableIncrementValueAction extends SimpleRedirectAction<Object>
286286
{
287287
@Override
288-
public URLHelper getRedirectURL(Object o) throws Exception
288+
public ActionURL getRedirectURL(Object o)
289289
{
290290
return DetailsURL.fromString("laboratory/setTableIncrementValue.view", getContainer()).getActionURL();
291291
}
@@ -297,7 +297,7 @@ public URLHelper getRedirectURL(Object o) throws Exception
297297
public class ManageFileRootAction extends SimpleRedirectAction<Object>
298298
{
299299
@Override
300-
public URLHelper getRedirectURL(Object o) throws Exception
300+
public ActionURL getRedirectURL(Object o)
301301
{
302302
return DetailsURL.fromString("admin/manageFileRoot.view", getContainer()).getActionURL();
303303
}
@@ -308,15 +308,15 @@ public URLHelper getRedirectURL(Object o) throws Exception
308308
public static class AddCustomIndexesAction extends ConfirmAction<Object>
309309
{
310310
@Override
311-
public ModelAndView getConfirmView(Object o, BindException errors) throws Exception
311+
public ModelAndView getConfirmView(Object o, BindException errors)
312312
{
313313
setTitle("Add Custom Core.Container Indexes");
314314

315315
return HtmlView.of("This action will add custom indexes to core.contains. Only do this if you are absolutely certain about the consequences. Do you want to continue?");
316316
}
317317

318318
@Override
319-
public boolean handlePost(Object o, BindException errors) throws Exception
319+
public boolean handlePost(Object o, BindException errors)
320320
{
321321
return DiscvrCoreManager.get().addCoreContainersIndexes();
322322
}

0 commit comments

Comments
 (0)