I have created a behaviour class NewUserEmail.java to auto generate an email with username and password while creating a new user mannualy and It is working fine. but this behaviour is automatically calls when I am creating multiple users by uploading CSV file. so users are getting two autogenerated mails - one is by default and another from that behaviour. now , I am trying to override the class UserCSVUploadPost so that I can remove the default behaviour of sending the mails while creating multiple users by uploading CSV file.
please guide me what to do, so that I can remove the default behaviour of sending the mails while uploading CSV file to create multiple users.
thanks in advance.
Solved! Go to Solution.
To override Out Of The Box WebScripts you will probably need to place your <some>-context.xml file in the extensions directory not in the module directory, otherwise your bean will get overridden by alfresco's defaults.
To override Out Of The Box WebScripts you will probably need to place your <some>-context.xml file in the extensions directory not in the module directory, otherwise your bean will get overridden by alfresco's defaults.
yes. I have created custom-context.xml file inside extensions directory having content :
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<import resource="classpath*:alfresco/module/*/module-webscripts-context.xml" />
<bean id="webscript.org.alfresco.repository.person.user-csv-upload.post"
class="com.eisenvault.mailTest.CustomUserBulkUpload" parent="webscript">
<property name="authenticationService" ref="AuthenticationService" />
<property name="authorityService" ref="AuthorityService" />
<property name="personService" ref="PersonService" />
<property name="tenantService" ref="tenantService" />
<property name="dictionaryService" ref="DictionaryService" />
<property name="transactionHelper" ref="web.retryingTransactionHelper" />
</bean>
</beans>
but its not working. I want to create multiple users by uploading CSV but dont want to send emails to the users. this is what I am trying to do. do you have any idea how to stop those mails.?
Try renaming the file to custom-web-context.xml, not sure if you should keep the import statement though.
thank you so much for your help. its working now with custom-web-context.xml. can you please help me to understand, why alfresco is working with this file name and how ?
and Is there any other way to override webscripts ?
thank you.
The main web application context loads in this order :
You should then use a file from this classpath location "classpath*:alfresco/extension/custom-web-context.xml" to override OOTB webscripts.
Extend/Override Users.js, which is located inside Share/Components/console.
Inside that file there is one function named as onUploadUsersClick
Inside this function replace below line
uploadURL: "api/people/upload.html",
With
uploadURL: "api/people/upload.html?email=false",
Above change will solve your issue.
I want to hide the "password" and "verify password" fields on UI of creating new user. I think it must be some .html.ftl file. but I am not able to file the exact name of the file. do you have any idea about the file name ?
That's a different question, you should start a new thread for it.
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.