Hi all,
I m using Alfresco Community 5.2. And I added some sites, folders and people by using REST API. But Alfresco Rest Api is running so slowly. For example When I updated just about 1000 site with rest api, This process takes about 40 minutes.
How can I do this issue or How can i speed this up ? Please help..
Thanks in advance.
Much more detail is needed before we can begin to help. For example:
private static void addMemebersToSites(String usid,String siteID,String role)
{
HttpClient client = new HttpClient();
String apiurl = api+"alfresco/service/api/sites/"+siteID+"/memberships";
PostMethod post = null;
try {
post = new PostMethod(URIUtil.encodePath(apiurl));
JsonObject person = new JsonObject();
person.addProperty("userName", usid); JsonObject member = new JsonObject();
member.addProperty("role", role);
member.add("person", person);
post.setDoAuthentication(true);
post.setRequestHeader("Content-Type", "application/json; charset=utf-8");
post.setRequestHeader(HttpHeaders.AUTHORIZATION, pass);
post.setRequestEntity(new StringRequestEntity(member.toString(), "application/json; charset=utf-8", "UTF-8"));
int status = client.executeMethod(post);
if(status == 200 || status==201)
{
System.out.println(status + " " +usid + " is added to this web site");}
elseSystem.out.println(status + " " + usid + " can not added to this web site(error)");
} catch (Exception e) {
e.printStackTrace();
} finally {
post.releaseConnection();
}
}
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.