diff --git a/scripts/api/setup-all.sh b/scripts/api/setup-all.sh index 8136b8d09a4..8e14256b128 100755 --- a/scripts/api/setup-all.sh +++ b/scripts/api/setup-all.sh @@ -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 @@ -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 diff --git a/src/main/java/edu/harvard/iq/dataverse/authorization/AuthenticationServiceBean.java b/src/main/java/edu/harvard/iq/dataverse/authorization/AuthenticationServiceBean.java index e3148760d1a..6e50cc8ca4e 100644 --- a/src/main/java/edu/harvard/iq/dataverse/authorization/AuthenticationServiceBean.java +++ b/src/main/java/edu/harvard/iq/dataverse/authorization/AuthenticationServiceBean.java @@ -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; @@ -42,6 +43,8 @@ public class AuthenticationServiceBean { @EJB BuiltinUserServiceBean builtinUserServiceBean; + @EJB + IndexServiceBean indexService; @PersistenceContext(unitName = "VDCNet-ejbPU") private EntityManager em; @@ -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; }