<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Troble adding new user using Person webscript in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/troble-adding-new-user-using-person-webscript/m-p/292989#M246119</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi everybody, I am working on a web application that uses Alfresco andd I have some trouble adding an user specifing the group which the user belongs to.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm calling the webscript using Java in this way:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;String url="&lt;A href="http://localhost:8080/alfresco/service/api/people?alf_ticket=%22+this.TICKET" rel="nofollow noopener noreferrer"&gt;http://localhost:8080/alfresco/service/api/people?alf_ticket='+this.TICKET&lt;/A&gt;;&lt;BR /&gt;DettagliUtente du=new DettagliUtente(nome, cnome, email, uname, pwd, da, quota, array_groups, titolo, orga, jobtitolo);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;HttpClient client = HttpClientBuilder.create().build();&lt;BR /&gt;HttpPost post=new HttpPost(url);&lt;BR /&gt;StringEntity entity=new StringEntity( gson.toJson(du) );&lt;BR /&gt;post.setEntity(entity);&lt;BR /&gt;post.setHeader("Content-type", "application/json");&lt;BR /&gt;HttpResponse risposta=client.execute(post);&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;DettagliUtente&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt; is a simple POJO class I made to store some information about the user. This information are retrieved from a jsp page.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In this class I store the groups in which the user belongs to, but I can't understand which Java object type I have to use to correctly send the groups in JSON format. You can see I convert my POJO class in JSON object using Gson.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I used an array of String that contains the name (shortName) of the group but it didn't work. I tried again a Vector of class Gruppo, which is this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;public class Gruppo {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private String displayName;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private String itemName;&lt;BR /&gt;}&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;but again I hadn't success. The user is created correctly but the groups are completly ignored.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So this is my question: How can I pass the groups to this webscript? I mean, which object I have to use to store groups information and pass them.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I hope I explain myself in a good way, if not tell me what is not clear.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Andrea&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Jul 2015 15:58:10 GMT</pubDate>
    <dc:creator>alextave</dc:creator>
    <dc:date>2015-07-24T15:58:10Z</dc:date>
    <item>
      <title>Troble adding new user using Person webscript</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/troble-adding-new-user-using-person-webscript/m-p/292989#M246119</link>
      <description>Hi everybody, I am working on a web application that uses Alfresco andd I have some trouble adding an user specifing the group which the user belongs to.I'm calling the webscript using Java in this way&lt;IMG id="smileyfrustrated" class="emoticon emoticon-smileyfrustrated" src="https://migration33.stage.lithium.com/i/smilies/16x16_smiley-frustrated.png" alt="Smiley Frustrated" title="Smiley Frustrated" /&gt;tring url="http://localhost:8080/alfresco/service/api/people?alf_ticket='+this.TICKET;DettagliUte</description>
      <pubDate>Fri, 24 Jul 2015 15:58:10 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/troble-adding-new-user-using-person-webscript/m-p/292989#M246119</guid>
      <dc:creator>alextave</dc:creator>
      <dc:date>2015-07-24T15:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: Troble adding new user using Person webscript</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/troble-adding-new-user-using-person-webscript/m-p/292990#M246120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Andrea&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you append preix "GROUP_" before your group name and try.Groups are stored in format GROUP_groupName where groupName is displayed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jul 2015 05:15:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/troble-adding-new-user-using-person-webscript/m-p/292990#M246120</guid>
      <dc:creator>rahulmackdani</dc:creator>
      <dc:date>2015-07-27T05:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: Troble adding new user using Person webscript</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/troble-adding-new-user-using-person-webscript/m-p/292991#M246121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks, you were right I had to use the prefix "GROUP_".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In Java I use a simple String array like this&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;String groups={"GROUP_GruppoTest3", "GROUP_GruppoTest4"};&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;in which GruppoTest3 or GruppoTest4 are the groups's displayedName. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2015 09:11:51 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/troble-adding-new-user-using-person-webscript/m-p/292991#M246121</guid>
      <dc:creator>alextave</dc:creator>
      <dc:date>2015-07-28T09:11:51Z</dc:date>
    </item>
  </channel>
</rss>

