Extensis Logo SUPPORT | FORUMS | KNOWLEDGE BASE

HTTP Redirect to mailto (or any) url


#1

Using Portfolio Server 10: I am trying to write a function to redirect to a mailto url with data populated from the catalogs using Media Script. I’m doing this by setting the global response object status code to 302 and the header Location to said URI. However, when I do this, I’m getting a NullPointerException, and the front end says that the task has been executed sucesffuly even though nothing happens. I am able to reproduce this with a more standard redirect (to google). See below for the code and exception.

Am I going about this the right way? I’ve done this using other frameworks and languages in the past. Is there a better way of doing this using Media Script, or is it even possible to do this?

function getOriginal()
{
debug_print(“getOriginal entered”);

resp.setStatusCode("302");
resp.setHeader("Location", "http://www.google.com");

}

2014-03-25 12:22:26,819 [] ERROR [extensis.portfolio] Fatal exception thrown in job
java.lang.NullPointerException
at extensis.portfolio.server.manager.ManagerUtils.getExtension(ManagerUtils.java:626)
at extensis.portfolio.server.async.PortfolioJob.getUnusedName(PortfolioJob.java:1329)
at extensis.portfolio.server.async.PortfolioJob.access$200(PortfolioJob.java:93)
at extensis.portfolio.server.async.PortfolioJob$GlobalData_Download.addToArchive(PortfolioJob.java:419)
at extensis.portfolio.server.async.PortfolioJob.doRunScript_Download(PortfolioJob.java:1490)
at extensis.portfolio.server.async.PortfolioJob.doFinishJob(PortfolioJob.java:2487)
at extensis.portfolio.server.async.PortfolioJob.processJob(PortfolioJob.java:2663)
at extensis.portfolio.server.async.PortfolioJob.call(PortfolioJob.java:2720)
at extensis.portfolio.server.async.PortfolioJob.call(PortfolioJob.java:93)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:695)


#2

What are you trying to redirect? Are you trying to get it to send a file to an Email address?

Matt


#3

I am trying to redirect to "mailto:email@addres.com?subject=asubject&body=BodyText", which will open the mail client with subject/body text populated.