Redirected from Deki/Extensions/Deki AJAX API
0 of 1 found this page helpful

Deki AJAX API

    Vendor
    MindTouch
    Type Script
    Categories Developer
    Requires MindTouch Core 9.02 or later
    Status Work-in-progress
    License Free/Open Source
    Manifest http://scripts.mindtouch.com/dekiapi.xml

     

    Install Script
    To add  this script to your site, enter the address of your MindTouch installation (ex: http://www.mindtouch.com) and click the Add Script button.  This will open your control panel and prepopulate the necessary values.  You will still need to manually add configuration settings if required.  Note that no changes are made to your site until you confirm the action in your control panel.
    Your site address:     


    Table of Contents

    Description

    Include AJAX API extension.

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


    Functions

    dekiapi(version : str) : xml

    Include functions for MindTouch JavaScript API.

    Parameters:

    NameTypeDescription
    versionstr(optional) Version of MindTouch JavaScript API to use. (one of '0.1', '0.2'; default: most recent)


    Script Source

    <extension>
      <title>MindTouch AJAX API Extension</title>
      <label>MindTouch API</label>
      <copyright>Copyright (c) 2006-2010 MindTouch Inc.</copyright>
      <description>Include AJAX API extension.</description>
    
      <requires host="MindTouch Core 9.02" />
    
      <function>
        <name>dekiapi</name>
        <description>Include functions for MindTouch JavaScript API.</description>
        <param name="version" type="str" optional="true">Version of MindTouch JavaScript API to use. (one of '0.1', '0.2'; default: most recent)</param>
        <return>
          <html xmlns:eval="http://mindtouch.com/2007/dekiscript">
            <head>
              <script type="text/javascript">
                if(typeof Deki.Env == 'undefined') {
                  Deki.Env = {
                    SiteApi: <eval:js>site.uri &amp; "@api" &amp; "deki"</eval:js>,
                    PageApi: <eval:js>site.uri &amp; "@api" &amp; "deki" &amp; "pages" &amp; page.id</eval:js>,
                    UserApi: <eval:js>site.uri &amp; "@api" &amp; "deki" &amp; "users" &amp; user.id</eval:js>
                  };
                }
              </script>
              <eval:if test="$version is nil || $version == '0.2'">
                <script type="text/javascript" src="self:res/deki/mindtouch.web.js" />
                <script type="text/javascript" src="self:res/deki/mindtouch.deki.js" />
              </eval:if>
              <eval:elseif test="$version == '0.1'">
                <script type="text/javascript" src="self:res/deki/deki.api.js" />
              </eval:elseif>
            </head>
          </html>
        </return>
      </function>
    </extension>
    

    Additional Notes

    This extension depends on the javascript files found here.  If you choose to install the extension XML on your own wiki (rather than simply referencing the version on the Mindtouch servers), you will need to install these javascript files as well, in the following directory structure:

    • dekiapi.xml
    • res (directory)
      • deki (directory)
        • deki.api.js
        • mindtouch.deki.js
        • mindtouch.web.js
    Was this page helpful?
    Tag page
    Viewing 15 of 15 comments: view all
    Please could you explain where exactly to put the files for installation on my own wiki? (how to make the integration work)

    Presently, I attached dekiapi.xml to my page, and linked to it for adding the script.
    The script runs but I don't think it actually works.
    I also created subdirectories of /opt/deki/src/services/Scripts/ and copied the other files in there but I really don't think this helps in any way...
    Posted 08:19, 23 Apr 2010
    this is low of info. it needs some examples.
    Posted 19:22, 29 Jun 2010
    not enough info, clarify, and it needs examples
    Posted 19:22, 29 Jun 2010
    Is this script broken for the latest release, or is it just my machine? I read somewhere that you can do a temporary workaround by adding this as an extension and not a script, but I can't find the link.
    Posted 11:27, 13 Oct 2010
    where can i find old mindtouch.web.js file
    (no 2010-11-17 version)
    Posted 18:38, 16 Nov 2010
    winzxc2000:
    I attach the previous versions of the files on this page: http://developer.mindtouch.com/User:lcolombo#pageFiles
    Posted 13:40, 1 Dec 2010
    Does this work in Mindtouch 2010 for Windows? I can not get any scripts working without calling dekiapi();....When I try the install script above I get a blank page. When try "add extension" in the control panel I get:

    Array
    (
    [title] => Bad Request (400)
    [message] => Invalid remote service: http://scripts.mindtouch.com/dekiapi.xml
    [response] => Request URI:
    http://localhost:8081/deki/site/services/51/start?dream.out.format=php&dream.in.host=localhost%3A8080&dream.in.scheme=http&dream.in.origin=127.0.0.1

    Server response:
    Array
    (
    [error] => Array
    (
    [message] => Invalid remote service: http://scripts.mindtouch.com/dekiapi.xml
    [status] => 400
    [title] => Bad Request
    [uri] => http://localhost:8080/@api/deki/site/services/51/start?dream.out.format=php&dream.in.host=localhost:8080&dream.in.scheme=http&dream.in.origin=127.0.0.1
    )

    )

    ) edited 14:43, 6 Dec 2010
    Posted 11:18, 6 Dec 2010
    Eventually got it working..the standard install method for the script was broken...installed a different way
    Posted 13:00, 14 Dec 2010
    The same as gpitel, does it work in MindTouch 2010? When I try to create any page with dekiapi(); I get:
    map is not valid; expected uri: /content/body/pre, line x, column 8
    Posted 07:42, 15 Mar 2011
    @gpitel @MariuszJ that's because DekiAPI is not a remote service, but a script. make sure to add it as such and you should have no issues
    Posted 09:09, 15 Mar 2011
    DekiAPI was installed as a script - using "add script" button above.
    Posted 06:06, 16 Mar 2011
    @SteveB I also checked it on latest VMware MindTouch Core 2010 (to make sure if it is not just a problem with my installation), with the same result "map is not valid; expected uri: /content/body/pre, line x, column 8". The script was installed using "Add script" button on this page, I entered manually namespace value 'dekiapi' (BTW why not automatically?).

    So for me the conclusion is: it doesn't work with MindTouch Core 2010.
    Posted 03:41, 18 Mar 2011
    @MariuszJ did you run updateWiki.sh to ensure you had the latest binaries?
    Posted 06:26, 18 Mar 2011
    @SteveB it was the latest 10.0.7, but I started also updateWiki.sh - no change, the error remains.
    Posted 13:21, 19 Mar 2011
    It works - my fault. Just after the first installation I received message: "reference to undefined name 'dekiapi'" (not sure why), so according to some suggestions in other threads I added 'dekiapi' as namespace, while it should remain empty.
    Posted 13:35, 21 Mar 2011
    Viewing 15 of 15 comments: view all
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by