examples/api-samples/public/docs/sample37.html in groupdocs-1.5.8 vs examples/api-samples/public/docs/sample37.html in groupdocs-1.5.9

- old
+ new

@@ -59,233 +59,80 @@ </div> <p>Route the handler url &quot;/sample37/signature_callback&quot;. The block function for callback with server</p> </div> - <div class="content"><div class='highlight'><pre>post <span class="string">'/sample37/signature_callback'</span> <span class="keyword">do</span></pre></div></div> + <div class="content"><div class='highlight'><pre>post <span class="string">'/sample37/signature_callback'</span> <span class="keyword">do</span> + <span class="keyword">unless</span> <span class="constant">File</span>.directory?(<span class="string">"<span class="subst">#{<span class="constant">File</span>.dirname(__FILE_<span class="number">_</span>)}</span>/../public/downloads"</span>) + <span class="keyword">return</span> <span class="string">'Directory was not found.'</span> + <span class="keyword">end</span></pre></div></div> </li> <li id="section-4"> <div class="annotation"> <div class="pilwrap "> <a class="pilcrow" href="#section-4">&#182;</a> </div> - <p>Get data json from callback</p> - - </div> - - <div class="content"><div class='highlight'><pre> data = <span class="constant">JSON</span>.parse(request.body.read) - <span class="keyword">begin</span> - - raise <span class="string">'Empty params!'</span> <span class="keyword">if</span> data.empty?</pre></div></div> - - </li> - - - <li id="section-5"> - <div class="annotation"> - - <div class="pilwrap "> - <a class="pilcrow" href="#section-5">&#182;</a> - </div> - <p>Set variables from data json</p> - - </div> - - <div class="content"><div class='highlight'><pre> source_id = data[<span class="string">'SourceId'</span>] - event_type = data[<span class="string">'EventType'</span>]</pre></div></div> - - </li> - - - <li id="section-6"> - <div class="annotation"> - - <div class="pilwrap "> - <a class="pilcrow" href="#section-6">&#182;</a> - </div> - <p>Set variables</p> - - </div> - - <div class="content"><div class='highlight'><pre> client_id = <span class="keyword">nil</span> - private_key = <span class="keyword">nil</span> - - <span class="keyword">return</span> <span class="keyword">if</span> event_type != <span class="string">'JobCompleted'</span></pre></div></div> - - </li> - - - <li id="section-7"> - <div class="annotation"> - - <div class="pilwrap "> - <a class="pilcrow" href="#section-7">&#182;</a> - </div> - <p>Set download path</p> - - </div> - - <div class="content"><div class='highlight'><pre> downloads_path = <span class="string">"<span class="subst">#{<span class="constant">File</span>.dirname(__FILE_<span class="number">_</span>)}</span>/../public/downloads"</span></pre></div></div> - - </li> - - - <li id="section-8"> - <div class="annotation"> - - <div class="pilwrap "> - <a class="pilcrow" href="#section-8">&#182;</a> - </div> - <p>Get private key and client_id from file user_info.txt</p> - - </div> - - <div class="content"><div class='highlight'><pre> <span class="keyword">if</span> <span class="constant">File</span>.exist?(<span class="string">"<span class="subst">#{<span class="constant">File</span>.dirname(__FILE_<span class="number">_</span>)}</span>/../public/user_info.txt"</span>) - contents = <span class="constant">File</span>.read(<span class="string">"<span class="subst">#{<span class="constant">File</span>.dirname(__FILE_<span class="number">_</span>)}</span>/../public/user_info.txt"</span>) - contents = contents.split(<span class="string">' '</span>) - client_id = contents[<span class="number">0</span>] - private_key = contents[<span class="number">1</span>] - <span class="keyword">end</span></pre></div></div> - - </li> - - - <li id="section-9"> - <div class="annotation"> - - <div class="pilwrap "> - <a class="pilcrow" href="#section-9">&#182;</a> - </div> - <p>Get Envelope instance</p> - - </div> - - <div class="content"><div class='highlight'><pre> envelope = <span class="constant">GroupDocs::Signature::Envelope</span>.get!(source_id, {<span class="symbol">:client_id</span> =&gt; client_id, <span class="symbol">:private_key</span> =&gt; private_key})</pre></div></div> - - </li> - - - <li id="section-10"> - <div class="annotation"> - - <div class="pilwrap "> - <a class="pilcrow" href="#section-10">&#182;</a> - </div> - <p>Get document by envelope</p> - - </div> - - <div class="content"><div class='highlight'><pre> envelope.signed_documents!(downloads_path, {<span class="symbol">:client_id</span> =&gt; client_id, <span class="symbol">:private_key</span> =&gt; private_key}) - - - <span class="keyword">rescue</span> <span class="constant">Exception</span> =&gt; e - err = e.message - <span class="keyword">end</span> -<span class="keyword">end</span></pre></div></div> - - </li> - - - <li id="section-11"> - <div class="annotation"> - - <div class="pilwrap "> - <a class="pilcrow" href="#section-11">&#182;</a> - </div> - <p>Route the handler url &quot;/sample37/check&quot;</p> - - </div> - - <div class="content"><div class='highlight'><pre> -get <span class="string">'/sample37/check'</span> <span class="keyword">do</span></pre></div></div> - - </li> - - - <li id="section-12"> - <div class="annotation"> - - <div class="pilwrap "> - <a class="pilcrow" href="#section-12">&#182;</a> - </div> - <p>Check is there download directory</p> - - </div> - - <div class="content"><div class='highlight'><pre> <span class="keyword">unless</span> <span class="constant">File</span>.directory?(<span class="string">"<span class="subst">#{<span class="constant">File</span>.dirname(__FILE_<span class="number">_</span>)}</span>/../public/downloads"</span>) - <span class="keyword">return</span> <span class="string">'Directory was not found.'</span> - <span class="keyword">end</span></pre></div></div> - - </li> - - - <li id="section-13"> - <div class="annotation"> - - <div class="pilwrap "> - <a class="pilcrow" href="#section-13">&#182;</a> - </div> <p>Get file name from download directory</p> </div> <div class="content"><div class='highlight'><pre> name = <span class="keyword">nil</span> - + i = <span class="number">0</span></pre></div></div> </li> - <li id="section-14"> + <li id="section-5"> <div class="annotation"> <div class="pilwrap "> - <a class="pilcrow" href="#section-14">&#182;</a> + <a class="pilcrow" href="#section-5">&#182;</a> </div> <p>Checking, if file exist</p> </div> <div class="content"><div class='highlight'><pre> <span class="keyword">while</span> i&lt;<span class="number">10</span> <span class="keyword">do</span> - sleep(<span class="number">5</span>) - <span class="constant">Dir</span>.entries(<span class="string">"<span class="subst">#{<span class="constant">File</span>.dirname(__FILE_<span class="number">_</span>)}</span>/../public/downloads"</span>).each <span class="keyword">do</span> |file| - name = file <span class="keyword">if</span> file != <span class="string">'.'</span> &amp;&amp; file != <span class="string">'..'</span> - <span class="keyword">end</span> + sleep(<span class="number">5</span>) + <span class="constant">Dir</span>.entries(<span class="string">"<span class="subst">#{<span class="constant">File</span>.dirname(__FILE_<span class="number">_</span>)}</span>/../public/downloads"</span>).each <span class="keyword">do</span> |file| + name = file <span class="keyword">if</span> file != <span class="string">'.'</span> &amp;&amp; file != <span class="string">'..'</span> + <span class="keyword">end</span> <span class="keyword">break</span> <span class="keyword">if</span> name i += <span class="number">1</span> <span class="keyword">end</span> name <span class="keyword">end</span></pre></div></div> </li> - <li id="section-15"> + <li id="section-6"> <div class="annotation"> <div class="pilwrap "> - <a class="pilcrow" href="#section-15">&#182;</a> + <a class="pilcrow" href="#section-6">&#182;</a> </div> <p>Route the handler url &quot;/sample37/downloads&quot;</p> </div> <div class="content"><div class='highlight'><pre>get <span class="string">'/sample37/downloads/:filename'</span> <span class="keyword">do</span> |filename|</pre></div></div> </li> - <li id="section-16"> + <li id="section-7"> <div class="annotation"> <div class="pilwrap "> - <a class="pilcrow" href="#section-16">&#182;</a> + <a class="pilcrow" href="#section-7">&#182;</a> </div> <p>Send file with header to download it</p> </div> @@ -293,30 +140,30 @@ <span class="keyword">end</span></pre></div></div> </li> - <li id="section-17"> + <li id="section-8"> <div class="annotation"> <div class="pilwrap "> - <a class="pilcrow" href="#section-17">&#182;</a> + <a class="pilcrow" href="#section-8">&#182;</a> </div> <p>Route the handler url &quot;/sample37&quot;. The function block creates new envelope</p> </div> <div class="content"><div class='highlight'><pre>post <span class="string">'/sample37'</span> <span class="keyword">do</span></pre></div></div> </li> - <li id="section-18"> + <li id="section-9"> <div class="annotation"> <div class="pilwrap "> - <a class="pilcrow" href="#section-18">&#182;</a> + <a class="pilcrow" href="#section-9">&#182;</a> </div> <p>Set variables from form</p> </div> @@ -332,30 +179,30 @@ set <span class="symbol">:source</span>, params[<span class="symbol">:source</span>]</pre></div></div> </li> - <li id="section-19"> + <li id="section-10"> <div class="annotation"> <div class="pilwrap "> - <a class="pilcrow" href="#section-19">&#182;</a> + <a class="pilcrow" href="#section-10">&#182;</a> </div> <p>Set download path</p> </div> <div class="content"><div class='highlight'><pre> downloads_path = <span class="string">"<span class="subst">#{<span class="constant">File</span>.dirname(__FILE_<span class="number">_</span>)}</span>/../public/downloads"</span></pre></div></div> </li> - <li id="section-20"> + <li id="section-11"> <div class="annotation"> <div class="pilwrap "> - <a class="pilcrow" href="#section-20">&#182;</a> + <a class="pilcrow" href="#section-11">&#182;</a> </div> <p>Remove all files from download directory or create folder if it not there</p> </div> @@ -368,33 +215,52 @@ <span class="keyword">begin</span></pre></div></div> </li> - <li id="section-21"> + <li id="section-12"> <div class="annotation"> <div class="pilwrap "> - <a class="pilcrow" href="#section-21">&#182;</a> + <a class="pilcrow" href="#section-12">&#182;</a> </div> <p>Check required variables</p> </div> - <div class="content"><div class='highlight'><pre> raise <span class="string">'Please enter all required parameters'</span> <span class="keyword">if</span> settings.client_id.empty? <span class="keyword">or</span> settings.private_key.empty? <span class="keyword">or</span> settings.email.empty? <span class="keyword">or</span> settings.name.empty? <span class="keyword">or</span> settings.lastName.empty? - - <span class="keyword">if</span> settings.base_path.empty? <span class="keyword">then</span> settings.base_path = <span class="string">'https://api.groupdocs.com'</span> <span class="keyword">end</span></pre></div></div> + <div class="content"><div class='highlight'><pre> raise <span class="string">'Please enter all required parameters'</span> <span class="keyword">if</span> settings.client_id.empty? <span class="keyword">or</span> settings.private_key.empty? <span class="keyword">or</span> settings.email.empty? <span class="keyword">or</span> settings.name.empty? <span class="keyword">or</span> settings.lastName.empty?</pre></div></div> </li> - <li id="section-22"> + <li id="section-13"> <div class="annotation"> <div class="pilwrap "> - <a class="pilcrow" href="#section-22">&#182;</a> + <a class="pilcrow" href="#section-13">&#182;</a> </div> + <p>Prepare base path</p> + + </div> + + <div class="content"><div class='highlight'><pre> <span class="keyword">if</span> settings.base_path.empty? + base_path = <span class="string">'https://api.groupdocs.com'</span> + <span class="keyword">elsif</span> settings.base_path.match(<span class="string">'/v2.0'</span>) + base_path = settings.base_path.split(<span class="string">'/v2.0'</span>)[<span class="number">0</span>] + <span class="keyword">else</span> + base_path = settings.base_path + <span class="keyword">end</span></pre></div></div> + + </li> + + + <li id="section-14"> + <div class="annotation"> + + <div class="pilwrap "> + <a class="pilcrow" href="#section-14">&#182;</a> + </div> <p>Configure your access to API server</p> </div> <div class="content"><div class='highlight'><pre> <span class="constant">GroupDocs</span>.configure <span class="keyword">do</span> |groupdocs| @@ -402,31 +268,31 @@ groupdocs.private_key = settings.private_key</pre></div></div> </li> - <li id="section-23"> + <li id="section-15"> <div class="annotation"> <div class="pilwrap "> - <a class="pilcrow" href="#section-23">&#182;</a> + <a class="pilcrow" href="#section-15">&#182;</a> </div> <p>Optionally specify API server and version</p> </div> - <div class="content"><div class='highlight'><pre> groupdocs.api_server = settings.base_path <span class="comment"># default is 'https://api.groupdocs.com'</span> + <div class="content"><div class='highlight'><pre> groupdocs.api_server = base_path <span class="comment"># default is 'https://api.groupdocs.com'</span> <span class="keyword">end</span></pre></div></div> </li> - <li id="section-24"> + <li id="section-16"> <div class="annotation"> <div class="pilwrap "> - <a class="pilcrow" href="#section-24">&#182;</a> + <a class="pilcrow" href="#section-16">&#182;</a> </div> <p>Write client and private key to the file for callback job</p> </div> @@ -434,17 +300,17 @@ out_file = <span class="constant">File</span>.new(<span class="string">"<span class="subst">#{<span class="constant">File</span>.dirname(__FILE_<span class="number">_</span>)}</span>/../public/user_info.txt"</span>, <span class="string">'w'</span>)</pre></div></div> </li> - <li id="section-25"> + <li id="section-17"> <div class="annotation"> <div class="pilwrap "> - <a class="pilcrow" href="#section-25">&#182;</a> + <a class="pilcrow" href="#section-17">&#182;</a> </div> - <p>white space is required</p> + <p>White space is required</p> </div> <div class="content"><div class='highlight'><pre> out_file.write(<span class="string">"<span class="subst">#{settings.client_id}</span> "</span>) out_file.write(<span class="string">"<span class="subst">#{settings.private_key}</span>"</span>) @@ -454,31 +320,31 @@ file = <span class="keyword">nil</span></pre></div></div> </li> - <li id="section-26"> + <li id="section-18"> <div class="annotation"> <div class="pilwrap "> - <a class="pilcrow" href="#section-26">&#182;</a> + <a class="pilcrow" href="#section-18">&#182;</a> </div> - <p>get document by file GUID</p> + <p>Get document by file GUID</p> </div> <div class="content"><div class='highlight'><pre> <span class="keyword">case</span> settings.source <span class="keyword">when</span> <span class="string">'guid'</span></pre></div></div> </li> - <li id="section-27"> + <li id="section-19"> <div class="annotation"> <div class="pilwrap "> - <a class="pilcrow" href="#section-27">&#182;</a> + <a class="pilcrow" href="#section-19">&#182;</a> </div> <p>Create instance of File</p> </div> @@ -487,61 +353,62 @@ <span class="keyword">when</span> <span class="string">'local'</span></pre></div></div> </li> - <li id="section-28"> + <li id="section-20"> <div class="annotation"> <div class="pilwrap "> - <a class="pilcrow" href="#section-28">&#182;</a> + <a class="pilcrow" href="#section-20">&#182;</a> </div> - <p>construct path</p> + <p>Construct path</p> </div> <div class="content"><div class='highlight'><pre> file_path = <span class="string">"<span class="subst">#{<span class="constant">Dir</span>.tmpdir}</span>/<span class="subst">#{params[<span class="symbol">:file</span>][<span class="symbol">:filename</span>]}</span>"</span></pre></div></div> </li> - <li id="section-29"> + <li id="section-21"> <div class="annotation"> <div class="pilwrap "> - <a class="pilcrow" href="#section-29">&#182;</a> + <a class="pilcrow" href="#section-21">&#182;</a> </div> - <p>open file</p> + <p>Open file</p> </div> <div class="content"><div class='highlight'><pre> <span class="constant">File</span>.open(file_path, <span class="string">'wb'</span>) { |f| f.write(params[<span class="symbol">:file</span>][<span class="symbol">:tempfile</span>].read) }</pre></div></div> </li> - <li id="section-30"> + <li id="section-22"> <div class="annotation"> <div class="pilwrap "> - <a class="pilcrow" href="#section-30">&#182;</a> + <a class="pilcrow" href="#section-22">&#182;</a> </div> - <p>make a request to API using client_id and private_key</p> + <p>Make a request to API using client_id and private_key</p> </div> - <div class="content"><div class='highlight'><pre> file = <span class="constant">GroupDocs::Storage::File</span>.upload!(file_path, {}).to_document + <div class="content"><div class='highlight'><pre> file = <span class="constant">GroupDocs::Storage::File</span>.upload!(file_path).to_document + <span class="keyword">when</span> <span class="string">'url'</span></pre></div></div> </li> - <li id="section-31"> + <li id="section-23"> <div class="annotation"> <div class="pilwrap "> - <a class="pilcrow" href="#section-31">&#182;</a> + <a class="pilcrow" href="#section-23">&#182;</a> </div> <p>Upload file from defined url</p> </div> @@ -553,17 +420,17 @@ name = file.name</pre></div></div> </li> - <li id="section-32"> + <li id="section-24"> <div class="annotation"> <div class="pilwrap "> - <a class="pilcrow" href="#section-32">&#182;</a> + <a class="pilcrow" href="#section-24">&#182;</a> </div> - <p>create envelope using user id and entered by user name</p> + <p>Create envelope using user id and entered by user name</p> </div> <div class="content"><div class='highlight'><pre> envelope = <span class="constant">GroupDocs::Signature::Envelope</span>.new envelope.name = file.name @@ -571,45 +438,45 @@ envelope.create!({})</pre></div></div> </li> - <li id="section-33"> + <li id="section-25"> <div class="annotation"> <div class="pilwrap "> - <a class="pilcrow" href="#section-33">&#182;</a> + <a class="pilcrow" href="#section-25">&#182;</a> </div> <p>Add uploaded document to envelope</p> </div> <div class="content"><div class='highlight'><pre> envelope.add_document!(file, {})</pre></div></div> </li> - <li id="section-34"> + <li id="section-26"> <div class="annotation"> <div class="pilwrap "> - <a class="pilcrow" href="#section-34">&#182;</a> + <a class="pilcrow" href="#section-26">&#182;</a> </div> <p>Get role list for current user</p> </div> <div class="content"><div class='highlight'><pre> roles = <span class="constant">GroupDocs::Signature::Role</span>.get!({})</pre></div></div> </li> - <li id="section-35"> + <li id="section-27"> <div class="annotation"> <div class="pilwrap "> - <a class="pilcrow" href="#section-35">&#182;</a> + <a class="pilcrow" href="#section-27">&#182;</a> </div> <p>Create new recipient</p> </div> @@ -620,60 +487,45 @@ recipient.role_id = roles.detect { |role| role.name == <span class="string">'Signer'</span> }.id</pre></div></div> </li> - <li id="section-36"> + <li id="section-28"> <div class="annotation"> <div class="pilwrap "> - <a class="pilcrow" href="#section-36">&#182;</a> + <a class="pilcrow" href="#section-28">&#182;</a> </div> <p>Add recipient to envelope</p> </div> - <div class="content"><div class='highlight'><pre> add = envelope.add_recipient!(recipient)</pre></div></div> + <div class="content"><div class='highlight'><pre> recipient = envelope.add_recipient!(recipient)</pre></div></div> </li> - <li id="section-37"> + <li id="section-29"> <div class="annotation"> <div class="pilwrap "> - <a class="pilcrow" href="#section-37">&#182;</a> + <a class="pilcrow" href="#section-29">&#182;</a> </div> - <p>Get recipient id</p> - - </div> - - <div class="content"><div class='highlight'><pre> recipient.id = add.id</pre></div></div> - - </li> - - - <li id="section-38"> - <div class="annotation"> - - <div class="pilwrap "> - <a class="pilcrow" href="#section-38">&#182;</a> - </div> <p>Get document id</p> </div> <div class="content"><div class='highlight'><pre> document = envelope.documents!</pre></div></div> </li> - <li id="section-39"> + <li id="section-30"> <div class="annotation"> <div class="pilwrap "> - <a class="pilcrow" href="#section-39">&#182;</a> + <a class="pilcrow" href="#section-30">&#182;</a> </div> <p>Get field and add the location to field</p> </div> @@ -682,45 +534,45 @@ field.name = <span class="string">'EMPLOYEE SIGNATURE'</span></pre></div></div> </li> - <li id="section-40"> + <li id="section-31"> <div class="annotation"> <div class="pilwrap "> - <a class="pilcrow" href="#section-40">&#182;</a> + <a class="pilcrow" href="#section-31">&#182;</a> </div> <p>Add field to envelope</p> </div> <div class="content"><div class='highlight'><pre> envelope.add_field!(field, document[<span class="number">0</span>], recipient)</pre></div></div> </li> - <li id="section-41"> + <li id="section-32"> <div class="annotation"> <div class="pilwrap "> - <a class="pilcrow" href="#section-41">&#182;</a> + <a class="pilcrow" href="#section-32">&#182;</a> </div> <p>Send envelop</p> </div> <div class="content"><div class='highlight'><pre> envelope.send!({<span class="symbol">:callbackUrl</span> =&gt; settings.callback})</pre></div></div> </li> - <li id="section-42"> + <li id="section-33"> <div class="annotation"> <div class="pilwrap "> - <a class="pilcrow" href="#section-42">&#182;</a> + <a class="pilcrow" href="#section-33">&#182;</a> </div> <p>Write client and private key to the file for callback job</p> </div> @@ -728,17 +580,17 @@ out_file = <span class="constant">File</span>.new(<span class="string">"<span class="subst">#{<span class="constant">File</span>.dirname(__FILE_<span class="number">_</span>)}</span>/../public/user_info.txt"</span>, <span class="string">'w'</span>)</pre></div></div> </li> - <li id="section-43"> + <li id="section-34"> <div class="annotation"> <div class="pilwrap "> - <a class="pilcrow" href="#section-43">&#182;</a> + <a class="pilcrow" href="#section-34">&#182;</a> </div> - <p>white space is required</p> + <p>White space is required</p> </div> <div class="content"><div class='highlight'><pre> out_file.write(<span class="string">"<span class="subst">#{settings.client_id}</span> "</span>) out_file.write(<span class="string">"<span class="subst">#{settings.private_key}</span>"</span>) @@ -747,59 +599,86 @@ <span class="keyword">end</span></pre></div></div> </li> - <li id="section-44"> + <li id="section-35"> <div class="annotation"> <div class="pilwrap "> - <a class="pilcrow" href="#section-44">&#182;</a> + <a class="pilcrow" href="#section-35">&#182;</a> </div> - <p>Get url from request</p> + <p>Prepare to sign url</p> </div> - <div class="content"><div class='highlight'><pre> <span class="keyword">case</span> settings.base_path - + <div class="content"><div class='highlight'><pre> iframe = <span class="string">"/signature2/signembed/<span class="subst">#{envelope.id}</span>/<span class="subst">#{recipient.id}</span>"</span></pre></div></div> + + </li> + + + <li id="section-36"> + <div class="annotation"> + + <div class="pilwrap "> + <a class="pilcrow" href="#section-36">&#182;</a> + </div> + <p>Construct result string</p> + + </div> + + <div class="content"><div class='highlight'><pre> url = <span class="constant">GroupDocs::Api::Request</span>.new(<span class="symbol">:path</span> =&gt; iframe).prepare_and_sign_url</pre></div></div> + + </li> + + + <li id="section-37"> + <div class="annotation"> + + <div class="pilwrap "> + <a class="pilcrow" href="#section-37">&#182;</a> + </div> + <p>Generate iframe URL</p> + + </div> + + <div class="content"><div class='highlight'><pre> <span class="keyword">case</span> base_path <span class="keyword">when</span> <span class="string">'https://stage-api-groupdocs.dynabic.com'</span> - url = <span class="string">"http://stage-apps-groupdocs.dynabic.com/signature/signembed/<span class="subst">#{envelope.id}</span>/<span class="subst">#{recipient.id}</span>"</span> + iframe = <span class="string">"https://stage-api-groupdocs.dynabic.com<span class="subst">#{url}</span>"</span> <span class="keyword">when</span> <span class="string">'https://dev-api-groupdocs.dynabic.com'</span> - url = <span class="string">"http://dev-apps-groupdocs.dynabic.com/signature/signembed/<span class="subst">#{envelope.id}</span>/<span class="subst">#{recipient.id}</span>"</span> + iframe = <span class="string">"https://dev-apps.groupdocs.com<span class="subst">#{url}</span>"</span> <span class="keyword">else</span> - url = <span class="string">"https://apps.groupdocs.com/signature/signembed/<span class="subst">#{envelope.id}</span>/<span class="subst">#{recipient.id}</span>"</span> - <span class="keyword">end</span> - - - iframe = <span class="constant">GroupDocs::Api::Request</span>.new(<span class="symbol">:path</span> =&gt; url).prepare_and_sign_url</pre></div></div> + iframe = <span class="string">"https://apps.groupdocs.com<span class="subst">#{url}</span>"</span> + <span class="keyword">end</span></pre></div></div> </li> - <li id="section-45"> + <li id="section-38"> <div class="annotation"> <div class="pilwrap "> - <a class="pilcrow" href="#section-45">&#182;</a> + <a class="pilcrow" href="#section-38">&#182;</a> </div> <p>Make iframe</p> </div> - <div class="content"><div class='highlight'><pre> iframe = <span class="string">"&lt;iframe src='<span class="subst">#{iframe}</span>' frameborder='0' width='720' height='600'&gt;&lt;/iframe&gt;"</span> + <div class="content"><div class='highlight'><pre> iframe = <span class="string">"&lt;iframe id='downloadframe' src='<span class="subst">#{iframe}</span>' width='800' height='1000'&gt;&lt;/iframe&gt;"</span> + message = <span class="string">"&lt;p&gt;File was uploaded to GroupDocs. Here you can see your &lt;strong&gt;<span class="subst">#{name}</span>&lt;/strong&gt; file in the GroupDocs Embedded Viewer.&lt;/p&gt;"</span> <span class="keyword">rescue</span> <span class="constant">Exception</span> =&gt; e err = e.message <span class="keyword">end</span></pre></div></div> </li> - <li id="section-46"> + <li id="section-39"> <div class="annotation"> <div class="pilwrap "> - <a class="pilcrow" href="#section-46">&#182;</a> + <a class="pilcrow" href="#section-39">&#182;</a> </div> <p>Set variables for template</p> </div>