AnsweredAssumed Answered

An easy way to integrate an HTML form.

Question asked by anweber on Jul 27, 2006
Hello,

   I just have found an easy way to integrate an HTML form in the Alfresco user interface. 

  • Context :
  •       
    • I create dynamicaly some HTML forms that I store in Alfresco (there are workflow messages and the user can use it to notify user actions to my workflow).  See my previous post http://forums.alfresco.com/viewtopic.php?t=2533
    • There is an example of such a file (for example "vote_for_docXX.html"):

      <html>
         <head>
            <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
         </head>
         <body>
            <form action="/alfresco/command/script/execute/workspace/SpacesStore/faa844c9-17c1-11db-a967-e94387e75e33">
               <input type="hidden" name="msgPath" value="test_vote_WF/voter_1_space/INBOX_WF_VOTE/vote_for_vote11.html">
               <input type="hidden" name="votedDocName" value="vote11">
               <input type="hidden" name="votedDocPath" value="/Company Home/test_vote_WF/editor_space/toVote">
               The user admin submit the document <a href="/alfresco/download/direct/workspace/SpacesStore/f40dd971-1a22-11db-aec6-031967fe322b/vote11">vote11</a> to vote<br></br>
               <input type="radio" name="voteDecision" value="accepted">Your vote is : Yes<br></br>
               <input type="radio" name="voteDecision" value="rejected"> Your vote is : NO<br></br>
               <input type="radio" name="voteDecision" value="noOpinion">You have no opinion
               <input type="submit" name="submit" value="Submit vote">
            </form>
         </body>
      </html>


    • With the web client, when the user click on such a file, a popup screen appears (a separate window of the browser) and shows the form.

    • I should like to obtain a better integration in the UI.

      
  • Solution :
  •        
    • I have created a new template using the default Alfresco Template Model (freeMarker Template Language):
    •            

      <#– Shows directly the content of the current document (this content should be made of HTML) –>
      <IFRAME SRC="http://localhost:8080/alfresco/${document.url}" WIDTH="100%" HEIGHT="500">

      </IFRAME>               
                 
                 
    • When I apply this template to view the content of my HTML form message, this form appears direcly in the current UI.  And the user can use it directly to interract with my workflow.
               Regards,
              
                            Andre

Outcomes