cancel
Showing results for 
Search instead for 
Did you mean: 

How to apply auto rendition to web form

alfresco_gopesh
Champ in-the-making
Champ in-the-making
Hi All,

I have one problem if you can help me out.

I have edited the xml file of my WCM project in the repository using webscript.

NOw i  want the rendition  means the generated jsp using the web form for the edited XML also to be reflect the changes i made to xml…

So i need auto rendition of xml to some how possible so that the jsp can also be changed.automatically for the xml file..


For example, if i have language.xml and language.jsp file generated through web form.

and i have successfully changed the language.xml file but i want the language.jsp to be regenerated so that the changes were reflected in the file.

i changed the .xml file using web script.
4 REPLIES 4

pmonks
Star Contributor
Star Contributor
Your web script will have to programmatically initiate re-renditioning for the modified file.  I don't recall off the top of my head the APIs that expose that functionality, but you should be able to figure it out from looking at how the UI "regenerate renditions" function works.

Cheers,
Peter

alfresco_gopesh
Champ in-the-making
Champ in-the-making
Thanx for the reply,

I think it is possible thru java based webscript…What you think???

Can you know how to get the AVM file  object in java based web script….???

because i might find the renderingenginetemplate on the file object…that we possibly rerender the file….

jayesh_prajapat
Star Contributor
Star Contributor
Hi pmonks and Gopesh

i want generate the html/jsp file from xml file. for that i am using render(formInstanceData, rendition) method of "RenderingEngineTemplate" class but i am getting  following error


java.lang.IllegalArgumentException: FacesContext must not be null
        at org.springframework.util.Assert.notNull(Assert.java:113)
        at org.springframework.web.jsf.FacesContextUtils.getWebApplicationContext(FacesContextUtils.java:50)
        at org.springframework.web.jsf.FacesContextUtils.getRequiredWebApplicationContext(FacesContextUtils.java:81)
        at org.alfresco.web.app.Application.getRootPath(Application.java:350)
        at org.alfresco.web.forms.FormsService.getContentFormsNodeRef(FormsService.java:169)
        at org.alfresco.web.forms.FormsService.getForm(FormsService.java:219)
        at org.alfresco.sample.RenditionWebsctipt.doExample(Unknown Source)
        at org.alfresco.sample.RenditionWebsctipt$1.execute(Unknown Source)
        at org.alfresco.sample.RenditionWebsctipt$1.execute(Unknown Source)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:308)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:215)
        at org.alfresco.sample.RenditionWebsctipt.executeImpl(Unknown Source)
        at org.alfresco.web.scripts.DeclarativeWebScript.executeImpl(DeclarativeWebScript.java:250)
        at org.alfresco.web.scripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:99)
        at org.alfresco.web.scripts.WebScriptRuntime.wrappedExecute(WebScriptRuntime.java:364)
        at org.alfresco.web.scripts.WebScriptRuntime$1.execute(WebScriptRuntime.java:330)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:308)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:215)
        at org.alfresco.web.scripts.WebScriptRuntime.transactionedExecute(WebScriptRuntime.java:341)
        at org.alfresco.web.scripts.WebScriptRuntime.authenticatedExecute(WebScriptRuntime.java:284)
        at org.alfresco.web.scripts.WebScriptRuntime.executeScript(WebScriptRuntime.java:150)
        at org.alfresco.web.scripts.WebScriptServlet.service(WebScriptServlet.java:109)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)

        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
        at java.lang.Thread.run(Thread.java:619)

i investigated for this error and found that render method uses FacesContext to load property from properties file so i am getting this error.

could you guys give me any suggestion on this?

Thanks in advance and looking forward to your reply

alfresco_gopesh
Champ in-the-making
Champ in-the-making
hi Jayesh,

Its not clear what you talking about please be clear and provide more details if possible.

Thanks,
Gopesh.