OS X维基/博客服务器API [英] OS X Wiki/Blog Server API

查看:232
本文介绍了OS X维基/博客服务器API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的iOS版客户端应用程序来编辑Mac OS X服务器(雪豹和放大器;狮子)上内置的维基/博客

I'm working on a client app for iOS to edit the built-in Wiki/Blog on Mac OS X Server (Snow Leopard & Lion).

看来,我们能够使用的MetaWeblog,Atom API的(我试过,但是失败)或XML-RPC。
但是,我找不到任何API文档了。

It seems that we are able to use MetaWeblog , Atom API(I've tried but failed) or XML-RPC. However, I can't find any API document for it.

所以我的问题是,我在哪里可以找到的文件,或者一些开源样?
我发现所有的样品不能处理OS X服务器。

So my question is, where can I find the documents, or some open source samples? All samples I found can't deal with the OS X Server.

大部分AP preciate!

Much appreciate!

更新:

继承人的标准结构的Wiki系统的:

Heres the standard structure of the Wiki system:

我甚至无法获得下的组名列表中的〜/组/

I can't even get the list of the 'group_name' under ~/Groups/

推荐答案

有关维基JavaScript源$ C ​​$ c未混淆,它似乎很简单,作为文档。例如,认证过程:

The javascript source code for the wiki is not obfuscated, and it seems simple enough to serve as documentation. For example, the authentication process:

sendAuthenticationPlain: function() {
    $('webauth').addClassName('verifying').removeClassName('error');
    var username = $F('username');
    var password = $F('password');
    var csrf = $F('authenticity_token');
    var plainResponse = "username="+username+"&password="+password
    this.setRememberMeCookie();
    var ajaxReq = new Ajax.Request(window.location.protocol + '//' + window.location.host + "/auth/plain_login", {
        method: 'post',
        requestHeaders: {'X-CSRF-Token': csrf},
        onComplete: this.gotAuthentication.bind(this),
        postBody: plainResponse
    });
    return false;
},
gotAuthentication: function(origRequest) {
    if (origRequest.responseJSON) {
        var jsonObject = origRequest.responseJSON
        if (jsonObject['success']) {
            var redirect = jsonObject['redirect'];
            var authToken = jsonObject['auth_token'];
            this.successCallback(authToken, redirect);
        } else {
            var errorString = jsonObject['error_string']
            this.failureCallback(errorString);
        }
    }
},

所以,你发送POST请求认证/ plain_login,只包含在POST数据中的用户名/密码和X-CSRF令牌头谁的价值来自于<输入类型=隐藏NAME =authenticity_token/>在页面上元素。服务器返回一个包含成功布尔值的JSON字符串。

So you send a POST request to auth/plain_login, containing just the username/password in the POST data and an X-CSRF-Token header who's value comes from the <input type="hidden" name="authenticity_token" /> element on the page. The server returns a JSON string containing 'success' boolean.

您也可以使用Safari / Chrome的开发者工具来监控Ajax请求/从服务器,例如这是一个PUT请求保存wiki页面的内容JSON:

You can also use safari/chrome's developer tools to monitor ajax requests to/from the server, for example this is the JSON contents of a PUT request to save a wiki page:

这篇关于OS X维基/博客服务器API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆