-
1. Re: Cant create a user page using gatein public api
theute Nov 25, 2013 3:05 AM (in response to anishantony)Anish , I would appreciate if you could avoid to post in 2 different forums the same question.
Either you downloaded GateIn Portal, and you should ask here *or* you downloaded JBoss Portal and you would ask where you did your other post The specified item was not found.
Thanks in advance and I hope you understand
-
2. Re: Cant create a user page using gatein public api
anishantony Nov 25, 2013 3:37 AM (in response to theute)Sorry thomas, i downloaded and checked on GateIn 3.6. Thanks for your advice i am going to delete my post from jboss portal fourm. Also i am expecting an answer for my above problem
-
3. Re: Cant create a user page using gatein public api
nscavell Nov 25, 2013 9:15 AM (in response to anishantony)Make sure you log in as that user first. The portal doesn't create a dashboard (user site) until they log in.
-
4. Re: Cant create a user page using gatein public api
anishantony Nov 26, 2013 1:07 AM (in response to nscavell)Thanks Nick
I am sure that i am logged in with as user in GateIn. But the user page worked if i add that user under predefinedOwner tag in portal-configuration.xml like following way
<object-param>
<name>user.configuration</name>
<description>description</description>
<object type="org.exoplatform.portal.config.NewPortalConfig">
<field name="predefinedOwner">
<collection type="java.util.HashSet">
<value>
<string>manager</string>
</value>
<value>
<string>admin</string>
</value>
</collection>
</field>
<field name="ownerType">
<string>user</string>
</field>
<field name="templateLocation">
<string>war:/conf/portal</string>
</field>
</object>
</object-param>
(In above manager and admin can create user page because they are under predefinedOwner tag )
But in the case of adding user page for users who are added programatically i got the above exception. I am using the following code for adding users programatically
OrganizationService orgService = (OrganizationService)PortalContainer.getInstance().getComponentInstanceOfType(OrganizationService.class);
User user =new UserImpl("supervisor");
user.setPassword("supervisor");
user.setEmail("supervisor@gmail.com");
user.setFirstName("supervisor");
user.setLastName("supervisor");
orgService.getUserHandler().createUser(user, false);
-
5. Re: Cant create a user page using gatein public api
vstorm83 Dec 2, 2013 10:37 PM (in response to anishantony)By default, user site is lazily created (performance reason). You can change this behaviour by changing this property:
gatein.portal.idm.createuserportal in tomcat/gatein/conf/configuration.properties
Or you'll need to create User site first, before creating User site's pages:
Site userSite = portal.createSite(new SiteId(user));
portal.saveSite(userSite);
//Now create user site's page