Skip to content

Commit

Permalink
index users on create #909
Browse files Browse the repository at this point in the history
  • Loading branch information
pdurbin committed Sep 18, 2014
1 parent 95e83bb commit 42692f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
8 changes: 2 additions & 6 deletions scripts/api/setup-all.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash
echo "deleting all data from Solr"
curl http://localhost:8983/solr/update/json?commit=true -H "Content-type: application/json" -X POST -d "{\"delete\": { \"query\":\"*:*\"}}"

SERVER=http://localhost:8080/api

Expand Down Expand Up @@ -27,9 +29,3 @@ echo Setting up the settings
echo - Allow internal signup
curl -X PUT $SERVER/s/settings/:AllowSignUp/yes
curl -X PUT $SERVER/s/settings/:SignUpUrl/%2Fdataverseuser.xhtml%3FeditMode%3DCREATE

# index-all
# FIXME: obviate the need for this

echo Start indexing
curl -s http://localhost:8080/api/index
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package edu.harvard.iq.dataverse.authorization;

import edu.harvard.iq.dataverse.IndexServiceBean;
import edu.harvard.iq.dataverse.authorization.exceptions.AuthenticationFailedException;
import edu.harvard.iq.dataverse.authorization.exceptions.DuplicateAuthenticationProviderException;
import edu.harvard.iq.dataverse.authorization.providers.builtin.BuiltinAuthenticationProvider;
Expand Down Expand Up @@ -42,6 +43,8 @@ public class AuthenticationServiceBean {

@EJB
BuiltinUserServiceBean builtinUserServiceBean;
@EJB
IndexServiceBean indexService;

@PersistenceContext(unitName = "VDCNet-ejbPU")
private EntityManager em;
Expand Down Expand Up @@ -205,7 +208,7 @@ public AuthenticatedUser createAuthenticatedUser(String authenticationProviderId
AuthenticatedUserLookup auusLookup = new AuthenticatedUserLookup(authPrvUserPersistentId, authenticationProviderId, auus);
em.persist( auusLookup );
auus.setAuthenticatedUserLookup(auusLookup);

indexService.indexUser(auus);
return auus;
}

Expand Down

0 comments on commit 42692f5

Please sign in to comment.