ThinkFree Viewer is no longer supported by ThinkFree. As such, MindTouch v9.02 "Lyons" no longer has this extension.

Note from the ThinkFree team: MindTouch v9.02 "Lyons" may no longer supports ThinkFree Viewer extension. However, ThinkFree still offers support for a more robust Viewer functionality as part of its self-hosted/on-premise server product that includes edit capabilities.  Please refer to http://product.thinkfree.com/serverint for more information.

ThinkFree Extension
Vendor
MindTouch
Type Script
Categories Documents
Requires MindTouch Deki 8.05.1 or later
Status DEPCRECATED
License Free/Open Source
Manifest http://scripts.mindtouch.com/thinkfree.xml

 

Table of Contents

Description

This extension contains functions for displaying Microsoft Office documents.

See also How to add a script, Using the Extension Dialog, Learn about DekiScript, Extensions Directory.


Functions

thinkfree.viewer(document, width, height, type) : xml

View a document.

Parameters:

NameTypeDescription
documenturiDocument uri.
widthnum(optional) Width of viewer. (default: 90%)
heightnum(optional) Height of viewer. (default: 425)
typestr(optional) Document type (either \"write\", \"calc\", or \"show\"; default: detect automatically)


Script Source

<extension>
  <title>ThinkFree Extension</title>
  <label>ThinkFree</label>
  <copyright>Copyright (c) 2006-2009 MindTouch, Inc.</copyright>
  <description>This extension contains functions for displaying Microsoft Office documents.</description>
  <uri.help>http://wiki.developer.mindtouch.com/MindTouch_Deki/Extensions/ThinkFree</uri.help>
  <uri.logo>http://scripts.mindtouch.com/logos/thinkfree-logo.png</uri.logo>
  <namespace>thinkfree</namespace>

  <requires host="MindTouch Deki 8.05.1" />

  <function>
    <name>viewer</name>
    <description>View a document.</description>
    <param name="document" type="uri">Document uri.</param>
    <param name="width" type="num" optional="true">Width of viewer. (default: 90%)</param>
    <param name="height" type="num" optional="true">Height of viewer. (default: 425)</param>
    <param name="type" type="str" optional="true">Document type (either \"write\", \"calc\", or \"show\"; default: detect automatically)</param>
    <return>
      <html xmlns:eval="http://mindtouch.com/2007/dekiscript">
        <body>
          <eval:if test="$type == 'write'"><eval:expr value="iframe($document, $width, $height, 'WRITE_VIEWER')" /></eval:if>
          <eval:elseif test="$type == 'calc'"><eval:expr value="iframe($document, $width, $height, 'CALC_VIEWER')" /></eval:elseif>
          <eval:elseif test="$type == 'show'"><eval:expr value="iframe($document, $width, $height, 'SHOW_VIEWER')" /></eval:elseif>
          <eval:else>
            <eval:block value="var parts = uri.parse($document); var last = parts.path[#parts.path-1]; var index = string.lastindexof(last, '.'); var ext = (index >= 0) ? string.substr(last, index + 1) : ''">
              <eval:if test="list.contains(['doc', 'docx', 'rtf', 'txt'], ext)"><eval:expr value="iframe($document, $width, $height, 'WRITE_VIEWER')" /></eval:if>
              <eval:elseif test="list.contains(['xls', 'xlsx', 'csv'], ext)"><eval:expr value="iframe($document, $width, $height, 'CALC_VIEWER')" /></eval:elseif>
              <eval:elseif test="list.contains(['ppt', 'pps', 'pptx', 'ppsx'], ext)"><eval:expr value="iframe($document, $width, $height, 'SHOW_VIEWER')" /></eval:elseif>
              <eval:else>ERROR: unable to determine document type, use 'type' argument to specify type</eval:else>
            </eval:block>
          </eval:else>
        </body>
      </html>
    </return>
  </function>

  <function>
    <access>private</access>
    <name>iframe</name>
    <param name="document" type="uri" />
    <param name="width" type="num" optional="true" />
    <param name="height" type="num" optional="true" />
    <param name="type" type="str" />
    <return>
      <html xmlns:eval="http://mindtouch.com/2007/dekiscript">
        <body>
          <iframe eval:src="'http://viewer.thinkfree.com/view.jsp?app=' .. $type .. '&amp;open=' .. uri.encode($document)" eval:width="web.size($width ?? 0.9)" eval:height="web.size($height ?? 425)" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" />
        </body>
      </html>
    </return>
  </function>
</extension>


Samples

   Output

To embed a 600 by 400 ThinkFree viewer for a word processing document:

{{ thinkfree.viewer("http://wiki.opengarden.org/@api/deki/files/1217", 600, 400, "write") }}
./ThinkFree1.JPG

To embed a 600 by 400 ThinkFree viewer for a spreadsheet:

{{ thinkfree.viewer("http://wiki.opengarden.org/@api/deki/files/1218", 600, 400, "calc") }}
./ThinkFree2.JPG

To embed a 600 by 400 ThinkFree viewer for a presentation:

{{ thinkfree.viewer("http://wiki.opengarden.org/@api/deki/files/1219", 600, 400, "show") }} 
./ThinkFree3.JPG

  

Tag page

Files 3

FileSizeDateAttached by 
 SampleDoc.doc
No description
23.5 kB23:47, 19 Oct 2007BrigetteKActions
 SamplePowerpoint.ppt
No description
8.5 kB00:06, 20 Oct 2007BrigetteKActions
 SampleSpreadsheet.xls
No description
13.5 kB00:03, 20 Oct 2007BrigetteKActions
Viewing 2 of 2 comments: view all
Will this api also work with files on a local share? I have tried but it did not work.
Posted 20:06, 3 Dec 2007
Looks like the thinkfree viewer tries to access the URL specified to convert and display it. This will not work for internal wikis. Anyone know of an alternative that could be used to view internal docs? (or is there a "free" version of the desktop suite to convert word/excel docs into wiki pages?)

Eamon.
Posted 18:11, 27 Jan 2009
Viewing 2 of 2 comments: view all
You must login to post a comment.