获取我所属的 Alfresco 站点

Get Alfresco sites I am a member of

有没有办法获取我所属的 Alfresco Share 网站的列表? (来自远程应用程序)

"member" 我的意思是:列在 https://example.com/share/page/site/thesite/site-members

理想情况下,CMIS 调用是最好的,但我想这是不可能的,所以另一个 REST API 也可以。
即使有数千个站点,它也需要快速,因此一个一个地检查每个站点是行不通的。
官方API不会很快消失的优先
它应该适用于 Alfresco 4.2 及更高版本。

对 Alfresco Share 仪表板进行逆向工程让我发现了这个 JSON REST 调用:

https://example.com/share/proxy/alfresco/api/people/nicolas/sites?roles=user&size=100

你得到这样的结果:

[
{
    "url": "\/alfresco\/s\/api\/sites\/superproject",
    "sitePreset": "site-dashboard",
    "shortName": "superproject",
    "title": "Super Project",
    "description": "A fabulous project",
    "node": "\/alfresco\/s\/api\/node\/workspace\/SpacesStore\/9dfb2426-bc2e-471e-8452-d4f6ea4b1cfa",
    "tagScope": "\/alfresco\/s\/api\/tagscopes\/workspace\/SpacesStore\/9dfb2426-bc2e-471e-8452-d4f6ea4b1cfa",
    "siteRole": "SiteCollaborator",
    "isPublic": true,
    "visibility": "PUBLIC"
}
        ,
{
    "url": "\/alfresco\/s\/api\/sites\/another",
    "sitePreset": "site-dashboard",
    "shortName": "another",
    "title": "Another Project",
    "description": "A less wonderful project",
    "node": "\/alfresco\/s\/api\/node\/workspace\/SpacesStore\/3859750c-8b3a-4736-b3e5-1ca1c2ff1cac",
    "tagScope": "\/alfresco\/s\/api\/tagscopes\/workspace\/SpacesStore\/3859750c-8b3a-4736-b3e5-1ca1c2ff1cac",
    "siteRole": "SiteManager",
    "isPublic": true,
    "visibility": "PUBLIC"
}
]

所以它适用于我的 Alfresco 4.2 测试服务器,但问题是我不太确定 "official" 它是怎样的。如果不是官方的,它可能会在下一个 Alfresco 版本中消失。

我还发现 http://sharextras.org/jsdoc/share/enterprise-4.0.0/symbols/Alfresco.SiteFinder.html#memberOfSites which seems to be exactly what I need, but it is part of the Alfresco Share JavaScript API 其文档似乎以 4.0 结尾,所以我不确定它是否仍然存在于 Alfresco 5 中。

您可以使用它来获取用户的会员详细信息。

GET /alfresco/service/api/sites/{shortname}/memberships/{username}

它对我有用,你甚至可以用 Postman 测试它,但不要忘记 authentification

您可以在 https://wiki.alfresco.com/wiki/Repository_RESTful_API_Reference

中找到更多信息