on 08-16-2018 8:15 AM
Let say as a admin user od my org, I want to download all the user who are registered to site. How can I do that? I want all user to be available at manage user page where user can click on download report button which will download details in excel format.
We introduced a enum called userType in our userModel, as soon as the user registers we update the userType to 'REGISTERED', otherwise the user is 'GUEST'.
Once this is done, we created a cronjob and in the cronjob we had the following logic. // fetch all users where type is registered. query = select {pk} from {User} where {userType} = ?userType
You get all the users, now we saved these users in an excel and placed it under {HYBRIS_DATA_FOLDER}\users\
name of your excel file should be unique and random otherwise it is prone to disk drive attacks. See below link for providing file security
Now, we created a controller called ManageUserController and when someone hit the fetchUsers function of this controller, we returned the saved list.
Make sure when you create ManageUserController, it is only accessible to your admin server and not your customer facing server, you can do this by apache configuration.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There is no out of the box functionality for this requirement. if you want this on your storefront then you need to write your own customization.
Otherwise use a report cockpit and generate the report by writing the code in jrxml to execute it in report cockpit.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You could use the OCC for this https://help.hybris.com/1808/hcd/8c19ab00866910148f87bf32d4a60d38.html There you have calls that be used to search users. It might be so that you need to add a customized call depending if you want to have a list of all users.
User | Count |
---|---|
6 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.