cancel
Showing results for 
Search instead for 
Did you mean: 

New Action Page Sample Backup Action not running

rcrittendon
Champ in-the-making
Champ in-the-making
I tried the backup-action example on the page http://wiki.alfresco.com/wiki/Custom_Document_Library_Action.  The Backup menu displays for documents, but when I select the menu nothing happens.  No message results, I do not think anything ran.

I added the web-scripts to Alfresco, made sure that the script was added to Alfresco etc.

Rollin

P.S.  Is there any documentation on best-practices to get a dialog to display for a custom action?
12 REPLIES 12

joaotpd
Champ on-the-rise
Champ on-the-rise
Hi jmi9999! … Thanks for the help… but the action still don't work… I'm getting this error after execute the action:


11:27:32,457 ERROR [org.alfresco.web.scripts.AbstractRuntime] Exception from executeScript - redirecting to status template error: 10100022 Wrapped Exception (with status template\
😞 org.json.JSONObject$Null cannot be cast to java.io.Serializable
org.alfresco.web.scripts.WebScriptException: 10100022 Wrapped Exception (with status template): org.json.JSONObject$Null cannot be cast to java.io.Serializable
        at org.alfresco.web.scripts.AbstractWebScript.createStatusException(AbstractWebScript.java:613)
        at org.alfresco.web.scripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:165)
        at org.alfresco.repo.web.scripts.RepositoryContainer$2.execute(RepositoryContainer.java:357)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:326)
        at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:407)
        at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:424)
        at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:288)
        at org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:262)
        at org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:139)
        at org.alfresco.web.scripts.servlet.WebScriptServlet.service(WebScriptServlet.java:122)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassCastException: org.json.JSONObject$Null cannot be cast to java.io.Serializable
        at org.alfresco.repo.jscript.ValueConverter.convertValueForRepo(ValueConverter.java:169)
        at org.alfresco.repo.jscript.ValueConverter.convertValueForRepo(ValueConverter.java:241)
        at org.alfresco.repo.jscript.ValueConverter.convertValueForRepo(ValueConverter.java:206)
        at org.alfresco.repo.web.scripts.RepositoryScriptProcessor.unwrapValue(RepositoryScriptProcessor.java:116)
        at org.alfresco.web.scripts.DeclarativeWebScript.mergeScriptModelIntoTemplateModel(DeclarativeWebScript.java:181)
        at org.alfresco.web.scripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:91)
        … 21 more
… and I get the message: Couldn't backup '{0}'…
It works for you??… can't understand… Thanks again! …

João Duarte

joaotpd
Champ on-the-rise
Champ on-the-rise
Hi again! …
Got it!! Smiley Happy … For my version of Alfresco, Community - v3.2.0 (2039), it's necessary this line:

var file = this.widgets.dataTable.getRecord(row).getData();

instead of just:

var file = row;
Thanks for the support…

João Duarte

jmi9999
Champ in-the-making
Champ in-the-making
I am glad for you  Smiley Very Happy

I am using Alfresco 3.2r

You are using the original line of the wiki, which is not running for me with 3.2r, interesting.

var file = this.widgets.dataTable.getRecord(row).getData();

Do you have an idea to use a simple workflow instead of backup ?