November 22, 2024

Alfresco tips and tricks – #10 Web Scripts to search for groups and users

Alfresco Web Script Framework provides RESTful access to content residing in the Alfresco repository. A web script is a service bound to a URI that responds to HTTP methods such as GET, POST, PUT, and DELETE. The HTTP response is rendered via one of the supplied templates: HTML, Atom, XML, RSS, JSON, CSV, or any combination of these. Here is a series of out-of-the-box web scripts to search for groups and users (I create a root group named “gnu_linux” which includes 3 sub-groups “kernel“, “package” e “repo” with some user).

giuseppe-urso-web-scripts-to-search-for-groups-and-users-01

1. Search all users in the group “gnu_linux”

# Alfresco Community 4.2.f
# Search all users in group "gnu_linux"
http://localhost:8080/alfresco/service/api/groups/gnu_linux/children?authorityType=USER&maxItems={maxItems?}&skipCount={skipCount?}&sortBy={sortBy?}

giuseppe-urso-web-scripts-to-search-for-groups-and-users-02

2. Search for string “gnu” in groups

# Alfresco Community 4.2.f
# Search for string "gnu" in groups
http://localhost:8080/alfresco/service/api/groups?shortNameFilter=gnu

giuseppe-urso-web-scripts-to-search-for-groups-and-users-03

3. Search all groups in the group “gnu_linux”

# Alfresco Community 4.2.f
# Search all groups in group "gnu_linux"
http://localhost:8080/alfresco/service/api/groups/gnu_linux/children?authorityType=GROUP&maxItems={maxItems?}&skipCount={skipCount?}&sortBy={sortBy?}

giuseppe-urso-web-scripts-to-search-for-groups-and-users-04

 

4 Comments

Leave a Reply

Your email address will not be published.